A multi-tenant backup platform designed for Microsoft SQL Server, PostgreSQL, and file systems. A central control plane handles job scheduling, storage topologies, and fleet telemetry, while lightweight outward-connecting agents execute zero-relay payload transfers directly to target storage.
┌────────────────────────────────────────────────────────┐
│ Control Plane │
│ Web UI (React 19) ──► API & Scheduler (ASP.NET 10) │
│ │ │
│ PostgreSQL 18 │
└──────────────────────────────────▲─────────────────────┘
│ Outbound polling + lease renewals
┌──────────────────────────────────▼─────────────────────┐
│ Target Host / Infrastructure │
│ Backup Agent (Windows / Linux) ──► MSSQL / PG / Files │
└──────────────────────────────────┬─────────────────────┘
│ AgentDirect (Zero-relay transfer)
▼
Storage: Local Disk, Central, SFTP, SMB, S3, Google Drive
The agent connects strictly outbound—no incoming firewall ports required. It claims scheduled tasks via atomic leases, streams encrypted artifacts directly to storage targets, and posts verified checksums back to the backend.
Detailed guides and implementation notes live in the respective subdirectories:
| Subsystem | Stack | Primary Responsibilities | Guide |
|---|---|---|---|
| Backend | .NET 10, ASP.NET Core, EF Core, Quartz.NET | Multi-tenant Web API, scheduler, leases, telemetry, providers | backup-backend/README.md |
| Frontend | React 19, TypeScript, Tailwind 4, TanStack Query | Web dashboard, Passkey/WebAuthn auth, design system, i18n (TR/EN) | backup-frontend/README.md |
| Automation & Scripts | Bash, PowerShell, Docker Compose | Dev environment harnesses, E2E runner, agent package builders | scripts/README.md |
| Architecture & Domain | Markdown, ADR | Ubiquitous vocabulary, naming constraints, architectural decisions (tenant administrators, tenant vs platform-operations data contexts) | GLOSSARY.md, docs/adr/ |
| Agent Engineering Skills | Markdown | Issue tracker workflows, triage labels, and domain rules for AI tools | docs/agents/ |
- Databases: Native full backup for Microsoft SQL Server;
pg_dumpcustom format for PostgreSQL. Every artifact is verified against SHA-256 and read back before completion. - File Backups: Structured tree backups with inclusion/exclusion filters and symlink policies, committed against a SHA-256 manifest.
- Snapshots: Consistent file-level backups via OS snapshot integration—Windows VSS shadow copies, and Linux Btrfs, ZFS, or LVM thin snapshots.
- Automated Verification: End-to-end restore verification into temporary disposable databases with checksum and integrity assertions.
- Supported Providers: Local agent disk, platform-managed central storage, SFTP, SMB shares, S3-compatible object storage, and Google Drive.
- Zero-Relay Architecture: Payloads transfer directly between the agent and the target storage provider. The central API never relays bulk backup bytes.
- Transfer Resilience: Resumable transfer checkpoints, time-based bandwidth throttling schedules, and automatic exponential backoff for network stalls.
- Access Control: Strict separation between
PlatformAdmin(fleet management, storage configuration) andUserAdmin(tenant backup jobs and artifact ownership). - Authentication: Passkey / FIDO2 (WebAuthn) support, rate-limiting, and distributed failed-login lockouts.
- Envelope Encryption: Agent-side client encryption before bytes reach storage. Supports tenant-managed offline recovery keys.
- Audit & Sharing: Time-limited, revocable
BackupSharetickets for authorized downloads, with instant multi-node revocation and audit trails.
- Security Posture: Outward-only HTTPS/WSS communication; DPAPI credential isolation on Windows; systemd sandboxing with unprivileged service accounts on Linux.
- Fleet Updates: Cryptographically signed release manifests enabling atomic, in-place self-updates across agent hosts.
- Health & Telemetry: Periodic storage
CapacityProbeexecution, multi-metricBackupHealthStaterollups, and advisorySizeAnomalyWarningbaseline deviation tracking.
Launch the full platform (PostgreSQL, ASP.NET Core API, and React frontend) in containers:
# 1. Copy sample environment
cp .env.example .env
# 2. Set a unique POSTGRES_PASSWORD and BOOTSTRAP_ADMIN_PASSWORD in .env.
# Set PUBLIC_HOST to the host clients will use.
# 3. Create the first PlatformAdmin (once per database)
docker compose run --build --rm bootstrap
# 4. Start all services
docker compose up --buildOpen https://localhost:5173 on the Docker host, or https://<PUBLIC_HOST>:5173 from another machine (use FRONTEND_PORT if changed; it is the single port for the UI, API and agents). The frontend generates a self-signed certificate; trust it only after verifying it for your environment.
The bootstrap command reads BOOTSTRAP_ADMIN_LOGIN, BOOTSTRAP_ADMIN_PASSWORD, BOOTSTRAP_ADMIN_NAME, and BOOTSTRAP_ADMIN_EMAIL from .env. Use a unique password of at least 12 characters and protect .env; the example credentials are public. It refuses to run if a PlatformAdmin already exists and does not change existing credentials. The bootstrap service is not started by normal docker compose up.
Production uses docker-compose.prod.yml (see its header): POSTGRES_PASSWORD, PUBLIC_HOST, TLS_CERT_FILE and TLS_KEY_FILE are required, the environment is Production, PostgreSQL and the API are not published, and the TLS certificate is supplied from outside (nothing is generated). Everything, including agents (/api/agent/, /api/agent-dist/, /hubs/agent), the Google Drive OAuth callback (https://<PUBLIC_HOST>/api/platform/google-drive/oauth/callback, register it in the Google Cloud Console) and agent mTLS, is served by nginx on port 443. nginx requests an optional client certificate (ssl_verify_client optional_no_ca), deletes any client-supplied X-Client-Cert header on every request and rewrites it from the TLS handshake; the API accepts that header only from Authentication:TrustedProxies and validates the certificate against its own agent CA (AgentSecurity:Mtls).
For Traefik, docker-compose.traefik.yml terminates TLS at Traefik and publishes no container ports. Configure PUBLIC_HOST, DATA_DIR, POSTGRES_PASSWORD, TRAEFIK_IP, AGENT_MTLS_ISSUER_PASSWORD, DATA_PROTECTION_CERT_PASSWORD, the Google credentials and GOOGLE_REDIRECT_URI in a private environment file. Place the issuer PFX at $DATA_DIR/issuer.pfx and the data-protection certificate at $DATA_DIR/data-protection.pfx; the API container must be able to read both and write $DATA_DIR/dp-keys and $DATA_DIR/gdrive-staging. PostgreSQL must be able to traverse and write $DATA_DIR/postgres. Back up the certificates, passwords, database and data-protection keys together.
Traefik needs a backup-mtls TLS option using RequestClientCert and a stable address in TRAEFIK_IP. The router strips client-supplied certificate headers before passTLSClientCert generates the header from the handshake; do not remove or reorder those middlewares. Only that proxy address is trusted, and the API validates the forwarded certificate against its own issuer. Cloudflare or another TLS-terminating intermediary cannot forward the agent's TLS client certificate; agents must connect directly to Traefik.
This Compose stack (docker-compose.yml) is for local development only: port 5174 currently serves plaintext HTTP, not a redirect. Do not expose it or use it to sign in. The nginx proxy at 172.29.0.10 is trusted by the API on the dedicated Compose network; ensure the subnet does not overlap existing networks.
The API container applies EF Core migrations before it starts (up to 30 attempts, 2 seconds apart). If they never succeed it exits with an error instead of serving against an unmigrated database, and the Compose restart policy retries it. The bootstrap service uses the same image and entrypoint, so it migrates before it creates the admin. Only the nginx address 172.29.0.10 (subnet 172.29.0.0/24) is listed in Authentication__TrustedProxies__0; the forwarded-header rules are in the backend README.
For native development (running .NET and Bun locally without containers) or launching the local E2E stack, consult
backup-backend/README.mdandscripts/README.md.
-
Navigate to Agents → Add Agent in the web UI and generate a single-use enrollment token.
-
Run the platform installer on the target host:
Windows (Elevated PowerShell):
& ([scriptblock]::Create((irm 'https://backup.example.com/api/agent-dist/install.ps1'))) -Interactive -Language en
Linux (Systemd, root):
curl -fsS https://backup.example.com/api/agent-dist/install-agent.sh -o install-agent.sh sudo bash install-agent.sh --server https://backup.example.com --token '<one-time-token>' --name "$(hostname)" --language en
Windows setup wizard (optional): when the platform administrator has published
backup-agent-win-x64-setup.exe(release assetbackup-agent-win-x64-setup-<version>.exe, copied under that fixed name into theAgentDistribution:PackagesDirectory), the Add computer dialog offers it under Other installation methods. The wizard asks only for the one-time key and the computer name and runs the sameinstall.ps1. If an agent is already installed (service,%ProgramFiles%\BackupAgentor%ProgramData%\BackupAgent), the wizard first asks, in its language, whether to remove it and reinstall (default No; nothing is changed on No). Silent runs (/VERYSILENT,/SUPPRESSMSGBOXES) never ask: they stop with a nonzero exit code and a/LOGentry unless/REPLACEEXISTING=1is passed, which removes the existing agent and its identity and enrolls again. The server address is appended by the backend when the file is downloaded, so the file must be downloaded from the backend. The wizard is not code-signed, so Windows SmartScreen warns. -
The agent registers its identity, reports discovered databases, and appears as Online on the dashboard.
For offline deployment and snapshot permission tuning, see scripts/README.md.
- Fast CI (
.github/workflows/ci.yml): runs on pull requests (non-draft for the integration job) and on pushes tomain, and is skipped when only*.mdordocs/files change. Jobs: backend (locked restore, release build with warnings as errors, unit, architecture and fast agent tests), integration (the wholetests/integration-testsproject against Testcontainers PostgreSQL, SQL Server and SFTP), E2E typecheck and lint, and frontend (install, typecheck, lint, test, build). - Dependency scan (
.github/workflows/security-scan.yml): weekly, on manual dispatch, and on pull requests that changebun.lock,package.json,Directory.Packages.propsor apackages.lock.json.bun audit --prodanddotnet list package --vulnerable --include-transitivefail the job on any finding; the audit of dev tools is reported but does not block. - Architecture tests enforce the layer dependency direction and, per ADR 0003, which files may use the unfiltered
PlatformOperationsDbContextor its companion helpers. This is a code-review guard, not PostgreSQL row-level security. - Nightly Playwright (
.github/workflows/playwright.yml): runs daily at 02:17 UTC and on manual dispatch, as four disposable Compose stacks: S1 (authentication), S2 (default settings), S2 sinks (MinIO, SFTP, mail, webhook) and S5 (artifact and real-byte flows). Fast CI also calls it onworkflow_dispatch. S3 and S4 need the lab VMs and are not part of it. Local commands are inscripts/README.md. - Manual only:
windows.yml(Windows validation) andrelease.yml(archive build, no publishing during pre-v1) run onworkflow_dispatch. - Reproducible builds: NuGet restores use committed
packages.lock.jsonfiles (--locked-modein CI and in the backendDockerfile), base images in the Dockerfiles are pinned by digest, and Dependabot proposes weekly updates for NuGet, Bun, GitHub Actions and Docker.
Dependabot opens the pull requests; we never merge them. The workflow:
- Review the Dependabot PR (what moves, release notes).
- Try it locally:
dotnet restore --locked-mode(regeneratepackages.lock.jsononly when a package really changed), build, then the targeted tests for the touched area. For Bun: install, typecheck, test. - If it is fine, apply the same change ourselves on our own branch, commit, and open our own PR using the repository PR template.
- Close the Dependabot PR with a short comment pointing to ours. Dependabot then stops tracking that update.
.NET is pinned to 10. .github/dependabot.yml ignores version-update:semver-major for the packages versioned with the .NET release (Microsoft.AspNetCore.*, Microsoft.EntityFrameworkCore.*, Microsoft.Extensions.*, System.Security.Cryptography.*, System.Formats.Cbor, Npgsql.EntityFrameworkCore.PostgreSQL, dotnet-ef) and for the dotnet/* Docker images in backup-backend. Minor and patch updates inside .NET 10 still arrive. Microsoft.NET.Test.Sdk and Microsoft.Data.SqlClient have their own version lines and are not pinned.
To move to a newer .NET deliberately: remove the two ignore blocks for /backup-backend in dependabot.yml, then upgrade by hand in one PR (Dockerfile tags and digests, TargetFramework, dotnet-version in .github/workflows/*.yml, the packages above, dotnet-tools.json, lock files). Dependabot only reads the file from the default branch, so the change takes effect after merge.
Detailed test execution instructions are documented in backup-backend/README.md and backup-frontend/README.md.