How hdn24/fastapi-boilerplate works
Main Components
• Backend API: The core of the project is in the “app” directory, with submodules for API endpoints (routers), business logic (cruds), data models (models), and schemas (for data validation with Pydantic). This forms the FastAPI service handling HTTP requests.
• Deployment/Containerization: Docker is used for both local and production setups (see docker-compose.yml and docker/Dockerfile). Clearly denote the Docker containers and the orchestration provided by Docker Compose.
• CI/CD & Testing: GitHub Actions are set up for continuous integration (see .github/workflows folder) and there are integration tests under “app/tests”. Mark these as supporting components for continuous quality assurance.
• Reverse Proxy: There is an “nginx” directory with configuration files. This likely serves as a reverse proxy or load balancer on the deployment side. Include a component for Nginx that sits at the front of the architecture.
• Utilities and Configuration: The app has central configuration files (configs.py, database.py, dependencies.py) that tie together settings and dependency management. Although not separate services, they are important for overall architecture clarity.
Relationships and Interactions
• A clear data flow from the client requests (could be browsers or API consumers) to the FastAPI service.
• Nginx as an external gateway or reverse proxy that routes incoming requests to the FastAPI backend.
• CI/CD pipeline (GitHub Actions) as an external process triggering builds and tests and pushing updates.
• How Docker Compose orchestrates these containers (backend, database, possibly nginx) and mention that Docker container builds are specified in Docker-related files.
Architectural Patterns and Design Principles
• Containerized Deployment: Emphasize the use of Docker, which means each main component (backend service, database, proxy) can be visualized as distinct containers communicating over defined networks.
Relevant Technologies and Frameworks
• FastAPI for building the web API
• SQLAlchemy as the ORM for PostgreSQL
• Pydantic for schema validation and settings
• Docker and Docker Compose for containerization and orchestration
• Nginx as the reverse proxy
• GitHub Actions for CI/CD workflows
• Poetry as the dependency management tool for Python
• FastAPI container: split internally to show its organization into routers, cruds, models, and schemas.
• Outside of this containerized environment, add an element for CI/CD (GitHub Actions) tied to the source code repository.
• Optionally, include a “Testing” component that highlights the integration tests and how they interact with the FastAPI service.