https://space-cruising.netlify.app/
Reusable Next.js App Router starter with authentication flows (register/login) already wired.
This repo uses pnpm (packageManager is pinned in package.json). Enable Corepack once, then install and run:
corepack enable
pnpm install
pnpm devOpen http://localhost:3000.
- Auth pages:
/{lng}/register,/{lng}/login(e.g./en/login,/fr/register) - Auth API routes under
/api/auth - Shared UI foundation (sections, buttons, theming)
- Email demo route:
POST /api/send(disabled whenRESEND_API_KEYis missing)
Create a .env file (copy .env.example).
- Database (Prisma)
- Default:
DATABASE_PROVIDER=sqliteandDATABASE_URL=file:./prisma/dev.db(file underprisma/). - Optional PostgreSQL (e.g.
docker composewith thedbservice): setDATABASE_PROVIDER=postgresqlandDATABASE_URL=postgresql://USER:PASS@HOST:5432/DB. - After switching provider, run
pnpm db:generate(orpnpm install) so the Prisma client matches the provider. - SQLite migrations live under
prisma/migrations(SQLite only). For a fresh Postgres DB, usepnpm exec prisma db pushwith Postgres env vars set.
- Default:
RESEND_API_KEY: required forPOST /api/send.- If it is missing or an empty string, the route will
console.warn(...)and return503(email sending disabled).
- If it is missing or an empty string, the route will
pnpm devpnpm buildpnpm lintpnpm test
This template includes a demo endpoint to show how to send emails with Resend.
- Route:
POST /api/send - Note:
app/api/send/route.tsuses placeholder/fake values for:fromaddresstorecipient(s)subject- a sample
EmailTemplate({ firstName: 'John' })
-
Set your API key
- Add
RESEND_API_KEYto.env(see.env.example). - If
RESEND_API_KEYis missing or"", the route willconsole.warn(...)and return503(email sending disabled).
- Add
-
Update placeholders in
app/api/send/route.ts- Replace the
fromsender with a sender configured/verified in your Resend dashboard. - Replace the
tolist with your real recipient(s). - Replace the
subjectwith what you need.
- Replace the
-
Update the email body/template
- The demo currently calls
EmailTemplate({ firstName: 'John' }). - Adjust the template props to match your real use-case.
- The demo currently calls
curl -X POST http://localhost:3000/api/send