How aswinramaraj/eosbackend1 works
Purpose and Runtime
This is a TypeScript NestJS backend for a broad institutional/campus management platform. It exposes role-scoped HTTP APIs for students, faculty, administrators, HODs, principals, finance, hostel, examinations, library, placement, IQAC, transport, sports, medical, and procurement operations. Application bootstrap and root dependency composition are in src/main.ts, src/app.module.ts, and src/app.controller.ts.
Request, Identity, and Cross-Cutting Boundary
Requests enter Nest controllers, are validated through DTOs/pipes, authenticated with JWT, and authorized by role guards before reaching domain services. Common response transformation, logging, exception handling, and transient database retry form the API boundary. Relevant paths: src/auth/auth.module.ts, src/auth/guards/jwt-auth.guard.ts, src/common/filters/http-exception.filter.ts. Audit logging is a shared concern through src/common/audit-log/audit-log.service.ts; configuration is centralized at src/config/configuration.ts.
Persistence and File Infrastructure
Prisma is the primary persistence boundary: schema, migrations, and seed assets define and initialize the relational data model, while a Nest Prisma provider is injected into services. Paths: prisma/schema.prisma, prisma/migrations, src/prisma/prisma.service.ts. Storage is abstracted behind a provider/service layer with explicit Cloudinary and Supabase implementations, allowing document/media features to avoid direct vendor coupling: src/modules/storage/storage.service.ts, src/modules/storage/providers/cloudinary-storage.provider.ts, src/modules/storage/providers/supabase-storage.provider.ts.
Core Academic Identity and Learning Operations
Academic structure supplies foundational departments, courses, subjects, classes, batches, and calendars consumed by downstream workflows. Admissions owns student records and student self-service views, including requests, attendance, results, fees, and profile operations. Faculty modules own teaching assignments, timetables, attendance, learning materials, and mark entry. Paths: src/modules/academic-structure/academic-calendar/academic-calendar.service.ts, src/modules/admissions/students/students.service.ts, src/modules/faculty/timetable/timetable.service.ts.
Examination Lifecycle
The exams domain is a dense operational pipeline: configure regulations/types/exams and subject mappings; manage registrations, fee status, schedules, halls, seating, invigilation, and tickets; then capture marks, apply rules/locks, produce results/marksheets, and process revaluation or certificate workflows. Confidential actions and script handling are separately represented. Paths: src/modules/exams/exams/exams.service.ts, src/modules/exams/seating-plans/seating-plans.service.ts, src/modules/exams/marks-roster/marks-roster.service.ts.
Institutional Workflows and Approvals
Several domains implement stateful request-to-review flows across roles: student/faculty leave and OD requests, procurement requests/proposals/orders/GRNs, finance approvals/tracking, venue booking, hostel outings, and hall-ticket clearance. HOD, principal, academic coordinator, secretary, and finance modules provide role-specific aggregation, approval, and reporting views over shared operational records. Paths: src/modules/procurement/purchase-order-proposals/purchase-order-proposals.service.ts, src/modules/finance/approvals/approvals.service.ts, src/modules/principal/approvals/approvals.service.ts.
Administrative Service Domains and Communication
Independent bounded modules cover fees and payment verification, wallet/top-ups, hostel residency and gate operations, transport fleet/routes, library circulation, placement drives/interviews, medical-centre operations, sports administration, entrepreneurship, IQAC/accreditation, and alumni. Notifications are an internal delivery layer with device token registration and push-notification service; SMS is exposed as shared infrastructure. Paths: src/modules/notifications/notifications/notifications.service.ts, src/common/sms/sms.service.ts, src/modules/fees-billing/fee-payments/fee-payment.service.ts.
Flow Characteristics
Most domain slices follow a controller → DTO validation/authorization → service → Prisma/storage pattern, packaged in feature modules. “Me” controllers/services provide subject-scoped student, faculty, alumni, or sports views, while administrative controllers operate across records. Reporting/export utilities appear at domain boundaries, turning persisted operational data into downloadable or dashboard-oriented outputs rather than creating a separate analytics runtime.
Main entry points: app.controller.ts Feature controllers · exams.service.ts Examination lifecycle · prisma.service.ts Prisma persistence · academic-calendar.service.ts Academic structure
Components 22
API boundary
- Nest application · Composes the root application and HTTP API.
src/main.ts - Feature controllers · Role-scoped endpoints across institutional domains.
src/app.controller.ts - JWT authentication
src/auth/auth.module.ts - Role authorization
src/auth/guards/jwt-auth.guard.ts - API error handling · Complements validation, response transformation, logging, and retry concerns.
src/common/filters/http-exception.filter.ts
Core platform
- Audit logging
src/common/audit-log/audit-log.service.ts - Prisma persistence · Injected relational persistence boundary for feature services.
src/prisma/prisma.service.ts - Relational schema and migrations · Defines, migrates, and seeds institutional records.
prisma/schema.prisma - Storage abstraction · Keeps document and media features vendor-independent.
src/modules/storage/storage.service.ts - Cloudinary provider
src/modules/storage/providers/cloudinary-storage.provider.ts - Supabase provider
src/modules/storage/providers/supabase-storage.provider.ts
Academic operations
- Academic structure · Departments, courses, subjects, classes, batches, and calendars.
src/modules/academic-structure/academic-calendar/academic-calendar.service.ts - Students and admissions · Student records and student self-service operations.
src/modules/admissions/students/students.service.ts - Faculty teaching operations · Teaching assignments, timetables, attendance, materials, and marks.
src/modules/faculty/timetable/timetable.service.ts - Examination lifecycle · Setup through registration, scheduling, marks, results, and revaluation.
src/modules/exams/exams/exams.service.ts - Exam seating and invigilation
src/modules/exams/seating-plans/seating-plans.service.ts - Marks and results processing · Applies marks rules and locks before results and marksheets.
src/modules/exams/marks-roster/marks-roster.service.ts
Institutional workflows
- Approval workflows · Leave, OD, procurement, finance, clearance, booking, and hostel requests.
src/modules/finance/approvals/approvals.service.ts - Principal approval views · Cross-record approval and reporting views for leadership roles.
src/modules/principal/approvals/approvals.service.ts
Service domains
- Administrative services · Fees, hostel, transport, library, placement, medical, sports, IQAC, and alumni.
src/modules/fees-billing/fee-payments/fee-payment.service.ts - Notifications · Device token registration and push delivery.
src/modules/notifications/notifications/notifications.service.ts - SMS
src/common/sms/sms.service.ts
Connections 32
- Nest application → Feature controllers: hosts
- Feature controllers → JWT authentication: authenticates
- JWT authentication → Role authorization: installs
- Role authorization → API error handling: guards requests
- Feature controllers → Academic structure: routes to
- Feature controllers → Students and admissions: routes to
- Feature controllers → Faculty teaching operations: routes to
- Feature controllers → Examination lifecycle: routes to
- Feature controllers → Approval workflows: routes to
- Feature controllers → Administrative services: routes to
- Academic structure → Students and admissions: supplies academic context
- Academic structure → Faculty teaching operations: supplies courses and calendars
- Academic structure → Examination lifecycle: supplies subjects and regulations context
- Students and admissions → Examination lifecycle: provides student records
- Faculty teaching operations → Marks and results processing: submits marks
- Examination lifecycle → Exam seating and invigilation: creates schedules and halls
- Exam seating and invigilation → Marks and results processing: supports exam execution
- Examination lifecycle → Marks and results processing: governs result processing
- Approval workflows → Principal approval views: feeds decisions and reporting
- Approval workflows → Prisma persistence: persists workflow state
- Administrative services → Prisma persistence: persists operations
- Academic structure → Prisma persistence: persists records
- Students and admissions → Prisma persistence: persists records
- Faculty teaching operations → Prisma persistence: persists records
- Examination lifecycle → Prisma persistence: persists records
- Prisma persistence → Relational schema and migrations: uses
- Storage abstraction → Cloudinary provider: delegates to
- Storage abstraction → Supabase provider: delegates to
- Examination lifecycle → Storage abstraction: stores documents
- Administrative services → Notifications: triggers
- Notifications → SMS: uses shared messaging
- Feature controllers → Audit logging: audits operations