A command-line tool to scaffold and bootstrap FastAPI projects quickly.
Project description
FastAPI Project Generator CLI
A CLI tool that scaffolds FastAPI projects with optional database and API structure.
โ Features
| Feature | Description |
|---|---|
| Generate FastAPI project | Creates a full FastAPI folder structure |
| Optional Database | Create project with or without SQLAlchemy setup |
| Auto-creates virtualenv | Creates .venv inside the project |
| Auto-installs requirements | Installs dependencies based on options |
| Jinja2 Templates | Clean and flexible template system |
| Developer friendly | Simple prompts & automatic setup |
CLI add commands |
Add routes, models, schemas, crud, services |
๐ Project Output Structure
When DB and routes are enabled:
project_name/
โโ app/
โ โโ main.py
โ โโ core/
โ โ โโ config.py
โ โโ models/
โ โ โโ user.py
โ โโ schemas/
โ โ โโ user.py
โ โโ crud/
โ โ โโ user.py
โ โโ services/
โ โ โโ example.py
โ โโ api/
โ โ โโ router.py
โ โโ __init__.py
โโ .fastapi # internal flag to detect project
โโ .env
โโ requirements.txt
โโ .venv/
If database or routes are disabled, the tool skips those folders.
๐งฐ Installation
Clone Repo
git clone https://github.com/aymen-Dahmoun/FApi.git
cd FApi
Install dependencies
pip install -r requirements.txt
Requires Python 3.10+
๐ Usage
Create a project
python cli.py myproject
Answer prompts
Example interaction:
Do you want to use a DB? [y/n]: y
Choose a Database (sqlite/postgres) [sqlite]: sqlite
Do you want to generate routes? [y/n]: y
or simply run
python cli.py myproject --db sqlite --routes
Add new components
fapi add route product
fapi add model product --schema --crud
fapi add service payment
Auto-detects if you're inside a FastAPI project using
.fastapi
๐ Run the project
cd myproject
source .venv/bin/activate # Linux/Mac
# or .venv\Scripts\activate on Windows
uvicorn app.main:app --reload
๐ Roadmap
| Feature | Status |
|---|---|
| Basic FastAPI scaffold | โ Done |
| Optional DB | โ Done |
| Optional API | โ Done |
fapi add commands |
โ Done |
| Auto router import | ๐ Planned |
| Alembic migrations | ๐ Planned |
| Docker support | ๐ Planned |
| Publish on PyPI | ๐ฏ Future |
๐ค Contributing
Pull requests are welcome! ๐
โญ If you like this tool, give the repo a star!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fapier-0.1.0.tar.gz.
File metadata
- Download URL: fapier-0.1.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
790d179b0b24eac6eb5270e758a25b20e8857e0c3133a130e400dfe5e72b74b0
|
|
| MD5 |
b4dd00b19a4772e450598c8d5c885c99
|
|
| BLAKE2b-256 |
ba7cec0b5286198bb50d7ca3b0ea43c5e32287d1028afad10ac8e150e9748a93
|
File details
Details for the file fapier-0.1.0-py3-none-any.whl.
File metadata
- Download URL: fapier-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc76791e61173e09f1f90bd3550590e4f3c9fdcd897c26bcf5c23c6c0140c947
|
|
| MD5 |
08245e297eae2049eb3d92e126e37103
|
|
| BLAKE2b-256 |
ea2ae36937eaa2186edc3abe889315dc15b1e4d217d76bbfb75084db53e1a30d
|