dryvPacks

@dryv/fastapi-backendv0.1.0

FastAPI routers and Pydantic models.

FastAPI BackendBackendUnitPublished 7 days ago2 downloads

dryv pack add @dryv/fastapi-backend
1.0 KBRaw ↗

FastAPI backend pack

Generates a Python package at its destination root:

  • models/: a Pydantic model per schema, enum and generic, with field constraints, defaults and validated formats;
  • routers/: for every feature with HTTP operations, an abstract <Group><Feature>Service and a build_<group>_<feature>_router(service) factory whose routes delegate to the service;
  • __init__.py: re-exports models and routers.

The project owns the app, persistence and tests. It implements each service and mounts the router:

python
app = FastAPI()
app.include_router(build_core_user_management_router(MyUserService()))

Services raise fastapi.HTTPException for failures such as "not found".

Test: bun scripts/test-pack.ts unit/backend/fastapi-backend renders the flagship IR into a small app with in-memory services and runs its tests against the real endpoints.

Use it

The executable Usage fixture shows the current source collection, destination and pack activation for this pack.