How igorbenav/fastapi-boilerplate works
Project type and purpose
• This is a monolithic, asynchronous REST API boilerplate built with FastAPI, Pydantic V2, SQLAlchemy 2.0, PostgreSQL and Redis.
• It provides user authentication (JWT + cookie‐refresh), Redis caching, rate limiting, ARQ background jobs, Alembic migrations, Docker Compose orchestration, and optional NGINX reverse proxy.
File structure
• Top‐level: Dockerfile, docker‐compose.yml, default.conf (NGINX), pyproject.toml, .env template
• src/app
• api/v1: versioned endpoints (login, users, posts, rate_limits, tasks, tiers)
• core: configuration, dependency setup, security, logger, DB (SQLAlchemy + Alembic), exceptions, cache/rate‑limit/queue utils, ARQ worker settings & functions
• crud: generic FastCRUD classes for each model
• models: SQLAlchemy ORM models (User, Post, Tier, RateLimit, TokenBlacklist)
• schemas: Pydantic models for validation/serialization
• middleware: e.g. client_cache_middleware
• main.py: application entrypoint
• src/migrations: Alembic scripts
• src/scripts: helper scripts to create first superuser & tier
• tests: pytest fixtures, helpers, unit tests
README insights
• Technology stack badges (Python, FastAPI, Pydantic, PostgreSQL, Redis, Docker, NGINX)
• Feature list: async, JWT auth, cookie refresh, client & server caching, ARQ queue, fastcrud, pagination, rate limiter, docs gating, extensibility
• Deployment instructions: Docker Compose up → services web, db, worker, redis, optional nginx & pgadmin
• Production: Gunicorn+Uvicorn, NGINX reverse proxy, multiple servers support