How 0xfurai/peekaping works
1. This is a multi-app monorepo, not a single service.
The core product is the Go backend in apps/server, the React/TypeScript admin UI in apps/web, plus separate marketing/docs sites (apps/landing, apps/docs). Architecture diagrams should treat these as distinct deployable frontends/backends rather than one web app.
2. The backend is a modular monolith split into multiple runtime binaries.
apps/server/cmd contains separate processes for api, producer, worker, ingester, and migrate (bun). These are the primary operational boundaries: one HTTP/API process, one scheduling process, one execution process, one ingestion process, and one migration job.
3. The api process is the system’s control plane.
It serves the REST API, auth/session endpoints, webhooks, status-page endpoints, badges, websocket updates, and the admin surface used by the UI. Most internal/modules/* packages expose controller/route/service layers here.
4. producer is the scheduler and coordination layer.
It is responsible for deciding when checks should run, with leader-election support so only one scheduler is active in a clustered setup. It emits work onto the shared queue/event infrastructure rather than executing checks itself.
5. worker is the execution layer for health checks.
The healthcheck/executor package contains protocol-specific executors for HTTP, TCP, ping, DNS, gRPC, Docker, databases, MQTT, RabbitMQ, Kafka producer, SNMP, Redis, etc. The worker consumes queued jobs, runs the appropriate executor, and persists results/state.
6. ingester handles externally received monitoring results.
This is a separate entry point and module boundary for ingesting push-style or remote-origin health data. It complements the worker path by accepting results from outside the local execution flow.
7. Data storage is abstracted behind repository interfaces with multiple backends.
Many domain modules have both *.sql.repository.go and *.mongo.repository.go, with shared interfaces in *.repository.go. The repo supports SQLite / PostgreSQL / MongoDB using backend-specific wiring in internal/infra/sql.go and internal/infra/mongo.go.
8. Redis is used for coordination/eventing rather than primary persistence.
internal/infra/redis_event_bus.go and internal/infra/queue.go indicate Redis-backed messaging/queue semantics between the API, producer, worker, and related listeners. This is the main asynchronous boundary in the system.
9. Domain modules map closely to product features.
The largest modules are monitor, notification_channel, status_page, maintenance, tag, proxy, heartbeat, stats, badge, api_key, auth, bruteforce, monitor_notification, monitor_status_page, monitor_tag, and monitor_tls_info. These should appear as business-domain subsystems around the core monitoring pipeline.
10. Notifications are adapter-based and highly extensible.
notification_channel/providers contains many provider implementations such as Slack, Telegram, Discord, WhatsApp, PagerDuty, Opsgenie, SMTP/SendGrid, Webhook, NTFY, Gotify, and others. A registry/sender layer routes alerts to the correct provider, making notifications a pluggable integration boundary.
11. The UI is a generated-client consumer of the API, with realtime updates.
apps/web uses a generated OpenAPI client (src/api/*), React Query, and websocket context. Its route structure is split into public auth pages, protected CRUD pages for monitors/channels/status pages/settings, and public status pages for end users.
12. There are separate public-facing presentation surfaces.
apps/landing is the marketing site, while apps/docs is Docusaurus documentation. apps/web/src/app/status/[slug] is the public status-page view generated from backend state and custom domains.
13. Security is built into the API boundary.
The backend includes JWT/auth middleware, MFA/2FA, API key management, and brute-force protection. These are not separate services; they are cross-cutting controls around the API and privileged admin flows.
14. Deployment is designed for multiple topologies.
The repo includes Dockerfiles for bundled single-container modes (Dockerfile.bundle.*), separate service images under apps/server/infra, Docker Compose files for dev/prod and each database, plus Helm charts in charts/ for Kubernetes-style deployment. The backend is therefore intended to run either as an all-in-one bundle or as split services.
15. Testing and fixtures are part of the architecture story.
e2e/ covers auth and monitor CRUD from the UI side, and test_utils/ contains protocol-specific harnesses for Kafka, MQTT, MSSQL, RabbitMQ, and Redis. apps/fake-server provides mock gRPC/MTLS endpoints for exercising healthcheck executors.
Main entry points: api API · server.go Server Core · monitor Monitor Domain · charts Deployments
Components 21
Backend
Go server, runtime binaries, and core domain modules
- API · HTTP control plane for auth, admin CRUD, status pages, badges, websockets, and public endpoints
apps/server/cmd/api - Producer · Scheduler and coordination process with leader election that enqueues check work
apps/server/cmd/producer - Worker · Queued execution process that runs health check executors and persists outcomes
apps/server/cmd/worker - Ingester · Separate entrypoint for accepting externally pushed monitoring results
apps/server/cmd/ingester - Migrate · Schema migration job for database bootstrap and upgrades
apps/server/cmd/bun - Server Core · Shared runtime wiring, config, logging, and module composition for server processes
apps/server/internal/server.go - Infra · SQL, Mongo, Redis event bus, queue, and event helper wiring
apps/server/internal/infra - Monitor Domain · Monitor CRUD, lifecycle state, listeners, and protocol validations
apps/server/internal/modules/monitor - Notifications · Notification channels, provider registry, sender, and alert listeners
apps/server/internal/modules/notification_channel - Status Pages · Public status page management, domains, and monitor-to-page mapping
apps/server/internal/modules/status_page - Security · Auth, JWT, API keys, brute-force protection, and privileged middleware
apps/server/internal/modules/auth - Operations · Maintenance windows, tags, proxies, heartbeat, stats, badges, and TLS info
apps/server/internal/modules/maintenance - Health Checks · Tick handling, push ingestion path, listeners, and protocol-specific executors
apps/server/internal/modules/healthcheck - Queue · Shared queue abstraction used to move scheduled checks into execution
apps/server/internal/modules/queue
Frontends
Admin UI plus public marketing and docs sites
Ops
Deployment manifests, bundles, and runtime topology
- Deployments · Docker bundle modes, compose files, Helm charts, and service images for split or bundled topologies
charts
Testing
End-to-end and protocol fixture assets
- Fake Server · Mock gRPC and mTLS endpoints used to exercise executors
apps/fake-server - E2E · End-to-end browser tests covering auth and monitor CRUD flows
e2e - Protocol Fixtures · Kafka, MQTT, MSSQL, RabbitMQ, and Redis integration fixtures and scripts
test_utils
Connections 37
- API → Server Core: boots · API process is assembled by shared server bootstrap
- Producer → Server Core: boots · Producer process uses the same shared runtime wiring
- Worker → Server Core: boots · Worker process uses the same shared runtime wiring
- Ingester → Server Core: boots · Ingester process uses the same shared runtime wiring
- Migrate → Server Core: boots · Migration job is launched through shared server tooling
- Server Core → Infra: wires · Shared runtime composes storage, queue, and event adapters
- Server Core → Security: includes · API boundary is wrapped by auth and anti-abuse controls
- API → Monitor Domain: serves · Control plane exposes monitor CRUD and lifecycle endpoints
- API → Notifications: serves · Admin surface manages notification channels and dispatch rules
- API → Status Pages: serves · API manages public status pages and custom domains
- API → Operations: serves · API exposes maintenance, tags, proxies, heartbeat, stats, and badges
- API → Queue: publishes · API and listeners can enqueue asynchronous work
- Producer → Monitor Domain: schedules · Scheduler evaluates monitors and decides when checks should run
- Producer → Queue: enqueues · Scheduler emits work onto the shared queue
- Producer → Infra: coordinates · Leader election and event bus integration are handled through infra
- Worker → Health Checks: executes · Worker runs protocol executors for each queued check
- Worker → Queue: consumes · Worker pulls jobs from the shared queue
- Worker → Monitor Domain: updates · Execution results are persisted back into monitor state
- Ingester → Health Checks: ingests · Push-style monitoring results enter through the ingester boundary
- Ingester → Monitor Domain: updates · Externally received results update monitor state and history
- Health Checks → Notifications: alerts · Failures and state changes flow into alerting and provider delivery
- Notifications → Infra: uses · Notification events rely on shared persistence and event infrastructure
- Monitor Domain → Infra: stores · Monitor data is backed by SQL or Mongo repositories
- Status Pages → Monitor Domain: reflects · Status pages are built from monitor and availability state
- Admin UI → API: consumes · Admin UI uses generated OpenAPI client against the backend API
- Admin UI → Status Pages: views · Public status pages are rendered from backend state
- Admin UI → Security: authenticates · Login, MFA, and API key flows are driven by backend security features
- Landing → API: markets · Marketing site points users toward the product and backend service
- Docs → API: documents · Docs describe backend processes, deployment, and feature boundaries
- Deployments → API: deploys · Charts and bundle images package the API runtime
- Deployments → Producer: deploys · Charts and bundle images package the scheduler runtime
- Deployments → Worker: deploys · Charts and bundle images package the execution runtime
- Deployments → Ingester: deploys · Charts and bundle images package the ingestion runtime
- Deployments → Migrate: deploys · Deployment manifests include migration job execution
- E2E → Admin UI: tests · Browser tests exercise the admin UI flows
- Protocol Fixtures → Health Checks: exercises · Protocol fixtures validate executor behavior across integrations
- Fake Server → Health Checks: mocks · Mock endpoints provide test targets for gRPC and mTLS checks