Templates / erDiagram
RBAC permissions data model
A role-based access control schema linking users to roles and roles to permissions.
Preview
Mermaid 11 renderer
Rendering preview...
Mermaid source
erDiagram
erDiagram
USER ||--o{ USER_ROLE : has
ROLE ||--o{ USER_ROLE : "assigned to"
ROLE ||--o{ ROLE_PERMISSION : grants
PERMISSION ||--o{ ROLE_PERMISSION : "granted by"
USER {
int id PK
string email
}
ROLE {
int id PK
string name
}
PERMISSION {
int id PK
string action
string resource
}
USER_ROLE {
int user_id FK
int role_id FK
}
ROLE_PERMISSION {
int role_id FK
int permission_id FK
}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.