Project developer is to create a set of API endpoints defined in the API Endpoints Specification section and use data structures to store data in memory
Below are the Endpoints that have been created.
EndPoints | Functionality | HTTP Method |
---|---|---|
api/v1/parties | Create party | POST |
api/v1/parties | Fetch all parties | GET |
api/v1/parties/int:party_id | Fetch single party | GET |
api/v1/parties/int:party_id | Delete party | DELETE |
api/v1/parties/int:party_id/name | Edit party | PATCH |
EndPoints | Functionality | HTTP Method |
---|---|---|
api/v1/offices | Create office | POST |
api/v1/offices | Fetch all offices | GET |
api/v1/offices/int:office_id | Fetch single office | GET |
Navigate to this link to run the application on heroku
This project developer is to create a set of API endpoints defined in the API Endpoints Specification section and use database to persist data.
Below are the Endpoints that have been created.
EndPoints | Functionality | HTTP Method |
---|---|---|
api/v2/parties | Create party | POST |
api/v2/parties | Fetch all parties | GET |
api/v2/parties/int:party_id | Fetch single party | GET |
api/v2/parties/int:party_id | Delete party | DELETE |
api/v2/parties/int:party_id/name | Edit party | PATCH |
EndPoints | Functionality | HTTP Method |
---|---|---|
api/v2/office/int:office_id/register | Register Citizen as a Candidate | POST |
api/v2/office/int:office_id/results | Fetch result of specific office | GET |
EndPoints | Functionality | HTTP Method |
---|---|---|
api/v2/offices | Create office | POST |
api/v2/offices | Fetch all offices | GET |
api/v2/offices/int:office_id | Fetch single office | GET |
EndPoints | Functionality | HTTP Method |
---|---|---|
api/v2/auth/signup | Create a user account | POST |
api/v2/auth/login | Login a User | POST |
api/v2/auth/reset/ | Password Reset | POST |
EndPoints | Functionality | HTTP Method |
---|---|---|
api/v2/votes/ | Vote for a candidate | POST |
api/v2/petitions/ | Create Petitions | POST |
Navigate to this link to run the application on heroku
Link to documentation Page link
- Server-Side Framework:Flask Python Framework
- Linting Library:Pylint, a Python Linting Library
- Style Guide:PEP8 Style Guide
- Testing Framework:PyTest, a Python Testing Framework
- Testing Endpoints: PostMan
- Testing Framework:Coverage, a Python Testing Framework
1 Clone repo from github
```bash
git clone https://github.com/lenileiro/politico-api.git
cd politico-api
git checkout develop branch
```
2 Create a virtual environment
```bash
virtualenv venv
```
3 Activate the virtual environment
```bash
source venv/bin/activate
```
4 Install project dependencies
```bash
pip install -r requirements.txt
```
```bash
source .env
python run.py
```
```bash
coverage run --source=app -m pytest && coverage report
```