- SDK that apps drop in to catch errors and send them to us.
- API that receives those errors and stores them.
- Dashboard where developers search and see the errors.
- Email alerts when a critical error pops up.
| Part | Tech | Why |
|---|---|---|
| SDK | JavaScript snippet published on npm | Works in browser & Node, zero config. |
| API | Node.js + Express (REST) | Easy to read, tons of examples. |
| DB | PostgreSQL (JSONB column) | One service, SQL + flexible JSON; cheap on any cloud. |
| Dashboard | React + Vite | Fast dev server, deploy as static files. |
| SendGrid API | Quick to set up, free tier. | |
| Deployment | Docker Compose on a small VM (e.g., DigitalOcean)** | One‑command up; can move to Kubernetes later if needed. |
- App hits an error → SDK captures stack trace.
- SDK batches errors and POSTs to
/api/logs. - API validates request, adds tenant & timestamp, inserts into
errorstable. - API checks: if
level = critical, trigger email via SendGrid. - Dashboard calls
/api/logs?search=…to show data.
- REST over GraphQL – fewer moving parts.
- Single DB – avoid extra queues until traffic demands it.
- Batching in SDK – keeps API lightweight without Kafka.
- JSONB – flexible schema, no migrations for every field.
- Docker Compose – easy local dev & prod parity.
- Backups – daily pg_dump to cloud storage.
- Uptime – Health‑check endpoint + Pingdom.
- Logs – App logs to file; optional Logtail or Papertrail.
- Traffic: expected errors per minute now & in 1 year?
- Retention: how long must we keep logs? 30, 90, 365 days?
- Auth: do we need per‑user accounts or one team token is fine?
- Critical definition: what counts as “critical” for alerts?
- Budget: monthly ceiling for hosting/email?
- Deployment: any preferred cloud or must be on‑prem?
Prepared by Yehor – Full‑Stack JavaScript Developer