How rabiaadel/stud_reg_system works
Purpose and runtime entry points
FCITU Student Registration System is a three-tier university platform for students, doctors, and admins: account admission, course/semester administration, registration, attendance/grades, transcripts, academic standing, and graduation checks. React starts at frontend/src/index.js and routes from frontend/src/App.js; Express initializes in backend/server.js. Local stack startup is quick-start.sh or docker-compose.yml.
Web client and role-oriented UI
The React 18 SPA keeps authentication in context/store, protects role-specific routes, and calls the REST API through a shared Axios client. Page/component groupings reflect student, doctor, and administrator workflows.
• frontend/src/context/AuthContext.js
• frontend/src/components/shared/ProtectedRoute.js
• frontend/src/services/api.js
Primary flow: browser → Nginx-served SPA → authenticated JSON API requests. UI state slices cover auth, courses, grades, notifications, and semesters under frontend/src/store/slices/.
API boundary, security, and request lifecycle
Express exposes versioned REST routes assembled centrally, then invokes controllers and domain services. Middleware establishes request context, validates JWT/RBAC, validates inputs, and normalizes failures before controllers execute.
• backend/server.js
• backend/routes/index.js
• backend/middleware/auth.js
• backend/middleware/requestContext.js
• backend/middleware/errorHandler.js
JWT authentication, bcrypt password hashes, CORS, Helmet, rate limiting, compression, structured logging, and Prometheus metrics are material API cross-cutting concerns. Public and authenticated endpoints are separated by route/middleware policy.
Academic domain workflows
Controllers represent transport-facing domains; services encapsulate policy-heavy workflows. Registration validates prerequisites, academic rules/bylaws, enrollment eligibility, and semester windows. Grade submission feeds GPA, transcripts, academic standing, and graduation eligibility; administrators manage users, assignments, courses, and semesters.
• backend/controllers/registrationController_v2.js
• backend/services/registrationValidationService.js
• backend/services/prerequisiteCheckService.js
• backend/services/bylawsEnforcementService.js
• backend/services/academicStandingService.js
• backend/services/graduationEligibilityService.js
Scheduled transitions and standing recalculation reside in backend/jobs/semesterTransitionJob.js and backend/jobs/academicStandingJob.js.
Persistence and lifecycle data
PostgreSQL 16 is the system of record, accessed through a backend connection pool. SQL defines relational users, student/instructor profiles, courses, semesters, enrollments, grades, notifications, attendance, and academic-standing extensions. Migrations and seeds establish schema and university bylaw/curriculum data.
• backend/config/database.js
• database/schema.sql
• database/migrations/003_add_academic_standing.sql
• database/migrations/005_add_semester_windows.sql
• database/seeds/003_complete_curriculum.sql
Database evolution runs through backend/scripts/migrate.js; initialization/demo data uses backend/scripts/seed.js.
Deployment and operational boundaries
Docker Compose runs frontend, backend, PostgreSQL, Prometheus, and Grafana. The frontend production image is served through Nginx; the API and database are separate containers with persistent DB storage and health checks. Kubernetes manifests provide deployable backend/frontend workloads, a stateful database, autoscaling, and monitoring resources.
• Dockerfile.frontend
• Dockerfile.backend
• Dockerfile.db
• docker-compose.yml
• k8s/kustomization.yaml
• k8s/db/statefulset.yaml
Observability and delivery
The backend exports metrics for Prometheus; Grafana is provisioned with application, performance, enrollment, and academic dashboards. CI/CD definitions exist for GitHub Actions, Jenkins, and a Minikube validation path.
• docker/prometheus.yml
• docker/grafana/dashboards/api-performance.json
• docker/grafana/dashboards/academic-affairs.json
• .github/workflows/ci-cd.yml
• Jenkinsfile
Main entry points: server.js Express API · schema.sql University system of record · database.js Database pool · docker-compose.yml Compose stack
Components 20
Web client
- Student, doctor & admin
- React SPA · Role-oriented pages and state slices.
frontend/src/App.js - Auth & route guard
frontend/src/context/AuthContext.js - Shared API client
frontend/src/services/api.js
Backend API
- Express API · Versioned routes, controllers, and cross-cutting middleware.
backend/server.js - Route assembly
backend/routes/index.js - Request security · Applies request context and normalizes API failures.
backend/middleware/auth.js
Academic domain
- Registration policy · Checks eligibility, prerequisites, bylaws, and semester windows.
backend/services/registrationValidationService.js - Academic outcomes · Produces standing, transcript inputs, and graduation eligibility.
backend/services/academicStandingService.js - Semester jobs · Runs transitions and standing recalculation.
backend/jobs/semesterTransitionJob.js
Data lifecycle
- Database pool
backend/config/database.js - University system of record · Stores identity, curriculum, enrollment, grades, attendance, and standing.
database/schema.sql - Schema migration · Applies academic-standing and semester-window changes.
backend/scripts/migrate.js - Curriculum seed
backend/scripts/seed.js
Operations
- Nginx frontend
Dockerfile.frontend - Compose stack · Runs frontend, API, PostgreSQL, Prometheus, and Grafana.
docker-compose.yml - Prometheus metrics
docker/prometheus.yml - Academic dashboards · Visualizes API performance and academic affairs.
docker/grafana/dashboards/academic-affairs.json - Kubernetes deployment · Deploys workloads, stateful database, autoscaling, and monitoring.
k8s/kustomization.yaml - CI/CD pipeline
.github/workflows/ci-cd.yml
Connections 24
- Student, doctor & admin → Nginx frontend: loads SPA
- Nginx frontend → React SPA: serves
- React SPA → Auth & route guard: uses
- Auth & route guard → Shared API client: authorizes calls
- Shared API client → Express API: JSON REST
- Express API → Route assembly: assembles
- Route assembly → Request security: middleware policy
- Request security → Registration policy: authenticated requests
- Request security → Academic outcomes: authenticated requests
- Registration policy → Database pool: reads and writes
- Academic outcomes → Database pool: reads and writes
- Semester jobs → Academic outcomes: recalculates standing
- Semester jobs → Database pool: updates lifecycle data
- Database pool → University system of record: connection pool
- Schema migration → University system of record: applies schema changes
- Curriculum seed → University system of record: loads curriculum data
- Compose stack → Nginx frontend: runs
- Compose stack → Express API: runs
- Compose stack → University system of record: persistent service
- Express API → Prometheus metrics: exports metrics
- Prometheus metrics → Academic dashboards: dashboard data
- CI/CD pipeline → Kubernetes deployment: deploys and validates
- Kubernetes deployment → Express API: deploys API workload
- Kubernetes deployment → University system of record: stateful database