ireporter A web based system for reporting on corruption and public services needs and requests.
iReporter is a web based platform that enables any/every citizen to bring any form of corruption to the notice of appropriate authorities and thegeneral public. Users can also report on things that need government intervention such as public works or repairs.
Clone this repo to your machine
git clone https://github.com/ogiste/ireporter.git
Then change the directory to the project by
cd ireporter
to make sure all the packages needed to run the project present in your machine, we'll create a virtual enviroment and install the packages there
-
to create a virtual enviroment run
virtualenv -p python3 venv
-
activating the enviroment
source venv/bin/activate
The virtual enviroment is now ready, we can install all packages needed for project ensure you have pip installed otherwise then on your terminal run
pip install -r requirements.txt
To test our project on your terminal run
export FLASK_APP=run.py
then
flask run
on your browser open up http://127.0.0.1:5000/api/v1/incidents
Sample Indicent Record JSON: { "title":"Corruption", "type":"red-flag", "location":"-1.324343434, 23.32321323", "comment":"Corruption in procurement" }
Current API endpoints :
METHOD | ENDPOINT | DESCRIPTION |
---|---|---|
POST | /api/v2/incidents | Used to create an incident record |
GET | /api/v2/incidents/ | Used to read all incident records |
GET | /api/v2/incidents/int:id | Used to view a particular incident record |
PATCH | /api/v2/incidents/int:id | Used to update the incident location and comment of an incident |
DELETE | /api/v2/incidents/int:id | Allows user to delete a specific incident record |
POST | /api/v2/auth/ | Allows user to login |
POST | /api/v2/user/ | Allows user to create an account |
GET | /api/v2/users/int:id | Allows user to view their profile |
GET | /api/v2/users/ | Allows admin to view all user profiles |
PATCH | /api/v2/incident/int:id/status | Allows admin to update the status of an incident |
View the published collection for more details
Install nosetest, codecov and coverage:
pip install nose
pip install coverage
pip install codecov
Within the root repository directory run the tests using nosetest with codecov for coverage:
nosetests --with-coverage --cover-package=app/
Python 3
Flask 1.0.2
nosetests
Blueprints was used for versioning
Alfred Opon
Though this project is open to feedback and suggestions all contributions are restricted to the main author as the project is for learning purposes