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

# System context

> People, external systems, and trust boundaries around the MUZE platform

MUZE operates within a bounded set of external systems. Understanding these boundaries is essential for maintenance and integration work.

## System context diagram

```mermaid theme={null}
graph TB
    subgraph People["People"]
        SM["Store Manager<br/>(logged in)"]
        HR["HR user<br/>(logged in)"]
        MA["Muze Admin<br/>(logged in)"]
        SA["Super Admin<br/>(logged in)"]
        EMP["Employee<br/>(no login)"]
    end

    subgraph MUZE["MUZE platform"]
        FE["React SPA<br/>(Firebase Hosting)"]
        BE["NestJS API<br/>(Render)"]
        DB["PostgreSQL<br/>(Neon)"]
    end

    subgraph External["External services"]
        R2["Cloudflare R2<br/>(file uploads)"]
        Email["Brevo / SMTP<br/>(email delivery)"]
    end

    SM & HR & MA & SA -->|"browser"| FE
    EMP -.->|"no access"| FE
    FE -->|"HTTPS"| BE
    BE -->|"Prisma Client"| DB
    BE -->|"S3 API"| R2
    BE -->|"SMTP/API"| Email
```

The full service map, including limits and known gaps for each integration, is in [External services](/system-architecture/external-services).

## Known integration gaps

These are documented as future work, not current integrations:

* No ERP integration (no SAP, Oracle, or inventory systems)
* No SMS gateway
* No payment processing (orders are internal and entitlement-based)
* No identity provider (no SSO or corporate-directory OAuth)
* No warehouse management or POS integration

## Trust boundaries

| Boundary           | Notes                                                                                                      |
| ------------------ | ---------------------------------------------------------------------------------------------------------- |
| Browser ↔ Backend  | HTTPS only. Session cookie is `SameSite=None; Secure` in production. CORS restricted to `FRONTEND_ORIGIN`. |
| Backend ↔ Database | Prisma connects to Neon over TLS. Connection string in `DATABASE_URL`. No IP allowlist configured.         |
| Backend ↔ R2       | Standard S3 API with access key/secret. Credentials in `R2_*` environment variables.                       |
| Backend ↔ Email    | Brevo API key or SMTP credentials. No email content is logged.                                             |
| Session storage    | Sessions stored in PostgreSQL via better-auth. No Redis.                                                   |
