Thanks for your interest in contributing! This guide covers everything you need to get set up, work with the database, and submit changes.
- Getting Started
- Database Management
- Clean Database & Redeploy on Vercel
- Common Database Errors
- Development Workflow
- Code Style & Conventions
- Quick Reference Checklist
# Fork the repo on GitHub, then:
git clone https://github.com/<your-username>/event-manager.git
cd event-manager
npm installCopy the example env file and fill in the required values:
cp .env.example .env| Variable | Description |
|---|---|
DATABASE_URL |
PostgreSQL connection string (pooled / connection pooler) |
DIRECT_URL |
PostgreSQL direct connection string (used for migrations) |
AUTH_SECRET |
NextAuth secret — generate with openssl rand -base64 32 |
AUTH_GOOGLE_ID |
Google OAuth Client ID (from Google Cloud Console) |
AUTH_GOOGLE_SECRET |
Google OAuth Client Secret |
SUPER_ADMIN_EMAIL |
Your email address — grants Super Admin on first sign-in |
DISCORD_BOT_TOKEN |
(optional) Discord bot token for notifications |
CRON_SECRET |
(optional) Secret for authenticating Vercel Cron jobs |
npx prisma generate
npx prisma migrate dev
npx tsx prisma/seed.tsnpm run devOpen http://localhost:3000.
| Command | What it does |
|---|---|
npx prisma generate |
Generate the Prisma client from schema.prisma |
npx prisma migrate dev |
Create and apply migrations in development |
npx prisma migrate reset --force |
Drop all tables, re-apply every migration, and run the seed script |
npx prisma studio |
Open a visual database explorer at localhost:5555 |
npx tsx prisma/seed.ts |
Run the seed script to populate default data |
Vercel has no interactive terminal, so migrations must be run either from your local machine or as part of the Vercel build process.
This is the simplest approach. Point your local CLI at the remote Neon database:
- Update your
.envwith the Neon productionDATABASE_URLandDIRECT_URL. - Run migrations:
npx prisma migrate deploy
- Seed the database (if needed):
npx tsx prisma/seed.ts
- Verify everything looks correct:
npx prisma studio
Tip: Switch your
.envback to your local database URL when you're done.
Via Vercel Dashboard:
Go to Settings → General → Build & Development Settings and set the build command to:
npx prisma generate && npx prisma migrate deploy && next build
Via package.json:
Update the build script:
{
"scripts": {
"build": "prisma generate && prisma migrate deploy && next build"
}
}For one-time seeding (e.g., after a fresh database), temporarily add the seed step to the build command:
npx prisma generate && npx prisma migrate deploy && npx tsx prisma/seed.ts && next build
Important: Revert the build command after the first successful deploy so the seed script doesn't run on every deployment.
Use this when you need a full database reset in production.
- Delete / recreate the database in the Neon Console.
- Update local
.envwith the newDATABASE_URLandDIRECT_URL. - Update Vercel environment variables:
- Go to Vercel Dashboard → Settings → Environment Variables.
- Set
DATABASE_URLandDIRECT_URLwith the new values. - Enable for Production, Preview, and Development.
- Run migrations from your local terminal:
npx prisma migrate deploy
- Seed the database:
npx tsx prisma/seed.ts
- Verify with Prisma Studio:
npx prisma studio
- Redeploy on Vercel — pick one:
- Push a new commit to trigger a build.
- Vercel Dashboard → Deployments → "..." → Redeploy.
- Or run
npx vercel --prodfrom your terminal.
| Error Code | Message | Fix |
|---|---|---|
| P2021 | Table does not exist | Run npx prisma migrate deploy |
| P1001 | Can't reach database server | Check that DATABASE_URL is correct and the Neon database is active |
| P2002 | Unique constraint failed | Duplicate data — check the seed script or reset the database |
| P1003 | Database does not exist | Create the database in the Neon Console first |
| P3009 | Migration failed | Run npx prisma migrate reset --force locally, then redeploy |
Use a prefix that describes the type of change:
feature/add-rsvp-tracking
fix/speaker-card-overflow
chore/update-dependencies
# Lint
npm run lint
# Type check
npx tsc --noEmit
# End-to-end tests
npm run test:e2e- Create PRs against the
mainbranch. - Include a clear description of what changed and why.
- Link related issues if applicable.
| Area | Convention |
|---|---|
| Language | TypeScript in strict mode — no any unless absolutely necessary |
| Styling | Tailwind CSS utility classes only — no inline style attributes |
| Database | All queries go through Prisma — no raw SQL unless there's a strong reason |
| Audit logging | Every CRUD operation must be audit-logged via the logAudit() helper |
| Authorization | All API routes must include role-based access checks using permissions.ts |
| Components | Use the design system components in src/components/design-system/ |
Full database reset + production redeploy:
- Delete / recreate database in Neon Console
- Update
DATABASE_URLandDIRECT_URLin local.env - Update
DATABASE_URLandDIRECT_URLin Vercel environment variables - Run
npx prisma migrate deployfrom local terminal - Run
npx tsx prisma/seed.tsfrom local terminal - Verify with
npx prisma studio - Redeploy on Vercel