- Node.js 18+
- PostgreSQL database URL in your env (
DATABASE_URL) - Strong
NEXTAUTH_SECRET
- Install deps:
npm install
- Set env vars (create
.env):DATABASE_URL=postgresql://USER:PASSWORD@HOST:PORT/DB_NAME?schema=public NEXTAUTH_SECRET=your-strong-secret NEXTAUTH_URL=http://localhost:3000 # Supabase (uploads/notifications features) SUPABASE_URL=... SUPABASE_SERVICE_ROLE_KEY=... # Vercel Cron protection (either works) CRON_SECRET_TOKEN=... # or (Vercel-native) CRON_SECRET=... # Upstash (login rate limiting) UPSTASH_REDIS_REST_URL=... UPSTASH_REDIS_REST_TOKEN=...
- Generate Prisma client and run migrations:
npx prisma generate npx prisma migrate deploy # or during dev: npx prisma migrate dev - Seed sample data (optional):
npm run seed
- Run locally:
npm run dev
- ADMIN, STAFF (email + password)
- STUDENT (Aadhar + password)
Login test users (if seeded):
- admin@school.com / Admin@123
- staff@school.com / Staff@123
- student@school.com / Student@123
- Push repo to GitHub/GitLab
- Create Vercel project
- Set Environment Variables in Vercel:
DATABASE_URLNEXTAUTH_SECRETNEXTAUTH_URL(e.g., your Vercel domain)SUPABASE_URLSUPABASE_SERVICE_ROLE_KEYRAZORPAY_KEY_ID(if using Razorpay)RAZORPAY_KEY_SECRET(if using Razorpay)CRON_SECRET_TOKEN(shared secret for cron routes; supported viaAuthorization: Bearerorx-cron-token)- Alternatively set Vercel’s
CRON_SECRETenv var and it will call cron jobs withAuthorization: Bearer $CRON_SECRET
- Alternatively set Vercel’s
UPSTASH_REDIS_REST_URLUPSTASH_REDIS_REST_TOKEN
- Vercel runs
npm install(triggerspostinstall: prisma generate) andnext build - Run migrations via Vercel CLI or a one-off job:
npx prisma migrate deploy
- Middleware enforces role-based access and redirects.
- Per-role layouts include a sidebar from
app/config/sidebarItem.ts. - Prisma client is in
lib/prisma.ts. - Subscription tiers stored in
SchoolSettings.tier(BASIC/PRO/ENTERPRISE) with optionalfeatureFlagsoverrides. - Feature gating helper in
app/lib/features.ts.
- Student promotion (year-end):
- Route:
POST /api/cron/promote-students - Auth: ADMIN session, or cron secret via
Authorization: Bearer $CRON_SECRET_TOKEN/x-cron-token: $CRON_SECRET_TOKEN - Vercel Cron: configured in
vercel.json(UTC schedule; adjust as needed)
- Route:
- Attendance reminder (daily):
- Route:
POST /api/cron/attendance-reminder - Auth: header
x-cron-token: $CRON_SECRET_TOKEN - Vercel Cron example (daily):
0 15 * * *(15:00 UTC)
- Route:
This is a Next.js project bootstrapped with create-next-app.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.