This guide covers everything you need to set up a development environment, follow project conventions, and submit quality pull requests.
| Tool | Min version | Notes |
|---|---|---|
| Node.js | 18.x | Required by Next.js 14 and Vercel runtime |
| npm | 9.x | Workspaces not used; run installs per folder |
| PostgreSQL | 14+ | A free Supabase project works out of the box |
| Supabase account | Free tier | Needed for Storage (images, avatars, downloadables) |
git clone https://github.com/<your-username>/traqify.git
cd traqifycd backend && npm install
cd ../frontend && npm install# Backend
cp backend/.env.example backend/.env
# Fill in: DATABASE_URL, DIRECT_URL, JWT_SECRET,
# SUPABASE_URL, SUPABASE_ANON_KEY, SUPABASE_SERVICE_ROLE_KEY,
# SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS, SMTP_FROM,
# GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET,
# PAYSTACK_SECRET_KEY, FRONTEND_URL
# CRON_SECRET (any long random string for local testing)
# Frontend
cp frontend/.env.local.example frontend/.env.local
# Fill in: API_ORIGIN, PROXY_SHARED_SECRETcd backend
npx prisma db push
npx prisma generate# Terminal 1 — backend (port 5000)
cd backend && npm run dev
# Terminal 2 — frontend (port 3000)
cd frontend && npm run dev# Run before every commit
cd backend && npx tsc --noEmit
cd ../frontend && npx tsc --noEmitNo any types unless absolutely unavoidable. All new controllers, routes, and components must be fully typed.
React class components are not used anywhere in the codebase.
Prefer named exports over default exports for components and utility functions.
All styling via Tailwind utility classes. No inline styles, no CSS modules.
All request bodies must be validated with a Zod schema before any business logic runs. Schema lives in utils/validators.ts.
New backend routes must declare an explicit auth guard: isOwnerOnly, isOwnerOrManager, isAtLeastAuditor, or isAtLeastCashier. No unguarded authenticated routes.
Follow the Conventional Commits spec:
<type>(<scope>): <short description>featNew feature
fixBug fix
securitySecurity fix or hardening
docsDocumentation only
styleFormatting, no logic change
refactorCode restructure, no feature/fix
choreDependency updates, build config
perfPerformance improvement
Open a GitHub issue with the following information:
For security vulnerabilities, do not open a public GitHub issue. Follow the responsible disclosure process on the Security Policy page instead.