Coder Social home page Coder Social logo

richiemounti / politico Goto Github PK

View Code? Open in Web Editor NEW

This project forked from a1ch3m1s7/politico

0.0 0.0 0.0 9.07 MB

A platform that will enable citizens to give their mandate to politicians running for different government offices while building trust in the process through transparency.

License: MIT License

Python 100.00%

politico's Introduction

Build Status Coverage Status Maintainability

Politico

A platform that will enable citizens to give their mandate to politicians running for different government offices while building trust in the process through transparency.

API Endpoints.

This are the required endpoints...

Requirements
○ Create a political party.
○ Get all political parties.
○ Get a specific political party.
○ Edit a specific political party.
○ Delete a particular party.
○ Create a political office.
○ Get all political offices.
○ Get a specific political office.

Required Features

  1. An administrator should be able to crete a political party in Politico
  2. An admin should be able to retrieve a particular office or party.
  3. An admin should be able to delete a political party and office
  4. Admin should be able to edit a party information

Endpoints

Title Endpoint Method Description
Create a party /api/v1/parties POST An admin creates a party
Get all party /api/v1/parties GET Get get all parties
Get specific party /api/v1/parties/partyID GET Get a specific party
Edit specific party /api/v1/edit/partyID PATCH Edit a specific party
Delete specific party /api/v1/remove_party/partyID DELETE Delete a specific party
Create an office /api/v1/offices POST An admin creates an office
Get all offices /api/v1/offices/ GET Get all offices
Get specific office /api/v1/office/office_id GET Get a specific office
Delete specific office /api/v1/remove_office/<office_id> DELETE Get a specific office

Installation and Setup

Clone the repository.

https://github.com/a1ch3m1s7/Politico.git

Create a virtual environment

python3 -m venv venv;
source venv/bin/activate

If you need to install virtualenv:

virtualenv venv

Creating an env file

create a .env file and insert the following code

source venv/bin/activate
export FLASK_APP="run.py"
export FLASK_ENV="development"
export APP_SETTIINGS="development"

Activate the virtual environment

Before you begin you will need to activate the corresponding environment

source .env

Install requirements

pip install -r requirements.txt

Running the application

After the configuration, you will run the app

flask run

Testing the app

To test the app, run the following

pytest

Usage

I recommended using postman to send requests to the above detailed endpoints

Party Endpoints

For this endpoint, minimum data required are as follows

{
  "id": 1,
  "name": "name of party",
  "hqAddress": "headquarters",
  "logoUrl": "imageUrl"
  
}

Office Endpoints

For this endpoint, minimum data required are as follows

{
  "id": 1,
  "type": "type of office",
  "name": "name of the office"
}

Heroku deployment site.

For parties .https://a1ch3m1s7-politico.herokuapp.com/api/v1/parties. For offices .https://a1ch3m1s7-politico.herokuapp.com/api/v1/offices.

Contributing

Contributions are highly encouraged, please open an issue to discuss what you would like to change and with what. For the test please update them to your specific needs.

politico's People

Contributors

a1ch3m1s7 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.