iReporter is an application that enables any citizen to bring any form of corruption to the notice of appropriate authorities. Citizens can also report on things that need government intervention.
- Python3
- Flask
- Flask-RESTful
| Method | Route | Endpoint Function |
|---|---|---|
| Post | api/v1/redflags | Creates a RedFlag |
| Get | api/v1/redflags | Gets all RedFlags |
| Get | api/v1/redflags/id | Gets a specific RedFlag |
| Patch | api/v1/redflags/id | Edit a specific RedFlag |
| Delete | api/v1/redflags/id | Delete a specific RedFlag |
$ git clone https://github.com/karisaJohn/Reporter/tree/ft-user-DeleteSpecificRedFlag-162338345
$ python3 -m venv venv
$ source venv/bin/activate
(venv) $ pip install -r requirements.txt
(venv) $ FLASK_APP=run.py
(venv) $ flask run
The app should be accessible through : http://127.0.0.1:5000/
To follow along with this examples get postman app installed.
-
Set Up POSTMAN.
-
Create RedFlag
- Post data in the format below to the redflag endpoint :
/api/v1/redflags
{
"createdBy" : "John",
"location" : "Nairobi";
"title" : "Bribery"
}
- Get all RedFlags
- Get data from the redflags endpoint :
/api/v1/redflags
- Get specific RedFlag
- Get data from the redflags endpoint :
/api/v1/redflags/1
- Edit specific RedFlag
- Post data in the format below to the redflag endpoint :
/api/v1/redflag/1
{
"description":"It has come to my notice, that....",
"location" : "Turkana"
}
- Delete Specific RedFlag
- Delete data from the redflag endpoint :
/api/v1/redflag/3
(venv) $ pytest --cov=app




