A CLI tool that scaffolds a production-ready FastAPI project with an interactive TUI. Choose your database, ORM, auth provider, package manager, and optional Docker/Redis support, and get a fully structured project in seconds.
pip install fastfastapipipx install fastfastapigo install github.com/markryangarcia/fastfastapi@latest
go install github.com/markryangarcia/fastfastapi/cmd/ffa@latest #for 'ffa' commandMake sure $GOPATH/bin (or $HOME/go/bin) is in your PATH.
- Python 3.8+ (for pip/pipx install)
- Go 1.21+ (only if installing via Go)
pipenv(optional, only if you choose it during setup)- Docker (optional, only if you choose Docker support)
# Create a new project in a new directory
fastfastapi
# Scaffold into the current directory
fastfastapi .
# Pass a project name directly (skips the name prompt)
fastfastapi my-api
# ffa is an alias for fastfastapi
ffa my-apiThe TUI walks you through:
- Project name
- Database —
PostgreSQL (SQLAlchemy)orMongoDB (PyMongo) - ORM —
SQLAlchemy,SQLModel, orFastCRUD(PostgreSQL only) - Auth provider —
None,Clerk, orAWS Cognito - Package manager —
Pipenvorrequirements.txt - Docker support — generates
Dockerfile,docker-compose.yml, and.dockerignore - Redis caching — generates
app/core/cache.pywith Redis integration - Install & start — run setup automatically or skip
my-api/
├── app/
│ ├── api/v1/
│ │ └── routers/
│ │ ├── users.py
│ │ └── items.py
│ ├── core/
│ │ ├── config.py
│ │ ├── security.py
│ │ └── cache.py # Redis only
│ ├── db/
│ │ ├── base.py # SQLAlchemy only
│ │ └── session.py
│ ├── models/
│ │ ├── user.py
│ │ └── item.py
│ ├── schemas/
│ │ ├── user.py
│ │ └── item.py
│ ├── services/
│ │ ├── user_service.py
│ │ └── item_service.py
│ ├── utils/
│ │ ├── pagination.py
│ │ ├── responses.py
│ │ └── exceptions.py
│ └── main.py
├── migrations/ # PostgreSQL only (Alembic)
│ └── versions/
├── tests/
│ ├── test_users.py
│ └── test_items.py
├── conftest.py
├── .env
├── .gitignore
├── alembic.ini # PostgreSQL only
├── Dockerfile # Docker only
├── docker-compose.yml # Docker only
├── .dockerignore # Docker only
├── requirements.txt # if not using pipenv
└── Pipfile # if using pipenv
| Option | Description |
|---|---|
SQLAlchemy |
Classic SQLAlchemy Core + ORM with Alembic migrations |
SQLModel |
SQLModel (SQLAlchemy + Pydantic) — models double as schemas |
FastCRUD |
FastCRUD on top of SQLModel for auto-generated CRUD endpoints |
MongoDB always uses PyMongo directly — no ORM prompt.
| Option | Description |
|---|---|
None |
Custom JWT auth via app/core/security.py |
Clerk |
Clerk JWT verification wired into the security module |
AWS Cognito |
AWS Cognito JWT verification wired into the security module |
Edit the generated .env file:
PostgreSQL:
APP_NAME="my-api"
DATABASE_URL="postgresql://user:password@localhost:5432/my-api"MongoDB:
APP_NAME="my-api"
MONGODB_URL="mongodb://localhost:27017"
MONGODB_DB="my-api"Redis (if enabled):
REDIS_URL="redis://localhost:6379"With Docker:
cd my-api
docker compose up --buildWith pipenv:
cd my-api
pipenv install --dev
pipenv shell
fastapi dev appWith requirements.txt:
cd my-api
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
fastapi dev appThe API will be available at http://localhost:8000.
Interactive docs at http://localhost:8000/docs.
pytestqorCtrl+Cat any point in the TUI cancels generation without writing any files.- MongoDB skips Alembic entirely — no
alembic.iniormigrations/folder is generated. SQLModelandFastCRUDskipapp/db/base.pysince SQLModel handles that internally.- Redis adds
app/core/cache.pywith a ready-to-use cache client. - If Docker is selected but the daemon isn't running, the tool warns you and exits cleanly.
- If you opt into "Install & start" with Docker,
docker compose up --buildruns automatically after scaffolding.