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.
- β‘ 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.
| 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. |
- What is SchoolHub?
- Key Capabilities at a Glance
- Who Uses SchoolHub?
- Architectural Overview
- System Architecture Flow
- Feature Matrix by User Role
- Technology Stack
- Database Schema & Multi-Tenancy
- Directory Structure
- Quick Start & Local Setup
- Environment Configuration
- Core API Endpoints
- Production Deployment Guide
- License
SchoolHub follows a Modular Monolith pattern designed for high cohesion, strict domain separation, and rapid operational scalability without premature microservice complexity.
- Tenant Hierarchy: Every school registered on the platform acts as an isolated tenant.
- Data Boundary: Implements a shared database + shared schema model with mandatory
schoolIdindexing on all tenant-scoped tables (Student,Teacher,Class,Attendance,FeeInvoice,Assignment,Exam, etc.). - Security & Authorization: The centralized
requireTenantmiddleware 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.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 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 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 |
- 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.
- 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.
- 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.
- 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.
- 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
localStoragepersistence.
- Instant Dark Mode contrast switcher powered by semantic CSS custom properties and
| 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 |
| 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 |
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)
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
- Node.js: v20 or v22 LTS
- npm: v10+
- PostgreSQL: Local PostgreSQL 15+ or a free Neon cloud instance
git clone https://github.com/somcpp/School_Mangement_System.git
cd School_Mangement_Systemcd backend
cp .env.example .envUpdate .env with your PostgreSQL database URL and JWT secrets (see Environment Configuration).
npm install
npm run prisma:generate
npm run prisma:push
npm run prisma:seednpm run dev
# Server listening on http://localhost:5000/api/v1In a new terminal window:
cd ../frontend
npm install
npm run dev
# Frontend live at http://localhost:5173# 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>"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).
| 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 |
- In Cloudflare Dashboard, go to Workers & Pages
$\rightarrow$ Create Application$\rightarrow$ Pages$\rightarrow$ Connect GitHub repository. - Configure Build Settings:
-
Framework preset:
Vite -
Root directory:
frontend -
Build command:
npm run build -
Build output directory:
dist
-
Framework preset:
- Add Environment Variable:
-
VITE_API_BASE_URL=https://<YOUR_RENDER_BACKEND>.onrender.com/api/v1
-
- Click Save and Deploy. Cloudflare automatically handles global edge caching and SPA routing.
- In Render, click New
$\rightarrow$ Web Service$\rightarrow$ Select repository. - 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
-
Name:
- Add Environment Variables (from your backend
.env):- Set
NODE_ENV=production - Set
DATABASE_URLto your Neon PostgreSQL connection string - Set
CORS_ORIGINto your Cloudflare Pages domain (e.g.https://schoolhub.pages.dev) - Set
JWT_ACCESS_SECRET,JWT_REFRESH_SECRET, and Cloudflare R2 credentials.
- Set
- Deploy the service.
This project is licensed under the ISC License. Built for educational excellence.