How jeca514/full-stack-fastapi-template works
Main components
• Backend API: This is built with FastAPI, using SQLModel (with PostgreSQL) for ORM, and includes modules for dependency injection (see backend/app/api), core configuration (backend/app/core), email templates (backend/app/email-templates), database migrations (alembic), and tests.
• Frontend Application: Built with React, it includes components (found in frontend/src/components), hooks, and auto-generated API client code. It leverages modern tooling such as Vite and TypeScript.
• Database: PostgreSQL is the primary datastore. Configuration and connection management occur within the backend’s core files.
• Containerization & Deployment: Docker Compose files (docker-compose.yml, docker-compose.override.yml, docker-compose.traefik.yml) manage both the backend and frontend containers, and Traefik is used for routing and HTTPS provisioning.
• CI/CD Pipelines: GitHub Actions workflows (under .github/workflows) automate running tests, linting, deployments, and generating clients.
• Auxiliary components: Email service integration for password recovery, JWT authentication mechanism, and miscellaneous scripts for formatting, testing, and pre-deployment tasks.
Relationships and interactions
• The Backend connects to the Database (PostgreSQL) using SQLModel; indicate a connection showing data CRUD operations.
• Docker Compose ties these components together as separate services; include symbols for containers and network connections.
• Traefik acts as a reverse proxy to forward client requests from the frontend or external endpoints to the appropriate service.
Architectural patterns and design principles
• Use of dependency injection and modular design in the backend (with routes, core, and CRUD components isolated).
• Containerization and reproducibility using Docker Compose, reflecting a microservices-style orchestration even if all services run in a unified environment.
• Additional layers such as the reverse proxy (Traefik) which abstracts traffic management and SSL/TLS termination.
Relevant technologies, frameworks, and libraries
• Backend: FastAPI, SQLModel, Pydantic, Alembic for migrations, JWT authentication, and pytest for testing.
• Frontend: React, TypeScript, Vite, Chakra UI, and Playwright for end-to-end testing.
• Infrastructure: Docker Compose for containerized deployment, Traefik for reverse proxying, and GitHub Actions for CI/CD.
• Other: Copier for project templating and environment configuration management through .env files.
• Clear labels for each major component: “Frontend (React + Vite)”, “Backend API (FastAPI + SQLModel)”, “PostgreSQL Database”, “Traefik Reverse Proxy”, and “CI/CD Pipeline (GitHub Actions)”.
• User requests coming into the Traefik proxy.
• Requests being forwarded to the frontend and backend.
• API calls from the frontend to the backend.
• Backend interactions with the PostgreSQL database.
• Data flowing from the CI/CD system into deployment (triggering Docker Compose builds and container updates).
• Clearly mention the role of Docker Compose which acts as the integrator by defining multiple services such as the frontend, backend, and Traefik service.