Skip to content

abhi152003/speedrun-stylus

 
 

Repository files navigation

SpeedRunStylus

SRE Thumbnail

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.

Features

  • 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.

Requirements

Before you begin, you need to install the following tools:

Development Quickstart

  1. Install dependencies

    yarn install
  2. Spin up the Postgres database service, create the database, and seed it

    docker compose up -d
    yarn drizzle-kit migrate
    yarn db:seed
  3. Start your NextJS app:

    yarn start

    Visit your app at: http://localhost:3000.

  4. You can explore the database with:

    yarn drizzle-kit studio

Database Information

We are using Drizzle with Postgres for database management. You can run drizzle-kit commands from the root with yarn drizzle-kit.

Local Development Database

For local development, we use a Docker-based Postgres instance.

Production Database with Neon

For production, we recommend using Neon DB, a serverless Postgres service optimized for Next.js applications. To configure Neon DB:

  1. Sign up for a Neon account and create a project.
  2. Get your connection string from the Neon dashboard.
  3. Set the POSTGRES_URL environment variable with your Neon connection string.
  4. Run migrations: POSTGRES_URL=your-neon-connection-string yarn drizzle-kit migrate.

For detailed setup instructions, see docs/NEON_DB_SETUP.md.

Database Migration

Anytime we update the schema in packages/nextjs/services/database/config/schema.ts, we can generate a migration with:

yarn drizzle-kit generate

Then we can apply the migration with:

yarn drizzle-kit migrate

We also need to make sure we commit the migration to the repo.

Database (dev info)

To iterate quickly on the database locally:

  • Tweak the schema in schema.ts.
  • Run yarn drizzle-kit push to apply the changes.
  • Copy seed.data.example.ts to seed.data.ts, tweak as needed, and run yarn db:seed (this will delete existing data).

About

Speedrun Stylus - Learn how to build on Arbitrum using Stylus.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 98.6%
  • Other 1.4%