Data app, database gateway micro service - Request and response database operations

Simple Rest API using Flask (python) + pymongo.

Maestro Server - Data architecture

Setup dev env

pip install FLASK_DEBUG=1 flask run --port=5010


    npm run server

Mongo service

cd devtool/

docker-compose up -d

Will be setup mongodb

Installation with python 3

  • Python >3.4
  • MongoDB

Download de repository

git clone

Install run api

python -m flask --port 5010

or FLASK_DEBUG=1 flask run --port 5010


npm run server


For production environment, use something like gunicorn.


import os

bind = "" + str(os.environ.get("MAESTRO_PORT", 5010))
workers = os.environ.get("MAESTRO_GWORKERS", 2)

Env variables

Env Variables Example Description
MAESTRO_PORT 5010 Port used
MAESTRO_MONGO_URI localhost Mongo Url conn
MAESTRO_MONGO_DATABASE maestro-client Db name, its differente of servers-app
MAESTRO_GWORKERS 2 Gunicorn multi process
MAESTRO_INSERT_QTD 200 Throughput insert in reports collection
MAESTRO_SECRETJWT_PRIVATE XXX Secret Key - JWT private connections
MAESTRO_NOAUTH XXX Secret Pass to validate private connections