# herloncosta/ai-customer-insights-platform architecture

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

- Interactive diagram: https://gitdiagram.com/herloncosta/ai-customer-insights-platform
- Repository: https://github.com/herloncosta/ai-customer-insights-platform

## Overview

This is an AI customer-feedback insights platform: users submit feedback, which is accepted for asynchronous analysis, while the interface provides feedback browsing and aggregate metrics. The sampled backend establishes the API-to-service-to-database/queue flow, and the worker establishes message dispatch to processing. The frontend’s screens and worker internals are represented from the tree, but their unsampled request and processing details are not expanded into unsupported connections.

Main entry points: [`frontend/src/App.tsx`](https://github.com/herloncosta/ai-customer-insights-platform/blob/main/frontend/src/App.tsx) (App shell), [`worker/src/index.ts`](https://github.com/herloncosta/ai-customer-insights-platform/blob/main/worker/src/index.ts) (Worker consumer), [`backend/src/routes/feedback.routes.ts`](https://github.com/herloncosta/ai-customer-insights-platform/blob/main/backend/src/routes/feedback.routes.ts) (Feedback routes), [`backend/src/services/feedback.service.ts`](https://github.com/herloncosta/ai-customer-insights-platform/blob/main/backend/src/services/feedback.service.ts) (Feedback service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Feedback interface"]
  node_app["App shell<br/>[App.tsx]"]
  node_new["Submit feedback"]
  node_list["Feedback list"]
  node_dashboard["Insights dashboard"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_api["Feedback API"]
  node_backend["HTTP application<br/>[app.ts]"]
  node_routes["Feedback routes<br/>[feedback.routes.ts]"]
  node_validation["Request validation<br/>[validate.ts]"]
  node_controller["Feedback controller"]
  node_service["Feedback service"]
end

subgraph group_processing["Analysis processing"]
  node_consumer["Worker consumer<br/>[index.ts]"]
  node_worker_queue["Worker queue setup<br/>[rabbitmq.ts]"]
  node_processor["Feedback processor"]
  node_analyzer["Feedback analyzer<br/>[analyzer.ts]"]
end

subgraph group_data["Persistence and messaging"]
  node_db["Prisma database access<br/>[index.ts]"]
  node_queue_publisher["Queue publisher<br/>[queue.ts]"]
  node_broker["RabbitMQ"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_new
node_app -->|"renders"| node_list
node_app -->|"renders"| node_dashboard
node_app -.-> node_api_client
node_backend -->|"mounts"| node_routes
node_routes -->|"validates with"| node_validation
node_routes -->|"dispatches"| node_controller
node_controller -->|"calls"| node_service
node_service -->|"reads and writes"| node_db
node_service -->|"publishes"| node_queue_publisher
node_queue_publisher -->|"sends message"| node_broker
node_consumer -->|"connects via"| node_worker_queue
node_consumer -->|"consumes from"| node_broker
node_consumer -->|"dispatches"| node_processor

click node_app "https://github.com/herloncosta/ai-customer-insights-platform/blob/main/frontend/src/App.tsx"
click node_new "https://github.com/herloncosta/ai-customer-insights-platform/blob/main/frontend/src/screens/NewFeedbackScreen.tsx"
click node_list "https://github.com/herloncosta/ai-customer-insights-platform/blob/main/frontend/src/screens/FeedbacksScreen.tsx"
click node_dashboard "https://github.com/herloncosta/ai-customer-insights-platform/blob/main/frontend/src/screens/DashboardScreen.tsx"
click node_api_client "https://github.com/herloncosta/ai-customer-insights-platform/blob/main/frontend/src/lib/api.ts"
click node_backend "https://github.com/herloncosta/ai-customer-insights-platform/blob/main/backend/src/app.ts"
click node_routes "https://github.com/herloncosta/ai-customer-insights-platform/blob/main/backend/src/routes/feedback.routes.ts"
click node_validation "https://github.com/herloncosta/ai-customer-insights-platform/blob/main/backend/src/middlewares/validate.ts"
click node_controller "https://github.com/herloncosta/ai-customer-insights-platform/blob/main/backend/src/controllers/feedback.controller.ts"
click node_service "https://github.com/herloncosta/ai-customer-insights-platform/blob/main/backend/src/services/feedback.service.ts"
click node_db "https://github.com/herloncosta/ai-customer-insights-platform/blob/main/shared/src/index.ts"
click node_queue_publisher "https://github.com/herloncosta/ai-customer-insights-platform/blob/main/backend/src/lib/queue.ts"
click node_consumer "https://github.com/herloncosta/ai-customer-insights-platform/blob/main/worker/src/index.ts"
click node_worker_queue "https://github.com/herloncosta/ai-customer-insights-platform/blob/main/worker/src/rabbitmq.ts"
click node_processor "https://github.com/herloncosta/ai-customer-insights-platform/blob/main/worker/src/feedback.processor.ts"
click node_analyzer "https://github.com/herloncosta/ai-customer-insights-platform/blob/main/worker/src/lib/analyzer.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_app,node_new,node_list,node_dashboard,node_api_client,node_user toneBlue
class node_backend,node_routes,node_validation,node_controller,node_service toneAmber
class node_consumer,node_worker_queue,node_processor,node_analyzer toneMint
class node_db,node_queue_publisher,node_broker toneRose
```

## Components

### Feedback interface

- [App shell](https://github.com/herloncosta/ai-customer-insights-platform/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Submit feedback](https://github.com/herloncosta/ai-customer-insights-platform/blob/main/frontend/src/screens/NewFeedbackScreen.tsx): `frontend/src/screens/NewFeedbackScreen.tsx`
- [Feedback list](https://github.com/herloncosta/ai-customer-insights-platform/blob/main/frontend/src/screens/FeedbacksScreen.tsx): `frontend/src/screens/FeedbacksScreen.tsx`
- [Insights dashboard](https://github.com/herloncosta/ai-customer-insights-platform/blob/main/frontend/src/screens/DashboardScreen.tsx): `frontend/src/screens/DashboardScreen.tsx`
- [API client](https://github.com/herloncosta/ai-customer-insights-platform/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`

### Feedback API

- [HTTP application](https://github.com/herloncosta/ai-customer-insights-platform/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Feedback routes](https://github.com/herloncosta/ai-customer-insights-platform/blob/main/backend/src/routes/feedback.routes.ts): `backend/src/routes/feedback.routes.ts`
- [Request validation](https://github.com/herloncosta/ai-customer-insights-platform/blob/main/backend/src/middlewares/validate.ts): `backend/src/middlewares/validate.ts`
- [Feedback controller](https://github.com/herloncosta/ai-customer-insights-platform/blob/main/backend/src/controllers/feedback.controller.ts): `backend/src/controllers/feedback.controller.ts`
- [Feedback service](https://github.com/herloncosta/ai-customer-insights-platform/blob/main/backend/src/services/feedback.service.ts): `backend/src/services/feedback.service.ts`

### Analysis processing

- [Worker consumer](https://github.com/herloncosta/ai-customer-insights-platform/blob/main/worker/src/index.ts): `worker/src/index.ts`
- [Worker queue setup](https://github.com/herloncosta/ai-customer-insights-platform/blob/main/worker/src/rabbitmq.ts): `worker/src/rabbitmq.ts`
- [Feedback processor](https://github.com/herloncosta/ai-customer-insights-platform/blob/main/worker/src/feedback.processor.ts): `worker/src/feedback.processor.ts`
- [Feedback analyzer](https://github.com/herloncosta/ai-customer-insights-platform/blob/main/worker/src/lib/analyzer.ts): `worker/src/lib/analyzer.ts`

### Persistence and messaging

- [Prisma database access](https://github.com/herloncosta/ai-customer-insights-platform/blob/main/shared/src/index.ts): `shared/src/index.ts`
- [Queue publisher](https://github.com/herloncosta/ai-customer-insights-platform/blob/main/backend/src/lib/queue.ts): `backend/src/lib/queue.ts`
- **RabbitMQ**

### Other components

- **User**

## Connections

- User → App shell: uses
- App shell → Submit feedback: renders
- App shell → Feedback list: renders
- App shell → Insights dashboard: renders
- App shell → API client
- HTTP application → Feedback routes: mounts
- Feedback routes → Request validation: validates with
- Feedback routes → Feedback controller: dispatches
- Feedback controller → Feedback service: calls
- Feedback service → Prisma database access: reads and writes
- Feedback service → Queue publisher: publishes
- Queue publisher → RabbitMQ: sends message
- Worker consumer → Worker queue setup: connects via
- Worker consumer → RabbitMQ: consumes from
- Worker consumer → Feedback processor: dispatches
