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.
This site is published at https://katherine95.github.io/iReporter/UI/index.html
Html5, CSS3, python, flask, flask_restful
-
Clone this repository
git clone https://github.com/katherine95/iReporter.git
-
Change the directory into the project directory.
cd iReporter
-
Fetch all origin to get all branches
git fetch origin
-
Checkout to
develop-api-v2
branch.git checkout develop-api-v2
-
Create a virtual environment to allow you to manage separate package installations for different projects.
virtualenv -p python3 venv
-
Activate virtual environment
source venv/bin/activate
-
Install requirements(all packages that the project needs)
pip install -r requirements.txt
-
Start server
export FLASK_APP=run.py
flask run
-
Test the endpoints on postman.
EndPoint Url Functionality POST /api/v2/auth/signup Register a user POST /api/v2/auth/login User log-in with valid username and password GET /api/v2/auth/signup Allow an athenticated admin to get all registered users POST /api/v2/incidents Allow authenticated user to create an incident GET /api/v2/incidents Allow authenticated user to fetch all incidents created GET /api/v2/incidents/int:id Allow authenticated user to fetch a single incident PATCH /api/v2/incidents/int:id Allow only an admin to change the status of an incident PATCH /api/v2/user/incidents/int:id Allow user to edit comment/location of his/her records DELETE /api/v2/incidents/int:id Allow authenticated user to delete his/her records PATCH /auth/users/ Allow an authenticated admin user to create a new admin -
To run migrations: run
python3 migrate.py
-
To run tests: run
pytest
-
To check test coverage: run
py.test --cov=app/api/v2
Link to Hosted demo