Project: iReporter Description:iReporter enables any 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.
git clone the repo
Two postgres databases are required one for testing the other for development Service account credentials from Google Cloud for file storage on Firebase
Setting up the database with a user who has all privileges
sudo -u postgres psql
postgres=# create database your-database;
postgres=# create user your-username with encrypted password 'your-password';
postgres=# grant all privileges on database your-database to your-username;
Note: Token EXPIRATION_TIME is in minutes
source venv/bin/activate
export EXPIRATION_TIME=59
export DATABASE_URL="dbname='your-database' host='localhost' port='5432' user='your-username' password='your-password'"
export DATABASE_URL_TEST="dbname='your-test-database' host='localhost' port='5432' user='your-username' password='your-password'"
export SECRET_KEY="secret-key-goes-here"
export MAIL_USERNAME="your-gmail-account"
export MAIL_PASSWORD="your-password"
export SUPER_USER_PASSWORD="your-password"
export SUPER_USER_USERNAME="your-username"
export SUPER_USER_EMAIL="your-email"
export SUPER_USER_FIRSTNAME="your-name"
export SUPER_USER_LASTNAME="your-name"
export SUPER_USER_OTHERNAMES="your-name"
export SUPER_USER_PHONENUMBER="your-phone-number"
export API_KEY="api-key"
export AUTH_DOMAIN="project-id.firebaseapp.com"
export FIREBASE_DATABASE_URL="firebase-database-url"
export PROJECT_ID="project-id"
export STORAGE_BUCKET="storage-bucket.appspot.com"
export MESSAGING_SENDER_ID="messaging-sender-id"
export PRIVATE_KEY_ID="private-key-id"
export PRIVATE_KEY="private-key"
export CLIENT_EMAIL="client-email"
export CLIENT_ID="client-id"
export CLIENT_CERT_URL="client-cert-url"
Cd into the iReporter folder
Create a virtual environment
python virtualenv venv
Run the virtual environment
source venv/bin/activate
Run the command to install all requirements inside the virtual environment
pip install -r requirements.txt
source .env
flask run
Tests with coverage are run with pytest or py.test on the root of iReporter folder
source .env
pytest --cov=app/
Tests check all incidents(red-flags and interventions), user sign up and login endpoints Note a super user is created by default in case none is present upon running the app
- Flask - Flask
versioning for the endpoints /api/v2/
- Ryan Simiyu
This project is licensed under the MIT License - see the LICENSE.md file for details