Diving deeper¶
These guides are for developers who already have a FastAPI host app, or are building one, and want to use the MSFLib packages in it. They are task-oriented. Each one shows a small example that was run against the current source, and says so when a technique is not supported.
If you have not yet read Basics and the other quick-start pages, start there. The guides assume you know what a module, an action and a router factory are.
Start here¶
How to extend MSFLib explains the extension model: what the packages provide, what your app owns, and which guide to read for each kind of change. It also lists the techniques that do not work.
Guides by task¶
| I want to | Read |
|---|---|
| Add my own tables, actions, endpoints and settings next to MSFLib modules | Writing custom code |
| Mount a module's endpoints at my own prefix, with my own dependencies, or hide or replace some of them | Mounting routes |
| Add columns to a module's account, profile or workspace table, or change its request and response schemas | Overriding models |
| Add business rules, queries or hooks around create, update and delete | Subclassing actions |
| Sign users in, protect routes, and resolve the active workspace | Authentication |
| Run ingestion and other background work outside the request | Long-running jobs and ingestion |
| Use chat models, embeddings, chunking and vector search | AI capabilities |
Suggested order for a new host app¶
- Writing custom code builds a complete small host app (settings, models, an action, an authenticated router, a test). Every later guide reuses its pieces.
- Authentication covers the login flow that the example relies on, plus workspaces.
- Overriding models, Subclassing actions and Mounting routes as you need to bend a module to your product.
Related material¶
- Concepts describes the ideas behind the packages: tiered configuration, policy, scopes, the event bus and dependency injection.
- Modules has one page per package with its settings, models, actions and routers.
- Contributors working inside this repository should also read Contributing.