Git Product home page Git Product logo

corrections's Introduction

Sunnah.com Corrections App

Overview

This is hadith corrections app.

python 3+ is required to run the project.

Getting started

Please follow the instructions below.

First create a local .env.local configuration file and update values as needed. A sample file is provided at .env.local.sample.

Run manually:

git clone REPO
cd REPO
python3 -m venv venv
source venv/bin/activate
pip install -r frontend/requirements.txt
cd frontend
export FLASK_ENV=development FLASK_APP=main.py
flask run --host=0.0.0.0

Or alternatively use docker-compose inside frontend directory which will give a full environment with a MySQL instance loaded with a sample dataset:

docker-compose up
  • Use --build option to re-build.
  • Use the -d option to run in detached mode.

You can then visit localhost:5500 to verify that it's running on your machine.

Deployment

Configuration files are located at env.local and uwsgi.ini.

A production ready uWSGI daemon (uwsgi socket exposed on port 5500) can be started with:

docker-compose -f docker-compose.prod.yml up -d --build

The production backend is deployed at https://l7jwlmg0h3.execute-api.us-west-2.amazonaws.com/prod

Request schema

The request to submit correction should be similar to:

{
  "urn": "123",
  "attr": "body",
  "val": "modified body text here",
  "lang": "en",
  "comment": "fixed spelling",
  "queue": "global",
  "submittedBy": "[email protected]"
}

How to get api key

You will need an API key to access this data, which you may request by creating an issue on our GitHub repo.

How to setup flask mail server configs

For detailed documentation on what each config mean, please vist: https://pythonhosted.org/Flask-Mail/

For the following configs, I have taken gmail as an example.

  1. The server is "smtp.gmail.com".

  2. The port must match the type of security used.

    • If using STARTTLS with MAIL_USE_TLS = True, then use MAIL_PORT = 587.
    • If using SSL/TLS directly with MAIL_USE_SSL = True, then use MAIL_PORT = 465.
    • Enable either STARTTLS or SSL/TLS, not both.
  3. Depending on your Google account's security settings, you may need to generate and use an app password rather than the account password. This may also require enabling 2-step verification. You should probably set this up anyway.

Configurations

MAIL_SERVER=smtp.gmail.com
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_USE_SSL = False
MAIL_USERNAME = '[email protected]'
MAIL_PASSWORD = 'app password generated in step 3'

corrections's People

Contributors

ahadith avatar ahsankamal avatar businessglitch avatar hasankhan avatar ilyas-shah avatar mohammedmustafaahmed avatar muhammadagf avatar nadeemnazeer avatar tanjinp avatar ysajid avatar

Watchers

 avatar

Forkers

mjabuz

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.