> ## Documentation Index
> Fetch the complete documentation index at: https://help.getatelier.design/llms.txt
> Use this file to discover all available pages before exploring further.

# Data model

> The key entities in Atelier and how they relate.

`Studio` is the top-level tenant. Everything else hangs off it.

```
Studio
├── StudioMember (User ↔ Studio, with MemberRole)
├── Client
│   └── Project
│       ├── Phase
│       ├── Task
│       ├── Pinboard
│       └── Schedule
└── Product library (studio-scoped)
```

## Entities

* **Studio** — the tenant boundary. All data is scoped to a studio.
* **StudioMember** — links a `User` to a `Studio` with a `MemberRole`
  (`OWNER | ADMIN | MEMBER`).
* **Client → Project** — a studio's clients and the projects under them.
* **Phase / Task / Pinboard / Schedule** — belong to a project.
* **Product** — lives in a studio-scoped library and can be pinned to pinboards
  or added to schedules.

<Note>
  When changing `apps/server/prisma/schema.prisma`, always create a corresponding
  migration file with `prisma migrate dev --name <description>`. Never use
  `prisma db push` against production — Railway only applies changes via
  `prisma migrate deploy`, so a missing migration causes runtime errors.
</Note>
