Project to manage the backend of the Open Gym application
See Structure
- Python 3.12+ ✨
- Uvicorn Lightning-fast ASGI server implementation, using uvloop and httptools 🦄
- FastAPI Web Framework for building APIs 🚀
- SQLModel SQLModel is a library for interacting with SQL databases from Python code 🗄️
- Pydantic Data validation and settings management using python type annotations ✅
- Poetry Python dependency management and packaging made easy 📦
- Alembic A database migrations tool for SQLAlchemy 🐍
- PostgreSQL Open Source Relational Database 🐘
- Docker Containerization platform 🐳
- Docker Compose Tool for defining and running multi-container Docker applications 🛠️
- Ruff is a code formatter and linter for Python 🐶
- Pre-commit A framework for managing and maintaining multi-language pre-commit hooks 🎣
- mypy Static type checker for Python 🏗️
- Comments: Google Style
- Ruff is a code formatter and linter for Python 🐶
- All code has to be formatted and linted before committing using pre-commit hooks
For checking static type checking run the following command
mypy src/**/*.py
-
Python 3.12+
-
Docker
-
Docker Compose
-
Poetry
-
Pre-commit
-
We are using pre-commit to enforce code style and formatting
## Install pre-commit
pip install pre-commit
## Install the pre-commit hooks
pre-commit install
- Clone the repository
- Install poetry
pip install poetry
- Create a virtual environment
poetry env use python3.x # where x is the version of python you want to use (3.12+)
source .venv/bin/activate # activate the virtual environment
or
python3.x -m venv .venv # where x is the version of python you want to use (3.12+)
source .venv/bin/activate # activate the virtual environment
- Install the dependencies
poetry install
- Run the server (before running the server, you need to have the
.env
file with the configuration of the database)
uvicorn src.main:app --reload --port 8000
- Clone the repository
- Use docker-compose to build and run the server
docker-compose up --build
- The API documentation is available at
http://localhost:8000/docs
See Migrations