Git Product home page Git Product logo

raywire / ireporter Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 27.5 MB

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.

Home Page: https://raywire.github.io/iReporter/UI

License: MIT License

Python 100.00%
python ireporter javascript flask-restful tdd api-rest postgresql firebase-storage

ireporter's Introduction

Build Status Coverage Status Maintainability

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.

GitHub Pages Hosting Link

Getting Started

git clone the repo

Prerequisites

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;

Contents of .env file

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"

Running the app

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

Running the tests

Tests with coverage are run with pytest or py.test on the root of iReporter folder

source .env 
pytest --cov=app/

Break down into end to end tests

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

Deployment on Heroku

Heroku Application Link

Built With

API Endpoints

versioning for the endpoints /api/v2/

API Documentation

Apiary API Documentation

Author

  • Ryan Simiyu

License

This project is licensed under the MIT License - see the LICENSE.md file for details

ireporter's People

Contributors

raywire avatar dependabot[bot] avatar

Stargazers

 avatar Mwangi  Anthony avatar kyakulumbye ahmad avatar

Watchers

James Cloos avatar  avatar

Forkers

ngareski

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.