#Politico app challenge Politico is an application that enables citizens give their mandate to politicians running for different government offices, while building trust in the process through transparency.
- An admin creates a political party
- An admin creates political offices
- Politicians show their interest to run for a particular government office
- Normal users creates an account
- Normal users with an account can login
- Normal users who are qualified to vote, can search for government offices and vote their prffered candidate to represent them.
- Normal users can be able to view their votes and the candidate they have voted for
- Polician user can file a petition against a concluded political office election
Clone this repository
https://github.com/francis-mwas/politico-app-api-v1
Heroku link
https://politico-app-api-v1.herokuapp.com/
API documentation link
https://politicoapiv2.docs.apiary.io/
in the root directory,open your terminal and create virtual environment by entering the commands below
virtualenv env --python=python3.6
source env/bin/activate
pip install -r requirements.txt
$ export FLASK_APP=run.py
$ export MODE=development
$ python manage.py
$ flask run
Method | Endpoint | Description | Roles |
POST | /api/v2/admin/parties | create party | Admin |
GET | /api/v2/admin/parties | Fetch all parties | Admin |
DELETE | /api/v2/admin/parties/<{id}> | delete a specific party | Admin |
PATCH | /api/v2/admin/parties/<{id}> | edit a specific party | Admin |
GET | /api/v2/admin/parties/<{id}> | get a specific party | Admin |
POST | /api/v2/admin/offices | create office | Admin |
GET | /api/v2/admin/offices/<{id}> | get a specific office | Admin |
GET | /api/v2/admin/offices | fetch all offices | Admin |
PATCH | /api/v2/admin/offices/<{id}> | update a specific office | Admin |
POST | /api/V2/auth/signup | create an account | Admin /Users |
POST | /api/v2/auth/signin | signin | Admin /Users |
POST | /api/v2/users/votes | Vote for a candidate | Admin /Users |
GET | /api/v2/users/candidates | View candidates | Admin /Users |
GET | /api/v2/users/offices/1 | View office results | Admin /Users |
GET | /api/v2/admin/users | View all users | Admin |
GET | /api/v2/admin/office/1/register | Register candidates | Admin |
GET | /api/v2/users/office/1/3/result | View office results for specific office and specific candidate | Admin /Users |
DELETE | /api/v2/admin/offices/<{id}> | delete a specific office | Admin |
Pytest
- Testing with coverage
- pytest --cov=app
Francis Mwangi