- Python
- FastAPI
- Postgres
- celery
- RabbitMQ
- Pytest
- Docker
- Sentry for monitoring the app
- Celery flower for monitoring the Celery tasks
- Alembic for Database Migrations
- pre-commit hooks
git clone git@github.com:MbxrAteeq/pika-test.git
Create a .env
file and set database url's
cp .env-sample .env
Build Docker Images
sudo docker-compose build
Start Docker Services
sudo docker-compose up -d
Run alembic migrations
sudo docker-compose run app alembic upgrade head
Create and activate virtual environment:
cd pika-assignment
python3 -m venv env
source env/bin/activate
cp .env-sample .env
Note: set .env values according to your local configurations.
Note: If you are running the app with PostgreSQL, you will probably need to create the databases as well:
createdb --host=localhost -U postgres -O postgres -E utf8 -T template0 pika
createdb --host=localhost -U postgres -O postgres -E utf8 -T template0 pika_test
bash ./setup.sh
bash run.sh
celery -A celery_service.celery worker --loglevel=info
celery -A celery_service.celery flower
The server will start listens on port 8000 on address http://127.0.1:8000. Find swagger docs at http://127.0.1:8000/docs/swagger. Find flower dashboard at http://127.0.1:5555.
To run test, run the following command
pytest -vv -s