# jayashree-011/chatmate-springai-chatbot architecture

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

- Interactive diagram: https://gitdiagram.com/jayashree-011/chatmate-springai-chatbot
- Repository: https://github.com/jayashree-011/chatmate-springai-chatbot

## Overview

ChatMate is a full-stack chatbot: users compose messages in a React interface, which sends the current message and conversation history to a Spring Boot API; the API obtains a Gemini reply for display. Conversation history and sidebar actions remain in browser memory, while the backend does not store conversations. The frontend request/response path is visible in excerpts, and the README documents the API contract and Gemini integration. Backend implementation details were not sampled, so internal backend call relationships are left unasserted.

Main entry points: [`chatmate-frontend/src/services/chatApi.ts`](https://github.com/jayashree-011/chatmate-springai-chatbot/blob/master/chatmate-frontend/src/services/chatApi.ts) (Chat API client), [`chatmate-backend/src/main/java/com/example/chatmate/controller/ChatController.java`](https://github.com/jayashree-011/chatmate-springai-chatbot/blob/master/chatmate-backend/src/main/java/com/example/chatmate/controller/ChatController.java) (Chat endpoint), [`chatmate-frontend/src/App.tsx`](https://github.com/jayashree-011/chatmate-springai-chatbot/blob/master/chatmate-frontend/src/App.tsx) (Conversation UI), [`chatmate-frontend/src/main.tsx`](https://github.com/jayashree-011/chatmate-springai-chatbot/blob/master/chatmate-frontend/src/main.tsx) (React bootstrap)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Chat interface"]
  node_app["Conversation UI<br/>[App.tsx]"]
  node_bootstrap["React bootstrap<br/>[main.tsx]"]
  node_api_client["Chat API client<br/>[chatApi.ts]"]
  node_contracts["Chat contracts<br/>[types.ts]"]
end

subgraph group_backend["Chat API"]
  node_chat_endpoint["Chat endpoint"]
  node_chat_service["Chat service<br/>[ChatService.java]"]
  node_chat_dtos["API messages"]
end

subgraph group_ai["AI provider"]
  node_gemini{{"Gemini 2.5 Flash"}}
end

node_user(("Chat user"))

node_user -->|"submits messages"| node_app
node_bootstrap -->|"renders"| node_app
node_app -->|"sends turns"| node_api_client
node_api_client -->|"uses types"| node_contracts
node_api_client -->|"posts message"| node_chat_endpoint
node_chat_endpoint -.->|"accepts and returns"| node_chat_dtos
node_chat_endpoint -.->|"delegates to"| node_chat_service
node_chat_endpoint -->|"requests AI reply"| node_gemini
node_api_client -->|"returns reply"| node_app

click node_app "https://github.com/jayashree-011/chatmate-springai-chatbot/blob/master/chatmate-frontend/src/App.tsx"
click node_bootstrap "https://github.com/jayashree-011/chatmate-springai-chatbot/blob/master/chatmate-frontend/src/main.tsx"
click node_api_client "https://github.com/jayashree-011/chatmate-springai-chatbot/blob/master/chatmate-frontend/src/services/chatApi.ts"
click node_contracts "https://github.com/jayashree-011/chatmate-springai-chatbot/blob/master/chatmate-frontend/src/types.ts"
click node_chat_endpoint "https://github.com/jayashree-011/chatmate-springai-chatbot/blob/master/chatmate-backend/src/main/java/com/example/chatmate/controller/ChatController.java"
click node_chat_service "https://github.com/jayashree-011/chatmate-springai-chatbot/blob/master/chatmate-backend/src/main/java/com/example/chatmate/service/ChatService.java"
click node_chat_dtos "https://github.com/jayashree-011/chatmate-springai-chatbot/tree/master/chatmate-backend/src/main/java/com/example/chatmate/dto"

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_bootstrap,node_api_client,node_contracts,node_user toneBlue
class node_chat_endpoint,node_chat_service,node_chat_dtos toneAmber
class node_gemini toneMint
```

## Components

### Chat interface

- [Conversation UI](https://github.com/jayashree-011/chatmate-springai-chatbot/blob/master/chatmate-frontend/src/App.tsx): `chatmate-frontend/src/App.tsx`
- [React bootstrap](https://github.com/jayashree-011/chatmate-springai-chatbot/blob/master/chatmate-frontend/src/main.tsx): `chatmate-frontend/src/main.tsx`
- [Chat API client](https://github.com/jayashree-011/chatmate-springai-chatbot/blob/master/chatmate-frontend/src/services/chatApi.ts): `chatmate-frontend/src/services/chatApi.ts`
- [Chat contracts](https://github.com/jayashree-011/chatmate-springai-chatbot/blob/master/chatmate-frontend/src/types.ts): `chatmate-frontend/src/types.ts`

### Chat API

- [Chat endpoint](https://github.com/jayashree-011/chatmate-springai-chatbot/blob/master/chatmate-backend/src/main/java/com/example/chatmate/controller/ChatController.java): `chatmate-backend/src/main/java/com/example/chatmate/controller/ChatController.java`
- [Chat service](https://github.com/jayashree-011/chatmate-springai-chatbot/blob/master/chatmate-backend/src/main/java/com/example/chatmate/service/ChatService.java): `chatmate-backend/src/main/java/com/example/chatmate/service/ChatService.java`
- [API messages](https://github.com/jayashree-011/chatmate-springai-chatbot/tree/master/chatmate-backend/src/main/java/com/example/chatmate/dto): `chatmate-backend/src/main/java/com/example/chatmate/dto`

### AI provider

- **Gemini 2.5 Flash**

### Other components

- **Chat user**

## Connections

- Chat user → Conversation UI: submits messages (evidence: `chatmate-frontend/src/App.tsx`)
- React bootstrap → Conversation UI: renders (evidence: `chatmate-frontend/src/main.tsx`)
- Conversation UI → Chat API client: sends turns (evidence: `chatmate-frontend/src/App.tsx`)
- Chat API client → Chat contracts: uses types (evidence: `chatmate-frontend/src/services/chatApi.ts`)
- Chat API client → Chat endpoint: posts message (evidence: `README.md`)
- Chat endpoint → API messages: accepts and returns
- Chat endpoint → Chat service: delegates to
- Chat endpoint → Gemini 2.5 Flash: requests AI reply (evidence: `README.md`)
- Chat API client → Conversation UI: returns reply (evidence: `chatmate-frontend/src/App.tsx`)
