How sivamani52/college-voting-system works
This is a college election platform for super-admins, scoped departmental admins, and student voters. The workflow is election setup and voter eligibility, candidate/position management, student ballot submission, then results review; administration also covers academic structure and student accounts. The graph separates the React role-based experience, HTTP routing and authorization, election-domain controllers, and MySQL persistence. Source excerpts show key voting, eligibility, scope, and routing behavior; other major screens and subsystems are represented from the source index, so some frontend-to-API relationships remain unverified.
Main entry points: server.js HTTP server · models Domain models · App.jsx Role routes · authRoutes.js Auth routes
Components 23
Role-based web client
- Role routes
frontend/src/App.jsx - Sign in
frontend/src/pages/auth/Login.jsx - Student voting
frontend/src/pages/student - Admin console
frontend/src/pages/admin - Super-admin console
frontend/src/pages/superadmin - API services
frontend/src/services
API and access control
- HTTP server
backend/server.js - Auth routes
backend/routes/authRoutes.js - Authentication
backend/controllers/authController.js - Token and role guards
backend/middleware - Assignment scope
backend/middleware/adminScopeMiddleware.js
Election operations
- Election management
backend/controllers/electionController.js - Voter eligibility
backend/controllers/eligibleVoterController.js - Candidate management
backend/controllers/candidateController.js - Ballot and vote
backend/controllers/voteController.js - Election results
backend/controllers/resultController.js
Academic administration
- Student accounts
backend/controllers/studentController.js - Academic structure
backend/controllers/academicStructureController.js - Admin accounts
backend/controllers/adminController.js
Persistence and messaging
- Domain models
backend/models - MySQL pool
backend/config/db.js - Email delivery
backend/services/emailService.js
Other components
- User
Connections 35
- User → Role routes: uses
frontend/src/App.jsx - Role routes → Sign in: routes to
frontend/src/App.jsx - Role routes → Student voting: routes to
frontend/src/App.jsx - Role routes → Admin console: routes to
frontend/src/App.jsx - Role routes → Super-admin console: routes to
frontend/src/App.jsx - Student voting → API services: requests data
- Admin console → API services: requests data
- Super-admin console → API services: requests data
- API services → HTTP server: calls API
- HTTP server → Auth routes: mounts
backend/server.js - Auth routes → Authentication: dispatches
backend/routes/authRoutes.js - Sign in → Auth routes: authenticates
- HTTP server → Election management: mounts election routes
- HTTP server → Voter eligibility: mounts eligibility routes
- HTTP server → Candidate management: mounts candidate routes
- HTTP server → Ballot and vote: mounts vote routes
- HTTP server → Election results: mounts result routes
- HTTP server → Student accounts: mounts student routes
- HTTP server → Academic structure: mounts academic routes
- HTTP server → Admin accounts: mounts admin routes
- Auth routes → Token and role guards: uses authentication
backend/routes/authRoutes.js - Voter eligibility → Token and role guards: checks admin scope
backend/controllers/eligibleVoterController.js - Election management → Assignment scope: checks assignment
backend/controllers/electionController.js - Candidate management → Assignment scope: checks assignment
backend/controllers/candidateController.js - Ballot and vote → Assignment scope: checks voter scope
backend/controllers/voteController.js - Election management → Domain models: reads and updates elections
backend/controllers/electionController.js - Voter eligibility → Domain models: manages eligibility
backend/controllers/eligibleVoterController.js - Candidate management → Domain models: manages candidates
backend/controllers/candidateController.js - Ballot and vote → Domain models: records votes
backend/controllers/voteController.js - Student accounts → Domain models: manages students
backend/controllers/studentController.js - Academic structure → Domain models: manages structure
backend/controllers/academicStructureController.js - Authentication → Domain models: reads accounts
backend/controllers/authController.js - Authentication → Email delivery: sends messages
backend/controllers/authController.js - Domain models → MySQL pool: queries
backend/models/electionModel.js - Assignment scope → MySQL pool: loads assignment
backend/middleware/adminScopeMiddleware.js