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.
-
Install dependencies:
pnpm install
-
Copy
.env.exampleto.envand fill in the required values. UseBETTER_AUTH_URLandBETTER_AUTH_SECRETfor the auth base URL and secret. -
Create a Neon project and set
DATABASE_URL.For
wrangler devorpnpm preview, put Worker runtime secrets in.dev.varsinstead ofwrangler.jsonc. Do not commit production values or a local database URL towrangler.jsonc, because deployed Workers cannot reach your laptop's Postgres instance. -
Apply the schema and load seed data:
pnpm db:migrate pnpm db:seed
-
Start the app:
pnpm dev
pnpm dev- Start the development serverpnpm preview- Build and preview the app in the OpenNext Cloudflare runtimepnpm deploy- Build and deploy with OpenNext Cloudflarepnpm db:generate- Generate Drizzle migrations from the TypeScript schemapnpm db:migrate- Apply Drizzle migrations indrizzle/pnpm db:seed- Seed the database usingdb/seed.sqlpnpm mailpit:start- Start Mailpit for local email testingpnpm mailpit:stop- Stop Mailpitpnpm mailpit:restart- Restart Mailpitpnpm mailpit:logs- Tail Mailpit logs
- 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.sqlwhen needed.