Architecture
SMO1 follows a service-oriented architecture with dedicated services for each concern.Service Map
Figure 1 — SMO1 Service Map. The marketing landing page and dashboard both communicate with purr-api. Analytics flow to ClickHouse, while link data is persisted in Neon PostgreSQL and cached in Upstash Redis. The edge redirect service reads from Cloudflare KV, which is synchronised from purr-api.
Trace ID Requirement Rationale Test Case SMO1-ARCH-001Link redirects shall be served from Cloudflare edge locations with P99 latency below 50 ms Edge-based resolution eliminates origin round-trips for the highest-volume operation TC-SMO1-ARCH-001SMO1-ARCH-002Cloudflare KV shall be synchronised from purr-api within 5 seconds of a link create/update Ensures redirect freshness while decoupling read and write paths TC-SMO1-ARCH-002SMO1-ARCH-003Click events shall be recorded in ClickHouse for analytics with at-least-once delivery Accurate analytics require durable event capture, and ClickHouse handles high write throughput TC-SMO1-ARCH-003
Services
purr-api (Backend)
- Stack: Go 1.24, Gin, pgx, go-redis, zerolog
- Responsibilities: Link CRUD, user management, analytics, billing
- Deployed on: Railway
meow-web (Dashboard)
- Stack: Next.js 15, React 19, TypeScript, Tailwind CSS
- Responsibilities: User dashboard, link management, analytics views
- Deployed on: Vercel
whiskers-landing (Marketing)
- Stack: Next.js, React, TypeScript, Tailwind CSS
- Responsibilities: Marketing landing page, pricing, blog
- Deployed on: Vercel
zoomies-edge (Redirects)
- Stack: Cloudflare Workers, Hono, TypeScript
- Responsibilities: Ultra-fast link redirects at the edge
- Deployed on: Cloudflare Workers
litter-box (DevTools)
- Stack: Docker Compose, Prometheus, Grafana
- Responsibilities: Local dev environment, monitoring dashboards
catnip-packages (Shared)
- Stack: TypeScript, pnpm
- Responsibilities: Shared types, utilities, configurations
Data Flow
- User creates a short link via meow-web -> purr-api -> PostgreSQL
- Link data syncs to Cloudflare KV via purr-api’s KV sync service
- Visitor clicks short link -> zoomies-edge reads from KV -> instant redirect
- Click event sent to purr-api -> stored in ClickHouse for analytics
- User views analytics in meow-web -> fetched from purr-api -> ClickHouse