# Codebase

> How the open-source repository is organized.

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

For agents: Run codebase: repo sypnia-run (in Sypnia Git, with a read-only mirror on GitHub): crates core, api (axum, /mcp), builder, deployer, edge (CloudFront Function + KVS format), aws (SigV4 clients), server (Lambda adapter, local server, CLI binary); images (build images, buildpacks); deploy (CloudFormation: engine, cell, app stack); spec (openapi.yaml, config JSON Schema); packages/run (@sypnia/run: CLI, the reader of the [run] table of sypnia.toml, framework adapters, API client).

The engine lives in one open-source repository, `sypnia-run`, in Sypnia Git with a read-only mirror on GitHub.

```text
sypnia-run/
├── crates/
│   ├── core/        config, project registry, auth context (Sypnia tokens, API keys, deploy tokens), errors, audit
│   ├── api/         the HTTP API (axum): apps, deploys, releases, env, domains, jobs, queues, logs, approvals, /mcp
│   ├── builder/     starts and watches builds (CodeBuild or local), log copying, cache keys
│   ├── deployer/    turns artifacts into AWS resources, releases at the edge, health checks, rollbacks
│   ├── edge/        the CloudFront Function and the KeyValueStore format
│   ├── aws/         small SigV4 clients for the AWS APIs it calls
│   └── server/      the binary: Lambda adapter, local HTTP server, the `sypnia-run` command
├── images/          the build images (Node, Python, Go) and the buildpacks
├── deploy/          CloudFormation templates: the engine, a cell, an app stack
├── spec/            openapi.yaml and the config file's JSON Schema
└── docs/            ARCHITECTURE.md
```

The TypeScript side is `@sypnia/run` in the same repository under `packages/run`: the CLI, the reader of the `[run]` table of `sypnia.toml`, the adapters (one folder per framework) and the API client. Adapters are tested by building real example apps of each framework in CI.
