Skip to content

Mastermoh0/full-stack-school

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Full-Stack School Management App

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.

Tech Stack

  • 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

How to Run Locally

You can get the project running in under 5 minutes by following these steps.

1. Requirements

  • Node.js (v18 or higher recommended)
  • Docker Desktop (or an existing PostgreSQL server)
  • npm installed

2. Install dependencies

npm install

3. Setup environment variables

Ensure 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"

4. Start the Database

The project includes a docker-compose.yml to spin up PostgreSQL quickly:

docker-compose up -d

Wait a few seconds for the database to become "healthy".

5. Run Migrations and Seed Data

Apply the Prisma schema to the database and generate dummy data:

npx prisma migrate dev
npx prisma db seed

6. Start the project

npm run dev

Your app is now running at http://localhost:3000.


Local Testing Credentials

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.)


Folder Structure

  • /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

Common Issues & Fixes

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 generate

2. 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 93.0%
  • JavaScript 6.4%
  • Other 0.6%