This project provides a foundational structure for building RESTful APIs using FastAPI, leveraging SQLAlchemy for object-relational mapping (ORM) and Alembic for database migrations. It adheres to Domain-Driven Design (DDD) principles for optimal code organization and maintainability.
- 🚀 FastAPI: High-performance, asynchronous web framework for building APIs.
- 🛡️ Sqlalchemy: Robust ORM for interacting with databases.
- 📘 Alembic: Powerful tool for managing database schema migrations.
- 🛠️ Ruff: An extremely fast Python linter and code formatter, written in Rust.
- 🔦 Pyright: Static Type Checker for Python.
- 💈 Pre-commit: A framework for managing and maintaining multi-language pre-commit hooks.
- 🚢 UV: Python packaging in Rust
- Ensure you have Python 3 and pip installed on your system. To set up the project environment, run the following command:
- After have pip let install uv
pip install uv
make install
- To start the development server, use the following command:
make dev
- All necessary scripts for this project are listed in the Makefile. Please carefully review the Makefile and execute the desired script accordingly.
The project follows Domain-Driven Design principles, with the following directory structure:
- presentation: Handles incoming requests and outgoing responses.
- application: Orchestrates business logic, coordinates domain objects
- domain: Defines the domain model and business entities.
- infrastructure: Manages external dependencies like databases and messaging systems.
- core: Contains shared utilitie, constants, configurations, and other cross-cutting concerns.