- Python 3.10* or later
- postgresql 12.6.* or later
- clone the repo
- install a virtual env and activate it:
python -m venv env; env/Scripts/activate[Windows] - install a virtual env and activate it:
virtualenv --no-site-packages env; source env/bin/activate[Linux/iOS] - install requirements:
pip install -r requirements.txt - copy the configuration file:
cp main/config/example.development.cfg > main/config/development.cfg.
Setup the PostgreSQL database (minimum version 12.*)
psql -U postgres
=# CREATE USER postgres WITH PASSWORD 'database-name';
=# CREATE DATABASE database-name;
=# GRANT ALL PRIVILEGES ON DATABASE database-name TO postgres;
=# \q
Or you can use the Graphic interface on windows
- App uses Flask-Migrate (which uses Alembic) to handle database migrations.
- Intialize db
flask db init - This will autogenerate a change. Double check that it make sense. To apply it on your machine, run
flask db migrate - To upgrade all versions, this ultimately delete all tables
flask db upgrade
- Powershell Run:
$ENV:PYTHONPATH = "<name-of-project>" - Linux/Mac to set the environment path
export PYTOHNPATH=<name-of-project>
Then run pytest for simple test summary or pytest -vv for detailed test summary
Redis is required for caching and background task management.
Install Redis:
- On Mac OS X:
brew install redis - On Windows: Use the Redis MSI installer
- On Ubuntu:
sudo apt-get update && sudo apt-get install redis-server - Update your
development.cfgto include Redis configuration:REDIS_URL = "redis://<redis-host>"
- You can use Heroku, which supports a wide range of programming languages and has an easy deployment that links to your github repository and waits on push commits before deploying your work. There is another option that uses the Heroku-CLI if you don't want to use github.
- You can also setup a PostgreSQL database and Redis instance on Heroku and update your
SQLALCHEMY_DATABASE_URIvariable in thedevelopment.cfg - You can setup Heroku Moonitoring to notify you of any issues.
- You can use the Astronomer To get started:
- Initialize an Astronomer project by running
astro dev init - Start Airflow locally by running
astro dev start - Navigate to localhost:8080 in your browser and you should see the tutorial DAGs there
- To stop the containers run
astro dev stopalternatively to destroy the container and images runastro dev kill
- For the API I used flask-Restful to intall
pip install flask-restfulwhich runs on Flask. Flask is a micro web framework written in Python. to installpip install flask
To access the api-docs http://localhost:5000/swagger