# hemanthn-dev/omnix-ai-copilot architecture

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

- Interactive diagram: https://gitdiagram.com/hemanthn-dev/omnix-ai-copilot
- Repository: https://github.com/hemanthn-dev/omnix-ai-copilot

## Overview

Omnix AI Copilot is a Spring Boot chat application with a JSP interface, session and message history, persistence, and a Gemini-backed response path. The main workflow is: a user starts a session, submits a message, the service verifies the session and saves the message, calls Gemini, saves the reply, and returns it. Session listing, history, deletion, and renaming are separate API operations. README capabilities are retained, though the sampled service shows an explicit rename operation rather than proving automatic renaming. The JSP and database configuration were not sampled, so those links rely on documented behavior or are omitted where unverified.

Main entry points: [`ai-copilot/src/main/java/com/ai/copilot/service/ChatService.java`](https://github.com/hemanthn-dev/omnix-ai-copilot/blob/main/ai-copilot/src/main/java/com/ai/copilot/service/ChatService.java) (Chat orchestration), [`ai-copilot/src/main/java/com/ai/copilot/controller/ChatController.java`](https://github.com/hemanthn-dev/omnix-ai-copilot/blob/main/ai-copilot/src/main/java/com/ai/copilot/controller/ChatController.java) (Chat endpoints), [`ai-copilot/src/main/java/com/ai/copilot/repository/ChatSessionRepository.java`](https://github.com/hemanthn-dev/omnix-ai-copilot/blob/main/ai-copilot/src/main/java/com/ai/copilot/repository/ChatSessionRepository.java) (Session repository), [`ai-copilot/src/main/java/com/ai/copilot/repository/MessageRepository.java`](https://github.com/hemanthn-dev/omnix-ai-copilot/blob/main/ai-copilot/src/main/java/com/ai/copilot/repository/MessageRepository.java) (Message repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_view["Page routing"]
  node_jsp["Chat interface<br/>[chat.jsp]"]
end

subgraph group_api["Chat API"]
  node_controller["Chat endpoints"]
  node_summary["Session summary"]
end

subgraph group_domain["Chat services"]
  node_service["Chat orchestration<br/>[ChatService.java]"]
  node_session["Session record<br/>[ChatSession.java]"]
  node_message["Message record<br/>[Message.java]"]
end

subgraph group_persistence["Persistence and AI"]
  node_sessionrepo["Session repository"]
  node_messagerepo["Message repository"]
  node_database[("Relational database<br/>[ChatSession.java]")]
  node_gemini{{"Gemini API"}}
end

node_user(("Chat user"))

node_user -->|"opens chat"| node_view
node_view -->|"resolves view"| node_jsp
node_user -->|"uses chat API"| node_controller
node_controller -->|"delegates"| node_service
node_controller -->|"maps sessions"| node_summary
node_service -->|"reads and writes"| node_sessionrepo
node_service -->|"reads and writes"| node_messagerepo
node_sessionrepo -->|"persists"| node_session
node_messagerepo -->|"persists"| node_message
node_sessionrepo -.->|"queries"| node_database
node_messagerepo -.->|"queries"| node_database
node_service -->|"requests response"| node_gemini

click node_view "https://github.com/hemanthn-dev/omnix-ai-copilot/blob/main/ai-copilot/src/main/java/com/ai/copilot/controller/ViewController.java"
click node_jsp "https://github.com/hemanthn-dev/omnix-ai-copilot/blob/main/ai-copilot/src/main/webapp/WEB-INF/views/chat.jsp"
click node_controller "https://github.com/hemanthn-dev/omnix-ai-copilot/blob/main/ai-copilot/src/main/java/com/ai/copilot/controller/ChatController.java"
click node_summary "https://github.com/hemanthn-dev/omnix-ai-copilot/blob/main/ai-copilot/src/main/java/com/ai/copilot/dto/SessionSummary.java"
click node_service "https://github.com/hemanthn-dev/omnix-ai-copilot/blob/main/ai-copilot/src/main/java/com/ai/copilot/service/ChatService.java"
click node_session "https://github.com/hemanthn-dev/omnix-ai-copilot/blob/main/ai-copilot/src/main/java/com/ai/copilot/entity/ChatSession.java"
click node_message "https://github.com/hemanthn-dev/omnix-ai-copilot/blob/main/ai-copilot/src/main/java/com/ai/copilot/entity/Message.java"
click node_sessionrepo "https://github.com/hemanthn-dev/omnix-ai-copilot/blob/main/ai-copilot/src/main/java/com/ai/copilot/repository/ChatSessionRepository.java"
click node_messagerepo "https://github.com/hemanthn-dev/omnix-ai-copilot/blob/main/ai-copilot/src/main/java/com/ai/copilot/repository/MessageRepository.java"
click node_database "https://github.com/hemanthn-dev/omnix-ai-copilot/blob/main/ai-copilot/src/main/java/com/ai/copilot/entity/ChatSession.java"

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_view,node_jsp,node_user toneBlue
class node_controller,node_summary toneAmber
class node_service,node_session,node_message toneMint
class node_sessionrepo,node_messagerepo,node_database,node_gemini toneRose
```

## Components

### Web interface

- [Page routing](https://github.com/hemanthn-dev/omnix-ai-copilot/blob/main/ai-copilot/src/main/java/com/ai/copilot/controller/ViewController.java): `ai-copilot/src/main/java/com/ai/copilot/controller/ViewController.java`
- [Chat interface](https://github.com/hemanthn-dev/omnix-ai-copilot/blob/main/ai-copilot/src/main/webapp/WEB-INF/views/chat.jsp): `ai-copilot/src/main/webapp/WEB-INF/views/chat.jsp`

### Chat API

- [Chat endpoints](https://github.com/hemanthn-dev/omnix-ai-copilot/blob/main/ai-copilot/src/main/java/com/ai/copilot/controller/ChatController.java): `ai-copilot/src/main/java/com/ai/copilot/controller/ChatController.java`
- [Session summary](https://github.com/hemanthn-dev/omnix-ai-copilot/blob/main/ai-copilot/src/main/java/com/ai/copilot/dto/SessionSummary.java): `ai-copilot/src/main/java/com/ai/copilot/dto/SessionSummary.java`

### Chat services

- [Chat orchestration](https://github.com/hemanthn-dev/omnix-ai-copilot/blob/main/ai-copilot/src/main/java/com/ai/copilot/service/ChatService.java): `ai-copilot/src/main/java/com/ai/copilot/service/ChatService.java`
- [Session record](https://github.com/hemanthn-dev/omnix-ai-copilot/blob/main/ai-copilot/src/main/java/com/ai/copilot/entity/ChatSession.java): `ai-copilot/src/main/java/com/ai/copilot/entity/ChatSession.java`
- [Message record](https://github.com/hemanthn-dev/omnix-ai-copilot/blob/main/ai-copilot/src/main/java/com/ai/copilot/entity/Message.java): `ai-copilot/src/main/java/com/ai/copilot/entity/Message.java`

### Persistence and AI

- [Session repository](https://github.com/hemanthn-dev/omnix-ai-copilot/blob/main/ai-copilot/src/main/java/com/ai/copilot/repository/ChatSessionRepository.java): `ai-copilot/src/main/java/com/ai/copilot/repository/ChatSessionRepository.java`
- [Message repository](https://github.com/hemanthn-dev/omnix-ai-copilot/blob/main/ai-copilot/src/main/java/com/ai/copilot/repository/MessageRepository.java): `ai-copilot/src/main/java/com/ai/copilot/repository/MessageRepository.java`
- [Relational database](https://github.com/hemanthn-dev/omnix-ai-copilot/blob/main/ai-copilot/src/main/java/com/ai/copilot/entity/ChatSession.java): `ai-copilot/src/main/java/com/ai/copilot/entity/ChatSession.java`
- **Gemini API**

### Other components

- **Chat user**

## Connections

- Chat user → Page routing: opens chat (evidence: `ai-copilot/src/main/java/com/ai/copilot/controller/ViewController.java`)
- Page routing → Chat interface: resolves view (evidence: `ai-copilot/src/main/java/com/ai/copilot/controller/ViewController.java`)
- Chat user → Chat endpoints: uses chat API (evidence: `README.md`)
- Chat endpoints → Chat orchestration: delegates (evidence: `ai-copilot/src/main/java/com/ai/copilot/controller/ChatController.java`)
- Chat endpoints → Session summary: maps sessions (evidence: `ai-copilot/src/main/java/com/ai/copilot/controller/ChatController.java`)
- Chat orchestration → Session repository: reads and writes (evidence: `ai-copilot/src/main/java/com/ai/copilot/service/ChatService.java`)
- Chat orchestration → Message repository: reads and writes (evidence: `ai-copilot/src/main/java/com/ai/copilot/service/ChatService.java`)
- Session repository → Session record: persists (evidence: `ai-copilot/src/main/java/com/ai/copilot/repository/ChatSessionRepository.java`)
- Message repository → Message record: persists (evidence: `ai-copilot/src/main/java/com/ai/copilot/repository/MessageRepository.java`)
- Session repository → Relational database: queries (evidence: `ai-copilot/src/main/java/com/ai/copilot/repository/ChatSessionRepository.java`)
- Message repository → Relational database: queries
- Chat orchestration → Gemini API: requests response (evidence: `ai-copilot/src/main/java/com/ai/copilot/service/ChatService.java`)
