Fastplace — an opinionated, full-stack, AI-native web framework built on Python and React, focused on a productive developer experience.
pip install fastplace==0.4.4 Copy PIP instructions
An opinionated, full-stack, AI-native web framework built on Python and React — designed around a highly productive developer experience.
Fastplace is a modular monolith by default — one deployable unit composed of strictly bounded internal modules — that serves every client through two presentation edges: a Server-Driven SPA (Inertia pattern) for the web and a Unified API for mobile and desktop applications, all backed by a single Controller-Service-Repository (CSR) core. AI is native infrastructure, not an integration: LLM tool calling, vector search, and SSE streaming are part of the framework fabric.
Status: The framework is implemented (Phases 1–7) and exercised end-to-end by the sample application in this repo. The documentation at fastplace.dev covers the guides; this README is the project overview.
# 1. Backend + frontend dependencies python -m venv .venv && source .venv/bin/activate pip install -e ".[dev]" npm install # 2. Environment (never commit .env) — defaults to zero-config SQLite cp .env.example .env # 3. Database schema + sample data fastplace migrate # Alembic migrations (db.create_all() also works locally) fastplace db:seed # projects, tasks, knowledge items # 4. Full-stack dev — Uvicorn (reload) + Vite (HMR) together fastplace run dev # → http://127.0.0.1:9000 What you get on first boot:
Every page is framed by the persistent AppLayout (nav chrome survives bridge navigation), and app-owned middleware lives in app/http/middleware/ (X-Process-Time request timing) registered from config/app.py.
pytest # backend suite mypy fastplace && ruff check . # static analysis npm run types && npm run test:run # frontend types + vitest npx playwright test # E2E through the real dev server Swap the database by setting DATABASE_URL (postgresql://… recommended in production — pgvector powers vector search; mysql:// and MongoDB via MONGODB_URL are supported too). See .env.example for every switch.
Modern full-stack web development often forces a trade-off: developer velocity vs. rich client-side interactivity. Fastplace solves this by pairing Python's asynchronous ecosystem with React's component model, wrapped in a single, cohesive framework. One backend serves two presentation edges — the hydrated React SPA and the Unified API — so web, mobile, and desktop clients share the same services, repositories, and business rules.
One Python process serving a React SPA bridge, a unified JSON API, a native AI engine, and a capability-aware data layer, all orchestrated by one CLI:
+-----------------------------------------------------------------------+ | Fastplace CLI | | (`fastplace run dev` / `fastplace serve` / Generators) | +-----------------------------------------------------------------------+ | +------------------+------------------+ | | Bridge Protocol Unified JSON API (X-Fastplace-Request: true) (session / token auth) | | v v +---------------------------------+ +---------------------------------+ | Web Browser | | Mobile / Desktop Apps | | React SPA (@fastplace/react) | | Unified JSON API clients via | | hydrated pages from | | routes/api.py: same services, | | routes/web.py | | same repositories | +---------------------------------+ +---------------------------------+ | | +------------------+------------------+ | v +-----------------------------------------------------------------------+ | Python Backend (modular monolith) | | one deployable unit, one ASGI stack (N workers) | | | | Fastplace HTTP Layer +------------------------+ | | FastAPI Application Core | AI Agent Engine | | | (Starlette ASGI Foundation) | Function-as-Tool Reg. | | | CSR Pipeline: | Structured Outputs | | | Controllers -> Services -> Repositories | SSE Streaming | | | Native Auth & RBAC | pgvector Vector Stores | | | SAQ Async Task Queue (app/jobs + Redis)+------------------------+ | | Fastplace ORM (public API) | | over SQLAlchemy 2.x + Alembic | +-----------------------------------------------------------------------+ | | | | v v v v +--------------+ +--------------+ +--------------+ +--------------+ | SQLite | | PostgreSQL | | MySQL | | MongoDB | | (default, | | (recommended | | (supported | | (separate | | zero-config) | | + pgvector) | | relational) | | document | | | | | | | | adapter) | +--------------+ +--------------+ +--------------+ +--------------+ How Fastplace Is Organized Modular Monolith Architecture Fastplace decomposes applications by business capability — billing, projects, accounts — but the decomposition is logical, not physical. Modules run in a single process, share a single database, and deploy with a single command (fastplace serve). From microservices Fastplace borrows the discipline of boundaries; what it refuses to borrow is the distributed runtime.
Every request follows the same path: Client Request → Controller → Service → Repository → Database.
Both presentation edges terminate in controllers that call the same services, so business logic is written exactly once and shared by web, mobile, and desktop clients. Pydantic schemas validate input at the edge and serialize output before any model instance reaches a client — explicit serialization prevents accidental exposure of password hashes, internal identifiers, and audit fields.
Fastplace's HTTP runtime is a deliberate layering of two complementary frameworks, not a choice between them (ADR-006):
Fastplace Framework (HTTP / routing / controllers / requests / responses / middleware / lifecycle) | v FastAPI (application HTTP framework: routing, DI, Pydantic v2, OpenAPI, WebSocket) | v Starlette (ASGI foundation: middleware, request/response, WebSocket primitives, lifespan) | v Uvicorn (ASGI server — development and production) Controllers own requests; services own logic. Business logic never lives inside @app.get(...) / @app.post(...) route handlers — the Fastplace path is Route → Controller → Service → Repository. Own request/response abstractions. Application code imports fastplace.http (render, request, response, middleware, lifecycle APIs), never fastapi or starlette directly. Escape hatches stay reachable. The underlying FastAPI application object (and through it Starlette) remains available for edge cases — mirroring the ORM escape hatch — and such code is deliberately framework-coupled. Server-Driven SPA & Unified API Fastplace replaces the classic "React app plus separate REST API" split with a server-driven SPA, and serves mobile/desktop clients from the very same services.
Guiding principle: Fastplace developers program against the Fastplace ORM API. SQLAlchemy 2.x remains the relational engine underneath. SQLModel is not the core abstraction.
An await-only, fluent public API — find(), where(), first(), get(), all(), count(), create(), save(), delete(), with_() (eager loading), order_by(), paginate(), and soft-delete accessors with_deleted() / only_deleted() — over SQLAlchemy 2.x async engines, Alembic migrations, and a Database Manager owning connections, pooling, and transaction scopes.
Multi-tenancy is not a framework default. It ships as the first-party, opt-in fastplace-tenancy package: company-scoped models extend CompanyScopedModel, every query is automatically filtered by company_id, and isolation is enforced defense-in-depth across ORM scope, middleware, authorization, Row-Level Security (PostgreSQL), cache key prefixes, job metadata, storage, search, and vector-store filters.
AI runs inside the same process, wired into the CSR layers — not bolted on as an integration:
The CLI (Typer + Rich) is the main developer interface — it orchestrates server runtimes, code generation, and database state:
A new project boots on SQLite with no external database installation: fastplace new myapp → fastplace migrate → fastplace run dev.
Fastplace applications are organized module-first: business logic lives inside bounded modules under app/modules/, while the HTTP edge, frontend assets, database state, and configuration follow fixed framework conventions:
my-fastplace-app/ ├── app/ # Python application logic │ ├── http/ # HTTP edge — the routing layer │ │ ├── controllers/ # Thin controllers: validate, delegate, respond │ │ ├── requests/ # Pydantic v2 request schemas (HTTP-edge validation) │ │ └── middleware/ # Auth & CSRF middleware (company-context middleware from fastplace-tenancy) │ ├── modules/ # Bounded business modules (module-first) │ │ ├── billing/ │ │ │ ├── models/ # Invoice, InvoiceLine, TimeEntry (Fastplace ORM) │ │ │ ├── repositories/ # Data access — the only path to the database │ │ │ └── services/ # Billing business logic; public module surface │ │ └── projects/ │ │ ├── models/ # Project, Task entities │ │ ├── repositories/ │ │ └── services/ │ ├── ai/ # AI agents, tools, and vector store registries │ │ ├── agents/ │ │ ├── tools/ │ │ └── vectors/ │ ├── jobs/ # Async queue background jobs (SAQ + Redis) │ └── models/ # Shared base model classes ONLY — no entities ├── database/ │ ├── migrations/ # Alembic database migrations │ └── seeders/ # Seeders run by `fastplace db:seed` ├── resources/ │ ├── js/ # React app source │ │ ├── components/ # Shared UI components │ │ ├── hooks/ # Fastplace React hooks │ │ ├── layouts/ # Page layout wrappers │ │ └── pages/ # React views (mapped to backend routes) │ └── css/ # Global styles & Tailwind configuration ├── routes/ # Thin route declarations — no business logic │ ├── api.py # Unified JSON API — mobile & desktop clients │ ├── web.py # Server-driven SPA bridge pages (Inertia pattern) │ └── ai.py # Streamed AI & agent endpoints (SSE) ├── config/ # Configuration loaded from .env │ ├── app.py │ ├── database.py # SQLite default; PostgreSQL recommended (pgvector) │ ├── ai.py │ └── auth.py ├── public/ # Static public assets & build output (public/build/) ├── storage/ # Logs, cache, local uploads — runtime output, gitignored ├── .env.example # Environment template — never commit .env ├── pyproject.toml # Python dependencies & CLI configuration ├── package.json # Frontend dependencies (React, Vite, Tailwind) └── vite.config.js # Vite bundler middleware Every fastplace make:* generator writes into this canonical layout, so a Fastplace codebase is predictable from the first commit. The shared kernel (app/models/) holds only base classes and mixins — never entities — preventing the gradual accumulation of a "god folder" of models.
This repo includes a working sample app (app/) that exercises the full framework — it powers our E2E suite and doubles as a live reference.
It is a real Fastplace application, not a toy: bounded modules (projects, accounts, knowledge, dashboard), thin controllers with Pydantic request schemas, app-owned middleware, an SSE-streamed AI assistant with registered tools, queue jobs, seeders, and the full React bridge frontend under resources/js/. The E2E suite (e2e/) boots it through the real dev server and drives auth, passkeys, broadcasting, and accessibility journeys against it. The published wheel ships only the fastplace/ package — the sample app is repo-only and never installed with the framework.
One deployable modular monolith, one CSR backend, one ORM public API: each concern — server runtime, data access, presentation, background work, AI — is owned by a single well-bounded technology behind a Fastplace-controlled developer experience.
The ORM is sequenced immediately after the core engine because every layer above it — the React bridge, the unified API, modules, and AI — consumes the Fastplace ORM public API. Presentation edges come after the data layer so both routes/web.py and routes/api.py stabilize against one contract.
Phase ordering is deliberate: the ORM precedes both presentation edges and the module system, so the modular monolith and the unified API are never built on a shifting data layer; database breadth lands after the portable API is proven against SQLite and PostgreSQL. The module-first directory layout exists from project bootstrap, so later phases add enforcement and generators on top of an already-correct structure.
Fastplace's developer-experience goals are informed by many excellent frameworks — most notably Laravel (MIT) for its ergonomics-first API design, and Inertia.js (MIT) for the server-driven SPA pattern the React bridge follows. Fastplace is an independent Python + React implementation with no shared code.
Fastplace is open-sourced under the MIT License.
testing postgresql mysql mongodb mail ai pwdlib queue webauthn s3 mcp all dev
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.




