Voting Site:
All musicians are listed with a Vote button- If you voted all of the other musicians should disappear
- Thanks for voting screen ?
Country Voting Site:
Login page for countriesPage where countries can give their points from 12 - 2
Admin Panel:
Admin panel with a set username and a passwordPanel Staff can add the Musicians to the voting site- Live view of current Voting statistics
Field for creating new Country AccountsAn export button to create a CSV file into an output folder
app:
The main part of the web app which includes the main page in page.tsx, as well as the css styles in globals.css and page.odule.css, used for every other page
components.tsx
- contains components that need to be rendered in the client side, since they utilize the DOM in some way contexts.tsx
- contains states need to be shared between different components in the component tree
db:
database.ts
- contains a singleton db wrapper class with an sqlite3 db connection, as well as several methods for interacting with the db init.ts
- an initialization script that populates the db with the needed tables and column names
- contains all of the web app's pages that can be viewed through https://site_domain/page_file_name
- Nextjs treats files here as the app's routes, so utility files should be placed elsewhere
pages/api
- contains endpoints where the client can send requests for the server to perform some actuon, which usually involves adding or changing data in the db
- Nextjs treats all files in here as endpoints, so any utility files should be placed elsewhere
Contains a handler function used for wrapping around any api endpoints' handlers so that they become accessible only if the client has admin credentials
Initialization script for setting the admin username and password
Utility file for comparing credentials provided by the client to the server's and returning whether or not they are valid
- Should probably look into using certificates or at the very least an encryption method
- Currently vulnerable to MITM attacks both during and post client-server connection
- Vulnerable to ip-spoofing or users having reassigned ips in which case multiple votes can be cast by one person