Skip to content

About

School Management System

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

69 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏫 SchoolHub β€” Multi-Tenant School Management SaaS Platform

What is SchoolHub?

SchoolHub is an all-in-one digital campus management platform built for modern K-12 schools, CBSE/ICSE colleges, and educational academies. It replaces scattered WhatsApp groups, paper notice boards, manual fee counters, and physical diaries with a single, real-time operating system for your entire school.

Whether you run a single independent campus or an entire multi-city school chain, SchoolHub provides dedicated, isolated workspaces for every institution while giving administrators complete oversight.


🌟 Key Capabilities at a Glance

  • ⚑ 10-Second Daily Attendance: Teachers mark roll call with a single tap; absence alerts are immediately tracked and accessible to parents.
  • πŸ“’ Digital Homework & Broadcasts: Teachers post homework, PDF worksheets, and study notes directly to student diaries with real-time delivery.
  • πŸ’³ Instant Online Fee Collection: Parents pay term fees securely via UPI, QR code, debit card, or net banking, with instant automated PDF receipts.
  • πŸ“Š CBSE/ICSE Exam & Report Cards: Configure grading scales, enter exam marks, and generate digital report cards in minutes.
  • πŸ“– Smart Library & Almanac Ledger: Search the digital library catalog, track issued books, and monitor campus notices seamlessly.
  • πŸ›‘οΈ Multi-Tenant Cloud Architecture: Complete privacy and data isolation for every school, secured with role-based access control.

πŸ‘₯ Who Uses SchoolHub?

Role What They Do on SchoolHub
πŸ‘‘ Super Admin Manages all school tenants, monitors platform subscriptions, and tracks revenue metrics.
🏫 School Admin Runs daily operations β€” staff onboarding, admissions, fee tiers, timetables, and audit logs.
πŸ‘©β€πŸ« Teacher Takes class attendance, broadcasts homework assignments, and records exam scores.
πŸŽ’ Student & Parent Checks daily homework, tracks attendance %, downloads report cards, and pays school fees online.

πŸ“‘ Table of Contents


πŸ›οΈ Architectural Overview

SchoolHub follows a Modular Monolith pattern designed for high cohesion, strict domain separation, and rapid operational scalability without premature microservice complexity.

Multi-Tenancy Isolation

  • Tenant Hierarchy: Every school registered on the platform acts as an isolated tenant.
  • Data Boundary: Implements a shared database + shared schema model with mandatory schoolId indexing on all tenant-scoped tables (Student, Teacher, Class, Attendance, FeeInvoice, Assignment, Exam, etc.).
  • Security & Authorization: The centralized requireTenant middleware validates incoming request context and prevents Insecure Direct Object Reference (IDOR) attacks across school tenants.
  • Super Admin Boundary: Platform owners have cross-tenant governance rights for subscription provisioning, tenant suspension, and platform analytics.

πŸ“Š System Architecture Flow

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                  CLIENT VIEWPORTS & CHANNELS                                    β”‚
β”‚                     Desktop Web Browser  β€’  Tablet Viewport  β€’  Mobile Device                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                β”‚  HTTPS / Global Edge Caching
                                                β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                             EDGE CDN & FRONTEND HOSTING (Cloudflare Pages)                      β”‚
β”‚                React 19 + TypeScript + Vite 8 SPA  β€’  Tailwind CSS v4 Semantic Tokens           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                β”‚  REST API Calls (/api/v1) + HttpOnly Cookies
                                                β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                   APPLICATION GATEWAY & HOSTING                                 β”‚
β”‚                                    Render Web Service / Node.js 22 LTS                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                β”‚
                                                β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                   SECURITY & TENANT PIPELINE                                    β”‚
β”‚   β”œβ”€β”€ Helmet (HTTP Security Headers) & CORS Dynamic Whitelist                                   β”‚
β”‚   β”œβ”€β”€ JWT Auth Guard (Access Token 15m / Refresh Token 7d in HttpOnly Cookies)                  β”‚
β”‚   β”œβ”€β”€ Tenant Isolation Middleware (Strict schoolId context extraction & IDOR defense)           β”‚
β”‚   └── RBAC Gatekeeper (SUPER_ADMIN β€’ SCHOOL_ADMIN β€’ TEACHER β€’ STUDENT β€’ PARENT)                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                β”‚
                                                β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                               MODULAR MONOLITH BACKEND DOMAIN ENGINES                           β”‚
β”‚   β”œβ”€β”€ Auth & School Onboarding Module         β”œβ”€β”€ Roll Call & Attendance Radar Engine           β”‚
β”‚   β”œβ”€β”€ Academic Structure & CBSE Starter Pack  β”œβ”€β”€ Homework Broadcast & Submissions Portal       β”‚
β”‚   β”œβ”€β”€ Student & Faculty Records Directories   β”œβ”€β”€ Fee Invoicing, UPI & Receipt Reconciliation   β”‚
β”‚   β”œβ”€β”€ Timetable Slot Generator (Mon-Sat)      β”œβ”€β”€ Examinations, Marks Entry & CBSE Report Cards β”‚
β”‚   β”œβ”€β”€ Notice Board & Urgent Circulars Hub     └── Cloudflare R2 / S3 Document Storage Handler    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚                               β”‚                         β”‚
                        β–Ό                               β–Ό                         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     NEON SERVERLESS POSTGRES  β”‚ β”‚    CLOUDFLARE R2 STORAGE  β”‚ β”‚    EXTERNAL INTEGRATIONS        β”‚
β”‚  Prisma 7 ORM Connection Pool β”‚ β”‚  Worksheets & Circulars   β”‚ β”‚  Razorpay Payment Gateway (UPI) β”‚
β”‚  Shared Schema + schoolId Idx β”‚ β”‚  Student Avatars & Photos β”‚ β”‚  Resend Transactional SMTP      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Architectural Tiers Breakdown

Architectural Tier Component & Stack Core Responsibility
Presentation Layer React 19, Vite 8, Tailwind CSS v4, Framer Motion Client SPA rendering, role-aware dashboard views, student digital almanac
Edge & CDN Cloudflare Pages & Global Anycast Network Static asset delivery, edge caching, and client routing
Ingress & Hosting Render Web Service (Node.js 22 LTS container) Managed HTTP runtime, process lifecycle, environment configuration
Security & Middleware Express, Helmet, CORS, jsonwebtoken, cookie-parser Rate hygiene, CSRF mitigations, JWT session validation, tenant boundary enforcement
Domain Logic Express 4 + TypeScript 5 Modular Monolith Business operations, CBSE academic logic, attendance calculation, fee billing
Relational Storage Neon Serverless PostgreSQL + Prisma 7 ORM ACID transactions, automated pooling, indexed multi-tenant data structures
Object Storage Cloudflare R2 (S3-compatible API) High-speed zero-egress storage for homework files, exam sheets, and circulars
Third-Party Services Razorpay & Resend SMTP Instant UPI fee collections, webhooks, and transactional alert notifications

🎯 Feature Matrix by User Role

πŸ‘‘ Platform Super Admin

  • Tenant Directory: Real-time listing of all schools, subscription plans (FREE, BASIC, PRO, ENTERPRISE), domain identifiers, and account statuses.
  • Platform Analytics: Monthly Recurring Revenue (MRR), total student enrollments across campuses, and system utilization metrics.
  • Tenant Lifecycle: Instantly provision, suspend, or renew school tenant subscriptions.

🏫 School Administrator

  • 1-Click CBSE Starter Pack: Instantly populates standard CBSE Class 1 to Class 10 structures with core subject curriculums (Mathematics, Science, English, Hindi, Social Science).
  • Faculty & Student Admissions: Comprehensive CRUD directories, admission numbers (ADM-2026-XXXX), section assignments, and contact records.
  • Fee Management & Invoicing:
    • Itemized fee structures (Tuition, Computer Lab, Examination, Sports).
    • Bulk invoice generation per academic term.
    • Receipt generation (REC-2026-XXXX) with balance calculations.
  • Timetable Scheduler: Configure weekly period slots (Monday through Saturday) with rooms, teachers, and timings.
  • Notice Board & Circulars: Publish priority announcements (URGENT, HIGH, NORMAL) with PDF attachments.
  • Analytics & Report Generation: One-click CSV exports for attendance defaulters, fee dues, and GPA rankings.

πŸ‘¨β€πŸ« Teacher Portal

  • Daily Lecture Agenda: Visual breakdown of assigned periods, classroom locations, and lecture times.
  • Interactive Roll Call: 1-click attendance puncher with bulk "Mark All Present", absent reasons, and holiday flags.
  • Homework & Assignment Engine:
    • Broadcast homework with class, section, and subject targeting.
    • Set submission deadlines and maximum grading scores.
    • Attach worksheets and question papers via Cloudflare R2 storage.
    • View "Recent Broadcasts" with live student submission counts.
  • Evaluation & Grading: Review submitted student copies, input marks, and record teacher remarks.

πŸŽ“ Student & Parent Digital Almanac

  • Personal Academic Dashboard:
    • Real-time attendance compliance gauge (minimum 75% CBSE requirement tracking).
    • Daily period timetable and room indicators.
    • Active homework checklist with urgency countdowns.
  • Classroom Portal ("My Subjects"):
    • Subject-wise syllabus coverage, chapter notes, and teacher contact cards.
    • Homework Submission Dialog: Upload completed homework documents (PDF, DOCX, JPG, PNG) directly to Cloudflare R2.
  • Fee Ledger & Payments:
    • Outstanding dues, installment schedules, and breakdown of tuition items.
    • Instant online UPI QR-code payment flow.
    • Download verified payment receipts with transaction IDs.
  • Exams & Report Cards:
    • Examination schedules, downloadable admit cards, and CBSE term report cards with GPA calculation.

πŸ“š Additional Integrated Utilities

  • Library Catalog & Circulation:
    • Inventory search by Title, Author, Category, and ISBN.
    • Interactive "Add Book" modal.
    • "Issue Book" modal with borrowing periods (7, 14, 30 days) and automated stock decrement.
    • Issued Books Register with one-click "Return Book" restoration.
  • In-App Messaging & Department Chat:
    • Real-time conversation threads between faculty leads, administrative desks, and parents.
    • Contact search, delivery timestamps, and online status indicators.
  • Daylight / Night Owl Theme System:
    • Instant Dark Mode contrast switcher powered by semantic CSS custom properties and localStorage persistence.

πŸ› οΈ Technology Stack

Frontend

Component Technology Description
Framework React 19 + Vite 8 Modern reactive user interface with sub-second HMR
Language TypeScript 5 Strict type checking and interface contracts
Styling Tailwind CSS v4 Semantic CSS variable tokens, daylight/dark mode themes
Animation Framer Motion + GSAP Fluid micro-interactions, layout transitions, and entrance effects
State & Data TanStack React Query Server state synchronization, caching, and mutation handling
Icons & Visuals Lucide React + Canvas Confetti Accessible feather icons & delight celebrations
Analytics Recharts Interactive bar, area, and pie charts

Backend

Component Technology Description
Runtime Node.js 22 LTS High-performance asynchronous JavaScript engine
Framework Express 4 RESTful HTTP routing architecture
ORM & DB Prisma 7 + PostgreSQL Type-safe schema migrations, queries, and pooling
Database Host Neon Serverless PostgreSQL with auto-scaling connection pooling
Authentication JWT + bcryptjs HttpOnly cookie storage (SameSite=None, Secure)
Validation Zod 3 Runtime request body and parameter validation schemas
Storage Cloudflare R2 via AWS S3 SDK S3-compatible, zero-egress cloud object storage
Security Helmet + CORS Security headers, CSRF mitigations, cross-origin white-listing

πŸ—„οΈ Database Schema & Multi-Tenancy

The PostgreSQL database contains 22 normalized models designed for relational integrity:

Platform & Tenancy:
β”œβ”€β”€ School               (Tenant master, status, domain, trial dates)
β”œβ”€β”€ User                 (System credentials, role, schoolId)
β”œβ”€β”€ SubscriptionPlan     (Platform pricing tiers & feature flags)

Academic Structure:
β”œβ”€β”€ AcademicYear         (Sessions, e.g., 2026-2027, isCurrent flag)
β”œβ”€β”€ Class                (Grade levels 1 through 12)
β”œβ”€β”€ Section              (A, B, C batches with capacity limits)
β”œβ”€β”€ Subject              (Theory & Practical subject codes)
β”œβ”€β”€ ClassSubject         (Class-Subject-Teacher mapping)

People:
β”œβ”€β”€ Student              (Admission details, roll numbers, guardian metadata)
β”œβ”€β”€ Teacher              (Faculty profiles, designations, joining dates)
β”œβ”€β”€ Parent               (Guardian relationships and contact details)

Daily Operations:
β”œβ”€β”€ Attendance           (Section-level roll call container)
β”œβ”€β”€ AttendanceRecord     (Per-student PRESENT, ABSENT, LATE, EXCUSED status)
β”œβ”€β”€ Timetable            (Day-wise period schedules with room numbers)
β”œβ”€β”€ Assignment           (Homework, title, due dates, max marks, worksheets)
β”œβ”€β”€ AssignmentSubmission (Student answer files, grades, feedback)

Examinations:
β”œβ”€β”€ Exam                 (Term examinations, date sheets, academic year)
β”œβ”€β”€ ExamSubject          (Subject maximum & passing thresholds)
β”œβ”€β”€ ExamResult           (Student marks obtained, letter grades, remarks)

Finance:
β”œβ”€β”€ FeeStructure         (Itemized annual fees per class)
β”œβ”€β”€ FeeInvoice           (Student term fee statements, dues, discounts)
β”œβ”€β”€ FeePayment           (Verified UPI/Cash transaction receipts)

Communications & Media:
β”œβ”€β”€ Announcement         (Notice board circulars with audience filters)
β”œβ”€β”€ Notification         (In-app alerts)
β”œβ”€β”€ Document             (Cloudflare R2 metadata and file URLs)

πŸ“ Directory Structure

School_Mangement_System/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ prisma/
β”‚   β”‚   β”œβ”€β”€ schema.prisma       # Database schema models & enums
β”‚   β”‚   └── seed.ts             # Comprehensive CBSE seed dataset
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ config/             # Zod environment configuration & validation
β”‚   β”‚   β”œβ”€β”€ db/                 # Prisma client instance with pg adapter
β”‚   β”‚   β”œβ”€β”€ middleware/         # Auth, Tenant isolation, RBAC, Error, Logging
β”‚   β”‚   β”œβ”€β”€ modules/            # Domain modules (auth, schools, academics,
β”‚   β”‚   β”‚                       # students, teachers, attendance, assignments,
β”‚   β”‚   β”‚                       # finance, exams, timetable, uploads, reports)
β”‚   β”‚   β”œβ”€β”€ utils/              # JWT helpers, API responses, passwords
β”‚   β”‚   β”œβ”€β”€ app.ts              # Express configuration & route mounting
β”‚   β”‚   └── server.ts           # HTTP server bootstrap & graceful shutdown
β”‚   └── package.json
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ public/                 # Static assets, SVG favicons, icons
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/         # Reusable UI & feature components
β”‚   β”‚   β”‚   β”œβ”€β”€ common/         # Buttons, Badges, Modals, Loaders
β”‚   β”‚   β”‚   β”œβ”€β”€ features/       # Attendance, Finance, Dashboard views
β”‚   β”‚   β”‚   └── layout/         # Sidebar, Header, AppLayout
β”‚   β”‚   β”œβ”€β”€ context/            # AuthContext, ThemeContext
β”‚   β”‚   β”œβ”€β”€ pages/              # Landing, Login, Dashboard, Subjects,
β”‚   β”‚   β”‚                       # Attendance, Finance, Timetable, Exams,
β”‚   β”‚   β”‚                       # Announcements, Calendar, OtherPages
β”‚   β”‚   β”œβ”€β”€ services/           # Typed Axios API services
β”‚   β”‚   β”œβ”€β”€ types/              # Domain TypeScript interfaces
β”‚   β”‚   β”œβ”€β”€ App.tsx             # Route declarations & auth guards
β”‚   β”‚   └── index.css           # Tailwind v4 theme tokens
β”‚   └── package.json
β”‚
β”œβ”€β”€ docs/                       # Architecture specifications & wireframes
β”œβ”€β”€ docker-compose.yml          # Containerized local environment
└── README.md

πŸš€ Quick Start & Local Setup

Prerequisites

  • Node.js: v20 or v22 LTS
  • npm: v10+
  • PostgreSQL: Local PostgreSQL 15+ or a free Neon cloud instance

1. Clone the Repository

git clone https://github.com/somcpp/School_Mangement_System.git
cd School_Mangement_System

2. Configure Backend Environment

cd backend
cp .env.example .env

Update .env with your PostgreSQL database URL and JWT secrets (see Environment Configuration).

3. Install Backend Dependencies & Seed Database

npm install
npm run prisma:generate
npm run prisma:push
npm run prisma:seed

4. Start the Backend Development Server

npm run dev
# Server listening on http://localhost:5000/api/v1

5. Install Frontend Dependencies & Start App

In a new terminal window:

cd ../frontend
npm install
npm run dev
# Frontend live at http://localhost:5173

πŸ”‘ Environment Configuration

Backend (backend/.env)

# Server
NODE_ENV=development
PORT=5000
API_PREFIX=/api/v1
CORS_ORIGIN=http://localhost:5173,http://localhost:3000

# PostgreSQL Connection String (Neon / Supabase / Local)
DATABASE_URL="postgresql://user:password@host.neon.tech/neondb?sslmode=require"

# JWT Secrets (Minimum 16 characters each)
JWT_ACCESS_SECRET="your_super_secret_jwt_access_key_min_16_chars"
JWT_REFRESH_SECRET="your_super_secret_jwt_refresh_key_min_16_chars"
JWT_ACCESS_EXPIRES_IN="15m"
JWT_REFRESH_EXPIRES_IN="7d"
COOKIE_DOMAIN="localhost"

# Super Admin Seed
SUPER_ADMIN_EMAIL="superadmin@platform.com"
SUPER_ADMIN_PASSWORD="SuperAdmin@Secure123!"
SUPER_ADMIN_NAME="Platform Super Admin"

# Cloudflare R2 / AWS S3 Object Storage
STORAGE_DRIVER=s3
AWS_ACCESS_KEY_ID="your_r2_access_key_id"
AWS_SECRET_ACCESS_KEY="your_r2_secret_access_key"
AWS_REGION="auto"
AWS_S3_BUCKET="school-management-files"
AWS_S3_ENDPOINT="https://<ACCOUNT_ID>.r2.cloudflarestorage.com"
AWS_S3_PUBLIC_URL="https://pub-xxxxxxxx.r2.dev"

# Payment Gateway (Razorpay)
RAZORPAY_KEY_ID="rzp_test_xxxxxx"
RAZORPAY_KEY_SECRET="your_razorpay_secret"

# Transactional Email (Resend / SMTP)
SMTP_HOST="smtp.resend.com"
SMTP_PORT=587
SMTP_USER="resend"
SMTP_PASS="re_xxxxxxxxxxxx"
SMTP_FROM="SchoolHub <notifications@schoolhub.edu>"

Frontend (frontend/.env)

VITE_API_BASE_URL="http://localhost:5000/api/v1"

(In production, set VITE_API_BASE_URL to your live Render backend URL, e.g. https://schoolhub-backend.onrender.com/api/v1).


πŸ“‘ Core API Endpoints

Method Endpoint Access Role Description
POST /api/v1/auth/login Public Authenticate user & receive HttpOnly cookies
POST /api/v1/auth/logout Authenticated Clear session tokens
GET /api/v1/auth/me Authenticated Retrieve authenticated user profile
GET /api/v1/schools Super Admin List all school tenants
POST /api/v1/schools Super Admin Provision a new school tenant
POST /api/v1/academics/starter-pack School Admin 1-Click setup of Classes 1-10 & CBSE subjects
GET /api/v1/students Admin / Teacher Directory of enrolled students
GET /api/v1/attendance Admin / Teacher Roll call records by class & section
POST /api/v1/attendance/punch Admin / Teacher Bulk punch daily student attendance
GET /api/v1/assignments All Authenticated Filter assignments by class/subject
POST /api/v1/assignments Teacher / Admin Broadcast class homework with deadline
POST /api/v1/assignments/:id/submit Student Submit completed homework copy
GET /api/v1/finance/invoices Admin / Student Fee invoices and balance statements
POST /api/v1/finance/payments Admin / Student Record payment transaction receipt
GET /api/v1/exams All Authenticated Examination schedules & mark entry
POST /api/v1/uploads Authenticated Upload document/worksheet to Cloudflare R2
GET /api/v1/reports/attendance Admin Attendance analytics & defaulters report

🌐 Production Deployment Guide

Frontend Deployment (Cloudflare Pages)

  1. In Cloudflare Dashboard, go to Workers & Pages $\rightarrow$ Create Application $\rightarrow$ Pages $\rightarrow$ Connect GitHub repository.
  2. Configure Build Settings:
    • Framework preset: Vite
    • Root directory: frontend
    • Build command: npm run build
    • Build output directory: dist
  3. Add Environment Variable:
    • VITE_API_BASE_URL = https://<YOUR_RENDER_BACKEND>.onrender.com/api/v1
  4. Click Save and Deploy. Cloudflare automatically handles global edge caching and SPA routing.

Backend Deployment (Render)

  1. In Render, click New $\rightarrow$ Web Service $\rightarrow$ Select repository.
  2. Configure Service Settings:
    • Name: schoolhub-backend
    • Region: Ohio (US East) (Matches Neon US-East DB for low latency)
    • Root directory: backend
    • Runtime: Node
    • Build command: npm install && npm run build
    • Start command: npm start
  3. Add Environment Variables (from your backend .env):
    • Set NODE_ENV=production
    • Set DATABASE_URL to your Neon PostgreSQL connection string
    • Set CORS_ORIGIN to your Cloudflare Pages domain (e.g. https://schoolhub.pages.dev)
    • Set JWT_ACCESS_SECRET, JWT_REFRESH_SECRET, and Cloudflare R2 credentials.
  4. Deploy the service.

πŸ“„ License

This project is licensed under the ISC License. Built for educational excellence.

About

School Management System

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages