Opinionated CLI to generate production-ready FastAPI boilerplate with typing and linting.
Project description
paststack
A CLI to generate production-ready FastAPI backends with a clean, opinionated architecture.
Vue d’ensemble
paststack génère un projet prêt au développement : arborescence src/app/ (core, api, routes, models, schemas), configuration pydantic-settings, CORS, santé /health et /ready.
Décisions actuelles de la v1 :
| Sujet | Choix |
|---|---|
| Gestionnaire de paquets | uv |
| Base de données | none, SQLite, PostgreSQL |
| Couche données | sans ORM (driver async) ou SQLModel (ORM unique) |
| Rate limiting | slowapi (optionnel), limite par IP |
| PostgreSQL | docker-compose fourni ; URL alignée sur le conteneur |
| Dépendances | extras dans le pyproject.toml généré (sqlite-none, sqlite-sqlmodel, postgres-none, postgres-sqlmodel, rate-limit) |
| Git | git init optionnel |
| Messages de commit | git-z optionnel (git z init dans le projet généré) |
Fonctionnalités
- Assistant interactif (
questionary) : nom du projet, CORS, base, ORM, rate limiting, installationuv, git, git-z - Copie des templates embarqués dans le package (
templates/**/*) - Création d’un venv +
uv syncavec les bons--extrasi demandé
Utilisation
Une fois le package installé (pip install paststack depuis PyPI, ou uv pip install -e . depuis ce dépôt) :
paststack
Puis ouvrir le dossier créé, copier .env.example vers .env, lancer l’API (voir le README.md généré dans le projet).
Développement (ce dépôt)
git clone https://github.com/initd-fr/paststack.git
cd paststack
uv sync
uv pip install -e .
paststack
Qualité (ce dépôt)
uv run ruff check .
uv run mypy .
Tests (ce dépôt)
uv sync --group dev
uv run pytest tests/ -v
Les combinaisons valides (SGBD × ORM × rate limiting) sont exposées dans paststack.combinations pour les tests ou un usage programmatique.
Conventions de commit (ce dépôt)
Format décrit dans git-z.toml : TYPE description (scope) (types et scopes listés dans le fichier).
Pour utiliser l’assistant git-z en local : git z init (après installation de l’outil). Le générateur peut lancer git z init dans le nouveau projet si tu coches l’option correspondante.
Feuille de route (indicative)
v0.x — générateur actuel
- CLI interactive + modèle
Projecttypé - Template FastAPI (
core,api, routes, models, schemas) - SQLite / Postgres × ORM ou driver seul
- Rate limiting (slowapi) en option
- Venv +
uv syncavec extras -
git init/git z initen option
Plus tard
- Variantes d’architecture (minimal / modulable avancée), autres SGBD, observabilité, etc.
Pourquoi ce projet
Poser une base FastAPI propre (structure, typing, lint, DB) prend du temps. Ce CLI applique les mêmes défauts à chaque nouveau service.
Licence
MIT
Project details
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 paststack-0.1.0.tar.gz.
File metadata
- Download URL: paststack-0.1.0.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50273f0c0fd0295c2dd9a87ecf1a157ecc8807bc721b43e04a8a0bf4602e9de2
|
|
| MD5 |
795ad137aabb8b212885ae6298d467b1
|
|
| BLAKE2b-256 |
39ccece88dd5fca2e0ec3d85334ce6d235c7b90f39cff736c61c796ec6d4ef28
|
File details
Details for the file paststack-0.1.0-py3-none-any.whl.
File metadata
- Download URL: paststack-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d72caa0ac8a8f0b20113ae8ff646f9b6c92d4d037a1d58bf1a5ae31eaae0bbc9
|
|
| MD5 |
642036fd84af642a1db8aaf9a4220b58
|
|
| BLAKE2b-256 |
f0a46ed3a18c3220b0f7b20556f03dabb26a6ecc5be2ae52046a372697c3e8d1
|