🆖 Politico is a web-app that enables both citizens give their mandate to politicians running for different government offices. POLITICO also enables politicians to express interest to run for an office, while building trust in the process through transparency. 🎰
https://app.swaggerhub.com/apis-docs/Anayo-Oleru/politico/1.0
https://anayooleru.github.io/POLITICO/
User profile: ../POLITICO/UI/parties.html
Admin: ../POLITICO/UI/admin/govOffice.html
- Users can sign up or sign in
- Registered users can reset password
- Registered users can view political parties
- Registered users can view all politicians running for a specific government
- Registered users can vote politician
- Registered user can view history containing a list of political offices and candidates the user has voted for
- Politician can express interest to run for a specific government office
- Politician can create a petition against a concluded election
- Admin can view and create a political party
- Admin can view and edit a political party
- Admin can delete a political party
- Admin can view and create a government office, which politicians can express interest to run for.
https://trustpolitico.herokuapp.com/api/v1/
- NodeJS - A Javascript runtime built on chrome V8 engine that uses an event-driven non-blocking I/O model that makes it lightweight and efficient.
- ExpressJs - A minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.
- EsLint - An open source project to provide a pluggable linting utility for javascript
- Mocha - A feature-rich javascript test framework running Node.js and in the browser, making asynchronous testing simple and fun, flexible and accurate reporting.
-
Install
node
-
Clone the repository
git clone https://github.com/AnayoOleru/POLITICO.git
-
Navigate to the project directory
cd ~/path/to/POLITICO
-
Install all dependencies
npm install
-
Start the app
npm start dev-start
-
Run the application on browser
http://localhost:3000/
- Uses
Chai
andChai-Http
npm run test
API BASE URL https://trustpolitico.herokuapp.com/api/v1/. It's recommended to attach a authorization
Header containing the generated token
from /api/auth/login
to all requests.
method | route | description | data |
---|---|---|---|
GET | /parties | Get all politcal parties | |
GET | /parties/:partyid | Get a specific political party record | |
POST | /parties | Create/Add parties | {name, hqaddress, logoUrl} |
PATCH | /parties/:partyid | Edit the name of a specific political party | |
DELETE | /parties/:partyid | Delete a specific political party |
method | route | description | data |
---|---|---|---|
POST | /offices/ | Create a political office | {type, name} |
GET | /offices/ | Fetch all political parties records | |
GET | /offices/:officeid | Fetch a specific office | |
POST | /office/:userid/register | Register a user as a candidate | {office, prt} |
GET | /office/:officeid/result | Collate and fetch the result of specicific office |
method | route | description | data |
---|---|---|---|
POST | /auth/login | Sign In | {email, password} |
POST | /auth/signup | Sign up or create account | {firstname, lastname, othername, email, phonenumber, passportUrl, password} |
method | route | description | data |
---|---|---|---|
POST | /votes | Vote for a candidate | {created_by, office, candidate} |
// login as admin
{
email: "anayokyle@gmail.com",
password: "anayokyleoleru"
}