Skip to content

Politico is a python application that allows users to vote online for their preferred leaders. A candidate can sign up and choose the seats they are vying for and the voter can vote fot that candidate.

Notifications You must be signed in to change notification settings

mimipeshy/Politicov2

Repository files navigation

Politico Build Status Coverage Status Maintainability

Politico enables citizens give their mandate to politicians running for different government offices while building trust in the process through transparency.

Getting Started

  1. Clone the repository by doing: git clone https://github.com/mimipeshy/Politicov2.git

  2. Create a virtual environment: virtualenv env

  3. Activate the virtual environment: source venv/bin/activate on Linux/Mac or source venv/Scripts/activate on windows.

  4. Git pull

  5. Install the requirements : pip install -r requirements.txt

Running tests

Export enviroment settings: source ./.travis.sh Use pytest to run: pytest --cov=app

Prerequisites

  • python 3.6
  • virtual environment

Running it on machine

  • Create a .env file to store your environment variables: touch .venv
  • On terminal do: source venv/bin/activate on Linux/Mac or source venv/Scripts/activate on windows
  • Run the application: python run.py
  • The api endpoints can be consumed using postman.

Endpoints

Endpoint FUNCTIONALITY
POST /api/v2/party CREATE political party
GET /api/v2/party GET ALL political parties
GET /api/v2/party/int:id GET ONE political party
DELETE /api/v2/party/int:id DELETE ONE political party
PATCH /api/v2/party/int:id/name UPDATE ONE political party
POST /api/v2/office CREATE government office
GET /api/v2/office/int:id GET ONE government office
GET /api/v2/office GET ALL government offices
POST /api/v2/auth/signup CREATE a new user
POST /api/v2/auth/login LOGS in a new user
POST /api/v2/office/register ADD candidate to political office
POST /api/v2/votes ALLOWS voter to vote
GET /api/v2/office/int:id/result GET results of votes casted

Built With

  • Flask-Api - The web framework used
  • Pip - Dependency Management

Authors

  • Peris Ndanu

License

This project is licensed under the MIT License

About

Politico is a python application that allows users to vote online for their preferred leaders. A candidate can sign up and choose the seats they are vying for and the voter can vote fot that candidate.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published