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
- packages/web-layer-admin/app/utils/admin-session.ts:12 — export type AdminSession
- packages/web-layer-admin/server/utils/admin-blog-api.ts:17 — export interface AdminBlogApi
- packages/web-layer-admin/shared/blog-types.ts:7 — export interface BlogPost
- core/web/server/db/blog-types.ts:11 — export interface BlogPostStore
- core/web/server/db/types.ts:8 — export interface ContactMessage
- core/admin/server/utils/minio-client.ts:18 — export type CdnObjectSummary
- core/web/server/db/migrations/002_posts.sql:4 — CREATE TABLE
- core/web/server/db/migrations/001_messages.sql:4 — CREATE TABLE