- Home
- Skills
- First Fluke
- Fullstack Starter
- Fastapi Templates
fastapi-templates_skill
- TypeScript
181
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill first-fluke/fullstack-starter --skill fastapi-templates- SKILL.md2.4 KB
Overview
This skill provides production-ready FastAPI project templates and scaffolding patterns to bootstrap services quickly and consistently. It bundles recommended project layout, example endpoints, Pydantic settings, and async SQLAlchemy models so teams can start with a solid, maintainable foundation. Use it to reduce boilerplate, enforce conventions, and accelerate reliable API development.
How this skill works
The templates define a scalable directory structure (api, core, db, schemas, services, main) and include sample code for common concerns: endpoints, dependency injection, settings management, and async models. It supplies ready-to-use snippets for APIRouter endpoints, Pydantic BaseSettings, and SQLAlchemy async models that integrate with dependency-based DB sessions and authentication. Developers copy or adapt the scaffolding into a new project, then replace the sample components with domain-specific logic.
When to use it
- Starting a new FastAPI service and wanting a production-ready baseline.
- Adding standardized components like auth, DB sessions, or config to an existing app.
- Enforcing a shared project layout and conventions across a team or monorepo.
- Prototyping an API quickly while retaining patterns suitable for production.
Best practices
- Keep clear separation: routers in api/, business logic in services/, schemas for validation, and models in db/.
- Use Pydantic BaseSettings for environment-driven configuration and load .env in non-production.
- Prefer async SQLAlchemy sessions with dependency-injected DB sessions for request-scoped access.
- Centralize security helpers (JWT, password hashing) in core/security and guard endpoints with dependency-based current_user.
- Import all models in db/base to ensure migrations detect them, and use alembic or a migration tool for schema changes.
Example use cases
- Scaffold a new microservice with auth, DB connection, and standardized endpoints in minutes.
- Integrate a consistent settings pattern across services to simplify CI/CD and secrets management.
- Convert a legacy FastAPI app to an opinionated structure for easier maintenance and onboarding.
- Create a sample endpoint that uses dependency-injected AsyncSession and current_user to enforce ownership.
FAQ
Yes. The structure is agnostic; swap async session patterns for synchronous sessions and adjust dependency code accordingly.
How do I handle secrets in production?
Keep secrets out of source control, load them via environment variables or a secret manager, and use Pydantic BaseSettings to centralize configuration.