classDiagram
class User {
+UUID id
+String email
+String displayName
+writePost(title, body) Post
}
class Admin {
+banUser(User u) void
}
class Post {
+UUID id
+String title
+String body
+Date publishedAt
+publish() void
}
class Comment {
+UUID id
+String body
}
class Tag {
+String name
}
class PostRepository {
<<interface>>
+findBySlug(slug) Post
+save(Post p) void
}
User <|-- Admin
User "1" --> "*" Post : writes
Post *-- "*" Comment : has
Post "*" -- "*" Tag : tagged
PostRepository ..> PostAbout this template
A compact domain model you can adapt for any content platform. It shows inheritance (Admin extends User), composition (Post owns Comments), associations with cardinality and an interface implemented by a repository.
How to customise it
- Add a Category class
- Add methods for publishing workflows
- Split into namespaces for content and identity
This template is a Mermaid class diagram. See the class diagram page for the full syntax reference and more examples.
Frequently asked questions
How do I use this blog platform class diagram template?
Click "Use this template" to open it in the MermaidViewer editor. Edit the Mermaid code on the left and the diagram updates instantly. No account is needed.
Can I export the template as an image?
Yes. In the editor use Export to download PNG, SVG or PDF, or copy the image to your clipboard. You can also copy the code as a Markdown block for GitHub, GitLab or Notion.
Can AI customise this template for me?
Yes. Open the AI assistant (Ctrl/Cmd+K) and describe the change, for example "Add a Category class". The updated diagram streams into the editor.