You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Build FastStack v1: a hybrid FastAPI framework with a pip-installable runtime core (faststack_core) and a CLI generator (faststack). Users can scaffold complete async FastAPI projects from YAML entity definitions, with protocol-based testing, structured logging, and RFC 7807 errors out of the box.
Overview
Build FastStack v1: a hybrid FastAPI framework with a pip-installable runtime core (
faststack_core) and a CLI generator (faststack). Users can scaffold complete async FastAPI projects from YAML entity definitions, with protocol-based testing, structured logging, and RFC 7807 errors out of the box.Design plan:
docs/design/fastapi-generator-plan.mdArchitecture decisions:
docs/architecture/adr/Implementation plan:
docs/implementation/v1-implementation-plan.mdPhases
Phase 0: Project Bootstrap ✅ (#2)
pyproject.toml— package config, dependencies, CLI entry point, ruff/black/pytest config__init__.pyfilesMakefile— ~15 targets (install, test, lint, format, typecheck, check, clean, help)conftest.py— pytest-asyncio configurationpoetry install,make check,python -c "import faststack_core"Phase 1: Runtime Core ✅ (#4)
faststack_core/base/entity.py— Entity, AuditedEntity, SoftDeleteEntity, FullAuditedEntityfaststack_core/base/repository.py— Repository Protocol + SqlAlchemyRepository (async)faststack_core/base/service.py— CrudService with 6 async lifecycle hooksfaststack_core/base/permissions.py— @require_permission, @require_rolefaststack_core/exceptions/domain.py— DomainError hierarchy (8 exception classes)faststack_core/exceptions/handlers.py— RFC 7807 global exception handlersfaststack_core/database/session.py— DatabaseConfig, async get_dbmake checkpassesPhase 2: Logging & Middleware ✅ (#5)
faststack_core/logging/— Structured logger (dual-format), sensitive data masking, configfaststack_core/middleware/— Correlation ID, request logging, security headersfaststack_core/health/endpoints.py— /health + /health/detailedfaststack_core/settings/config.py— FastStackConfig dataclassfaststack_core/setup.py—setup_app(app, config)one-call registrationmake checkPhase 3: CLI Foundation + YAML Parser ✅ (#6)
cli/__init__.py— Click CLI groupcli/field_mappings.py— 13-type YAML → SQLAlchemy → Pydantic mappingcli/yaml_parser.py— Entity/field definitions, relationship resolutioncli/model_introspector.py— AST-based model reader (highest risk item)Phase 4: Project Scaffolding (
faststack init) ✅ (#7)cli/cmd_init.py—faststack initcommandfaststack init test-projectproduces valid projectPhase 5: Simple Mode Entity Templates ✅ (#8)
ruff check+black --check, fake satisfies ProtocolPhase 6: Entity CLI Commands ✅ (#9)
cli/cmd_add_entity.py— add-entity (--fields, --from-yaml, --update)cli/cmd_generate.py— regenerate REGENERATABLE files, skip PRESERVED, hash trackingcli/cmd_migrate.py— Alembic wrapper (generate/upgrade/downgrade)cli/cmd_list.py— entity status + staleness detectionQuality Gates ✅ (#16)
Key Constraints (from ADRs)