- Node (>= v20.18.3)
- Yarn (v1 or v2+)
- Git
Create a .env.local file in packages/nextjs/ with the following variables:
# Tally API key for fetching proposals
# Get your API key from https://www.tally.xyz/
TALLY_API_KEY=your_tally_api_key_here
# Secret for protecting import endpoints (used by cron jobs)
# Set a secure random string for production
CRON_SECRET=your_cron_secret_here
**Note:** The `.env.local` file is gitignored and should not be committed to version control.
## Quickstart
1. Clone the repo
2. Install dependencies:
```bash
cd arbitrum-dashboard
yarn install- Spin up the Postgres database service
docker compose up -d
# sync database
yarn drizzle-kit push
# import data
yarn db:seed
# if you want to wipe the database
yarn db:wipeNote: If you get any issues with the database, you can restart by:
docker compose down
rm -rf data/
docker compose up -d- Start your NextJS app:
yarn startVisit your app on: http://localhost:3000.
- You can explore the database with:
yarn drizzle-kit studio
To iterate fast on the database locally:
- Tweak the schema in
schema.ts - Run
yarn drizzle-kit pushto apply the changes. - Copy
seed.data.example.tstoseed.data.ts, tweak as needed and runyarn db:seed(will delete existing data)
We'd switch to a migration model when ready (site live).
You can locally call the import routes like:
Forum posts:
curl -X POST http://localhost:3000/api/import-forum-posts \
-H "Authorization: Bearer my-cron-secret"Snapshot proposals:
curl -X POST http://localhost:3000/api/import-snapshot-proposals \
-H "Authorization: Bearer my-cron-secret"Tally proposals:
curl -X POST http://localhost:3000/api/import-tally-proposals \
-H "Authorization: Bearer my-cron-secret"