# abdulwahab458/crashly- architecture

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

- Interactive diagram: https://gitdiagram.com/abdulwahab458/crashly-
- Repository: https://github.com/abdulwahab458/crashly-

## Overview

This repository provides an error-tracking backend and a small TypeScript SDK. An application captures an exception through the SDK, which builds an event and sends it through a configurable transport; the backend authenticates API keys, fingerprints incoming events, and persists them. Backend routes also expose event and error-group queries, dashboard summaries and trends, and group-status updates. The source excerpts show the route and storage boundaries, but not all route implementations or the database schema details.

Main entry points: [`backend/src/utils/db.ts`](https://github.com/abdulwahab458/crashly-/blob/main/backend/src/utils/db.ts) (Database client), [`sdk/src/index.ts`](https://github.com/abdulwahab458/crashly-/blob/main/sdk/src/index.ts) (Exception capture), [`backend/src/app.ts`](https://github.com/abdulwahab458/crashly-/blob/main/backend/src/app.ts) (API routes), [`backend/src/auth.ts`](https://github.com/abdulwahab458/crashly-/blob/main/backend/src/auth.ts) (API-key validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sdk["SDK"]
  node_tracker["Exception capture<br/>[index.ts]"]
  node_transports["Event transports<br/>[transport.ts]"]
  node_event_types["Event contract<br/>[types.ts]"]
end

subgraph group_api["Backend API"]
  node_server["HTTP server<br/>[server.ts]"]
  node_routes["API routes<br/>[app.ts]"]
  node_fingerprint["Event fingerprinting<br/>[fingerprint.ts]"]
  node_event_intake["Event intake<br/>[app.ts]"]
  node_error_groups["Error-group views<br/>[app.ts]"]
  node_dashboard["Dashboard metrics<br/>[app.ts]"]
  node_group_status["Group status<br/>[app.ts]"]
end

subgraph group_identity["Identity"]
  node_auth["API-key validation<br/>[auth.ts]"]
  node_key_creation["API-key creation<br/>[create-api-key.ts]"]
end

subgraph group_storage["Persistence"]
  node_database_client["Database client<br/>[db.ts]"]
  node_database[("Postgres data<br/>[schema.prisma]")]
end

node_application(("Instrumented app"))

node_application -->|"captures exceptions"| node_tracker
node_tracker -->|"sends events"| node_transports
node_tracker -->|"creates event"| node_event_types
node_transports -.->|"posts events"| node_event_intake
node_server -->|"starts app"| node_routes
node_event_intake -->|"validates key"| node_auth
node_routes -->|"validates keys"| node_auth
node_event_intake -->|"generates fingerprint"| node_fingerprint
node_routes -->|"queries data"| node_database_client
node_auth -->|"looks up key"| node_database_client
node_key_creation -->|"stores key"| node_database_client
node_database_client -.->|"accesses database"| node_database
node_error_groups -->|"queries groups"| node_database_client
node_dashboard -->|"queries metrics"| node_database_client
node_group_status -.->|"updates status"| node_database_client

click node_tracker "https://github.com/abdulwahab458/crashly-/blob/main/sdk/src/index.ts"
click node_transports "https://github.com/abdulwahab458/crashly-/blob/main/sdk/src/transport.ts"
click node_event_types "https://github.com/abdulwahab458/crashly-/blob/main/sdk/src/types.ts"
click node_server "https://github.com/abdulwahab458/crashly-/blob/main/backend/src/server.ts"
click node_routes "https://github.com/abdulwahab458/crashly-/blob/main/backend/src/app.ts"
click node_fingerprint "https://github.com/abdulwahab458/crashly-/blob/main/backend/src/utils/fingerprint.ts"
click node_auth "https://github.com/abdulwahab458/crashly-/blob/main/backend/src/auth.ts"
click node_key_creation "https://github.com/abdulwahab458/crashly-/blob/main/backend/src/create-api-key.ts"
click node_database_client "https://github.com/abdulwahab458/crashly-/blob/main/backend/src/utils/db.ts"
click node_database "https://github.com/abdulwahab458/crashly-/blob/main/backend/prisma/schema.prisma"
click node_event_intake "https://github.com/abdulwahab458/crashly-/blob/main/backend/src/app.ts"
click node_error_groups "https://github.com/abdulwahab458/crashly-/blob/main/backend/src/app.ts"
click node_dashboard "https://github.com/abdulwahab458/crashly-/blob/main/backend/src/app.ts"
click node_group_status "https://github.com/abdulwahab458/crashly-/blob/main/backend/src/app.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_tracker,node_transports,node_event_types toneBlue
class node_server,node_routes,node_fingerprint,node_event_intake,node_error_groups,node_dashboard,node_group_status toneAmber
class node_auth,node_key_creation toneMint
class node_database_client,node_database toneRose
class node_application toneIndigo
```

## Components

### SDK

- [Exception capture](https://github.com/abdulwahab458/crashly-/blob/main/sdk/src/index.ts): `sdk/src/index.ts`
- [Event transports](https://github.com/abdulwahab458/crashly-/blob/main/sdk/src/transport.ts): `sdk/src/transport.ts`
- [Event contract](https://github.com/abdulwahab458/crashly-/blob/main/sdk/src/types.ts): `sdk/src/types.ts`

### Backend API

- [HTTP server](https://github.com/abdulwahab458/crashly-/blob/main/backend/src/server.ts): `backend/src/server.ts`
- [API routes](https://github.com/abdulwahab458/crashly-/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Event fingerprinting](https://github.com/abdulwahab458/crashly-/blob/main/backend/src/utils/fingerprint.ts): `backend/src/utils/fingerprint.ts`
- [Event intake](https://github.com/abdulwahab458/crashly-/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Error-group views](https://github.com/abdulwahab458/crashly-/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Dashboard metrics](https://github.com/abdulwahab458/crashly-/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Group status](https://github.com/abdulwahab458/crashly-/blob/main/backend/src/app.ts): `backend/src/app.ts`

### Identity

- [API-key validation](https://github.com/abdulwahab458/crashly-/blob/main/backend/src/auth.ts): `backend/src/auth.ts`
- [API-key creation](https://github.com/abdulwahab458/crashly-/blob/main/backend/src/create-api-key.ts): `backend/src/create-api-key.ts`

### Persistence

- [Database client](https://github.com/abdulwahab458/crashly-/blob/main/backend/src/utils/db.ts): `backend/src/utils/db.ts`
- [Postgres data](https://github.com/abdulwahab458/crashly-/blob/main/backend/prisma/schema.prisma): `backend/prisma/schema.prisma`

### Other components

- **Instrumented app**

## Connections

- Instrumented app → Exception capture: captures exceptions (evidence: `sdk/src/index.ts`)
- Exception capture → Event transports: sends events (evidence: `sdk/src/index.ts`)
- Exception capture → Event contract: creates event (evidence: `sdk/src/index.ts`)
- Event transports → Event intake: posts events
- HTTP server → API routes: starts app (evidence: `backend/src/server.ts`)
- Event intake → API-key validation: validates key (evidence: `backend/src/app.ts`)
- API routes → API-key validation: validates keys (evidence: `backend/src/app.ts`)
- Event intake → Event fingerprinting: generates fingerprint (evidence: `backend/src/app.ts`)
- API routes → Database client: queries data (evidence: `backend/src/app.ts`)
- API-key validation → Database client: looks up key (evidence: `backend/src/auth.ts`)
- API-key creation → Database client: stores key (evidence: `backend/src/create-api-key.ts`)
- Database client → Postgres data: accesses database
- Error-group views → Database client: queries groups (evidence: `backend/src/app.ts`)
- Dashboard metrics → Database client: queries metrics (evidence: `backend/src/app.ts`)
- Group status → Database client: updates status (evidence: `backend/src/app.ts`)
