Content Modeling
Entity Hierarchy
Every piece of content in Brease follows a strict ownership and scoping chain. Understanding this hierarchy is key to working with the CMS and the brease-next package.
The Hierarchy
Team
└── Site
└── Environment (e.g., main, staging)
├── Pages
│ └── Page Sections (ordered content blocks)
├── Sections (schema definitions)
├── Collections
│ └── Entries (individual records)
├── Templates (ordered bundles of sections)
├── Page Types (template + reference fields)
├── Navigations
│ └── Navigation Items (nested tree)
├── Redirects
├── Media (files + variants)
└── Locales (language/region codes)
Ownership Chain
Teams own Sites. A team is the top-level organizational unit. All billing, membership, and permissions are managed at the team level. A team can own multiple sites.
Sites have Environments. Each site has at least one environment. Environments let you maintain separate content contexts — for example, a main environment for production and a staging environment for preview.
Environments scope content. Everything below the environment level — pages, sections, collections, navigations, redirects, media, and locales — is environment-scoped. The same section can exist in both main and staging with completely different content.
Environment Scoping
This is the most important architectural concept: all content is scoped to an environment.
- A page in
mainand a page instagingwith the same slug are independent entities - Sections defined in
maindo not exist instagingunless explicitly created there - Collection entries, navigations, and redirects are all per-environment
- Media files are shared at the site level but their usage in content is per-environment
Default Environment and Default Page
Each site has a default environment — typically main. This is the environment used for production deployments.
Each environment has a default page — the page served at the root URL (/). This is usually your homepage.
API Access
The brease-next package identifies which environment to fetch from using two values:
| Variable | Purpose |
|---|---|
BREASE_ENV | The environment UUID — scopes all API requests to this environment |
BREASE_TOKEN | The API token — authenticates requests to the public API |
These are set as environment variables in your Next.js project:
BREASE_ENV=your_environment_uuid
BREASE_TOKEN=your_api_token
Every fetch function in brease-next — fetchPage(), fetchCollectionById(), fetchNavigation(), etc. — automatically uses these values. You never need to pass the environment or token manually.
On the frontend
In brease-next, you configure BREASE_ENV with your environment UUID and BREASE_TOKEN with your API token. All fetch functions are automatically scoped to that environment. To switch between environments (e.g., staging vs production), change the environment variables in your .env.local or deployment configuration.