Skip to content

Repository files navigation

PoliTo Rocket Team Website

This repository powers the PoliTo Rocket Team website. The stack is Next.js, OpenNext for Cloudflare deployment, Drizzle ORM for database schema/migrations, Neon Postgres, Better Auth, and Tailwind CSS.

Setup

  1. Install dependencies:

    pnpm install
  2. Copy .env.example to .env and fill in the required values. Use BETTER_AUTH_URL and BETTER_AUTH_SECRET for the auth base URL and secret.

  3. Create a Neon project and set DATABASE_URL.

    For wrangler dev or pnpm preview, put Worker runtime secrets in .dev.vars instead of wrangler.jsonc. Do not commit production values or a local database URL to wrangler.jsonc, because deployed Workers cannot reach your laptop's Postgres instance.

  4. Apply the schema and load seed data:

    pnpm db:migrate
    pnpm db:seed
  5. Start the app:

    pnpm dev

Common Commands

  • pnpm dev - Start the development server
  • pnpm preview - Build and preview the app in the OpenNext Cloudflare runtime
  • pnpm deploy - Build and deploy with OpenNext Cloudflare
  • pnpm db:generate - Generate Drizzle migrations from the TypeScript schema
  • pnpm db:migrate - Apply Drizzle migrations in drizzle/
  • pnpm db:seed - Seed the database using db/seed.sql
  • pnpm mailpit:start - Start Mailpit for local email testing
  • pnpm mailpit:stop - Stop Mailpit
  • pnpm mailpit:restart - Restart Mailpit
  • pnpm mailpit:logs - Tail Mailpit logs

Database Workflow

  • Update the Drizzle schema files in db/schema.
  • Generate SQL with pnpm db:generate.
  • Review the generated migration in drizzle/.
  • Apply it with pnpm db:migrate.
  • Refresh fixture data in db/seed.sql when needed.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages