Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mahelou/Fullstack-FastAPI
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: yuting1214/Fullstack-FastAPI
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 2 commits
  • 70 files changed
  • 2 contributors

Commits on Feb 20, 2026

  1. Optimized version (yuting1214#2)

    * [FEAT] Add locust file to benchmark performance.
    
    * [EHN] 1. orjson for parse 2. lifespan with increased thread pools 3. refactor middleware and add gzip compression 4.
    
    * [EHN] add locust in dependency.
    
    * [REFACTOR] Restructure project, migrate to uv, apply FastAPI best practices
    
    Project structure:
    - Reorganize from backend/fastapi/ to src/backend/, frontend/ to src/frontend/
    - Move tests to root tests/ directory with shared conftest.py
    - Remove dead files (constants.py, authorization.py, rate_limiter.py)
    
    Package management:
    - Replace requirements.txt with pyproject.toml + uv
    - Pin Python 3.12 via .python-version
    - Drop unused deps (trio, databases), add uvloop
    
    Environment & security:
    - Replace tracked .env with .env.example template
    - Add .env, .cursor/, .claude/ to .gitignore
    - Fix hardcoded SECRET_KEY in SessionMiddleware
    - Auth reads from pydantic-settings instead of os.getenv()
    
    FastAPI best practices (from Kludex/fastapi-tips):
    - Convert all endpoints and CRUD to async (Tips yuting1214#2, #9)
    - Pure ASGI DocProtectMiddleware replacing BaseHTTPMiddleware (Tip #8)
    - Typed lifespan state yielding session factory (Tip #6)
    - Async DB init and proper engine disposal on shutdown
    - SQLAlchemy 2.0: select(), DeclarativeBase, Mapped, async_sessionmaker
    - Portable UUID column (String(36)) for SQLite + PostgreSQL compat
    
    Testing:
    - All-async test suite with httpx.AsyncClient + pytest-anyio (Tips #5, #10)
    - conftest.py handles DB lifecycle since ASGITransport skips lifespan
    - Consolidated test_api_sync.py + test_api_async.py into test_api.py
    
    Deployment:
    - Dockerfile updated for Python 3.12 + uv
    - Docker build and test run verified in container (7/7 pass)
    
    Co-Authored-By: Claude Opus 4.6 <[email protected]>
    
    * [FIX] Use SQLAlchemy Uuid type for PostgreSQL + SQLite compatibility
    
    Replace String(36) with SQLAlchemy 2.0 native Uuid type which maps to
    PostgreSQL UUID and SQLite CHAR(32) automatically. Fixes startup crash
    when deploying against an existing PostgreSQL database that has UUID
    columns from the previous schema.
    
    Co-Authored-By: Claude Opus 4.6 <[email protected]>
    
    ---------
    
    Co-authored-by: Claude Opus 4.6 <[email protected]>
    yuting1214 and claude authored Feb 20, 2026
    Configuration menu
    Copy the full SHA
    47f036b View commit details
    Browse the repository at this point in the history

Commits on Feb 21, 2026

  1. Update CHANGELOG.md

    yuting1214 authored Feb 21, 2026
    Configuration menu
    Copy the full SHA
    0aa60d1 View commit details
    Browse the repository at this point in the history
Loading