# kumardhananjaya/pulsetrace architecture

> Architecture diagram of the GitHub repository kumardhananjaya/pulsetrace, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kumardhananjaya/pulsetrace
- Repository: https://github.com/kumardhananjaya/pulsetrace

## Overview

PulseTrace collects browser telemetry through its SDK, validates and queues it at the API, then processes events into issues and persisted records. A separate worker checks configured endpoints for uptime. Users access issues, performance, logs, realtime data, and project settings through the dashboard; authentication supports password and OAuth flows. The graph includes the SDK capture layers and the API’s key processing stages. Some dashboard data-fetching and route internals were not sampled, so those links rely only on documented architecture or are omitted.

Main entry points: [`api/src/index.ts`](https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/index.ts) (Express API), [`dashboard/src/App.tsx`](https://github.com/kumardhananjaya/pulsetrace/blob/main/dashboard/src/App.tsx) (Dashboard Routes), [`api/src/db.ts`](https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/db.ts) (PostgreSQL Data), [`api/src/workers/eventWorker.ts`](https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/workers/eventWorker.ts) (Event Processor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sdk["Telemetry SDK"]
  node_sdkcore["SDK Capture<br/>[core.ts]"]
  node_sdkhandlers["Capture Handlers"]
  node_sdkvitals["Web Vitals<br/>[vitals.ts]"]
  node_sdktransport["Event Transport<br/>[transport.ts]"]
end

subgraph group_ingestion["Ingestion Pipeline"]
  node_api["Express API<br/>[index.ts]"]
  node_validator["Event Validation<br/>[event.ts]"]
  node_queue["Event Queue<br/>[eventQueue.ts]"]
  node_eventworker["Event Processor<br/>[eventWorker.ts]"]
  node_eventutils["Event Enrichment"]
  node_db[("PostgreSQL Data<br/>[db.ts]")]
end

subgraph group_identity["Identity and Projects"]
  node_authroutes["Auth Routes<br/>[auth.ts]"]
  node_authservice["OAuth Identity Service<br/>[AuthService.ts]"]
  node_sessions["Session Service<br/>[SessionService.ts]"]
  node_oauthproviders["OAuth Providers"]
  node_projectroutes["Project Routes<br/>[projects.ts]"]
end

subgraph group_monitoring["Monitoring Services"]
  node_logsapi["Log Routes<br/>[logs.ts]"]
  node_uptimeapi["Uptime Routes<br/>[uptime.ts]"]
  node_uptimeworker["Uptime Checker<br/>[uptimeWorker.ts]"]
  node_artifacts["Artifacts and Maps<br/>[artifacts.ts]"]
end

subgraph group_dashboard["Dashboard"]
  node_dashboard["Dashboard Routes<br/>[App.tsx]"]
  node_authui["Auth Context<br/>[AuthContext.tsx]"]
  node_issueui["Issue Views<br/>[IssuesList.tsx]"]
  node_performanceui["Performance View<br/>[Performance.tsx]"]
  node_logsui["Log Explorer<br/>[Logs.tsx]"]
  node_realtimeui["Realtime Feed<br/>[Realtime.tsx]"]
  node_settingsui["Project Settings"]
  node_uptimeui["Uptime View<br/>[Uptime.tsx]"]
end

node_webapp(("Instrumented App"))
node_redis[("Redis")]
node_browser(("Dashboard User"))
node_endpoint(("Monitored Endpoint"))

node_webapp -->|"initializes"| node_sdkcore
node_sdkcore -->|"registers handlers"| node_sdkhandlers
node_sdkcore -->|"starts capture"| node_sdkvitals
node_sdkcore -->|"sends events"| node_sdktransport
node_sdktransport -->|"posts events"| node_api
node_api -->|"validates batch"| node_validator
node_api -->|"enqueues events"| node_queue
node_queue -->|"uses queue backend"| node_redis
node_eventworker -->|"consumes jobs"| node_queue
node_eventworker -->|"connects worker"| node_redis
node_eventworker -->|"scrubs and enriches"| node_eventutils
node_eventworker -->|"stores events and issues"| node_db
node_browser -->|"uses dashboard"| node_dashboard
node_dashboard -->|"provides auth"| node_authui
node_dashboard -->|"routes to issues"| node_issueui
node_dashboard -->|"routes to performance"| node_performanceui
node_dashboard -->|"routes to logs"| node_logsui
node_dashboard -->|"routes to realtime"| node_realtimeui
node_dashboard -->|"routes to settings"| node_settingsui
node_dashboard -->|"routes to uptime"| node_uptimeui
node_db -->|"serves dashboard data"| node_dashboard
node_api -->|"mounts auth routes"| node_authroutes
node_authroutes -->|"handles identity"| node_authservice
node_authroutes -->|"creates sessions"| node_sessions
node_authroutes -->|"delegates OAuth"| node_oauthproviders
node_authservice -->|"reads and writes users"| node_db
node_sessions -->|"persists sessions"| node_db
node_api -->|"mounts project routes"| node_projectroutes
node_projectroutes -.->|"manages projects"| node_db
node_api -->|"mounts log routes"| node_logsapi
node_api -->|"mounts uptime routes"| node_uptimeapi
node_uptimeworker -->|"reads monitors and records checks"| node_db
node_uptimeworker -->|"checks endpoint"| node_endpoint
node_api -->|"starts checker"| node_uptimeworker
node_api -.->|"artifact API"| node_artifacts

click node_sdkcore "https://github.com/kumardhananjaya/pulsetrace/blob/main/sdk/src/core.ts"
click node_sdkhandlers "https://github.com/kumardhananjaya/pulsetrace/tree/main/sdk/src/handlers"
click node_sdkvitals "https://github.com/kumardhananjaya/pulsetrace/blob/main/sdk/src/vitals.ts"
click node_sdktransport "https://github.com/kumardhananjaya/pulsetrace/blob/main/sdk/src/transport.ts"
click node_api "https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/index.ts"
click node_validator "https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/validators/event.ts"
click node_queue "https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/queues/eventQueue.ts"
click node_eventworker "https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/workers/eventWorker.ts"
click node_eventutils "https://github.com/kumardhananjaya/pulsetrace/tree/main/api/src/utils"
click node_db "https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/db.ts"
click node_dashboard "https://github.com/kumardhananjaya/pulsetrace/blob/main/dashboard/src/App.tsx"
click node_authui "https://github.com/kumardhananjaya/pulsetrace/blob/main/dashboard/src/context/AuthContext.tsx"
click node_issueui "https://github.com/kumardhananjaya/pulsetrace/blob/main/dashboard/src/pages/IssuesList.tsx"
click node_performanceui "https://github.com/kumardhananjaya/pulsetrace/blob/main/dashboard/src/pages/Performance.tsx"
click node_logsui "https://github.com/kumardhananjaya/pulsetrace/blob/main/dashboard/src/pages/Logs.tsx"
click node_realtimeui "https://github.com/kumardhananjaya/pulsetrace/blob/main/dashboard/src/pages/Realtime.tsx"
click node_settingsui "https://github.com/kumardhananjaya/pulsetrace/blob/main/dashboard/src/pages/ProjectSettings.tsx"
click node_uptimeui "https://github.com/kumardhananjaya/pulsetrace/blob/main/dashboard/src/pages/Uptime.tsx"
click node_authroutes "https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/routes/auth.ts"
click node_authservice "https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/services/AuthService.ts"
click node_sessions "https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/services/SessionService.ts"
click node_oauthproviders "https://github.com/kumardhananjaya/pulsetrace/tree/main/api/src/providers"
click node_projectroutes "https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/routes/projects.ts"
click node_logsapi "https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/routes/logs.ts"
click node_uptimeapi "https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/routes/uptime.ts"
click node_uptimeworker "https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/workers/uptimeWorker.ts"
click node_artifacts "https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/routes/artifacts.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_sdkcore,node_sdkhandlers,node_sdkvitals,node_sdktransport,node_browser toneBlue
class node_api,node_validator,node_queue,node_eventworker,node_eventutils,node_db,node_redis toneAmber
class node_authroutes,node_authservice,node_sessions,node_oauthproviders,node_projectroutes toneMint
class node_logsapi,node_uptimeapi,node_uptimeworker,node_artifacts toneRose
class node_dashboard,node_authui,node_issueui,node_performanceui,node_logsui,node_realtimeui,node_settingsui,node_uptimeui,node_webapp,node_endpoint toneIndigo
```

## Components

### Telemetry SDK

- [SDK Capture](https://github.com/kumardhananjaya/pulsetrace/blob/main/sdk/src/core.ts): `sdk/src/core.ts`
- [Capture Handlers](https://github.com/kumardhananjaya/pulsetrace/tree/main/sdk/src/handlers): `sdk/src/handlers`
- [Web Vitals](https://github.com/kumardhananjaya/pulsetrace/blob/main/sdk/src/vitals.ts): `sdk/src/vitals.ts`
- [Event Transport](https://github.com/kumardhananjaya/pulsetrace/blob/main/sdk/src/transport.ts): `sdk/src/transport.ts`

### Ingestion Pipeline

- [Express API](https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/index.ts): `api/src/index.ts`
- [Event Validation](https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/validators/event.ts): `api/src/validators/event.ts`
- [Event Queue](https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/queues/eventQueue.ts): `api/src/queues/eventQueue.ts`
- [Event Processor](https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/workers/eventWorker.ts): `api/src/workers/eventWorker.ts`
- [Event Enrichment](https://github.com/kumardhananjaya/pulsetrace/tree/main/api/src/utils): `api/src/utils`
- [PostgreSQL Data](https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/db.ts): `api/src/db.ts`

### Identity and Projects

- [Auth Routes](https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/routes/auth.ts): `api/src/routes/auth.ts`
- [OAuth Identity Service](https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/services/AuthService.ts): `api/src/services/AuthService.ts`
- [Session Service](https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/services/SessionService.ts): `api/src/services/SessionService.ts`
- [OAuth Providers](https://github.com/kumardhananjaya/pulsetrace/tree/main/api/src/providers): `api/src/providers`
- [Project Routes](https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/routes/projects.ts): `api/src/routes/projects.ts`

### Monitoring Services

- [Log Routes](https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/routes/logs.ts): `api/src/routes/logs.ts`
- [Uptime Routes](https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/routes/uptime.ts): `api/src/routes/uptime.ts`
- [Uptime Checker](https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/workers/uptimeWorker.ts): `api/src/workers/uptimeWorker.ts`
- [Artifacts and Maps](https://github.com/kumardhananjaya/pulsetrace/blob/main/api/src/routes/artifacts.ts): `api/src/routes/artifacts.ts`

### Dashboard

- [Dashboard Routes](https://github.com/kumardhananjaya/pulsetrace/blob/main/dashboard/src/App.tsx): `dashboard/src/App.tsx`
- [Auth Context](https://github.com/kumardhananjaya/pulsetrace/blob/main/dashboard/src/context/AuthContext.tsx): `dashboard/src/context/AuthContext.tsx`
- [Issue Views](https://github.com/kumardhananjaya/pulsetrace/blob/main/dashboard/src/pages/IssuesList.tsx): `dashboard/src/pages/IssuesList.tsx`
- [Performance View](https://github.com/kumardhananjaya/pulsetrace/blob/main/dashboard/src/pages/Performance.tsx): `dashboard/src/pages/Performance.tsx`
- [Log Explorer](https://github.com/kumardhananjaya/pulsetrace/blob/main/dashboard/src/pages/Logs.tsx): `dashboard/src/pages/Logs.tsx`
- [Realtime Feed](https://github.com/kumardhananjaya/pulsetrace/blob/main/dashboard/src/pages/Realtime.tsx): `dashboard/src/pages/Realtime.tsx`
- [Project Settings](https://github.com/kumardhananjaya/pulsetrace/blob/main/dashboard/src/pages/ProjectSettings.tsx): `dashboard/src/pages/ProjectSettings.tsx`
- [Uptime View](https://github.com/kumardhananjaya/pulsetrace/blob/main/dashboard/src/pages/Uptime.tsx): `dashboard/src/pages/Uptime.tsx`

### Other components

- **Instrumented App**
- **Redis**
- **Dashboard User**
- **Monitored Endpoint**

## Connections

- Instrumented App → SDK Capture: initializes
- SDK Capture → Capture Handlers: registers handlers (evidence: `sdk/src/core.ts`)
- SDK Capture → Web Vitals: starts capture (evidence: `sdk/src/core.ts`)
- SDK Capture → Event Transport: sends events (evidence: `sdk/src/core.ts`)
- Event Transport → Express API: posts events
- Express API → Event Validation: validates batch (evidence: `api/src/index.ts`)
- Express API → Event Queue: enqueues events (evidence: `api/src/index.ts`)
- Event Queue → Redis: uses queue backend (evidence: `api/src/queues/eventQueue.ts`)
- Event Processor → Event Queue: consumes jobs (evidence: `api/src/workers/eventWorker.ts`)
- Event Processor → Redis: connects worker (evidence: `api/src/workers/eventWorker.ts`)
- Event Processor → Event Enrichment: scrubs and enriches (evidence: `api/src/workers/eventWorker.ts`)
- Event Processor → PostgreSQL Data: stores events and issues (evidence: `api/src/workers/eventWorker.ts`)
- Dashboard User → Dashboard Routes: uses dashboard (evidence: `dashboard/src/App.tsx`)
- Dashboard Routes → Auth Context: provides auth (evidence: `dashboard/src/App.tsx`)
- Dashboard Routes → Issue Views: routes to issues (evidence: `dashboard/src/App.tsx`)
- Dashboard Routes → Performance View: routes to performance (evidence: `dashboard/src/App.tsx`)
- Dashboard Routes → Log Explorer: routes to logs (evidence: `dashboard/src/App.tsx`)
- Dashboard Routes → Realtime Feed: routes to realtime (evidence: `dashboard/src/App.tsx`)
- Dashboard Routes → Project Settings: routes to settings (evidence: `dashboard/src/App.tsx`)
- Dashboard Routes → Uptime View: routes to uptime (evidence: `dashboard/src/App.tsx`)
- PostgreSQL Data → Dashboard Routes: serves dashboard data
- Express API → Auth Routes: mounts auth routes (evidence: `api/src/index.ts`)
- Auth Routes → OAuth Identity Service: handles identity (evidence: `api/src/routes/auth.ts`)
- Auth Routes → Session Service: creates sessions (evidence: `api/src/routes/auth.ts`)
- Auth Routes → OAuth Providers: delegates OAuth (evidence: `api/src/routes/auth.ts`)
- OAuth Identity Service → PostgreSQL Data: reads and writes users (evidence: `api/src/services/AuthService.ts`)
- Session Service → PostgreSQL Data: persists sessions (evidence: `api/src/services/SessionService.ts`)
- Express API → Project Routes: mounts project routes (evidence: `api/src/index.ts`)
- Project Routes → PostgreSQL Data: manages projects
- Express API → Log Routes: mounts log routes (evidence: `api/src/index.ts`)
- Express API → Uptime Routes: mounts uptime routes (evidence: `api/src/index.ts`)
- Uptime Checker → PostgreSQL Data: reads monitors and records checks (evidence: `api/src/workers/uptimeWorker.ts`)
- Uptime Checker → Monitored Endpoint: checks endpoint (evidence: `api/src/workers/uptimeWorker.ts`)
- Express API → Uptime Checker: starts checker (evidence: `api/src/index.ts`)
- Express API → Artifacts and Maps: artifact API
