faspi

Crates.iofaspi
lib.rsfaspi
version1.2.0
created_at2025-05-09 08:30:20.401896+00
updated_at2025-05-10 06:52:22.529502+00
description๐Ÿš€ CLI generator for FastAPI projects with hexagonal architecture
homepage
repositoryhttps://github.com/1Terabit/faspi
max_upload_size
id1666613
size369,342
. (1Terabit)

documentation

README

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

Commit count: 12

cargo fmt