/flask-full

starter/boilerplate flask application with celery, mongoengine, shell commands and docs intergration

Primary LanguagePython

Flask-Full

Flask-Full is a boilerplate framework on top of flask for developing large api backend applications using flask. It has in built support for creating shell commands, celery, websocket, eventlet, mongoengine orm and rst docs.

Usage

Flask-Full requres minimum python 3.5.

Pre-required Setup:

  • MacOS/Linux/Windows
  • git
  • Python3 / pip3 /
  • MongoDB
git clone https@github.com:fynd/flask-full.git
cd flask-full (rename repository directory to required value)
pip3 install -r requirements.txt

To start server hit

python3 manage.py run -p 8080

Server will start on port 8080. Hitting http://localhost:8080/ping/ on web browser should return {"message": "pong"}.

To start celery hit

python3 manage.py celery

To start beat hit

python3 manage.py beat

For available commands and options hit

python manage.py

Structure

├── CHANGES                     Change logs
├── README.rst
├── manage.py                   Management commands file
├── meta.conf                   App meta conf
├── requirements.txt            3rd libraries
├── requirements_test.txt       Testing 3rd libraries
├── temp                        Temp directory for storing logs
├── app
   ├── __init__.py              App starting point
   ├── app.py                   Main blueprint with before and after request handler
   ├── api_info.py              api level constants
   ├── choices.py               CHOICES constant dictionary
   ├── crons.py                 Crons diectionary file
   ├── exceptions.py            custom exceptions
   ├── stats.py                 Api stats
   ├── wsgi.py                  wsgi app
   ├── wsgi_aux.py              wsgi auxilary app
   ├── utils                    Utils
   │   ├── __init__.py
   │   ├── api_caller.py        wrapper over requests which handles emits blinker signal over call
   │   ├── common_util.py       common utils
   │   ├── json_util.py         contains custom flask encodes
   │   ├── slack_util.py
   └── api
       └── v1
           └── ├── urls.py url routes
               ├──demo_api  container one demo api