#scaffold #fastapi #cli #architecture

app faspi

๐Ÿš€ CLI generator for FastAPI projects with hexagonal architecture

4 stable releases

Uses new Rust 2024

new 1.2.0 May 10, 2025
1.1.1 May 10, 2025
1.1.0 May 9, 2025
1.0.0 May 9, 2025

#247 in Command line utilities

Download history 139/week @ 2025-05-04

139 downloads per month

MIT license

315KB
1K SLoC

Faspi Logo


 

๐Ÿš€ FastAPI CLI in Rust

๐Ÿ“ Description

A powerful and efficient CLI for generating FastAPI projects with hexagonal architecture, written in Rust.

โœจ Features

  • ๐Ÿ—๏ธ Project generation with hexagonal architecture
  • ๐Ÿ› ๏ธ Route, model, and service creation
  • ๐Ÿงช Automatic test generation
  • ๐Ÿ”„ Automatic module updates
  • ๐ŸŽฏ Python environment agnostic

๐Ÿ“ฆ Installation and Usage

๐Ÿ› ๏ธ Global Installation

cargo install faspi

๐Ÿ’ป Basic Commands

# Create new project
faspi new myapp

# Generate components
faspi make route user
faspi make model user
faspi make service user
faspi make core user
faspi make ports user
faspi make infrastructure user

๐ŸŽฏ Optional Features

When creating a new project, you can include additional features:

# Create project with optional features
faspi new myapp --sql        # Include SQLAlchemy ORM support
faspi new myapp --supabase   # Include Supabase integration
faspi new myapp --auth       # Include JWT authentication
faspi new myapp --cors       # Include CORS middleware
faspi new myapp --cache      # Include Redis and FastAPI-Cache support
faspi new myapp --tasks      # Include Celery task queue and Flower monitoring

# Combine multiple features
faspi new myapp --sql --auth --cache

๐Ÿ“ Project Structure

myapp/
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ main.py
โ”‚   โ”œโ”€โ”€ routes/
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ””โ”€โ”€ example_router.py
โ”‚   โ”œโ”€โ”€ models/
โ”‚   โ”‚   โ””โ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ services/
โ”‚   โ”‚   โ””โ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ core/
โ”‚   โ”‚   โ””โ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ ports/
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ””โ”€โ”€ example_port.py
โ”‚   โ””โ”€โ”€ infrastructure/
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ””โ”€โ”€ example_impl.py
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ conftest.py
โ”‚   โ””โ”€โ”€ test_example.py
โ”œโ”€โ”€ .env.example
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ requirements.txt
โ””โ”€โ”€ README.md

๐Ÿ”ง Technical Requirements

  • โš™๏ธ Rust and Cargo installed
  • ๐Ÿ’พ Compatible system (Linux, macOS, Windows)
  • ๐Ÿ“ Write permissions in working directory

๐Ÿง  Python Environments

The CLI generates the base structure, and you choose your preferred environment:

# Example with venv
cd myapp
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -r requirements.txt
uvicorn main:app --reload

๐Ÿ“š Documentation

For more details about available commands:

faspi --help
faspi make --help

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE (English) and LICENSE.es (Spanish) files for details.

Licence MIT

Dependencies

~10โ€“21MB
~296K SLoC