Git Product home page Git Product logo

chrismatgit / ireporterdb Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 61 KB

Corruption is a huge bane to Africa’s development. African countries must develop novel and localised solutions that will curb this menace, hence the birth of iReporter. iReporter enables any/every citizen to bring any form of corruption to the notice of appropriate authorities and the general public. Users can also report on things that needs government intervention

Procfile 0.01% Python 99.99%
python flask ireporter api-rest

ireporterdb's Introduction

Build Status Coverage Status Maintainability

iReporterdb

Corruption is a huge bane to Africa’s development. African countries must develop novel and localised solutions that will curb this menace, hence the birth of iReporter. iReporter enables any/every citizen to bring any form of corruption to the notice of appropriate authorities and the general public. Users can also report on things that needs government intervention

Getting Started

You can clone the project using the link [Github repository] (https://github.com/chrismatgit/ireporterdb.git) .

Installing

  • Clone the project into your local repository using this command:
  $ git clone https://github.com/chrismatgit/iReporter.git

Switch to the cloned directory, install a virtual environment, create a virtual environment, activate it, checkout to the most stable branch, install app dependencies and run the app.

  $ cd iReporterdb
  $ pip install virtualenv
  $ virtualenv -p python3 venv
  $ source venv/bin/activate
  $ git checkout ft-api
  $ pip install -r requirements.txt
  $ python3 run.py

Note If you're using Windows, activate your virtualenv using $ source venv/Scripts/activate

  • Copy the url http://127.0.0.1:5000/ into your Postman and to run any endpoint follow the table under the heading (Endpoints) with the url prefix ('/api/v1') for each endpoint.

Endpoints

HTTP Method Endpoint Functionality Parameters Protected
POST /auth/signup Create a user None False
POST /auth/signup/admin Create a admin None False
POST /auth/login Login a user None False
GET /welcome Welcome a user None True
GET /users Fetch all users None False
POST /red-flags Create a red-flag None True
GET /red-flags/int:incident_id Fetch a single red-flags record incident_id True
GET /red-flags/ Fetch all red-flags records None True
PATCH /red-flags/incident_id/comment Update a comment of a single red-flag record None True
PATCH /red-flags/incident_id/location Update a location of a single red-flag record None True
PATCH /red-flags/incident_id/status Update a status of a single red-flag record None True
DELETE /red-flag/incident_id Delete a single red-flag record incident_id True
POST /interventions Create a intervention None True
GET /interventions/int:intervention_id Fetch a single interventions record intervention_id True
GET /interventions/ Fetch all interventions records None True
PATCH /interventions/intervention_id/comment Update a comment of a single intervention record None True
PATCH /interventions/intervention_id/location Update a location of a single intervention record None True
PATCH //interventions/int:intervention_id/status Update a status of a single intervention record None True
DELETE /intervention/intervention_id Delete a single red-flag record intervention_id True

Running the tests

Install pytest, source the .env file, run the tests.

  $ pip install pytest
  $ python3 -m pytest

Deployment

The Python application is hosted on Heroku

Tools Used

  • Flask - Web microframework for Python
  • Virtual environment - tool used to create isolated python environments
  • pip - package installer for Python

Built With

The project has been built with the following technologies so far:

  • Python/Flask

Contributions

To contibute to the project, create a branch from the develop branch and make a PR after which your contributions may be merged into the develop branch

Authors

Christian Matabaro

ireporterdb's People

Contributors

chrismatgit avatar

Stargazers

 avatar

Watchers

James Cloos 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.