Skip to the content.

Admin interfaces and data model

Interfaces and type aliases are shown as such, not runtime classes. Adapter factories return objects implementing the ports. publishedAt is nullable and lastModified optional. Posts/messages have no declared owner, attachment or mutual foreign key. AdminSession lives in browser state, not a server session table. CdnObjectSummary projects an object listing. SQL posts enforce unique slug and draft/published status; messages index created_at.

Legend: all drawn relationships are source-verified.

classDiagram
  class AdminSession {
    <<type>>
    string token
    AdminDatabase database
  }
  class AdminBlogApi {
    <<interface>>
    listAllPosts()
    getPostById(id)
    createBlogPostFromBody(body)
    updateBlogPostFromBody(id, body)
    deleteBlogPostById(id)
  }
  class BlogPostStore {
    <<interface>>
    listAll()
    listPublished()
    getById(id)
    getBySlug(slug)
    create(input)
    update(id, input)
    delete(id)
  }
  class MessageStore {
    <<interface>>
    list()
    create(input)
    delete(id)
  }
  class BlogPost {
    <<interface>>
    string id
    string slug
    string title
    string excerpt
    string body
    BlogPostStatus status
    string createdAt
    string updatedAt
    string publishedAt
  }
  class ContactMessage {
    <<interface>>
    string id
    string name
    string email
    string body
    string createdAt
  }
  class CdnObjectSummary {
    <<type>>
    string key
    number size
    string lastModified
  }
  class AdminDatabase {
    <<enumeration>>
    sqlite
    postgres
    dynamodb
  }
  class BlogPostStatus {
    <<enumeration>>
    draft
    published
  }
  AdminSession --> AdminDatabase : selection
  AdminBlogApi ..> BlogPostStore : host service closures
  AdminBlogApi ..> BlogPost : returns
  BlogPostStore ..> BlogPost : persists
  MessageStore ..> ContactMessage : persists
  BlogPost --> BlogPostStatus : status

Source evidence