PlatformDatabase
OS Shell Backend Model
This is a documentation-only backend model sketch. It does not create database
Status
This is a documentation-only backend model sketch. It does not create database tables, migrations, API routes, auth, marketplace, billing, or agent runtime.
Minimal Model
The first OS backend should focus on identity, spaces, installed surfaces, desktop restore, and one real business loop.
Suggested model order:
User
Organization
Membership
Space
Desktop
Surface
InstalledSurface
Folder
WindowSession
WindowInstance
UserPreferenceSurface Sketch
type Surface = {
id: string
surfaceType: 'app' | 'hub' | 'collection' | 'folder' | 'space' | 'module' | 'external' | 'system'
ownerType: 'user' | 'organization' | 'system'
ownerId: string
slug: string
title: string
description?: string
runtimeRoute?: string
creatorPath?: string
storePath?: string
icon?: string
tags: string[]
status: 'concept' | 'incubating' | 'alpha' | 'stable'
}Desktop And Window Session Sketch
type Desktop = {
id: string
spaceId: string
ownerId: string
slug: string
title: string
isDefault: boolean
dockPins: string[]
folderIds: string[]
}
type WindowSession = {
id: string
userId: string
desktopId: string
restorePolicy: 'auto' | 'manual' | 'ask'
windows: WindowInstance[]
updatedAt: string
}
type WindowInstance = {
id: string
surfaceId: string
runtimeRoute: string
internalPath?: string
title?: string
x: number
y: number
width: number
height: number
zIndex: number
state: 'normal' | 'minimized' | 'maximized'
}Storage Boundaries
- Desktop layout stores organization.
- WindowSession stores UI memory.
- App data stores business records.
- App data must not be embedded into WindowSession records.
- Runtime routes are launch metadata, not resource identity.
Recommended Backend Order
- Auth, login, and session baseline.
- User, Organization, and Membership.
- Space, Desktop, Surface, and InstalledSurface.
- WindowSession persistence.
- First real business loop: visitor, waitlist, activation code, and feedback.
- Moments and personal data import as the second vertical.
- Payment and entitlement only after legal, tax, and payment readiness.
- Marketplace, hub subscription, and revenue split later.
- Agent runtime later.
Do not build the hub marketplace backend before OS shell persistence and the first real business loop.