The only dependencies for this project should be docker and docker-compose.
Starting the project with hot-reloading enabled (the first time it will take a while):
docker-compose up -d
To run the alembic migrations (for the users table):
docker-compose run --rm backend alembic upgrade head
And navigate to http://localhost:8000
Note: If you see an Nginx error at first with a 502: Bad Gateway
page, you may have to wait for webpack to build the development server (the nginx container builds much more quickly).
Auto-generated docs will be at http://localhost:8000/api/docs
docker-compose build
docker-compose restart
docker-compose down
Migrations are run using alembic. To run all migrations:
docker-compose run --rm backend alembic upgrade head
To create a new migration:
alembic revision -m "create users table"
And fill in upgrade
and downgrade
methods. For more information see
Alembic's official documentation.
There is a helper script forbackend tests:
./scripts/test.sh
docker-compose run backend pytest
any arguments to pytest can also be passed after this command
docker-compose logs
Or for a specific service:
docker-compose logs -f name_of_service # |backend|db
backend
└── app
├── alembic
│ └── versions # where migrations are located
├── api
│ └── api_v1
│ └── endpoints
├── core # config
├── db # db models
├── tests # pytest
└── main.py # entrypoint to backend