- Frontend: NextJS (ReactJS) 13 (App Router)
- Backend: C# .NET 7 (API) - Attempted to use .NET 8 but had issues with Identity Server authentication in endpoints, so reverted to .NET 7. I realised its not fully supported.
- Database: PostgreSQL (Database)
- Deployment: Docker (Containerization)
- Install Docker
- Run
docker-compose up
in thebackend
directory - Install NodeJS
- Run
npm install
in thefrontend
directory - Run
npm run dev
in thefrontend
directory - Open
http://localhost:3000
in your browser
The docker-compose.yml
file contains the following services:
gevsdb
- The PostgreSQL databasegevs-api
- The .NET APIgevs-identity
- Identity Server
The docker compose should run all of these services and link them together.
- Register an account
- Login
- Vote on an election
- View the results of an election (once the admin has closed the election)
- The admin account is created when the database is created.
- Login with the admin account
- Open an election
- View the results of an election
- Close an election
- Restart an election - this will delete all votes and reset the election results
Returns the results of an election for a given constituency
Returns the results of an election and the seats won by each party
Returns the candidate details for all constituencies
Opens or closes an election - true to open, false to close
Returns the candidate details for a given candidate ID
Deletes vote history and election results from the database
Returns the status of the election - true if open, false if closed
Returns the candidate details for a given constituency
/
- Home page/election/vote
- Voting page (only accessible if logged in - you can only vote once - admins cannot vote)/election/results
- Results page (only accessible if logged in - you can only view the results once the admin has closed the election)/admin/session
- Admin session details which hold the tokens for the admin API endpoints/admin/dashboard
- Admin dashboard (only accessible if logged in as an admin)
- When restarting an election as an admin, all votes for the candidates are zeroed.
- You may have to refresh the webpage occasionally to see the update on the home page since the website is an SPA.