The goal of the project is to provide an interface for user
to create bookings of the hotel's free rooms.
Also, there's an admin panel to manage all the existing data.
- General: Python 3.10.6, FastAPI, Docker
- Databases: PostgreSQL, MongoDB
- Tests: PyTest
- Admin panel: sqladmin
- Authorization: Client-Side JWT Tokens
- Clone repository:
git clone https://github.com/nelttjen/fastapi-hotels.git- Create .env file by using .env-example template (preferred)
cp -f .env.example .envor make a new file and fill data manually
touch .env- Build docker containers (docker compose required)
# dev version (Need to run server and migrations manually)
sudo docker compose -f docker-compose.yaml build# prod version (requires .env-prod file)
cp .env .env-prod
sudo docker compose -f docker-compose-prod.yaml build- Run containers
# dev version
sudo docker compose -f docker-compose.yaml up# prod version (requires .env-prod file)
sudo docker compose -f docker-compose-prod.yaml upIn the dev version of docker you need to manually run migrations and server
- Create venv, install dependencies
sudo apt install python3-dev python3-venv python3-pip
python3 -m venv venv
source venv/bin/activate
pip3 install poetry
poetry install- run migrations and dev server
poetry run alembic upgrade head
poetry run uvicorn main:app --reload