fastapi-project-generator
БесплатноБез исполняемых скриптовНе проверенGenerate complete FastAPI project skeleton with SQLAlchemy, MongoDB, JWT auth, Redis cache, Celery tasks, Docker, and CRUD generators. Use when user wants to…
от diegosouzapw★ 68 звёзд на GitHubОб этом скилле
This skill guides the creation of a production-ready FastAPI project with all necessary components.
Project Structure
Generate this standardized structure:
project/
├── app/
│ ├── api/ # API modules
│ │ ├── router.py # Central route registration
│ │ └── [module]/ # Feature module (e.g., user, form)
│ │ ├── __init__.py
│ │ ├── models.py # SQLAlchemy models
│ │ ├── schemas.py # Pydantic schemas
│ │ ├── router.py # APIRouter definitions
│ │ ├── views.py # View functions
│ │ └── tasks.py # Celery tasks
│ ├── core/ # Core components
│ │ ├── __init__.py
│ │ ├── exceptions.py # Custom exception handlers
│ │ ├── middleware.py # CORS, compression, rate limiting
│ │ └── oauth2.py # JWT authentication
│ ├── extensions/ # Extensions layer
│ │ ├── __init__.py
│ │ ├── db.py # SQLAlchemy sync/async engines
│ │ ├── cache.py # Redis client
│ │ └── mongo.py # MongoDB Motor client
│ ├── settings/ # Configuration management
│ │ ├── __init__.py # Settings loader
│ │ ├── development.py # Development config
│ │ ├── testing.py # Testing config
│ │ └── production.py # Production config
│ ├── utils/ # Utilities
│ │ ├── __init__.py
│ │ ├── logger.py # Logging setup
│ │ └── helpers.py # Helper functions
├── common/ # Shared modules
│ ├── response.py # Response wrappers (response_ok/response_err)
│ ├── security.py # Password hashing, JWT
│ ├── pagination.py # Custom pagination
│ └── error.py # Custom exceptions
├── tests/ # Test suite
├── alembic/ # Database migrations
│ ├── versions/
│ └── env.py
├── docker/ # Docker configuration
│ ├── Dockerfile
│ └── docker-compose.yml
├── requirements.txt # Python dependencies
├── main.py # Application entry point (root directory)
├── .env # Environment variables
├── .env.example # Environment template
├── .gitignore
└── alembic.ini
Core Dependencies
Use these versions as baseline:
# Core
fastapi>=0.115.0
uvicorn[standard]>=0.30.0
pydantic>=2.5.0
pydantic-settings>=2.1.0
# Database
sqlalchemy>=2.0.25
alembic>=1.13.0
asyncmy>=0.2.10 # Async MySQL driver
redis>=5.0.1
motor>=3.3.0 # MongoDB async
# Auth
PyJWT>=2.10.0
pwdlib[argon2]>=0.3.0
# Rate limiting
slowapi>=0.1.9
# Tasks
celery>=5.3.0
redis>=5.0.1
# Utilities
python-multipart>=0.0.6
python-dotenv>=1.0.0
loguru>=0.7.0
httpx>=0.26.0
limits>=5.6.0
Configuration Management
Use multi-environment settings based on ENV variable:
# app/settings/__init__.py
import os
from typing import Dict
from functools import lru_cache
from dotenv import load_dotenv
load_dotenv('.env')
from app.settings.development import DevelopmentSettings
from app.settings.testing import TestingSettings
from app.settings.production import ProductionSettings
@lru_cache()
def get_settings():
env = os.getenv('ENV', None)
env_config: Dict = {
"development": DevelopmentSettings(),
"testing": TestingSettings(),
"production": ProductionSettings()
}
if env is None or env not in env_config:
raise EnvironmentError("ENV is undefined!")
return env_config[env]
settings = get_settings()
# app/settings/development.py
from pydantic import Field
from typing import List
class DevelopmentSettings:
# App
PROJECT_NAME: str = "FastAPI Project"
VERSION: str = "1.0.0"
ENVIRONMENT: str = "development"
# Database
SQLALCHEMY_DATABASE_ASYNC_URL: str = "mysql+asyncmy://user:pass@localhost:3306/db"
SQLALCHEMY_DATABASE_SYNC_URL: str = "mysql+pymysql://user:pass@localhost:3306/db"
SQLALCHEMY_POOL_SIZE: int = 5
SQLALCHEMY_POOL_RECYCLE: int = 3600
SQLALCHEMY_POOL_PRE_PING: bool = True
SQLALCHEMY_ECHO: bool = False
# Redis
REDIS_URL: str = "redis://localhost:6379/0"
# JWT
JWT_SECRET_KEY: str = "your-secret-key"
ALGORITHM: str = "HS256"
ACCESS_TOKEN_EXPIRE_MINUTES: int = 30
REFRESH_TOKEN_EXPIRE_DAYS: int = 7
# MongoDB
MONGODB_URL: str = "mongodb://localhost:27017"
MONGODB_DB: str = "app"
# Celery
CELERY_BROKER_URL: str = "redis://localhost:6379/1"
CELERY_RESULT_URL: str = "redis://localhost:6379/2"
# CORS
BACKEND_CORS_ORIGINS: List[str] = ["http://localhost:3000"]
# Swagger
SWAGGER_DOCS_URL: str = "/docs"
SWAGGER_REDOC_URL: str = "/redoc"
OPENAPI_URL: str = "/openapi.json"
Response Wrapper
Use unified response format:
# common/response.py
from typing import Union, List, Dict,
Установить fastapi-project-generator в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл fastapi-project-generator?
Generate complete FastAPI project skeleton with SQLAlchemy, MongoDB, JWT auth, Redis cache, Celery tasks, Docker, and CRUD generators. Use when user wants to create or scaffold a FastAPI project.
Как установить скилл fastapi-project-generator?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл fastapi-project-generator запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
ci-review
The scan that the plugin's GitHub Action runs.
от Anthropicazure-static-web-apps
Helps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
от GitHubai-ready
Make any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
от GitHubaws-cdk-python-setup
Setup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…
от GitHub