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
139 downloads per month
315KB
1K
SLoC
๐ 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.
Dependencies
~10โ21MB
~296K SLoC