This guide walks you through setting up PRFC Connect for local development.
- Git
- fnm (Fast Node Manager)
- Docker Desktop
- VS Code (recommended)
fnm manages Node.js versions. It reads the .nvmrc file and switches to the correct version automatically.
macOS/Linux:
curl -fsSL https://fnm.vercel.app/install | bashWindows:
winget install Schniz.fnmAfter installing, restart your terminal and enable auto-switching:
# Add to your shell profile (.bashrc, .zshrc, etc.)
eval "$(fnm env --use-on-cd)"git clone https://github.com/hack4impact-calpoly/prfc-connect.git
cd prfc-connectfnm will read .nvmrc and install the correct version.
fnm install
fnm useVerify you're on the right version:
node -v # Should show v22.xnpm installStart MySQL using Docker:
npm run docker:upThis starts MySQL on port 3306 and Adminer (database UI) on port 8080.
Copy the example file and get secrets from a tech lead:
cp .env.local.example .env.localRequired variables:
DATABASE_URL- MySQL connection string- SMTP settings for email
Optional (for production):
PRFC_PORTAL_SECRET- Shared HMAC secret with PRFC portal (uses dev fallback locally)
Set up the database schema:
npx prisma migrate devnpm run devVisit http://localhost:3000. You should see the referral form.
To access protected pages (like the referral database), use the mock portal at http://localhost:3000/dev/mock-portal. This simulates the PRFC member portal login flow.
Install these VS Code extensions:
Enable format on save:
- Open Settings (Cmd/Ctrl + ,)
- Search "default formatter" -> select Prettier
- Search "format on save" -> check the box
Development:
npm run dev- Start dev server at localhost:3000npm run build- Build for productionnpm run lint- Check code stylenpm run lint:fix- Auto-fix style issuesnpm test- Run tests
Database:
npm run docker:up- Start MySQL containernpm run docker:down- Stop MySQL containernpm run db:seed- Populate test datanpx prisma studio- Open database GUInpx prisma migrate dev- Run migrations
prfc-connect/
├── .github/ # GitHub Actions and templates
├── docs/ # Documentation
├── prisma/ # Database schema and migrations
├── public/ # Static assets
├── src/
│ ├── app/ # Next.js pages and API routes
│ ├── actions/ # Server Actions
│ ├── components/ # React components
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # Utilities (db, dal, rate-limit)
│ ├── schema/ # Zod validation schemas
│ ├── services/ # Business logic
│ └── utils/ # Helper functions
└── test/ # Test files
Port 3306 already in use: Stop any existing MySQL process or change the port in docker-compose.yml.
Prisma client errors: Regenerate the client:
npx prisma generateNode version mismatch: Make sure fnm is using the correct version:
fnm useOnce your environment is running, read Contributing to learn the development workflow.