$ show yezz123/fastango
Fastango is a uv-first CLI tool for generating production-ready FastAPI projects. It provides two template styles (simple, mvc), a curated integration catalog spanning auth, databases, payments, AI, observability, and deployment, and an interactive terminal playground for selecting components. The tool also includes a constrained AI generation mode that converts natural-language prompts into validated project plans using only supported templates, skills, presets, and integrations, rejecting unsafe or unsupported suggestions. Architecturally, Fastango uses a modular scaffold engine: a mutable ScaffoldPlan accumulates dependencies, files, environment variables, and documentation; a TemplateRenderer renders Jinja2 templates from packaged directories and inline specifications; and an IntegrationRegistry resolves aliases, conflicts, and preset expansions before applying integrations. The generator module separates deterministic rules from optional LLM provider adapters (Anthropic, OpenAI), merging suggestions after validation against the same registry. The codebase demonstrates strong engineering practices: type hints throughout, Pydantic v2 for configuration, Protocol-based integration contracts, and comprehensive tests including smoke tests for generated projects. The safety modelβwhere provider output is always validated against a allowlist before writing filesβis a notable design decision that prevents arbitrary code generation. The integration catalog is declarative and extensible, making it straightforward to add new integrations without writing imperative code.
The LLM identified 4 files worth highlighting for reuse:
Provides the ScaffoldPlan dataclass that acts as a mutable accumulator for all generated file specifications, dependencies, environment variables, and metadata. Integrations call methods like add_file, add_dependency, add_env_var to contribute to the plan before rendering. This pattern is reusable in any code generation pipeline and decouples integration logic from rendering.
Implements IntegrationRegistry with built-in integration loading, alias resolution, category/name filtering, conflict detection, and preset expansion. The resolve() method expands presets, resolves transitive requirements, and rejects conflicting integrations before they are applied. This pattern is directly reusable for any plugin or feature management system.
Defines CatalogIntegration, a declarative integration that bundles dependencies, environment variables, file specs, routers, middleware, lifespan hooks, and Docker Compose services into a single apply() method. This avoids scattered logic across many integration modules and makes adding new integrations a data-driven task. The docs_integration factory function further reduces boilerplate.
Implements build_generation_plan, which first runs deterministic rules to extract skills and integrations from a prompt, then optionally enriches the plan via an LLM provider (Anthropic/OpenAI). Provider suggestions are validated against the allowlist before merging, with unsupported items collected as notes rather than silently dropped. This safety-first approach is a reusable pattern for any AI-assisted code generation tool.