How upparavinod7/smart_campus_backend works
Joy University Smart Campus ERP is an Express backend for academic administration and student/faculty workflows. Users enter through the versioned API; authentication and role or academic-policy checks guard routed operations. The principal academic workflow manages institutional structure and offerings, assigns students to sections, schedules classes, and records attendance. Separate academic-learning endpoints support materials, quizzes, attempts, and results. MySQL is the authoritative relational store; MongoDB is documented for optional attendance audit archiving. Several domain controllers were not sampled, so their internal call relationships are not inferred.
Main entry points: index.js Route registry · mysql.js MySQL pool · material.controller.js Learning materials · attendance.controller.js Attendance records
Components 26
API and access
- Express API
src/app.js - Route registry
src/routes/index.js - JWT authentication
src/middleware/auth.middleware.js - Role authorization
src/middleware/role.middleware.js - Academic policies
src/middleware/academicAuth.js - MySQL pool
src/config/mysql.js - MongoDB config
src/config/mongodb.js
Academic structure
- Institutional hierarchy
src/controllers - Enrollment and roster
src/controllers/enrollment.controller.js - Section capacity
src/controllers/section.controller.js - Timetable scheduling
src/controllers/timetable.controller.js
User portals
- Student portal
src/controllers/studentPortal.controller.js - Faculty portal
src/controllers/facultyPortal.controller.js - Faculty records
src/controllers/faculty.controller.js
Attendance
- Class sessions
src/controllers/attendanceSession.controller.js - Attendance records
src/controllers/attendance.controller.js
Academic learning
- Subjects and topics
src/controllers/academic/subjectTopic.controller.js - Learning materials
src/controllers/academic/material.controller.js - Quiz authoring
src/controllers/academic/quizAuthoring.controller.js - Quiz attempts
src/controllers/academic/quizAttempt.controller.js - Results analytics
src/controllers/academic/resultsAnalytics.controller.js - Academic audit ledger
src/utils/academicLedger.js - Material upload parsing
src/utils/multipart.js - Text extraction
src/utils/textExtractor.js - Virus scanning
src/utils/virusScanner.js
Other components
- API users
Connections 38
- API users → Express API: send requests
src/app.js - Express API → Route registry: mounts API
src/app.js - Route registry → JWT authentication: guards routes
src/routes/index.js - Route registry → Institutional hierarchy: routes domains
- Route registry → Enrollment and roster: routes enrollments
- Route registry → Student portal: routes portal
- Route registry → Faculty portal: routes portal
- Route registry → Attendance records: routes attendance
- Route registry → Class sessions: routes sessions
- Route registry → Section capacity: routes sections
- Route registry → Timetable scheduling: routes timetable
- Route registry → Subjects and topics: routes academics
- Route registry → Learning materials: routes academics
- Route registry → Quiz authoring: routes academics
- Route registry → Quiz attempts: routes academics
- Route registry → Results analytics: routes academics
- Route registry → Role authorization: checks roles
- Route registry → Academic policies: checks policy
- JWT authentication → MySQL pool: checks revocation
src/middleware/auth.middleware.js - Enrollment and roster → MySQL pool: reads and writes
src/controllers/enrollment.controller.js - Section capacity → MySQL pool: reads and writes
src/controllers/section.controller.js - Timetable scheduling → MySQL pool: reads and writes
src/controllers/timetable.controller.js - Faculty portal → MySQL pool: reads and writes
src/controllers/facultyPortal.controller.js - Faculty records → MySQL pool: reads and writes
src/controllers/faculty.controller.js - Attendance records → MySQL pool: reads and writes
src/controllers/attendance.controller.js - Class sessions → MySQL pool: reads and writes
src/controllers/attendanceSession.controller.js - Subjects and topics → MySQL pool: reads and writes
src/controllers/academic/subjectTopic.controller.js - Learning materials → MySQL pool: reads and writes
src/controllers/academic/material.controller.js - Quiz authoring → MySQL pool: reads and writes
src/controllers/academic/quizAuthoring.controller.js - Quiz attempts → MySQL pool: reads and writes
src/controllers/academic/quizAttempt.controller.js - Results analytics → MySQL pool: reads and writes
src/controllers/academic/resultsAnalytics.controller.js - Academic policies → MySQL pool: checks access
src/middleware/academicAuth.js - Student portal → MySQL pool: reads and writes
- Quiz attempts → Academic audit ledger: logs events
src/controllers/academic/quizAttempt.controller.js - Learning materials → Material upload parsing: parses uploads
src/controllers/academic/material.controller.js - Learning materials → Text extraction: extracts text
src/controllers/academic/material.controller.js - Material upload parsing → Virus scanning: scans files
src/utils/multipart.js - Attendance records → MongoDB config: archives audit logs
README.md