View UI Hosted with ❤️ at Github pages
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.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- python 3.6
- pip3
- Postgres database
If you wish to clone the repo please satisfy the requirements in the requirements.txt
clone the repo to local machine
git clone https://github.com/ChegeBryan/politico.git
pip3 install virtualenv
- Navigate to the cloned repo directory and open terminal from there.
- run
virtualenv venv
to create virtual environment with the namevenv
- activate the virtualenv by
source venv/bin/activate
pip3 install -r requirements.txt
to install app requirements on your virtual environment
while still at the terminal:
- set enviroment variables from your platform specific dotenv file
source {your dotenv}
- set APP_SETTING variable
export APP_SETTING=development
- Start the app by running
python run
To run the application unit_tests
- run
pytest
at the app root directory - run with coverage
pytest --cov=app/api app/tests
This are the currently available v2 endpoints. The data is written into a database.
HTTP Method | URL Endpoint | Description |
---|---|---|
POST |
/api/v2/auth/signup |
Create new user |
POST |
/api/v2/auth/signin |
Sign in existing user |
POST |
/api/v2/auth/signout |
Sign out logged in user |
HTTP Method | URL Endpoint | Description |
---|---|---|
POST |
/api/v2/parties |
Create a new party |
POST |
/api/v2/offices |
Create a new office |
PATCH |
/api/v2/parties/<int:party_id>/name |
Update a party name |
DELETE |
/api/v2/parties/<int:party_id> |
Delete a party |
POST |
/api/v2/office/<int:_id>/register |
Register office candidate |
HTTP Method | URL Endpoint | Description |
---|---|---|
GET |
/api/v2/offices |
Fetch offices records |
GET |
/api/v2/offices/<int:office_id> |
Fetch a specific office |
GET |
/api/v2/parties |
Fetch all parties created |
GET |
/api/v2/parties/<int:party_id> |
Fetch specific party |
GET |
/api/v2/office/<int:office_id>/result |
Fetch office results |
POST |
/api/v2/office/application |
Apply for office |
POST |
/api/v2/votes |
Cast a vote |
POST |
/api/v2/petitions |
Create a petition |
Contributions will be highly appreciated. Make a pull request and lets build
software together.
see Changelog