How mervin0266/iqac-plateform works
1. Purpose and entry points
IQAC Platform is a two-process institutional-quality-management application: a React/Vite frontend for public and authenticated administration views, plus an Express backend for persistent operational data. Frontend starts at src/main.tsx and composes the application in src/app/App.tsx; backend starts at src/app/backend/server.js.
2. Frontend application shell
src/app/App.tsx is the primary UI composition and navigation boundary. It brings together public-site presentation, login, dashboard, and content-management pages. Shared authenticated layout/navigation is represented by src/app/components/Header.tsx, src/app/components/Sidebar.tsx, and src/app/components/DashboardPage.tsx.
3. Public versus administrative experiences
The UI separates public institutional content from managed IQAC workflows. Public-facing rendering is centered on src/app/components/PublicWebsite.tsx, src/app/components/PublicHomePage.tsx, and src/app/components/PublicNavBar.tsx. Administrative pages cover departments, faculty, students, documents, achievements, strategic plans, and placement/research areas, such as src/app/components/DepartmentTrackingPage.tsx, src/app/components/AchievementsPage.tsx, and src/app/components/StrategicPlanPage.tsx.
4. Authentication and authorization boundary
Frontend authentication state is owned by src/app/contexts/AuthContext.tsx. UI-level access enforcement uses src/app/components/PermissionGuard.tsx and the permission definitions in src/app/config/permissions.ts. Backend requests cross the trust boundary through src/app/backend/middleware/auth.js; authorization and audit behavior should remain server-enforced rather than relying on the UI guard.
5. Backend API and domain modules
The Express server mounts resource-specific route modules from src/app/backend/routes/, which dispatch to controllers in src/app/backend/controllers/. Key domain slices include identity (src/app/backend/routes/auth.js, src/app/backend/controllers/authController.js, src/app/backend/models/User.js), institutional entities (src/app/backend/routes/departments.js, src/app/backend/controllers/departmentController.js, src/app/backend/models/Department.js), and document governance (src/app/backend/routes/documents.js, src/app/backend/controllers/documentController.js, src/app/backend/models/Document.js).
6. Persistence, workflow, and observability
Database configuration is isolated in src/app/backend/config/database.js, while model registration is consolidated in src/app/backend/models/index.js. The backend supports governance workflows beyond CRUD: edit-request lifecycle through src/app/backend/models/EditRequest.js and src/app/backend/controllers/editRequestController.js; user notifications through src/app/backend/models/Notification.js and src/app/backend/middleware/notificationHelper.js; and audit capture through src/app/backend/models/AuditLog.js and src/app/backend/middleware/auditLogger.js. Seeding/initialization is provided by src/app/backend/config/autoSeed.js and src/app/backend/scripts/initDatabase.js.
7. Runtime and delivery shape
The frontend runs under Vite, configured by vite.config.ts, with TypeScript/React source under src/ and static host entry index.html. The backend is a separately installed Node.js package under src/app/backend/package.json, run independently from the frontend. The repository includes backend deployment and operational guidance at src/app/backend/DEPLOYMENT.md and src/app/backend/QUICKSTART.md; a hosted design/site reference is identified in README.md.
Main entry points: index.js Model registry · App.tsx Application shell · PermissionGuard.tsx UI permission guard · server.js Express server
Components 18
React/Vite frontend
Public site and authenticated IQAC administration UI.
- Vite runtime
vite.config.ts - Frontend entry
src/main.tsx - Application shell · Navigation boundary for public, login, dashboard, and management pages.
src/app/App.tsx - Public website
src/app/components/PublicWebsite.tsx - Auth state
src/app/contexts/AuthContext.tsx - UI permission guard · Applies frontend permission definitions to administrative views.
src/app/components/PermissionGuard.tsx - Admin dashboard layout
src/app/components/DashboardPage.tsx - IQAC management pages · Manages departments, documents, achievements, plans, and related institutional data.
src/app/components/DepartmentTrackingPage.tsx
Express backend
Independently run API, workflow, and persistence service.
- Express server
src/app/backend/server.js - Server auth middleware · Enforces authentication and authorization on backend requests.
src/app/backend/middleware/auth.js - Resource routes · Mounts domain-specific API endpoints.
- Domain controllers · Implements identity, institutional, document, and workflow operations.
- Model registry · Consolidates registered persistence models.
src/app/backend/models/index.js - Database
src/app/backend/config/database.js - Edit-request workflow · Tracks lifecycle of requested edits.
src/app/backend/models/EditRequest.js - Notifications · Creates user notifications during backend workflows.
src/app/backend/middleware/notificationHelper.js - Audit logging · Captures server-side operational audit records.
src/app/backend/middleware/auditLogger.js - Database initialization · Seeds and initializes operational data.
src/app/backend/scripts/initDatabase.js
Connections 22
- Vite runtime → Frontend entry: serves
- Frontend entry → Application shell: mounts
- Application shell → Public website: renders public experience
- Application shell → Auth state: uses session state
- Auth state → UI permission guard: supplies identity
- Application shell → UI permission guard: guards admin views
- UI permission guard → Admin dashboard layout: permits
- Admin dashboard layout → IQAC management pages: hosts
- Public website → Express server: API requests
- IQAC management pages → Express server: API requests
- Express server → Server auth middleware: protects requests
- Server auth middleware → Resource routes: authorizes
- Resource routes → Domain controllers: dispatches
- Domain controllers → Model registry: reads and writes
- Model registry → Database: persists to
- Domain controllers → Edit-request workflow: manages
- Domain controllers → Notifications: triggers
- Domain controllers → Audit logging: records actions
- Edit-request workflow → Model registry: stored as model
- Notifications → Model registry: creates notification records
- Audit logging → Model registry: writes audit records
- Database initialization → Database: initializes