How dharshancr/college-management-system works
Purpose and entry points
NGI is a full-stack college-management system covering student, faculty, HR, and admissions workflows. The React SPA starts at client/src/main.jsx, with application state and view selection centralized in client/src/App.jsx. The Express API starts at server/index.js; root scripts in package.json coordinate client/server development and seeding.
Client application shell and access
client/src/App.jsx is the client-side orchestration boundary: it manages authentication/session state, selected module, API-backed data, and role-sensitive rendering. Shared navigation and global interactions are split across client/src/components/Navbar.jsx, client/src/components/Sidebar.jsx, client/src/components/LoginModal.jsx, and client/src/components/NotificationDrawer.jsx. The frontend is a Vite-built React 18 application with Tailwind CSS; production assets are emitted to client/dist.
Domain module views
Feature UI is organized as independently rendered page modules, while sharing the shell and central application state:
• Student dashboard, reminders, attendance, fees, grades: client/src/pages/DashboardView.jsx, client/src/pages/RemindersView.jsx, client/src/pages/AttendanceView.jsx.
• Academic scheduling and library circulation: client/src/pages/TimetableScheduleView.jsx, client/src/pages/LibraryView.jsx.
• Administrative workflows: client/src/pages/AdmissionsView.jsx, client/src/pages/HRPayrollView.jsx.
• Campus messaging/announcements: client/src/pages/CommunicationView.jsx.
These views represent the principal user-facing workflow boundary rather than separate client routes.
API, authorization, and workflow control
server/index.js is the single REST API surface for the ten functional areas. It owns request validation/control flow, JWT authentication, role-based authorization, and mutations such as attendance events, payments/receipts, grade publishing, admission stage changes, payroll actions, and messages. Browser requests reach it directly in deployed environments or through the Vite development proxy configured by client/vite.config.js. JWT, bcrypt, and CORS are material backend dependencies.
Persistence and lifecycle
server/db.js provides the persistent cross-platform JSON/SQLite-style database abstraction consumed by the API. Persisted data is represented in server/college_db.json; server/seed.js initializes or refreshes the demo dataset. This is the core infrastructure boundary: clients never access database records directly, and all durable state changes pass through API handlers and the DB layer.
Primary flows
1. Login or demo role selection in the client establishes an authenticated role context; subsequent API calls carry JWT authorization.
2. The app shell loads role-relevant records from Express, then dispatches them to module views.
3. User actions in a module invoke REST mutations; the server enforces permissions, persists through server/db.js, and returns updated data for UI state refresh.
4. Notifications/reminders cross-cut workflows and are surfaced globally through client/src/components/NotificationDrawer.jsx.
5. Build/deployment separates the static Vite bundle (client/dist) from Node runtime hosting; Express can optionally serve that bundle for a single-server deployment.
Main entry points: App.jsx Application shell · index.js Express REST API · package.json Root scripts · db.js Database abstraction
Components 16
React client
Vite React SPA and workflow views.
- SPA entry
client/src/main.jsx - Application shell · Centralizes session, selected module, API data, and role-sensitive rendering.
client/src/App.jsx - Navigation
client/src/components/Sidebar.jsx - Login modal
client/src/components/LoginModal.jsx - Notification drawer · Surfaces cross-cutting reminders and notifications.
client/src/components/NotificationDrawer.jsx - Student workflows
client/src/pages/DashboardView.jsx - Academic operations
client/src/pages/TimetableScheduleView.jsx - Administrative workflows
client/src/pages/AdmissionsView.jsx - Campus communications
client/src/pages/CommunicationView.jsx - Vite dev proxy
client/vite.config.js - Static bundle · Can be served by Express in a single-server deployment.
client/dist
Node API
REST control, authorization, and durable workflow changes.
- Express REST API · Validates requests, enforces JWT roles, and executes domain mutations.
server/index.js
Persistence
Demo data lifecycle and durable records.
- Database abstraction · Only API handlers access durable records through this layer.
server/db.js - College records
server/college_db.json - Demo data seeder
server/seed.js
Other components
- Root scripts · Coordinates development and seeding.
package.json
Connections 18
- Root scripts → SPA entry: starts client
- Root scripts → Express REST API: starts API
- Root scripts → Demo data seeder: runs
- SPA entry → Application shell: mounts
- Application shell → Navigation: renders
- Application shell → Login modal: establishes session
- Application shell → Notification drawer: surfaces alerts
- Application shell → Student workflows: dispatches state
- Application shell → Academic operations: dispatches state
- Application shell → Administrative workflows: dispatches state
- Application shell → Campus communications: dispatches state
- Application shell → Vite dev proxy: development requests
- Application shell → Express REST API: JWT-authenticated REST
- Vite dev proxy → Express REST API: forwards in development
- Express REST API → Database abstraction: authorized reads and mutations
- Database abstraction → College records: persists
- Demo data seeder → Database abstraction: initializes or refreshes
- Express REST API → Static bundle: optionally serves