Architecture
Technical overview of Pact's architecture and design
Architecture
Pact consists of three main components that work together.
Overview
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ CLI (Go) │────▶│ GitHub │◀────│ Web App │
│ │ │ (my-pact) │ │ (SvelteKit) │
└─────────────┘ └─────────────┘ └─────────────┘
│ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ OS Keychain│ │ Browser │
│ (secrets) │ │ localStorage│
└─────────────┘ └─────────────┘Components
CLI (Go)
The command-line interface for syncing and managing configurations.
Tech Stack:
| Package | Purpose |
|---|---|
spf13/cobra | Command-line parsing |
charmbracelet/bubbletea | TUI framework |
charmbracelet/lipgloss | TUI styling |
go-git/go-git/v5 | Git operations |
zalando/go-keyring | OS keychain access |
Web App (SvelteKit)
Browser-based editor and dashboard.
Tech Stack:
| Technology | Purpose |
|---|---|
| SvelteKit | Framework |
| Tailwind CSS | Styling |
| CodeMirror 6 | Code editor |
| Lucide Svelte | Icons |
GitHub Repository
Your my-pact repo is the database — no separate backend needed.
Design Principles
- GitHub is the database: No separate backend, your repo is the source of truth
- Edit anywhere: Local editor or web UI, your choice
- Cross-OS by default: Darwin, Windows, Linux configs coexist
- Secrets stay local: API keys in OS keychain, never in repo
- Files not strings: Configs as files, not inline JSON
- Local-first:
.pact/folder lives in your project directory