# jvitor-hash/devlink architecture

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

- Interactive diagram: https://gitdiagram.com/jvitor-hash/devlink
- Repository: https://github.com/jvitor-hash/devlink

## Overview

DevLink is a client–programmer project marketplace. Users browse and filter projects, open project details, save opportunities, and collaborate through encrypted-session-key chat and offer negotiation; clients can create projects, manage work, and receive reviews and notifications. The React frontend reaches the Elysia API through HTTP and WebSockets, with PostgreSQL-backed domain services. The graph preserves documented project, saved-ticket, chat, notification, webhook, and scheduling capabilities. Many routes and frontend pages are represented at their exact tree paths; their internal wiring is not asserted where source excerpts were unavailable.

Main entry points: [`API/src/index.ts`](https://github.com/jvitor-hash/devlink/blob/main/API/src/index.ts) (Elysia API), [`FRONTEND/src/main.tsx`](https://github.com/jvitor-hash/devlink/blob/main/FRONTEND/src/main.tsx) (React application), [`FRONTEND/src/utils/api_client.ts`](https://github.com/jvitor-hash/devlink/blob/main/FRONTEND/src/utils/api_client.ts) (HTTP client), [`API/src/modules/websocket.ts`](https://github.com/jvitor-hash/devlink/blob/main/API/src/modules/websocket.ts) (Chat WebSocket)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_front["Frontend experience"]
  node_frontend["React application<br/>[main.tsx]"]
  node_project_views["Project discovery<br/>[home.tsx]"]
  node_project_detail["Project workspace<br/>[project_open.tsx]"]
  node_questionnaire["Project questionnaire<br/>[questionnaire.tsx]"]
  node_account_views["Account and settings<br/>[settings.tsx]"]
  node_notifications_ui["Notification center<br/>[notification.tsx]"]
  node_api_client["HTTP client<br/>[api_client.ts]"]
  node_chat_hook["Project chat hook"]
  node_ws_client["WebSocket client"]
end

subgraph group_api["API and domain"]
  node_api["Elysia API<br/>[index.ts]"]
  node_project_routes["Project routes<br/>[index.ts]"]
  node_project_service["Project service<br/>[service.ts]"]
  node_saved_service["Saved opportunities<br/>[service.ts]"]
  node_work_routes["Work and review routes<br/>[index.ts]"]
  node_user_routes["User routes<br/>[index.ts]"]
  node_notification_routes["Notification routes<br/>[index.ts]"]
  node_webhook_routes["Webhook routes<br/>[index.ts]"]
  node_message_service["Message service<br/>[service.ts]"]
end

subgraph group_realtime["Chat and events"]
  node_chat_ws["Chat WebSocket<br/>[websocket.ts]"]
  node_notification_ws["Notification WebSocket"]
  node_scheduler["Background scheduler<br/>[scheduler.ts]"]
  node_outbox["Notification outbox"]
  node_webhook_delivery["Webhook delivery"]
end

subgraph group_persistence["Persistence"]
  node_postgres[("PostgreSQL")]
  node_schemas["Domain schemas<br/>[project_schema.ts]"]
end

node_users(("Marketplace users"))

node_users -->|"use"| node_frontend
node_frontend -.->|"renders"| node_project_views
node_frontend -.->|"renders"| node_project_detail
node_frontend -.->|"renders"| node_questionnaire
node_frontend -.->|"renders"| node_account_views
node_frontend -.->|"renders"| node_notifications_ui
node_project_views -.->|"requests data"| node_api_client
node_project_detail -.->|"requests data"| node_api_client
node_questionnaire -.->|"submits project"| node_api_client
node_account_views -.->|"requests data"| node_api_client
node_notifications_ui -.->|"loads notifications"| node_api_client
node_project_detail -.->|"uses"| node_chat_hook
node_chat_hook -.->|"uses"| node_ws_client
node_api_client -.->|"HTTP requests"| node_api
node_ws_client -.->|"WebSocket frames"| node_chat_ws
node_api -->|"registers"| node_project_routes
node_api -->|"registers"| node_notification_routes
node_api -->|"registers"| node_webhook_routes
node_api -->|"registers"| node_chat_ws
node_api -->|"registers"| node_notification_ws
node_api -->|"starts"| node_scheduler
node_project_routes -.->|"delegates"| node_project_service
node_project_service -->|"reads saved IDs"| node_saved_service
node_chat_ws -->|"creates messages"| node_message_service
node_saved_service -->|"publishes event"| node_outbox
node_chat_ws -->|"publishes event"| node_outbox
node_scheduler -->|"drains and retries"| node_outbox
node_scheduler -.->|"fanout documented"| node_webhook_delivery
node_project_service -->|"queries projects"| node_postgres
node_saved_service -->|"reads and writes"| node_postgres
node_message_service -.->|"persists messages"| node_postgres
node_chat_ws -->|"loads project and users"| node_postgres
node_scheduler -->|"sweeps project data"| node_postgres
node_schemas -.->|"defines tables"| node_postgres
node_work_routes -.->|"domain coordination"| node_project_service
node_user_routes -.->|"user operations"| node_postgres
node_notification_routes -.->|"notification events"| node_outbox
node_webhook_routes -.->|"configures delivery"| node_webhook_delivery

click node_frontend "https://github.com/jvitor-hash/devlink/blob/main/FRONTEND/src/main.tsx"
click node_project_views "https://github.com/jvitor-hash/devlink/blob/main/FRONTEND/src/pages/home/home.tsx"
click node_project_detail "https://github.com/jvitor-hash/devlink/blob/main/FRONTEND/src/pages/project_open/project_open.tsx"
click node_questionnaire "https://github.com/jvitor-hash/devlink/blob/main/FRONTEND/src/pages/questionnaire/questionnaire.tsx"
click node_account_views "https://github.com/jvitor-hash/devlink/blob/main/FRONTEND/src/pages/settings/settings.tsx"
click node_notifications_ui "https://github.com/jvitor-hash/devlink/blob/main/FRONTEND/src/pages/notification_center/notification.tsx"
click node_api_client "https://github.com/jvitor-hash/devlink/blob/main/FRONTEND/src/utils/api_client.ts"
click node_chat_hook "https://github.com/jvitor-hash/devlink/blob/main/FRONTEND/src/hooks/use_project_chat.ts"
click node_ws_client "https://github.com/jvitor-hash/devlink/blob/main/FRONTEND/src/utils/websocket_client.ts"
click node_api "https://github.com/jvitor-hash/devlink/blob/main/API/src/index.ts"
click node_project_routes "https://github.com/jvitor-hash/devlink/blob/main/API/src/routes/v1/projects/index.ts"
click node_project_service "https://github.com/jvitor-hash/devlink/blob/main/API/src/routes/v1/projects/service.ts"
click node_saved_service "https://github.com/jvitor-hash/devlink/blob/main/API/src/routes/v1/saved_ticket/service.ts"
click node_work_routes "https://github.com/jvitor-hash/devlink/blob/main/API/src/routes/v1/ticket/index.ts"
click node_user_routes "https://github.com/jvitor-hash/devlink/blob/main/API/src/routes/v1/users/index.ts"
click node_notification_routes "https://github.com/jvitor-hash/devlink/blob/main/API/src/routes/v1/notification/index.ts"
click node_webhook_routes "https://github.com/jvitor-hash/devlink/blob/main/API/src/routes/v1/webhook/index.ts"
click node_chat_ws "https://github.com/jvitor-hash/devlink/blob/main/API/src/modules/websocket.ts"
click node_notification_ws "https://github.com/jvitor-hash/devlink/blob/main/API/src/modules/websocket_notifications.ts"
click node_scheduler "https://github.com/jvitor-hash/devlink/blob/main/API/src/modules/scheduler.ts"
click node_outbox "https://github.com/jvitor-hash/devlink/blob/main/API/src/modules/notification_outbox.ts"
click node_webhook_delivery "https://github.com/jvitor-hash/devlink/blob/main/API/src/modules/webhook_delivery.ts"
click node_schemas "https://github.com/jvitor-hash/devlink/blob/main/API/src/database/schema/project_schema.ts"
click node_message_service "https://github.com/jvitor-hash/devlink/blob/main/API/src/routes/v1/message/service.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_frontend,node_project_views,node_project_detail,node_questionnaire,node_account_views,node_notifications_ui,node_api_client,node_chat_hook,node_ws_client,node_users toneBlue
class node_api,node_project_routes,node_project_service,node_saved_service,node_work_routes,node_user_routes,node_notification_routes,node_webhook_routes,node_message_service toneAmber
class node_chat_ws,node_notification_ws,node_scheduler,node_outbox,node_webhook_delivery toneMint
class node_postgres,node_schemas toneRose
```

## Components

### Frontend experience

- [React application](https://github.com/jvitor-hash/devlink/blob/main/FRONTEND/src/main.tsx): `FRONTEND/src/main.tsx`
- [Project discovery](https://github.com/jvitor-hash/devlink/blob/main/FRONTEND/src/pages/home/home.tsx): `FRONTEND/src/pages/home/home.tsx`
- [Project workspace](https://github.com/jvitor-hash/devlink/blob/main/FRONTEND/src/pages/project_open/project_open.tsx): `FRONTEND/src/pages/project_open/project_open.tsx`
- [Project questionnaire](https://github.com/jvitor-hash/devlink/blob/main/FRONTEND/src/pages/questionnaire/questionnaire.tsx): `FRONTEND/src/pages/questionnaire/questionnaire.tsx`
- [Account and settings](https://github.com/jvitor-hash/devlink/blob/main/FRONTEND/src/pages/settings/settings.tsx): `FRONTEND/src/pages/settings/settings.tsx`
- [Notification center](https://github.com/jvitor-hash/devlink/blob/main/FRONTEND/src/pages/notification_center/notification.tsx): `FRONTEND/src/pages/notification_center/notification.tsx`
- [HTTP client](https://github.com/jvitor-hash/devlink/blob/main/FRONTEND/src/utils/api_client.ts): `FRONTEND/src/utils/api_client.ts`
- [Project chat hook](https://github.com/jvitor-hash/devlink/blob/main/FRONTEND/src/hooks/use_project_chat.ts): `FRONTEND/src/hooks/use_project_chat.ts`
- [WebSocket client](https://github.com/jvitor-hash/devlink/blob/main/FRONTEND/src/utils/websocket_client.ts): `FRONTEND/src/utils/websocket_client.ts`

### API and domain

- [Elysia API](https://github.com/jvitor-hash/devlink/blob/main/API/src/index.ts): `API/src/index.ts`
- [Project routes](https://github.com/jvitor-hash/devlink/blob/main/API/src/routes/v1/projects/index.ts): `API/src/routes/v1/projects/index.ts`
- [Project service](https://github.com/jvitor-hash/devlink/blob/main/API/src/routes/v1/projects/service.ts): `API/src/routes/v1/projects/service.ts`
- [Saved opportunities](https://github.com/jvitor-hash/devlink/blob/main/API/src/routes/v1/saved_ticket/service.ts): `API/src/routes/v1/saved_ticket/service.ts`
- [Work and review routes](https://github.com/jvitor-hash/devlink/blob/main/API/src/routes/v1/ticket/index.ts): `API/src/routes/v1/ticket/index.ts`
- [User routes](https://github.com/jvitor-hash/devlink/blob/main/API/src/routes/v1/users/index.ts): `API/src/routes/v1/users/index.ts`
- [Notification routes](https://github.com/jvitor-hash/devlink/blob/main/API/src/routes/v1/notification/index.ts): `API/src/routes/v1/notification/index.ts`
- [Webhook routes](https://github.com/jvitor-hash/devlink/blob/main/API/src/routes/v1/webhook/index.ts): `API/src/routes/v1/webhook/index.ts`
- [Message service](https://github.com/jvitor-hash/devlink/blob/main/API/src/routes/v1/message/service.ts): `API/src/routes/v1/message/service.ts`

### Chat and events

- [Chat WebSocket](https://github.com/jvitor-hash/devlink/blob/main/API/src/modules/websocket.ts): `API/src/modules/websocket.ts`
- [Notification WebSocket](https://github.com/jvitor-hash/devlink/blob/main/API/src/modules/websocket_notifications.ts): `API/src/modules/websocket_notifications.ts`
- [Background scheduler](https://github.com/jvitor-hash/devlink/blob/main/API/src/modules/scheduler.ts): `API/src/modules/scheduler.ts`
- [Notification outbox](https://github.com/jvitor-hash/devlink/blob/main/API/src/modules/notification_outbox.ts): `API/src/modules/notification_outbox.ts`
- [Webhook delivery](https://github.com/jvitor-hash/devlink/blob/main/API/src/modules/webhook_delivery.ts): `API/src/modules/webhook_delivery.ts`

### Persistence

- **PostgreSQL**
- [Domain schemas](https://github.com/jvitor-hash/devlink/blob/main/API/src/database/schema/project_schema.ts): `API/src/database/schema/project_schema.ts`

### Other components

- **Marketplace users**

## Connections

- Marketplace users → React application: use (evidence: `FRONTEND/src/main.tsx`)
- React application → Project discovery: renders
- React application → Project workspace: renders
- React application → Project questionnaire: renders
- React application → Account and settings: renders
- React application → Notification center: renders
- Project discovery → HTTP client: requests data
- Project workspace → HTTP client: requests data
- Project questionnaire → HTTP client: submits project
- Account and settings → HTTP client: requests data
- Notification center → HTTP client: loads notifications
- Project workspace → Project chat hook: uses
- Project chat hook → WebSocket client: uses
- HTTP client → Elysia API: HTTP requests
- WebSocket client → Chat WebSocket: WebSocket frames
- Elysia API → Project routes: registers (evidence: `API/src/index.ts`)
- Elysia API → Notification routes: registers (evidence: `API/src/index.ts`)
- Elysia API → Webhook routes: registers (evidence: `API/src/index.ts`)
- Elysia API → Chat WebSocket: registers (evidence: `API/src/index.ts`)
- Elysia API → Notification WebSocket: registers (evidence: `API/src/index.ts`)
- Elysia API → Background scheduler: starts (evidence: `API/src/index.ts`)
- Project routes → Project service: delegates
- Project service → Saved opportunities: reads saved IDs (evidence: `API/src/routes/v1/projects/service.ts`)
- Chat WebSocket → Message service: creates messages (evidence: `API/src/modules/websocket.ts`)
- Saved opportunities → Notification outbox: publishes event (evidence: `API/src/routes/v1/saved_ticket/service.ts`)
- Chat WebSocket → Notification outbox: publishes event (evidence: `API/src/modules/websocket.ts`)
- Background scheduler → Notification outbox: drains and retries (evidence: `API/src/modules/scheduler.ts`)
- Background scheduler → Webhook delivery: fanout documented
- Project service → PostgreSQL: queries projects (evidence: `API/src/routes/v1/projects/service.ts`)
- Saved opportunities → PostgreSQL: reads and writes (evidence: `API/src/routes/v1/saved_ticket/service.ts`)
- Message service → PostgreSQL: persists messages
- Chat WebSocket → PostgreSQL: loads project and users (evidence: `API/src/modules/websocket.ts`)
- Background scheduler → PostgreSQL: sweeps project data (evidence: `API/src/modules/scheduler.ts`)
- Domain schemas → PostgreSQL: defines tables
- Work and review routes → Project service: domain coordination
- User routes → PostgreSQL: user operations
- Notification routes → Notification outbox: notification events
- Webhook routes → Webhook delivery: configures delivery
