Welcome to the SpeedRunStylus project, an enhanced platform for builders to engage with various challenges and unlock their builder profiles. This project is built with Scaffold-ETH 2 and offers an expanded experience for developers.
- Interact with various BuidlGuidl curriculums.
- Share your builds and discover what other builders are creating.
- Earn badges for your achievements.
- Compete on the leaderboard with other builders.
You can find the repository containing the challenges here.
Before you begin, you need to install the following tools:
- Node (>= v18.18)
- Yarn (v1 or v2+)
- Git
- Docker Engine
-
Install dependencies
yarn install
-
Spin up the Postgres database service, create the database, and seed it
docker compose up -d yarn drizzle-kit migrate yarn db:seed
-
Start your NextJS app:
yarn start
Visit your app at:
http://localhost:3000. -
You can explore the database with:
yarn drizzle-kit studio
We are using Drizzle with Postgres for database management. You can run drizzle-kit commands from the root with yarn drizzle-kit.
For local development, we use a Docker-based Postgres instance.
For production, we recommend using Neon DB, a serverless Postgres service optimized for Next.js applications. To configure Neon DB:
- Sign up for a Neon account and create a project.
- Get your connection string from the Neon dashboard.
- Set the
POSTGRES_URLenvironment variable with your Neon connection string. - Run migrations:
POSTGRES_URL=your-neon-connection-string yarn drizzle-kit migrate.
For detailed setup instructions, see docs/NEON_DB_SETUP.md.
Anytime we update the schema in packages/nextjs/services/database/config/schema.ts, we can generate a migration with:
yarn drizzle-kit generateThen we can apply the migration with:
yarn drizzle-kit migrateWe also need to make sure we commit the migration to the repo.
To iterate quickly 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(this will delete existing data).
