How laith-alsurkhi/secure-student-portal works
The Secure Student Portal serves static browser pages and provides signup/login, authenticated profile management, and admin user, role, and audit-log workflows. The Express server mounts the API routes and applies shared security controls; route handlers enforce access, transform sensitive fields, and use MongoDB models. The source excerpts show the main route and storage relationships, but not the HTML-to-script wiring, so frontend page-to-script links are omitted.
Main entry points: server.js Express server · database.js MongoDB models · admin.js Admin operations · auth.js Signup and login
Components 14
Browser experience
- Portal pages
frontend - Session client
frontend/js/auth.js - Profile dashboard
frontend/js/dashboard.js - Admin dashboard
frontend/js/admin.js
Server and security
- Express server
backend/server.js - Session verification
backend/middleware/auth.js - Role authorization
backend/middleware/role.js
Portal workflows
- Signup and login
backend/routes/auth.js - Profile management
backend/routes/user.js - Admin operations
backend/routes/admin.js
Data and integrations
- MongoDB models
backend/database.js - MongoDB
- Turnstile verification
Other components
- Portal user
Connections 17
- Portal user → Portal pages: uses
README.md - Express server → Portal pages: serves
backend/server.js - Express server → Signup and login: mounts
backend/server.js - Express server → Profile management: mounts
backend/server.js - Express server → Admin operations: mounts
backend/server.js - Session client → Express server: requests API
frontend/js/auth.js - Profile dashboard → Express server: requests profile
frontend/js/dashboard.js - Admin dashboard → Express server: requests admin API
frontend/js/admin.js - Signup and login → MongoDB models: reads and writes
backend/routes/auth.js - Signup and login → Turnstile verification: verifies challenge
backend/routes/auth.js - Profile management → Session verification: protects routes
backend/routes/user.js - Profile management → MongoDB models: reads and writes
backend/routes/user.js - Admin operations → Session verification: protects routes
backend/routes/admin.js - Admin operations → Role authorization: checks role
backend/routes/admin.js - Admin operations → MongoDB models: reads and writes
backend/routes/admin.js - Session verification → MongoDB models: loads user
backend/middleware/auth.js - MongoDB models → MongoDB: connects
backend/database.js