Templates / erDiagram
SaaS multi-tenant data model
Organizations, users, subscriptions, plans, and projects — the backbone schema of a B2B SaaS.
Preview
Mermaid 11 renderer
Rendering preview...
Mermaid source
erDiagram
erDiagram
ORGANIZATION ||--o{ USER : employs
ORGANIZATION ||--o{ SUBSCRIPTION : has
PLAN ||--o{ SUBSCRIPTION : "priced by"
ORGANIZATION ||--o{ PROJECT : owns
USER }o--o{ PROJECT : "member of"
ORGANIZATION {
int id PK
string name
string billing_email
}
USER {
int id PK
int org_id FK
string email
string role
}
SUBSCRIPTION {
int id PK
int org_id FK
int plan_id FK
string status
date renews_at
}
PLAN {
int id PK
string name
decimal monthly_price
}
PROJECT {
int id PK
int org_id FK
string name
}More templates
flowchartArchitecture
Microservices architecture
A service map with an API gateway, core services, and shared infrastructure. A solid starting point for README architecture sections.
sequenceDiagramProcess
User login sequence
A login flow with token issuance and a failure branch. Useful for documenting auth endpoints and session behavior.
stateDiagram-v2Process
Order state machine
Lifecycle states for an e-commerce order, from creation to fulfillment, with cancellation and refund paths.