# codeyantra-technologies/devcaught architecture

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

- Interactive diagram: https://gitdiagram.com/codeyantra-technologies/devcaught
- Repository: https://github.com/codeyantra-technologies/devcaught

## Overview

DevCaught is a local-first developer inbox for capturing development email and webhooks, detecting useful OTP, link, and commerce references, and inspecting them in a dashboard. The main flow is a local app or SMTP client into the server runtime, normalization and parsing, SQLite persistence, HTTP APIs, and the inbox UI; test email and webhook capture are alternate entry points. The graph preserves the documented settings and message-inspection capabilities. Edges use README or excerpted source evidence; some UI/API wiring and unsampled subsystems are represented only where documented.

Main entry points: [`apps/server/src/http/app.ts`](https://github.com/codeyantra-technologies/devcaught/blob/main/apps/server/src/http/app.ts) (HTTP API), [`apps/server/src/ingest/inboxService.ts`](https://github.com/codeyantra-technologies/devcaught/blob/main/apps/server/src/ingest/inboxService.ts) (Inbox service), [`packages/parsers/src/runParsers.ts`](https://github.com/codeyantra-technologies/devcaught/blob/main/packages/parsers/src/runParsers.ts) (Detection runner), [`apps/server/src/http/handlers.ts`](https://github.com/codeyantra-technologies/devcaught/blob/main/apps/server/src/http/handlers.ts) (Message handlers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture and runtime"]
  node_runtime["Server runtime<br/>[runtime.ts]"]
  node_smtp_receiver["SMTP receiver<br/>[receiver.ts]"]
end

subgraph group_processing["Normalization and detection"]
  node_webhook_normalizer["Webhook normalizer"]
  node_email_normalizer["Email normalizer<br/>[normalizeEmail.ts]"]
  node_inbox_service["Inbox service<br/>[inboxService.ts]"]
  node_parser_runner["Detection runner<br/>[runParsers.ts]"]
  node_otp_parser["OTP detection<br/>[otpParser.ts]"]
  node_link_parser["Link detection<br/>[linkParser.ts]"]
  node_commerce_parser["Commerce detection<br/>[commerceParser.ts]"]
end

subgraph group_storage["Persistence and API"]
  node_http_api["HTTP API<br/>[app.ts]"]
  node_handlers["Message handlers<br/>[handlers.ts]"]
  node_sqlite[("SQLite inbox<br/>[sqlite.ts]")]
end

subgraph group_dashboard["Dashboard"]
  node_test_composer["Test composer<br/>[TestEmailForm.tsx]"]
  node_dashboard["Inbox dashboard<br/>[InboxPage.tsx]"]
  node_message_detail["Message detail<br/>[MessageDetail.tsx]"]
  node_html_preview["HTML preview<br/>[HtmlPreview.tsx]"]
  node_settings["Listener settings<br/>[SettingsPage.tsx]"]
  node_webhook_setup["Webhook setup<br/>[WebhookSetup.tsx]"]
  node_frontend_api["Dashboard API client<br/>[api.ts]"]
  node_routes["Dashboard routes<br/>[index.tsx]"]
end

node_app_sender(("Local app"))
node_smtp_client(("SMTP client"))
node_webhook_sender(("Webhook sender"))

node_app_sender -->|"sends mail"| node_smtp_receiver
node_smtp_client -->|"connects SMTP"| node_smtp_receiver
node_runtime -->|"starts receiver"| node_smtp_receiver
node_smtp_receiver -->|"ingests mail"| node_inbox_service
node_test_composer -->|"submits test"| node_handlers
node_handlers -->|"ingests test"| node_inbox_service
node_webhook_sender -->|"posts webhook"| node_http_api
node_http_api -->|"normalizes request"| node_webhook_normalizer
node_http_api -->|"ingests webhook"| node_inbox_service
node_runtime -->|"provides normalizer"| node_email_normalizer
node_inbox_service -->|"runs detections"| node_parser_runner
node_parser_runner -->|"checks OTPs"| node_otp_parser
node_parser_runner -->|"checks links"| node_link_parser
node_parser_runner -->|"checks commerce"| node_commerce_parser
node_inbox_service -->|"stores message"| node_sqlite
node_runtime -->|"opens store"| node_sqlite
node_http_api -->|"routes requests"| node_handlers
node_handlers -->|"reads and mutates"| node_sqlite
node_dashboard -.->|"loads inbox"| node_frontend_api
node_frontend_api -.->|"requests data"| node_http_api
node_routes -->|"renders inbox"| node_dashboard
node_dashboard -.->|"shows details"| node_message_detail
node_message_detail -.->|"previews HTML"| node_html_preview
node_settings -.->|"checks status"| node_frontend_api
node_webhook_setup -->|"fetches status"| node_frontend_api
node_webhook_setup -->|"sends test request"| node_http_api

click node_runtime "https://github.com/codeyantra-technologies/devcaught/blob/main/apps/server/src/runtime.ts"
click node_smtp_receiver "https://github.com/codeyantra-technologies/devcaught/blob/main/apps/server/src/smtp/receiver.ts"
click node_test_composer "https://github.com/codeyantra-technologies/devcaught/blob/main/src/components/inbox/TestEmailForm.tsx"
click node_http_api "https://github.com/codeyantra-technologies/devcaught/blob/main/apps/server/src/http/app.ts"
click node_handlers "https://github.com/codeyantra-technologies/devcaught/blob/main/apps/server/src/http/handlers.ts"
click node_webhook_normalizer "https://github.com/codeyantra-technologies/devcaught/blob/main/apps/server/src/ingest/normalizeWebhook.ts"
click node_email_normalizer "https://github.com/codeyantra-technologies/devcaught/blob/main/apps/server/src/ingest/normalizeEmail.ts"
click node_inbox_service "https://github.com/codeyantra-technologies/devcaught/blob/main/apps/server/src/ingest/inboxService.ts"
click node_parser_runner "https://github.com/codeyantra-technologies/devcaught/blob/main/packages/parsers/src/runParsers.ts"
click node_otp_parser "https://github.com/codeyantra-technologies/devcaught/blob/main/packages/parsers/src/otpParser.ts"
click node_link_parser "https://github.com/codeyantra-technologies/devcaught/blob/main/packages/parsers/src/linkParser.ts"
click node_commerce_parser "https://github.com/codeyantra-technologies/devcaught/blob/main/packages/parsers/src/commerceParser.ts"
click node_sqlite "https://github.com/codeyantra-technologies/devcaught/blob/main/apps/server/src/store/sqlite.ts"
click node_dashboard "https://github.com/codeyantra-technologies/devcaught/blob/main/src/components/inbox/InboxPage.tsx"
click node_message_detail "https://github.com/codeyantra-technologies/devcaught/blob/main/src/components/inbox/MessageDetail.tsx"
click node_html_preview "https://github.com/codeyantra-technologies/devcaught/blob/main/src/components/inbox/HtmlPreview.tsx"
click node_settings "https://github.com/codeyantra-technologies/devcaught/blob/main/src/components/inbox/SettingsPage.tsx"
click node_webhook_setup "https://github.com/codeyantra-technologies/devcaught/blob/main/src/components/inbox/WebhookSetup.tsx"
click node_frontend_api "https://github.com/codeyantra-technologies/devcaught/blob/main/src/lib/api.ts"
click node_routes "https://github.com/codeyantra-technologies/devcaught/blob/main/src/routes/index.tsx"

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_runtime,node_smtp_receiver,node_smtp_client toneBlue
class node_webhook_normalizer,node_email_normalizer,node_inbox_service,node_parser_runner,node_otp_parser,node_link_parser,node_commerce_parser toneAmber
class node_http_api,node_handlers,node_sqlite,node_webhook_sender toneMint
class node_test_composer,node_dashboard,node_message_detail,node_html_preview,node_settings,node_webhook_setup,node_frontend_api,node_routes toneRose
class node_app_sender toneIndigo
```

## Components

### Capture and runtime

- [Server runtime](https://github.com/codeyantra-technologies/devcaught/blob/main/apps/server/src/runtime.ts): `apps/server/src/runtime.ts`
- [SMTP receiver](https://github.com/codeyantra-technologies/devcaught/blob/main/apps/server/src/smtp/receiver.ts): `apps/server/src/smtp/receiver.ts`

### Normalization and detection

- [Webhook normalizer](https://github.com/codeyantra-technologies/devcaught/blob/main/apps/server/src/ingest/normalizeWebhook.ts): `apps/server/src/ingest/normalizeWebhook.ts`
- [Email normalizer](https://github.com/codeyantra-technologies/devcaught/blob/main/apps/server/src/ingest/normalizeEmail.ts): `apps/server/src/ingest/normalizeEmail.ts`
- [Inbox service](https://github.com/codeyantra-technologies/devcaught/blob/main/apps/server/src/ingest/inboxService.ts): `apps/server/src/ingest/inboxService.ts`
- [Detection runner](https://github.com/codeyantra-technologies/devcaught/blob/main/packages/parsers/src/runParsers.ts): `packages/parsers/src/runParsers.ts`
- [OTP detection](https://github.com/codeyantra-technologies/devcaught/blob/main/packages/parsers/src/otpParser.ts): `packages/parsers/src/otpParser.ts`
- [Link detection](https://github.com/codeyantra-technologies/devcaught/blob/main/packages/parsers/src/linkParser.ts): `packages/parsers/src/linkParser.ts`
- [Commerce detection](https://github.com/codeyantra-technologies/devcaught/blob/main/packages/parsers/src/commerceParser.ts): `packages/parsers/src/commerceParser.ts`

### Persistence and API

- [HTTP API](https://github.com/codeyantra-technologies/devcaught/blob/main/apps/server/src/http/app.ts): `apps/server/src/http/app.ts`
- [Message handlers](https://github.com/codeyantra-technologies/devcaught/blob/main/apps/server/src/http/handlers.ts): `apps/server/src/http/handlers.ts`
- [SQLite inbox](https://github.com/codeyantra-technologies/devcaught/blob/main/apps/server/src/store/sqlite.ts): `apps/server/src/store/sqlite.ts`

### Dashboard

- [Test composer](https://github.com/codeyantra-technologies/devcaught/blob/main/src/components/inbox/TestEmailForm.tsx): `src/components/inbox/TestEmailForm.tsx`
- [Inbox dashboard](https://github.com/codeyantra-technologies/devcaught/blob/main/src/components/inbox/InboxPage.tsx): `src/components/inbox/InboxPage.tsx`
- [Message detail](https://github.com/codeyantra-technologies/devcaught/blob/main/src/components/inbox/MessageDetail.tsx): `src/components/inbox/MessageDetail.tsx`
- [HTML preview](https://github.com/codeyantra-technologies/devcaught/blob/main/src/components/inbox/HtmlPreview.tsx): `src/components/inbox/HtmlPreview.tsx`
- [Listener settings](https://github.com/codeyantra-technologies/devcaught/blob/main/src/components/inbox/SettingsPage.tsx): `src/components/inbox/SettingsPage.tsx`
- [Webhook setup](https://github.com/codeyantra-technologies/devcaught/blob/main/src/components/inbox/WebhookSetup.tsx): `src/components/inbox/WebhookSetup.tsx`
- [Dashboard API client](https://github.com/codeyantra-technologies/devcaught/blob/main/src/lib/api.ts): `src/lib/api.ts`
- [Dashboard routes](https://github.com/codeyantra-technologies/devcaught/blob/main/src/routes/index.tsx): `src/routes/index.tsx`

### Other components

- **Local app**
- **SMTP client**
- **Webhook sender**

## Connections

- Local app → SMTP receiver: sends mail
- SMTP client → SMTP receiver: connects SMTP
- Server runtime → SMTP receiver: starts receiver (evidence: `apps/server/src/runtime.ts`)
- SMTP receiver → Inbox service: ingests mail
- Test composer → Message handlers: submits test
- Message handlers → Inbox service: ingests test (evidence: `apps/server/src/http/handlers.ts`)
- Webhook sender → HTTP API: posts webhook
- HTTP API → Webhook normalizer: normalizes request (evidence: `apps/server/src/http/app.ts`)
- HTTP API → Inbox service: ingests webhook (evidence: `apps/server/src/http/app.ts`)
- Server runtime → Email normalizer: provides normalizer (evidence: `apps/server/src/runtime.ts`)
- Inbox service → Detection runner: runs detections (evidence: `apps/server/src/ingest/inboxService.ts`)
- Detection runner → OTP detection: checks OTPs (evidence: `packages/parsers/src/index.ts`)
- Detection runner → Link detection: checks links (evidence: `packages/parsers/src/index.ts`)
- Detection runner → Commerce detection: checks commerce (evidence: `packages/parsers/src/index.ts`)
- Inbox service → SQLite inbox: stores message (evidence: `apps/server/src/ingest/inboxService.ts`)
- Server runtime → SQLite inbox: opens store (evidence: `apps/server/src/runtime.ts`)
- HTTP API → Message handlers: routes requests (evidence: `apps/server/src/http/app.ts`)
- Message handlers → SQLite inbox: reads and mutates (evidence: `apps/server/src/http/handlers.ts`)
- Inbox dashboard → Dashboard API client: loads inbox
- Dashboard API client → HTTP API: requests data
- Dashboard routes → Inbox dashboard: renders inbox (evidence: `src/routes/index.tsx`)
- Inbox dashboard → Message detail: shows details
- Message detail → HTML preview: previews HTML
- Listener settings → Dashboard API client: checks status
- Webhook setup → Dashboard API client: fetches status (evidence: `src/components/inbox/WebhookSetup.tsx`)
- Webhook setup → HTTP API: sends test request (evidence: `src/components/inbox/WebhookSetup.tsx`)
