Adding FastBackend to an Existing Project
-
Install packages:
pip install fastbackend-fastapi npm install -g @fastbackend/cli -
Create
fastbackend.yamlpointing to your existing schema file. -
Create
app/custom/and move existing custom routes there. -
Replace manual CRUD routes with the runtime:
from fastbackend_fastapi import create_app app = create_app() -
Run
fastbackend generateto produce IR and OpenAPI. -
Remove hand-written CRUD route files that duplicate runtime behavior.
Before vs After
| Before | After |
|---|---|
| Hand-written CRUD routers | Runtime creates routes from IR |
| Manual Pydantic schemas | Runtime creates models from IR |
| Manual OpenAPI annotations | Core generates OpenAPI from IR |
| Business logic endpoints | Keep in app/custom/ |
Keep: schema definitions, custom business logic, database migrations, auth middleware.