# Architecture

> How Sypnia App is built: its parts, where Rust runs, and how they connect.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://app.docs.sypnia.com/architecture/

For agents: App architecture: web interface (TypeScript, React, @sypnia/ui; static files) shared by the phone (installable web app, service worker for Web Push) and the desktop app (Tauri 2, Rust shell: local folders, terminal stream, editor button, OS notifications, signed updates); App server (Rust, axum): API, sessions and messages, streaming relay to Sypnia Agent (SSE), board reader (reads each product's API with the person's token, 60 s cache), notifications (Web Push, desktop, e-mail through Sypnia Mail or SMTP), uploads to Sypnia Files, MCP; Postgres (sypnia_app schema); identity in Sypnia Data; credits ledger and PayPal top-ups (Sypnia Cloud only, not open source). App keeps no product data: it reads it.

**Figure**: Sypnia App: one interface on the web, the phone and the desktop, the App server in the middle, and every product behind it.

1. You use the web, the phone or the desktop app: one interface.
2. The App server keeps your sessions and streams the agent's answers.
3. Sypnia Agent does the work, within its budget and rules.
4. Every product is reached through its own API and MCP server, with your session.

The web interface, shared by the phone and the desktop app, calls the App server's API. The server keeps sessions, messages, notifications and the credits ledger in Postgres, relays each message to Sypnia Agent and streams the answer back, and reads the products' APIs for the board. Sign-in goes through Sypnia Data. In Sypnia Cloud, the credits ledger takes top-ups from PayPal.

| Part                          | What it does                                                                                            | Language                         | Open source           |
| ----------------------------- | ------------------------------------------------------------------------------------------------------- | -------------------------------- | --------------------- |
| **Web interface**             | the chat, the side panel, the board, the account; also the phone's installable web app                  | TypeScript (React, `@sypnia/ui`) | yes, MIT              |
| **Desktop app**               | a Tauri window around the same interface, plus folders, terminal, editor button, notifications, updates | Rust (Tauri 2)                   | yes, MIT              |
| **App server**                | the API, sessions, the stream to the agent, the board reader, notifications, uploads, MCP               | Rust (axum)                      | yes, AGPL-3.0         |
| **`@sypnia/app`**             | the SDK and the `app` command                                                                           | TypeScript                       | yes, MIT              |
| **Credits ledger and PayPal** | balances, held credits, top-ups, limits                                                                 | Rust                             | no: Sypnia Cloud only |

## App keeps no product data

App stores what is its own: sessions, messages, attachments' links, notifications, and in Sypnia Cloud the ledger. The map, the code, the rows, the deploys and the problems stay in their products, and App reads them with your session each time. That is why the chat cannot do more than you can.

- [Request paths](/architecture/request-paths/): A message in the chat, an approval, the board and a top-up, step by step.
- [Data model](/architecture/data-model/): What the App server keeps, and what it only reads.
- [On AWS](/architecture/reference-implementation-aws/): How Sypnia Cloud runs App on AWS, part by part.
- [Failures and scaling](/architecture/failures-and-scaling/): What happens when the agent, a product, PayPal or a notification fails, and how App grows.
- [Codebase](/architecture/codebase/): Where each part of App lives in its repository.
