Skip to content

Commit

Permalink
Merge branch 'dev' into feat/docker-deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
0xtiti committed Sep 4, 2024
2 parents 630d2e4 + 4418f69 commit b79c812
Show file tree
Hide file tree
Showing 20 changed files with 1,325 additions and 39 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
NEXT_PUBLIC_API_BASE_URL= # Example: https://api.example.com
NEXT_PUBLIC_PROJECT_ID= # ProjectID from WalletConnect
NEXT_PUBLIC_TESTNET_MODE= # true or false
NEXT_PUBLIC_TESTNET_MODE= # true or false
NEXT_PUBLIC_TESTING_MODE= # true or false
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ jobs:
- name: Create env file
run: |
touch .env
echo "NEXT_PUBLIC_API_URL=http://mock-api:3000" >> .env
echo "NEXT_PUBLIC_API_BASE_URL=${{ secrets.NEXT_PUBLIC_API_BASE_URL }}" >> .env
echo "NEXT_PUBLIC_TESTING_MODE=${{ secrets.NEXT_PUBLIC_TESTING_MODE }}" >> .env
- name: run Cypress and Jest
uses: cypress-io/github-action@v6
Expand Down
52 changes: 48 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ $ pnpm install
## ⚙️ Setting up env variables

- Create `.env` file in the `root` folder and copy paste `.env.example` content in there.

```
$ cp .env.example .env
```

- Set up `NEXT_PUBLIC_API_BASE_URL` with ZKchainHub Backend API url. It will typically run on `http://localhost:3000`
- (Optionally)
- Set `NEXT_PUBLIC_PROJECT_ID` with your [Wallet Connect](https://walletconnect.com/) ProjectID
- Set `NEXT_PUBLIC_TESTNET_MODE ` with `true` to use testnet mode with testnet backend API URL set up in `NEXT_PUBLIC_API_BASE_URL`
- (Optionally)
- Set `NEXT_PUBLIC_PROJECT_ID` with your [Wallet Connect](https://walletconnect.com/) ProjectID
- Set `NEXT_PUBLIC_TESTNET_MODE ` with `true` to use testnet mode with testnet backend API URL set up in `NEXT_PUBLIC_API_BASE_URL`

## 🏃 Running the app

Expand All @@ -41,9 +43,51 @@ $ pnpm run start

To verify ZKchainHub UI is running open http://localhost:5173 in your browser

## Deployment

## 🏗️ Vercel deployment

## Prerequisites

1. **Vercel Account**: [Sign up](https://vercel.com) if you don’t have an account.
2. **Vercel CLI**: Install the Vercel CLI by running:

```bash
npm install -g vercel
```

## Deployment Steps

1. **Authenticate with Vercel**: Run the following command and follow the prompts to log in

```bash
vercel login
```

2. **Deploy Your Project**: Navigate to your project directory and run:

```bash
vercel
```

Follow the prompts to configure your project.
Vercel will automatically deploy your project and provide a live URL.

3. **Set Environment Variables**: To add environment variables, use:

```bash
vercel env add <name> <value>
```

**Additional Resources**

- **[Vercel CLI Documentation](https://vercel.com/docs/cli)**: Find comprehensive information on using the Vercel CLI.
- **[Vercel Documentation](https://vercel.com/docs)**: Access general Vercel documentation and guides.

## Development

### 💻 Conventional Commits

We follow the Conventional Commits [specification](https://www.conventionalcommits.org/en/v1.0.0/#specification).

## Contributing
Expand All @@ -52,4 +96,4 @@ ZKchainHub was built with ❤️ by [Wonderland](https://defi.sucks).

Wonderland is a team of top Web3 researchers, developers, and operators who believe that the future needs to be open-source, permissionless, and decentralized.

[DeFi sucks](https://defi.sucks), but Wonderland is here to make it better.
[DeFi sucks](https://defi.sucks), but Wonderland is here to make it better.
4 changes: 4 additions & 0 deletions cypress/cypress.env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"NEXT_PUBLIC_API_BASE_URL": "http://mock-api:3000",
"NEXT_PUBLIC_TESTING_MODE": "true"
}
3 changes: 3 additions & 0 deletions cypress/e2e/navigation.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
describe('Navigation tests', () => {
beforeEach(() => {
Cypress.env('NEXT_PUBLIC_API_BASE_URL', 'NEXT_PUBLIC_TESTING_MODE');
cy.visit('/');
});

Expand All @@ -16,6 +17,8 @@ describe('Navigation tests', () => {

cy.getByTestId('search-bar').find('input').type('324');
cy.getByTestId('chain-row').should('be.visible').click();

cy.getByTestId('chain-id').should('be.visible').and('contain', '324');
cy.url().should('include', '/324');

cy.getByTestId('home-breadcrumb').click();
Expand Down
Loading

0 comments on commit b79c812

Please sign in to comment.