How mooceanstudio/saas-starter-kit works
This is a multi-tenant SaaS starter kit: a browser dashboard authenticates users, loads their organizations, and lets them manage tenant members, invitations, and projects through a FastAPI API. The backend enforces membership and role checks, applies business logic, and persists tenant-scoped data. The graph includes the documented capabilities whose implementation was not sampled, but omits uncertain wiring; for those areas, it uses only paths supported by the tree.
Main entry points: database.py DB Session · auth.py Authentication Routes · deps.py Auth Dependencies · main.py FastAPI App
Components 18
Dashboard
- SPA Controller
frontend/js/app.js - API Client
frontend/js/api.js - UI Helpers
frontend/js/ui.js
HTTP API
- FastAPI App
app/main.py - Authentication Routes
app/api/auth.py - Organization Routes
app/api/organizations.py - Project Routes
app/api/projects.py - Auth Dependencies
app/api/deps.py - API Schemas
app/schemas/schemas.py
Tenant Services
- JWT Security
app/core/security.py - User Service
app/services/users.py - Organization Service
app/services/organizations.py - Invitation Service
app/services/invitations.py - Project Service
app/services/projects.py
Persistence
- Tenant Models
app/models/entities.py - DB Session
app/core/database.py - SQL Database
Other components
- User
Connections 29
- User → SPA Controller: uses dashboard
- SPA Controller → API Client: calls API methods
- SPA Controller → UI Helpers: renders with
- API Client → FastAPI App: sends HTTP requests
- FastAPI App → Authentication Routes: mounts routes
- FastAPI App → Organization Routes: mounts routes
- FastAPI App → Project Routes: mounts routes
- FastAPI App → DB Session: creates schema
- Authentication Routes → User Service: authenticates users
- Authentication Routes → Organization Service: creates first tenant
- Authentication Routes → JWT Security: issues JWT
- Authentication Routes → Auth Dependencies: resolves current user
- Organization Routes → Organization Service: manages tenants
- Organization Routes → Invitation Service: manages invitations
- Organization Routes → Auth Dependencies: checks membership and role
- Project Routes → Project Service: manages projects
- Project Routes → Auth Dependencies: checks membership and role
- Auth Dependencies → JWT Security: validates JWT
- Auth Dependencies → User Service: loads user
- Auth Dependencies → Organization Service: resolves membership
- Authentication Routes → API Schemas: validates and returns data
- Organization Routes → API Schemas: validates and returns data
- Project Routes → API Schemas: validates and returns data
- User Service → DB Session: queries and writes
- Organization Service → DB Session: queries and writes
- Invitation Service → DB Session: queries and writes
- Project Service → DB Session: queries and writes
- DB Session → Tenant Models: maps ORM models
- DB Session → SQL Database: reads and writes