How leopadilla147/cnnhs-svock-finalrepo210926 works
This is an online voting system for students and school election staff. Its user-facing workflow runs from student registration and candidacy submission through staff review and election administration to voting and live results; complaints, reports, and archives support election oversight. The React app routes these surfaces through shared application state, which synchronizes domain data with Supabase. The README gives only the product name, and several core pages and voting modules were not excerpted, so those capabilities are represented from the file tree without asserting unverified implementation links.
Main entry points: routes.tsx Role routes · supabaseData.ts Domain data access · AppContext.tsx Application state · supabase.ts Supabase service
Components 25
App entry
- App bootstrap
src/app/App.tsx - Role routes
src/app/routes.tsx
Identity and data
- Student registration
src/app/pages/RegisterPage.tsx - Login
src/app/pages/LoginPage.tsx - Session token
src/app/lib/session.ts - Application state
src/app/context/AppContext.tsx - Domain data access
src/app/lib/supabaseData.ts - Supabase service
src/app/lib/supabase.ts - Supabase database
Election workflow
- Candidacy application
src/app/pages/student/StudentApplyCandidacy.tsx - Application document
src/app/components/EAFPreviewDocument.tsx - Candidate review
src/app/pages/admin/AdminCandidates.tsx - Election setup
src/app/pages/admin/AdminElectionSetup.tsx - Voting
src/app/lib/voteApi.ts - Vote receipt
src/app/components/VoteReceiptDialog.tsx - Live results
src/app/pages/admin/AdminLiveResults.tsx - Candidacy functions
supabase/functions
Oversight
- Complaints
src/app/pages/admin/AdminComplaints.tsx - Student complaints
src/app/pages/student/StudentComplaints.tsx - Reports
src/app/pages/admin/AdminReports.tsx - Election archive
src/app/pages/admin/AdminArchive.tsx - Student records
src/app/pages/admin/AdminStudents.tsx - Staff appointments
src/app/pages/admin/ChiefAppointments.tsx
Other components
- Student
- Election staff
Connections 38
- App bootstrap → Application state: provides state
src/app/App.tsx - App bootstrap → Role routes: mounts routes
src/app/App.tsx - Role routes → Student registration: routes to
src/app/routes.tsx - Role routes → Login: routes to
src/app/routes.tsx - Role routes → Candidacy application: routes to
src/app/routes.tsx - Role routes → Candidate review: routes to
src/app/routes.tsx - Role routes → Election setup: routes to
src/app/routes.tsx - Role routes → Live results: routes to
src/app/routes.tsx - Role routes → Complaints: routes to
src/app/routes.tsx - Role routes → Student complaints: routes to
src/app/routes.tsx - Role routes → Reports: routes to
src/app/routes.tsx - Role routes → Election archive: routes to
src/app/routes.tsx - Role routes → Student records: routes to
src/app/routes.tsx - Role routes → Staff appointments: routes to
src/app/routes.tsx - Student → Student registration: registers
- Student → Candidacy application: applies
- Election staff → Candidate review: reviews
- Student registration → Domain data access: registers student
src/app/pages/RegisterPage.tsx - Login → Application state: uses state
src/app/pages/LoginPage.tsx - Application state → Domain data access: loads and syncs
src/app/context/AppContext.tsx - Application state → Session token: clears session
src/app/context/AppContext.tsx - Application state → Supabase service: uses client
src/app/context/AppContext.tsx - Domain data access → Supabase service: queries and writes
src/app/lib/supabaseData.ts - Supabase service → Session token: attaches token
src/app/lib/supabase.ts - Supabase service → Supabase database: accesses data
- Candidacy application → Domain data access: submits application
src/app/pages/student/StudentApplyCandidacy.tsx - Candidacy application → Application document: previews form
src/app/components/EAFPreviewDocument.tsx - Candidate review → Domain data access: reviews candidate
src/app/pages/admin/AdminCandidates.tsx - Candidacy functions → Supabase database: handles candidacy
- Voting → Supabase database: records ballots
- Voting → Vote receipt: shows receipt
- Live results → Domain data access: loads results
- Student complaints → Domain data access: submits complaint
- Complaints → Domain data access: manages complaints
- Reports → Domain data access: builds reports
- Election archive → Domain data access: loads records
- Student records → Domain data access: manages records
src/app/pages/admin/AdminStudents.tsx - Staff appointments → Domain data access: manages appointments
src/app/pages/admin/ChiefAppointments.tsx