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

# Architecture

> Architecture guidance for Replied contributors and AI agents.

This docs repo contains Mintlify docs and a limited `docs/codebase-map.json`. The full application source was not present during this docs update.

## Known product architecture

```mermaid theme={null}
flowchart LR
  Website[Website form or widget] --> API[Submit API]
  API --> Dashboard[Replied dashboard]
  Dashboard --> Team[Team workflow]
  Dashboard --> Email[Email provider]
  Dashboard --> Aria[Aria]
```

## Contributor rules

* Read `docs/codebase-map.json` before editing.
* Inspect existing app patterns before adding routes or actions.
* Preserve Supabase auth and RLS.
* Preserve `org_id` scoping.
* Keep dashboard, company admin, and superadmin code separate.
* Preserve API response contracts.

## Dangerous areas

| Area            | Risk                                         |
| --------------- | -------------------------------------------- |
| Auth            | Access leaks across workspaces.              |
| RLS             | Data leaks across `org_id`.                  |
| API contracts   | Website integrations break.                  |
| Email providers | Replies fail or send from the wrong mailbox. |
| Aria actions    | Drafts or analysis use wrong context.        |
