5. Incremental roadmap
Each phase is a GitHub epic; each line below is an issue (a sub-issue of the epic). Every phase ends with something usable and tested. The UI design comes from Claude Design during Phase 4; earlier phases only ship a functional shell.
Status: Phases 1 to 4 are done and shipped as v0.1.0. Phase 5 (epic #122) targets v0.2. Ideas not planned in a phase wait in the backlog epic #123 until a phase picks them up.
Phase 1: Core DB and ingestion (done, v0.1.0)
Section titled “Phase 1: Core DB and ingestion (done, v0.1.0)”Goal: a single Docker container that accepts POST /v1/emails, stores it, and lets a test
read it back with GET /capture/messages.
- Monorepo scaffold: pnpm workspaces, TypeScript strict, Biome, Vitest, CI, Dependabot.
- Spike: TanStack Start runtime boot (custom server entry starting SMTP + workers in dev and in the Nitro build, clean shutdown) (D3).
- Lingui setup: FR + EN catalogs, locale detection, CI check, translation guide (D17-D19).
@mailsink/db: schema (doc 02), migrations,node-postgres+ PGlite drivers, test harness running every DB test on both drivers.@mailsink/contracts: primitives, admin, native, capture schemas.- Admin API: create/list/get/delete persistent workspaces, connection keys (
msk_,mskw_), env snippets. - Native ingestion:
/v1/emails,/v1/emails/batch,NormalizedEmail, EML composition, link extraction, blob store,Idempotency-Key. - Capture API v1: list/filter/detail/raw/attachments/purge.
- Jobs queue + simulation baseline (
delivered100 %, status events). - Retention scheduler (duration +
maxMessages, orphan blobs). - Docker multi-stage image +
docker-compose.yml(Postgres and PGlite profiles).
Phase 2: Ephemeral workspaces and overrides (done, v0.1.0)
Section titled “Phase 2: Ephemeral workspaces and overrides (done, v0.1.0)”Goal: parallel CI workers each get an isolated, self-destroying workspace with chaos knobs.
- Ephemeral workspaces:
ephemeral,idleTtlSeconds,includeEphemeralfilter. - Activity tracking (throttled touch on every surface) + ephemeral GC scheduler.
- Settings resolver (4 layers) and simulation engine: weighted rates, deterministic recipient rules, latency, deferred re-queue.
- Override API:
GET/POST /capture/override,/reset, optional TTL, history. - Suppression list: auto-add on
hard_bounce/complained,suppressedat ingestion, list/reset API. - Rate limiting: token bucket, workspace/connection/override layers, headers,
429. - Chaos: request-level error rate (HTTP codes).
- Event bus +
GET /capture/stream(SSE,Last-Event-ID) +wait=truelong-poll. - E2E recipe docs: Playwright fixture creating one workspace per worker.
Phase 3: Provider dialects and webhooks (done, v0.1.0)
Section titled “Phase 3: Provider dialects and webhooks (done, v0.1.0)”Goal: point the official Resend, Brevo and Nodemailer clients at Mailsink with only a base URL / host change.
- Resend dialect:
POST /emails,/emails/batch,GET /emails/:id, error shapes,ratelimit-*headers; contract tests with the officialresendSDK. - Brevo dialect:
POST /v3/smtp/email,messageVersions, templates +{{ params.x }}rendering, error shapes; contract tests with@getbrevo/brevo. - Brevo templates management (Admin API + seed).
- SMTP server:
smtp-server+mailparser, AUTH PLAIN/LOGIN, STARTTLS option, size cap, SMTP chaos and rate limit codes, transcripts; contract tests withnodemailer. - Webhook endpoints CRUD: workspace or connection scope,
payloadFormatdefaulted from the connection kind, canonical events mapped both ways per format, preview endpoint. - Webhook dispatcher:
WebhookFormatterstrategy (unified, Resend, Brevo), decoupled from the ingestion channel; X-Mailsink HMAC, Svix and Brevo auth headers; exact body stored once; backoff retries; attempts journal with exact headers; replay (exact/resign). - Manual events:
POST /capture/messages/:id/events(opened, clicked + url, forced simulated status), auto open/click rates; webhook test send. - Request logging:
api_logs(redaction, truncation),smtp_sessions, log query API.
Phase 4: Web UI and MCP (done, v0.1.0)
Section titled “Phase 4: Web UI and MCP (done, v0.1.0)”Goal: staging teams inspect everything in the browser; AI agents drive tests through MCP.
- Integration of the Claude Design delivery
docs/design/brand-1into@mailsink/ui(tokens, fonts, theme, logos; shadcn/ui on Base UI); brief 2 for the login screen and the language switcher. - App shell: admin-key login /
MAILSINK_UI_AUTH=none, workspace picker with ephemeral toggle, locale switcher, direct/w/$workspaceSlugaccess. - Workspace and connection management (TanStack Form, kind-conditional fields,
credentials shown once, rotation,
.envsnippets). - Inbox: SSE -> Query cache, TanStack Virtual list, URL-persisted filters.
- Message viewer: sandboxed HTML preview (desktop/mobile), text, MIME source, headers, attachments, links with click simulation, status/webhook timeline.
- Logs: DataTables (API / SMTP / webhooks), faceted filters, server pagination,
inspector
Sheet(webhooks:payloadFormat, exact signature headers, exact body), webhook replay (optimistic,exact/resign). - Override panel (rates sum <= 100, latency bounds, reset) and suppression list UI.
- Settings: defaults, retention, rate limits, webhooks (scope prefills
payloadFormat, event labels follow the format, live payload and headers preview). - MCP server: tools (
list_emails,get_email,wait_for_email,trigger_email_event,set_override_config,reset_override_config,purge_emails,get_delivery_logs), Streamable HTTP at/mcp, stdio proxy CLI. - Release: README, docs site pages, image publication (GHCR), v0.1.0.
Phase 5: SDK, test helpers, CLI and OpenAPI (v0.2)
Section titled “Phase 5: SDK, test helpers, CLI and OpenAPI (v0.2)”Goal: tests and CI pipelines drive Mailsink without hand-written HTTP calls (epic #122).
Packages are published on npm under the @devitek scope, live in this monorepo and carry
the server version (D226). The OpenAPI specification and the SDK come first (in
parallel); the helpers, the CLI and the npm publication build on the SDK.
- OpenAPI 3.1 specification generated from the Zod contracts, served by the instance and attached to each release (#124).
- TypeScript SDK
@devitek/mailsink(packages/sdk): Admin and Capture clients,waitFor, overrides, no server dependency, Node and browser (#125). - Playwright helpers
@devitek/mailsink-playwright: one ephemeral workspace per worker,expectEmail, link and OTP extraction, overrides (#126). - Vitest and Jest helpers: ephemeral workspace setup and
expect.extendmatchers for integration tests outside the browser (#127). - CLI commands for CI (
workspace create / delete,wait,override,purge) on the SDK (#50). - npm publication of the
@devitekpackages on each release, with provenance (#128).
Cross-cutting rules
Section titled “Cross-cutting rules”- Every DB-dependent test runs on Postgres and PGlite.
- Every dialect has contract tests driven by the official SDK.
- No UI string outside Lingui; FR and EN catalogs complete in CI.