Politico enables citizens give their mandate to politicians running for different government offices while building trust in the process through transparency.
My UI templates can be found here: UI
My Pivotal Tracker board can be found here
My Swagger API documentation can be found here
My API can be found here: API
An admin can perform the following:
- Admin (electoral body) can create political parties.
- Admin (electoral body) can modify political parties
- Admin (electoral body) can delete a political party.
- Admin (electoral body) can create different political offices.
- Admin (electoral body) can delete different political offices
- Admin (electoral body) can modify different political offices
- Users can sign up
- Users can sign in
- Users can vote for only one politician per political office.
- Users can see the results of election
This application was developed using NodeJs with express for routing.
- Babel - Compiler for Next Generation JavaScript
- Clone the repository.
- Run git clone (https://github.com/adex001/Politico.git)
git clone https://github.com/adex001/Politico.git
more info: (https://help.github.com/articles/cloning-a-repository/)
- Run
npm installto install the dependencies in the package.json file. - Rename
.env.sampleto.envand update file as specified. - Run
npm startto start the application.
- Navigate to the project location in your terminal.
- Run
npm testto run the test.
| HTTP VERB | ENDPOINT | FUNCTIONALITY | RESPONSE |
|---|---|---|---|
| GET /parties | /api/v1/parties | Retrieves all parties | { "status": 200, "data": [ { "partyId": 1, "name": "Peoples Democratic Party", "address": "21, Ilupeju Road, Ikeja", "logo": "http://mylogopdp.com/pdp" }, { "partyId": 2, "name": "Alliance National Peoples party", "address": "2, James Owl lane, VI", "logo": "http://mylogodp.com/anpp" } ] } |
| GET /parties/:id | /api/v1/parties/:id | Fetch a specific party | { "status": 200, "data": [ { "partyId": 1, "name": "Peoples Democratic Party", "address": "21, Ilupeju Road, Ikeja", "logo": "http://mylogopdp.com/pdp" } ] } |
| POST /parties | /api/v1/parties/ | Creates a party | { "status": 201, "data": [ { "partyId": 3, "address": "No 21,nejhfeuhebwejbgwj", "name": "Councillor", "logo": "http://logo.co" } ] } |
| PATCH /parties/:id | /api/v1/parties/:id | Updates a specific party | { "status": 200, "data": [ { "partyId": 2, "name": "Councillor", "address": "No 21,nejhfeuhebwejbgwj", "logo": "http://logo.co" } ] } |
| DELETE /parties/:id | /api/v1/parties/:id | Deletes a specific political party | { "status": 200, "data": [ { "partyId": 2, "name": "Councillor", "address": "No 21,nejhfeuhebwejbgwj", "logo": "http://logo.co" }, { "partyId": 3, "address": "No 21,nejhfeuhebwejbgwj", "name": "Councillor", "logo": "http://logo.co" } ] } |
| GET /office/:id | /api/v1/offices/:id | Fetch a specific office | { "status": 200, "data": [ { "officeId": 2, "type": "State", "name": "Governor", "description": "Office of the Governor of Lagos State" } ] } |
| GET /offices | /api/v1/offices/ | Fetch all offices | { "status": 200, "data": [ { "officeId": 1, "type": "Federal", "name": "President", "description": "Office of the president of the federal republic of Nigeria" }, { "officeId": 2, "type": "State", "name": "Governor", "description": "Office of the Governor of Lagos State" } ] } |
| POST /offices/ | /api/v1/offices/ | Creates a government office | { "status": 201, "data": [ { "officeId": 3, "type": "legislative", "name": "Councillor", "description": "lorem opsum lef" } ] } |
| PATCH /offices/:id | /api/v1/offices/:id | Updates a specific government office | { "status": 200, "data": [ { "officeId": 2, "type": "legislative", "name": "Councillor", "description": "lorem opsum lef" } ] } |
| DELETE /offices/:id | /api/v1/offices/:id | Deletes a specific government office | { "status": 200, "data": [ { "officeId": 2, "type": "legislative", "name": "Councillor", "description": "lorem opsum lef" }, { "officeId": 3, "type": "legislative", "name": "Councillor", "description": "lorem opsum lef" } ] } |
- JavaScript (ES6) (http://es6-features.org/)
- Node.js (https://nodejs.org/en/)
- Express (https://www.npmjs.com/package/express-api)
- Babel - Compiler for Next Generation JavaScript
- Olatunbosun Adeoye Ebenezer
- MIT License