GenAI RAG app (FastAPI) project structure

GenAI RAG app (FastAPI) project structure

Explorer

  • .git…
  • .venv…, not committed
  • .claudenew
  • .vscodenew
  • settings.jsonnew
  • extensions.jsonnew
  • launch.jsonnew
  • alembicnew
  • env.pynew
  • script.py.makonew
  • app
  • __init__.py
  • main.py
  • config.py
  • errors.pynew
  • datanew
  • rawnew, not committed
  • processednew, not committed
  • indexnew, not committed
  • fixturesnew
  • docsnew
  • architecture.mdnew
  • evals.mdnew
  • evalsnew
  • metrics.pynew
  • judges.pynew
  • run_offline.pynew
  • thresholds.yamlnew
  • resultsnew, not committed
  • frontendnew
  • scriptsnew
  • seed.pynew
  • ingest.pynew
  • testsnew
  • conftest.pynew
  • factories.pynew
  • htmlcov…new, not committed
  • .editorconfig
  • .python-version
  • .gitignore
  • README.md
  • pyproject.toml
  • uv.lock
  • .env, not committed
  • .env.examplenew
  • alembic.ininew
  • docker-compose.ymlnew
  • .pre-commit-config.yamlnew
  • justfilenew
  • AGENTS.mdnew
  • CLAUDE.mdnew
  1. # Create the project with uv (no build system, plain app)

    uv init --no-package rag-app && cd rag-app
  2. # Add FastAPI, settings, the vector DB client and a model SDK

    uv add "fastapi[standard]" pydantic-settings qdrant-client anthropic
  3. # Add dev tools

    uv add --dev pytest ruff mypy
  4. # Start the local services (Qdrant first, Postgres and Redis once you add them)

    docker compose up -d
  5. # Run the API with reload (reads [tool.fastapi] entrypoint)

    uv run fastapi dev
  6. # Later: add the data layer and create the migrations folder

    uv add sqlalchemy alembic "psycopg[binary]" && uv run alembic init alembic