Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/semaphore-protocol/boilerplate

Simple monorepo you can use as a template to start developing your dApp with Semaphore.
https://github.com/semaphore-protocol/boilerplate

boilerplate hardhat nextjs semaphore

Last synced: 5 days ago
JSON representation

Simple monorepo you can use as a template to start developing your dApp with Semaphore.

Awesome Lists containing this project

README

        


Semaphore Boilerplate






Github license


GitHub Workflow style


Linter eslint


Code style prettier




| The repository is divided into two components: [web app](./apps/web-app) and [contracts](./apps/contracts). The app allows users to create their own Semaphore identity, join a group and then send their feedback anonymously (currently on Sepolia). |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |

## 🛠 Install

Use this repository as a Github [template](https://github.com/semaphore-protocol/boilerplate/generate).

Clone your repository:

```bash
git clone https://github.com//.git
```

and install the dependencies:

```bash
cd && yarn
```

## 📜 Usage

Copy the `.env.example` file as `.env`:

```bash
cp .env.example .env
```

and add your environment variables or run the app in a local network.

### Local server

You can start your app locally with:

```bash
yarn dev
```

### Deploy the contract

1. Go to the `apps/contracts` directory and deploy your contract:

```bash
yarn deploy --semaphore --network sepolia
```

2. Update the `apps/web-app/.env.production` file with your new contract address and the group id.

3. Copy your contract artifacts from `apps/contracts/artifacts/contracts` folder to `apps/web-app/contract-artifacts` folder.

> [!NOTE]
> Check the Semaphore contract addresses [here](https://docs.semaphore.pse.dev/deployed-contracts).

### Verify the contract

Verify your contract on Etherscan:

```bash
yarn verify --network sepolia
```

> **Note**
> Remember to set the Etherscan API Key in your .env file.

### Code formatting

Run [Prettier](https://prettier.io/) to check formatting rules:

```bash
yarn prettier
```

or to automatically format the code:

```bash
yarn prettier:write
```