How johnyrex/gcr-election-portal works
This is a Next.js election-information and voting application. Visitors browse election information, candidate profiles, announcements and published results; eligible voters enter the voting flow, verify, review a ballot and submit it. Administrators manage candidates and voters, import voter data, and view election dashboards. The service layer centralizes election API requests, while the API route implements the server endpoint. The available excerpts establish some page composition and client-to-service/API calls, but do not show the API route’s backend persistence or all admin routing, so those relationships are not inferred.
Main entry points: electionService.ts Election service · VotingFlow.tsx Voting flow · CandidateManager.tsx Candidate management · page.tsx Home overview
Components 29
Public election experience
- Home overview
app/page.tsx - Home features
features/home - Candidate browsing
features/candidates/CandidateGrid.tsx - Candidate profiles
app/candidates/[slug]/page.tsx - Announcements
app/announcements/page.tsx - Election information
app/elections/page.tsx - Constitution
app/constitution/page.tsx - Published results
features/results/ResultsDashboard.tsx
Voting workflow
- Voting entry
app/vote/page.tsx - Voting flow
features/voting/VotingFlow.tsx - Voter verification
features/voting/VerificationForm.tsx - Ballot and submission
features/voting/Ballot.tsx - Vote confirmation
features/voting/Confirmation.tsx
Election administration
- Admin login
features/admin/AdminLogin.tsx - Admin dashboard
features/admin/AdminDashboard.tsx - Candidate management
features/admin/candidates/CandidateManager.tsx - Candidate editor
features/admin/candidates/CandidateModal.tsx - Candidate table
features/admin/candidates/CandidateTable.tsx - Voter management
features/admin/voters/VotersManager.tsx - CSV voter import
features/admin/voters/CsvImportButton.tsx - Election analytics
features/admin/analytics/AnalyticsDashboard.tsx
Election API and UI foundations
- Election service
services/electionService.ts - Election API route
app/api/election/route.ts - Election configuration
lib/config.ts - Candidate content
constants/candidates.ts - Shared UI primitives
components/ui
Other components
- Visitor
- Eligible voter
- Administrator
Connections 34
- Visitor → Home overview: opens
app/page.tsx - Home overview → Home features: renders
app/page.tsx - Visitor → Candidate browsing: browses
- Candidate browsing → Candidate content: reads
features/candidates/CandidateGrid.tsx - Home features → Candidate content: previews
features/home/CandidatePreview.tsx - Candidate profiles → Candidate content: reads
app/candidates/[slug]/page.tsx - Visitor → Announcements: opens
app/announcements/page.tsx - Visitor → Election information: opens
app/elections/page.tsx - Visitor → Constitution: opens
app/constitution/page.tsx - Visitor → Published results: views
- Published results → Election service: requests results
features/results/ResultsDashboard.tsx - Eligible voter → Voting entry: starts
app/vote/page.tsx - Voting entry → Voting flow: renders
app/vote/page.tsx - Voting flow → Voter verification: renders
features/voting/VotingFlow.tsx - Voting flow → Ballot and submission: renders
features/voting/VotingFlow.tsx - Voting flow → Vote confirmation: renders
features/voting/VotingFlow.tsx - Ballot and submission → Election service: loads candidates
features/voting/Ballot.tsx - Ballot and submission → Election API route: submits ballot
features/voting/Ballot.tsx - Administrator → Admin login: signs in
- Administrator → Admin dashboard: uses
- Administrator → Candidate management: manages candidates
- Candidate management → Candidate editor: opens editor
features/admin/candidates/CandidateManager.tsx - Candidate management → Candidate table: renders table
features/admin/candidates/CandidateManager.tsx - Candidate management → Election service: manages records
features/admin/candidates/CandidateManager.tsx - Administrator → Voter management: manages voters
- Voter management → CSV voter import: offers import
features/admin/voters/VotersManager.tsx - Voter management → Election service: updates voters
features/admin/voters/VotersManager.tsx - CSV voter import → Election service: imports voters
features/admin/voters/CsvImportButton.tsx - Administrator → Election analytics: views analytics
- Admin dashboard → Election service: requests election data
features/admin/AdminDashboard.tsx - Admin login → Election service: authenticates
features/admin/AdminLogin.tsx - Election service → Election API route: sends requests
services/electionService.ts - Election service → Election configuration: reads settings
services/electionService.ts - Home overview → Shared UI primitives: uses components