# Architecture

> How Sypnia Design is built: its parts, where they run, and why your repository holds the truth.

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

For agents: Design architecture: @sypnia/design (TypeScript: CLI, token builder, generator, checker with TS/CSS parsers, local gallery, local renderer with Chromium) and @sypnia/base (React, React Aria) run in the customer's repo; the Design engine (TypeScript, AGPL-3.0: API, MCP, proposals, Git writer, renderer and PDF exporter on headless Chromium, asset sanitizer) keeps proposals, renders, assets metadata and check results in Postgres (sypnia_design) and files in S3-compatible storage; writes approved changes as pull requests to Sypnia Git or GitHub; AI proposals through Sypnia AI (or any OpenAI-compatible endpoint); identities from Sypnia Data. The repository is the source of truth; the engine holds no second copy of the guide.

**Figure**: Sypnia Design: the tools in your repository, the engine with its renderer, and where state lives.

1. You, App or an agent change the guide or ask for a screen, through the console, the CLI or MCP.
2. The engine opens a proposal, asks Sypnia AI for options when needed, and renders before-and-after pictures.
3. A person approves; the engine writes the change to your repository as a pull request.
4. In your repository, `@sypnia/design` builds tokens, generates pieces and runs `design check`.

| Part                 | What it does                                                                                                | Language           | Open source   |
| -------------------- | ----------------------------------------------------------------------------------------------------------- | ------------------ | ------------- |
| **`@sypnia/design`** | CLI, token builder, component generator, `design check`, local gallery, local renders and PDF               | TypeScript         | yes, MIT      |
| **`@sypnia/base`**   | the unstyled accessible pieces, on React Aria                                                               | TypeScript (React) | yes, MIT      |
| **Design engine**    | API, MCP, proposals, the Git writer, the renderer and PDF exporter (headless Chromium), the asset sanitizer | TypeScript         | yes, AGPL-3.0 |
| **Design skills**    | the instructions agents follow                                                                              | Markdown           | yes, MIT      |
| **Console**          | `design.app.sypnia.com` and the Design panel of App                                                         | TypeScript (React) | no            |

## Why your repository holds the truth

Your guide, your pieces and your screens are part of your app, so they live with its code and change with it in the same pull requests. The engine keeps only what does not belong in a repository: proposals under review, rendered pictures, uploaded originals and check results. If the engine disappeared, your app would keep its whole design.

## Why TypeScript

Everything Design reads and writes is web code (React, CSS, SVG) and every render is a web page, so the generator, the checker and the renderer use the same parsers and the same browser your app does.

- [Request paths](/architecture/request-paths/): A proposal, a render and a check, step by step.
- [Data model](/architecture/data-model/): The sypnia_design schema, and the files that live in your repository instead.
- [Reference implementation on AWS](/architecture/reference-implementation-aws/): Every AWS service Design uses in Sypnia Cloud, and how.
- [Failures and scaling](/architecture/failures-and-scaling/): What happens when a render, the model, Git or the database fails, and how Design grows.
- [Codebase](/architecture/codebase/): How the open-source repository is organized.
