Politico enables citizens give their mandate to politicians running for different government offices while building trust in the process through transparency.
- Users can sign up
- Users can login
- Admin (electoral body) can create political parties
- Admin (electoral body) can delete a political party
- Admin (electoral body) can create different political offices
- Users can vote for only one politician per political office
- Users can see the results of election
- User can reset password
- A politician can create a petition against a concluded political office election
https://ng-politico.herokuapp.com/api/v1/
HTTP VERB | API ENDPOINT | DESCRIPTION | INPUT | OUTPUT |
---|---|---|---|---|
POST | api/v1/signup | Signup user |
{ firstname: "string", lastname: "string", othername: "string", email: "string", phone: "string", passportUrl: "string", password: "string" } |
{ message: "string"} |
POST | api/v1/login | Login user |
{ email: "string", password: "string" } |
{ message: "string"} |
POST | /api/v1/parties | Create a political party |
{ name: "string", hqAddress: "string", logoUrl: "string", email: "string", phone: "string" } |
{ message: "string" party: {object} } |
GET | /api/v1/parties/:partyId | Fetch a specific political party record | { message: "string", party: {object}} |
|
GET | /api/v1/parties/ | Fetch all political parties records | { message: "string", allParties: {object} } |
|
PATCH | /api/v1/parties/:partyId/name | Edit the name of a specific political party | partyId: "Number" | { message: "string", foundParty: {object} } |
DELETE | /api/v1/parties/:partyId> | Delete a specific political party | partyId: "Number" | {message: {object}} |
POST | /api/v1/offices | Create a political office |
{ name: "string", type: "string", candidateAge: "string", qualification: "string"} |
{ message: "string," office: {object} } |
GET | api/v1/offices | Fetch all political offices records | { message: "string" allOffices: {object} } |
|
GET | api/v1/offices/:officeId | Fetch a specific political office record | officeId: "Number" | { message: "string", office: {object}} |
UI templates are hosted on Github pages here
- Node.js - A runtime environment based off of Chrome's V8 Engine for writing Javascript code on the server.
- Babel - Javascript transpiler.
- Eslint - Javascript linter.
- Express.js - Web framework based on Node.js.
- Airbnb and style guide was followed.
- Install NodeJs
npm install node
- Clone this repository using
git clone https://github.com/Joyce-O/politico.git
- Open the repository in terminal and Install dependencies by running:
npm install
-
Run "npm start" to start the app
-
Navigate to
localhost:5700/api/v1
in your browser to access the application -
Use Postman to test all endpoints
- The tests were written using Mocha and Chai-http
- To run tests, navigate to the project's root directory
- After installation, run the following command
npm run test
- Joyce Obi