# riyanamanda/helpdesk-backend architecture

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

- Interactive diagram: https://gitdiagram.com/riyanamanda/helpdesk-backend
- Repository: https://github.com/riyanamanda/helpdesk-backend

## Overview

This is a Go/Echo REST API for internal IT helpdesk operations. Employees and administrators use the HTTP API for authentication, ticket handling, user/profile administration, feedback, and supporting lookups; services persist domain data and return API responses. Ticket and user workflows can also produce queued events that the background worker publishes and processes for email. The README describes a handler–service–repository architecture. Some domain implementations and integrations were not excerpted, so those branches are shown only where wiring is explicit or documented.

Main entry points: [`cmd/api/main.go`](https://github.com/riyanamanda/helpdesk-backend/blob/main/cmd/api/main.go) (HTTP API), [`internal/ticket/service.go`](https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/ticket/service.go) (Ticket management), [`internal/auth/service.go`](https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/auth/service.go) (Authentication), [`internal/outbox/repository.go`](https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/outbox/repository.go) (Event outbox)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API and workers"]
  node_api["HTTP API<br/>[main.go]"]
end

subgraph group_domains["Helpdesk domains"]
  node_auth["Authentication<br/>[service.go]"]
  node_ticket["Ticket management<br/>[service.go]"]
  node_users["User management<br/>[service.go]"]
  node_category["Categories<br/>[service.go]"]
  node_division["Divisions<br/>[service.go]"]
  node_feedback["Feedback<br/>[service.go]"]
  node_profile["User profiles<br/>[service.go]"]
  node_dashboard["Dashboard<br/>[service.go]"]
  node_rbac["Access control"]
  node_integrations["Queue and SIMGOS"]
end

subgraph group_infra["Infrastructure"]
  node_postgres[("PostgreSQL<br/>[postgres.go]")]
  node_simgosdb[("SIMGOS database")]
  node_redis[("Redis cache<br/>[client.go]")]
  node_storage["Object storage<br/>[storage.go]"]
end

subgraph group_async["Event processing"]
  node_outbox[("Event outbox<br/>[repository.go]")]
  node_rabbit["RabbitMQ<br/>[rabbitmq.go]"]
  node_worker["Worker consumers<br/>[consumer.go]"]
  node_publisher["Outbox publisher<br/>[publisher.go]"]
  node_mailer["Email delivery<br/>[mailer.go]"]
end

node_employee(("API user"))

node_employee -->|"sends requests"| node_api
node_api -->|"registers routes"| node_auth
node_api -->|"registers routes"| node_ticket
node_api -->|"registers routes"| node_users
node_api -->|"registers routes"| node_category
node_api -->|"registers routes"| node_division
node_api -->|"registers routes"| node_feedback
node_api -->|"registers routes"| node_profile
node_api -->|"registers routes"| node_rbac
node_api -->|"registers routes"| node_integrations
node_api -.->|"registers routes"| node_dashboard
node_api -->|"connects"| node_postgres
node_api -->|"optionally connects"| node_simgosdb
node_api -->|"connects"| node_redis
node_ticket -->|"uploads attachments"| node_storage
node_profile -->|"uploads avatars"| node_storage
node_ticket -->|"looks up categories"| node_category
node_ticket -->|"looks up divisions"| node_division
node_ticket -->|"looks up users"| node_users
node_auth -->|"gets permissions"| node_rbac
node_auth -->|"stores sessions"| node_redis
node_auth -->|"publishes reset event"| node_rabbit
node_users -->|"records events"| node_outbox
node_ticket -->|"records events"| node_outbox
node_api -->|"connects"| node_rabbit
node_api -.->|"starts separately"| node_worker
node_publisher -->|"reads pending events"| node_outbox
node_publisher -->|"publishes events"| node_rabbit
node_worker -->|"consumes messages"| node_rabbit
node_worker -->|"delivers email"| node_mailer
node_api -->|"initializes repository"| node_outbox
node_api -.->|"wires service"| node_dashboard
node_api -->|"wires SIMGOS services"| node_integrations

click node_api "https://github.com/riyanamanda/helpdesk-backend/blob/main/cmd/api/main.go"
click node_auth "https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/auth/service.go"
click node_ticket "https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/ticket/service.go"
click node_users "https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/user/service.go"
click node_category "https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/category/service.go"
click node_division "https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/division/service.go"
click node_feedback "https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/feedback/service.go"
click node_profile "https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/profile/service.go"
click node_dashboard "https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/dashboard/service.go"
click node_rbac "https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/rbac/permission_service.go"
click node_integrations "https://github.com/riyanamanda/helpdesk-backend/tree/main/internal/ihs"
click node_postgres "https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/platform/database/postgres.go"
click node_redis "https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/platform/redis/client.go"
click node_storage "https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/platform/storage/storage.go"
click node_outbox "https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/outbox/repository.go"
click node_rabbit "https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/platform/rabbitmq/rabbitmq.go"
click node_worker "https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/worker/consumer.go"
click node_publisher "https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/worker/publisher.go"
click node_mailer "https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/mailer/mailer.go"

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_api,node_employee toneBlue
class node_auth,node_ticket,node_users,node_category,node_division,node_feedback,node_profile,node_dashboard,node_rbac,node_integrations toneAmber
class node_postgres,node_simgosdb,node_redis,node_storage toneMint
class node_outbox,node_rabbit,node_worker,node_publisher,node_mailer toneRose
```

## Components

### API and workers

- [HTTP API](https://github.com/riyanamanda/helpdesk-backend/blob/main/cmd/api/main.go): `cmd/api/main.go`

### Helpdesk domains

- [Authentication](https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/auth/service.go): `internal/auth/service.go`
- [Ticket management](https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/ticket/service.go): `internal/ticket/service.go`
- [User management](https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/user/service.go): `internal/user/service.go`
- [Categories](https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/category/service.go): `internal/category/service.go`
- [Divisions](https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/division/service.go): `internal/division/service.go`
- [Feedback](https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/feedback/service.go): `internal/feedback/service.go`
- [User profiles](https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/profile/service.go): `internal/profile/service.go`
- [Dashboard](https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/dashboard/service.go): `internal/dashboard/service.go`
- [Access control](https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/rbac/permission_service.go): `internal/rbac/permission_service.go`
- [Queue and SIMGOS](https://github.com/riyanamanda/helpdesk-backend/tree/main/internal/ihs): `internal/ihs`

### Infrastructure

- [PostgreSQL](https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/platform/database/postgres.go): `internal/platform/database/postgres.go`
- **SIMGOS database**
- [Redis cache](https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/platform/redis/client.go): `internal/platform/redis/client.go`
- [Object storage](https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/platform/storage/storage.go): `internal/platform/storage/storage.go`

### Event processing

- [Event outbox](https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/outbox/repository.go): `internal/outbox/repository.go`
- [RabbitMQ](https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/platform/rabbitmq/rabbitmq.go): `internal/platform/rabbitmq/rabbitmq.go`
- [Worker consumers](https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/worker/consumer.go): `internal/worker/consumer.go`
- [Outbox publisher](https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/worker/publisher.go): `internal/worker/publisher.go`
- [Email delivery](https://github.com/riyanamanda/helpdesk-backend/blob/main/internal/mailer/mailer.go): `internal/mailer/mailer.go`

### Other components

- **API user**

## Connections

- API user → HTTP API: sends requests (evidence: `README.md`)
- HTTP API → Authentication: registers routes (evidence: `cmd/api/main.go`)
- HTTP API → Ticket management: registers routes (evidence: `cmd/api/main.go`)
- HTTP API → User management: registers routes (evidence: `cmd/api/main.go`)
- HTTP API → Categories: registers routes (evidence: `cmd/api/main.go`)
- HTTP API → Divisions: registers routes (evidence: `cmd/api/main.go`)
- HTTP API → Feedback: registers routes (evidence: `cmd/api/main.go`)
- HTTP API → User profiles: registers routes (evidence: `cmd/api/main.go`)
- HTTP API → Access control: registers routes (evidence: `cmd/api/main.go`)
- HTTP API → Queue and SIMGOS: registers routes (evidence: `cmd/api/main.go`)
- HTTP API → Dashboard: registers routes
- HTTP API → PostgreSQL: connects (evidence: `cmd/api/main.go`)
- HTTP API → SIMGOS database: optionally connects (evidence: `cmd/api/main.go`)
- HTTP API → Redis cache: connects (evidence: `cmd/api/main.go`)
- Ticket management → Object storage: uploads attachments (evidence: `internal/ticket/service.go`)
- User profiles → Object storage: uploads avatars (evidence: `internal/profile/service.go`)
- Ticket management → Categories: looks up categories (evidence: `internal/ticket/service.go`)
- Ticket management → Divisions: looks up divisions (evidence: `internal/ticket/service.go`)
- Ticket management → User management: looks up users (evidence: `internal/ticket/service.go`)
- Authentication → Access control: gets permissions (evidence: `internal/auth/service.go`)
- Authentication → Redis cache: stores sessions (evidence: `internal/auth/service.go`)
- Authentication → RabbitMQ: publishes reset event (evidence: `internal/auth/service.go`)
- User management → Event outbox: records events (evidence: `internal/user/service.go`)
- Ticket management → Event outbox: records events (evidence: `internal/ticket/service.go`)
- HTTP API → RabbitMQ: connects (evidence: `cmd/api/main.go`)
- HTTP API → Worker consumers: starts separately
- Outbox publisher → Event outbox: reads pending events
- Outbox publisher → RabbitMQ: publishes events
- Worker consumers → RabbitMQ: consumes messages
- Worker consumers → Email delivery: delivers email
- HTTP API → Event outbox: initializes repository (evidence: `cmd/api/main.go`)
- HTTP API → Dashboard: wires service
- HTTP API → Queue and SIMGOS: wires SIMGOS services (evidence: `cmd/api/main.go`)
