Fajr Danesh School Platform
A full school management platform — React + Express + MongoDB, with an Android app and live at fajrdanesh1.ir.
What it is
Fajr Danesh is a complete educational platform for a real school, live at fajrdanesh1.ir. It manages students, teachers, parents and educational news in one system: a React + Vite frontend (plus Capacitor Android app), an Express + MongoDB backend, and a security-hardened API with role-based access.
Live: fajrdanesh1.ir
Feature highlights
Frontend (React + Vite)
- Role-based dashboards — Admin, Teacher, Parent and Student views with separate layouts
- News management — publish educational news with rich content
- Gallery & media —
GalleryUploader/GalleryManagerwith image/video upload - Progress tracking —
ProgressChart+MultiTermProgressChartvisual growth per term - Grades & rankings — grade tables, summary views and a ranking table
- Quiz & questions archive — create, store and reuse questions
- Class schedules —
ScheduleEditorfor term timetables - Smart notifications —
SmartNotificationsystem for parents/teachers - Real teacher profiles — dedicated pages per teacher, plus pre-registration (
PreRegisterForm) - PDF export — jsPDF + autotable for printable reports
- Persian-first — jalaali calendar support (
moment-jalaali), Persian digit handling
Backend (Express + MongoDB)
- Auth & roles — JWT tokens, bcrypt hashing, cookie sessions, middleware-enforced roles (
requireRole) - 12 Mongoose models —
User,Student,Grade,ClassSchedule,News,Gallery,Album,GalleryVideo,Question,Note,PreRegister,ActivityLog - Controllers & routes — auth, admin, teacher, parent, news, gallery, schedule, questions, pre-register and meta, each with dedicated routes
- Hardened by default —
helmetheaders,express-rate-limit(global + per-route), CSRF token route,express-mongo-sanitize, HPP protection,express-validator - Uploads — multer-based upload pipeline with
uploads/storage - Realtime — Socket.io presence & live updates
- Logging — Winston structured logs + Morgan request logging
- Backups —
mongo_backup/, restore scripts andrestore_users.json
Project structure
School-Vps/
├── frontend/ # React 18 + Vite SPA (+ Capacitor Android app)
│ └── src/
│ ├── pages/ # dashboards, login/register, about, contact, honours…
│ ├── components/ # 50+ components incl. admin/, charts, tables
│ ├── context/AuthContext.jsx # global auth state
│ └── secure_guard/ProtectedRoute.jsx # route guarding by role
├── backend/
│ ├── index.js # Express app + middleware stack
│ ├── models/ # 12 Mongoose schemas
│ ├── controllers/ # auth, admin, teacher, parent, news, schedule…
│ ├── routes/ # REST routes grouped by domain
│ ├── middleware/ # auth, role, CSRF, error handling
│ ├── config/ # env loader, rate limits, upload paths
│ ├── services/ # business logic
│ └── uploads/ # media storage
└── mongo_backup/ # database backups
Getting started
cd backend && npm install && npm run start:prod
cd frontend && npm install && npm run dev # http://localhost:5173
Prerequisites: Node 18+, MongoDB, Git.
Why it stands out
This isn’t a demo — it’s a live production platform with real teachers, real students and real school data. It shows full-stack breadth (React, state, charts, Capacitor on one side; REST, auth, uploads, realtime, security hardening on the other) and the operational care of a project that ships and keeps running: rate limits, CSRF, sanitization, structured logging and database backups are built in, not bolted on.