Skip to main content

Fabrik logo

Fabrik

Generateur de projet FastAPI async + opinionated.
En 60 secondes : auth JWT, admin UI auto-decouverte, tests isoles,
background tasks (ARQ), migrations Alembic, CORS strict, responsive.

PyPI version Python 3.13+ Fabrik CI License: MIT

Version : 1.0.1  ·  Auteur : Falandy Jean  ·  Licence : MIT


Installation

pip install fabrik-fastapi

Verifier l'installation :

fabrik --help

Pre-requis : Python 3.13+.


60 secondes pour demarrer

fabrik new mon-api
cd mon-api
venv\Scripts\activate                 # Windows
# source venv/bin/activate            # Linux/Mac
python create_superuser.py
python -m uvicorn main:app --reload

Ouvre :


Ce que tu obtiens out-of-the-box

Domaine Choix par defaut
Framework FastAPI 0.136 + Starlette
ORM SQLAlchemy 2.0 async (AsyncSession)
Driver DB aiosqlite (dev) / asyncpg (prod PostgreSQL)
Auth JWT (access + refresh) avec bcrypt
Admin UI auto-decouverte responsive, multi-search, bulk delete, CSV
Migrations Alembic (autogenerate)
Background tasks ARQ (Redis-backed, async-native) avec degradation gracieuse
Tests pytest + pytest-asyncio + DB SQLite in-memory isolee
CORS Strict via BACKEND_CORS_ORIGINS (pas de *)
Config pydantic-settings (12-factor)
Docker Dockerfile Python 3.13-slim + docker-compose.yml

Les 4 commandes

Commande Effet
fabrik new <nom> Genere un projet complet (venv + deps + migration initiale)
fabrik add <module> Ajoute un module CRUD (auto-wire + migration + tests)
fabrik upgrade Met a jour un projet existant a la derniere version
fabrik test-self Meta-test : verifie que le scaffold genere un projet OK

Detail complet dans docs/USAGE.md.


Pourquoi Fabrik ?

Fabrik couvre l'angle mort entre Django (rigide, monolithique, sync) et FastAPI nu (zero opinion, 2 jours de plomberie a chaque projet).

FastAPI standard Django Fabrik
Stack async oui non oui
Auth JWT prete non tierce oui
Admin UI auto-genere non oui (sync) oui (async, responsive)
Background tasks non Celery (tiers) oui (ARQ inclus)
Tests isoles fournis non oui oui
Architecture modulaire a faire apps src/<module>/
Migration de projet non manuel fabrik upgrade
Demarrage zero-config 2j 30 min 60 secondes

Detail des choix de conception : ARCHITECTURE.md.


Structure d'un projet genere

mon-api/
├── main.py                       FastAPI app + lifespan + pool ARQ
├── worker.py                     Entrypoint ARQ (python worker.py)
├── docker-compose.yml            Redis + (PostgreSQL optionnel)
├── .env                          SECRET_KEY 256 bits + CORS + DB + Redis
├── .scaffold-version             Trace de la version Fabrik (pour upgrade)
├── create_superuser.py
├── requirements.txt
├── pytest.ini
├── alembic.ini + alembic/
├── src/
│   ├── database.py               AsyncEngine + get_db
│   ├── tasks.py                  ARQ tasks + WorkerSettings + get_arq dep
│   ├── core/                     Config, security, mixins, pagination
│   ├── users/                    Module exemple (models/schemas/service/router)
│   └── admin/                    UI auto-decouverte (router + templates + static)
└── tests/
    ├── conftest.py               Fixtures async (DB in-memory isolee)
    ├── test_users.py
    └── test_tasks.py

Architecture du repo Fabrik

fabrik/                           Repo GitHub
├── pyproject.toml                Package metadata (PyPI)
├── MANIFEST.in
├── README.md, ARCHITECTURE.md, LICENSE
├── docs/
│   ├── USAGE.md                  Guide utilisateur
│   └── PUBLISHING.md             Workflow de release PyPI
├── .github/workflows/ci.yml      CI : lance test-self a chaque commit
└── fabrik/                       Package Python
    ├── __init__.py
    ├── __main__.py               Pour `python -m fabrik`
    ├── scaffold.py               Moteur CLI
    └── core/                     Templates copies a chaque `new`

Developpement local

Si tu veux contribuer ou tester en local sans publier sur PyPI :

git clone https://github.com/FalandyJEAN/fabrik.git
cd fabrik
pip install -e .                  # installation en mode editable
fabrik test-self                  # verifie que tout fonctionne

Tout changement qui modifie la structure des projets generes doit :

  1. Bumper SCAFFOLD_VERSION dans fabrik/scaffold.py (et version dans pyproject.toml)
  2. Ajouter une fonction patch_vN_to_vM(root) idempotente
  3. L'enregistrer dans PATCHES
  4. fabrik test-self doit passer en local et en CI

Publication PyPI

Workflow complet dans docs/PUBLISHING.md. En resume :

pip install -e ".[dev]"
python -m build
twine upload dist/*

Licence

MIT © 2026 Falandy Jean — voir LICENSE.

Metadata

Release files for fabrik-fastapi 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fabrik-fastapi 1.0.3
File Size Uploaded
fabrik_fastapi-1.0.3.tar.gz 71.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fabrik-fastapi 1.0.3
File Interpreter ABI Platform
fabrik_fastapi-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 130.2 kB

Release files / fabrik_fastapi-1.0.3.tar.gz

Download URL fabrik_fastapi-1.0.3.tar.gz
Size 71.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4c86b4dabc63ff3e1e62eeb0de6462625bb20dbc974e0e32007db52050ef445d
BLAKE2b-256 checksum
How to use checksums
d95d8f6c4f470e8d750bee839a6505e5f7c1e1fe351401977f9050cc1d22244c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release files / fabrik_fastapi-1.0.3-py3-none-any.whl

Download URL fabrik_fastapi-1.0.3-py3-none-any.whl
Size 58.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39fcb57667b264649df98ab5a625d87f674e52e21af2a736f2b41e94bade0fae
BLAKE2b-256 checksum
How to use checksums
c6c0fc1be9248a08ca4f5e2ff6261000b61c9fec07a90c52cba5205b86700ed6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page