# DevOS v1 Domain Model ## 1. Resource ```typescript interface Resource { id: string type: ResourceType name: string workspaceId: string provider?: string status: ResourceStatus metadata: Record createdAt: Date updatedAt: Date } ``` ## 2. Resource Types Initial model: - Server - Domain - Website - Repository - Database - Container - EmailAccount - Project - Task - Note - Document - Backup - Deployment - Monitor - Credential ## 3. Core Entities ### Workspace Tenant/security boundary for users and resources. ### Project Business/work boundary connecting repositories, websites, servers, databases, deployments, domains, email and monitoring. ### Server Managed compute target. Supports SSH connection and infrastructure discovery. ### Website Deployable application resource associated with domain, repository, deployment, server/container, database, SSL, environment, logs, monitoring and backup. ### Deployment A concrete execution of deploying a repository/version to a target. ### Credential Encrypted provider or infrastructure secret reference. Secret material is never exposed as ordinary resource metadata. ### Task Work item associated with a project and optionally related to resources and automations. ## 4. Relationships ```text Workspace ├── Projects ├── Resources ├── Users ├── Credentials └── Automations Project ├── Repository* ├── Website* ├── Server* ├── Database* ├── Deployment* ├── Domain* ├── Task* └── Monitoring* ``` ## 5. Actions Every mutable operation should be modeled as an auditable action: - server.exec - server.restart - server.installPackage - website.deploy - website.logs - domain.updateRecords - deployment.create - container.restart ## 6. Events Canonical event names should use `.` or `.`: - deployment.created - deployment.started - deployment.success - deployment.failed - server.online - server.offline - website.down - website.recovered - email.received - github.push - task.created - task.completed