A comprehensive school management dashboard built with Next.js 14, providing portals for Admins, Teachers, Students, and Parents. It handles daily school operations including classes, exams, assignments, events, announcements, and fee payments.
- Frontend & Backend Framework: Next.js 14 (App Router)
- Database: PostgreSQL with Prisma ORM
- Authentication: NextAuth.js v4 (Credentials & OTP support)
- Payments: Stripe
- Media Storage: Cloudinary
- Emails: Nodemailer (SMTP)
- Styling: Tailwind CSS
You can get the project running in under 5 minutes by following these steps.
- Node.js (v18 or higher recommended)
- Docker Desktop (or an existing PostgreSQL server)
npminstalled
npm installEnsure that you have .env and .env.local files configured. The repository already contains basic local templates for these.
If not present, create a .env file at the root:
# Database
DATABASE_URL="postgresql://lamauser:lamapassword@localhost:5432/lamadb"
# NextAuth
NEXTAUTH_SECRET="your-super-secret-key-in-production"
NEXT_PUBLIC_APP_URL="http://localhost:3000"The project includes a docker-compose.yml to spin up PostgreSQL quickly:
docker-compose up -dWait a few seconds for the database to become "healthy".
Apply the Prisma schema to the database and generate dummy data:
npx prisma migrate dev
npx prisma db seednpm run devYour app is now running at http://localhost:3000.
The seed script generates several users you can use to log in and test different dashboard views:
| Role | Username | Password |
|---|---|---|
| Admin | admin |
admin123 |
| Super Admin | superadmin |
super123 |
| Teacher | e.g. TE-2024-01 |
admin123 |
| Parent | e.g. PA-2024-01 |
admin123 |
| Student | e.g. ST-2024-01 |
admin123 |
(Note: The exact TE/PA/ST usernames depend on what the seed generated. You can check your database Teacher, Parent, or Student tables if the 01 suffix doesn't work.)
/src/app- Next.js App Router pages (admin, teacher, student, parent dashboards)/src/components- Reusable UI components/src/lib- Core utilities (Prisma client, NextAuth configuration, Stripe, Nodemailer)/prisma- Database schema (schema.prisma) and seed scripts (seed.ts)/public- Static assets and images
1. Prisma Client Errors on Startup
If you see errors related to prisma.teacher or similar not found during build/startup, ensure you've regenerated the client:
npx prisma generate2. Database Connection Failed
Check that Docker is running (docker ps) and that the credentials in .env match what is in docker-compose.yml.
3. Cloudinary Uploads Failing
Ensure there are no trailing quotes (") around your CLOUDINARY_API_SECRET in .env.local.