How deahesi/deahesi-os-backend works
This Go service exposes a text-and-file chat endpoint that validates and parses requests, prepares optional file data, calls an OpenRouter model, and streams response events to the client. Startup and dependency wiring are shown in the sampled application files. The README is empty; the graph therefore reflects the demonstrated endpoint and does not infer additional routes or tool behavior from unsampled code.
Main entry points: service.go AI service · ai.go Chat handler · application.go Application · services.go Service wiring
Components 18
Startup and wiring
- Process entry
cmd/server/server.go - Application
internal/app/application.go - Configuration
internal/config/config.go - Service wiring
internal/app/services.go - HTTP lifecycle
internal/app/server.go
HTTP API
- Route server
internal/httpapi/server.go - Chat handler
internal/httpapi/handlers/ai-handlers/ai.go - Request DTO
internal/httpapi/handlers/ai-handlers/dto.go - File parser
internal/httpapi/parsers/file.go - Stream responses
internal/httpapi/responses/responses.go
Chat and model
- AI service
internal/ai/service.go - AI input
internal/ai/input.go - AI errors
internal/domain/ai.go - Chat message
internal/domain/llm.go - LLM service
internal/llm/service.go - LLM tools
internal/llm/tools.go
Other components
- Chat client
- OpenRouter
Connections 20
- Chat client → Process entry: sends request
- Process entry → Application: starts
cmd/server/server.go - Application → Configuration: loads
internal/app/application.go - Application → Service wiring: builds services
internal/app/application.go - Service wiring → Configuration: reads settings
internal/app/services.go - Application → HTTP lifecycle: creates
internal/app/application.go - Service wiring → AI service: constructs
internal/app/services.go - Service wiring → LLM service: constructs
internal/app/services.go - HTTP lifecycle → Route server: serves
internal/app/server.go - Route server → Chat handler: routes to
internal/httpapi/server.go - Chat handler → File parser: parses upload
internal/httpapi/handlers/ai-handlers/ai.go - Chat handler → AI service: submits message
internal/httpapi/handlers/ai-handlers/ai.go - Chat handler → Stream responses: writes stream
internal/httpapi/handlers/ai-handlers/ai.go - Chat handler → AI errors: checks errors
internal/httpapi/handlers/ai-handlers/ai.go - AI service → AI input: accepts input
internal/ai/service.go - AI service → Chat message: builds message
internal/ai/service.go - AI service → LLM service: forwards message
internal/ai/service.go - AI service → AI errors: returns errors
internal/ai/service.go - LLM service → OpenRouter: sends completion
internal/llm/service.go - LLM service → LLM tools: uses tools