# jeyasinghalex/chatapp architecture

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

- Interactive diagram: https://gitdiagram.com/jeyasinghalex/chatapp
- Repository: https://github.com/jeyasinghalex/chatapp

## Overview

This repository combines a small user-registration REST service, persistence-facing code, and static web assets. The main backend workflow is a client POSTing JSON user data to the service, which delegates to the user API; the API modifies the name and email and passes the user to the database connection implementation. The model represents users and gender. The tree also shows home, timer, and chat-box UI assets, but their wiring is not established by the excerpts. The database implementation was not excerpted, so its internals and configuration use remain uncertain.

Main entry points: [`src/main/java/userAPI/UserAPIImpl.java`](https://github.com/jeyasinghalex/chatapp/blob/master/src/main/java/userAPI/UserAPIImpl.java) (User API implementation), [`src/main/java/service/UserService.java`](https://github.com/jeyasinghalex/chatapp/blob/master/src/main/java/service/UserService.java) (User endpoint), [`src/main/java/model/User.java`](https://github.com/jeyasinghalex/chatapp/blob/master/src/main/java/model/User.java) (User model), [`src/main/java/commen/ConfigUtil.java`](https://github.com/jeyasinghalex/chatapp/blob/master/src/main/java/commen/ConfigUtil.java) (Configuration utility)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_service["REST service"]
  node_user_service["User endpoint<br/>[UserService.java]"]
end

subgraph group_api["User API"]
  node_user_api["User API contract<br/>[UserAPI.java]"]
  node_user_api_impl["User API implementation<br/>[UserAPIImpl.java]"]
end

subgraph group_domain["User domain"]
  node_user_model["User model<br/>[User.java]"]
  node_gender["Gender enum<br/>[Gender.java]"]
end

subgraph group_storage["Persistence"]
  node_user_dao["User DAO contract<br/>[UserDao.java]"]
  node_db_connection["Database connection"]
  node_config_util["Configuration utility<br/>[ConfigUtil.java]"]
  node_db_properties["Database properties"]
end

subgraph group_web["Web assets"]
  node_home_page["Home page<br/>[home.html]"]
  node_home_script["Home script<br/>[home.js]"]
  node_home_styles["Home styles<br/>[home.css]"]
  node_chat_page["Chat box page<br/>[chatBox.html]"]
  node_chat_styles["Chat box styles<br/>[chatBox.css]"]
  node_timer_page["Timer page<br/>[timer.html]"]
  node_timer_script["Timer script<br/>[timer.js]"]
  node_timer_styles["Timer styles<br/>[timer.css]"]
  node_site_index["Site index<br/>[index.html]"]
  node_custom_styles["Shared styles<br/>[custom.css]"]
end

node_client(("API client"))

node_client -->|"POSTs JSON"| node_user_service
node_user_service -->|"inserts user"| node_user_api_impl
node_user_service -->|"accepts user"| node_user_model
node_user_api_impl -->|"implements"| node_user_api
node_user_api_impl -->|"updates fields"| node_user_model
node_user_api_impl -->|"stores user"| node_db_connection
node_user_model -->|"uses enum"| node_gender
node_config_util -->|"inserts sample"| node_user_api_impl
node_config_util -->|"loads properties"| node_db_properties

click node_user_service "https://github.com/jeyasinghalex/chatapp/blob/master/src/main/java/service/UserService.java"
click node_user_api "https://github.com/jeyasinghalex/chatapp/blob/master/src/main/java/userAPI/UserAPI.java"
click node_user_api_impl "https://github.com/jeyasinghalex/chatapp/blob/master/src/main/java/userAPI/UserAPIImpl.java"
click node_user_model "https://github.com/jeyasinghalex/chatapp/blob/master/src/main/java/model/User.java"
click node_gender "https://github.com/jeyasinghalex/chatapp/blob/master/src/main/java/model/Gender.java"
click node_user_dao "https://github.com/jeyasinghalex/chatapp/blob/master/src/main/java/database/UserDao.java"
click node_db_connection "https://github.com/jeyasinghalex/chatapp/blob/master/src/main/java/database/dbConnectionImpl.java"
click node_config_util "https://github.com/jeyasinghalex/chatapp/blob/master/src/main/java/commen/ConfigUtil.java"
click node_db_properties "https://github.com/jeyasinghalex/chatapp/blob/master/src/main/resources/config/dbconfig.properties"
click node_home_page "https://github.com/jeyasinghalex/chatapp/blob/master/src/main/SKProject/home.html"
click node_home_script "https://github.com/jeyasinghalex/chatapp/blob/master/src/main/SKProject/home.js"
click node_home_styles "https://github.com/jeyasinghalex/chatapp/blob/master/src/main/SKProject/home.css"
click node_chat_page "https://github.com/jeyasinghalex/chatapp/blob/master/src/main/SKProject/chatBox.html"
click node_chat_styles "https://github.com/jeyasinghalex/chatapp/blob/master/src/main/SKProject/chatBox.css"
click node_timer_page "https://github.com/jeyasinghalex/chatapp/blob/master/src/main/SKProject/timer.html"
click node_timer_script "https://github.com/jeyasinghalex/chatapp/blob/master/src/main/SKProject/timer.js"
click node_timer_styles "https://github.com/jeyasinghalex/chatapp/blob/master/src/main/SKProject/timer.css"
click node_site_index "https://github.com/jeyasinghalex/chatapp/blob/master/src/main/SKProject/index.html"
click node_custom_styles "https://github.com/jeyasinghalex/chatapp/blob/master/src/main/SKProject/custom.css"

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_user_service,node_client toneBlue
class node_user_api,node_user_api_impl toneAmber
class node_user_model,node_gender toneMint
class node_user_dao,node_db_connection,node_config_util,node_db_properties toneRose
class node_home_page,node_home_script,node_home_styles,node_chat_page,node_chat_styles,node_timer_page,node_timer_script,node_timer_styles,node_site_index,node_custom_styles toneIndigo
```

## Components

### REST service

- [User endpoint](https://github.com/jeyasinghalex/chatapp/blob/master/src/main/java/service/UserService.java): `src/main/java/service/UserService.java`

### User API

- [User API contract](https://github.com/jeyasinghalex/chatapp/blob/master/src/main/java/userAPI/UserAPI.java): `src/main/java/userAPI/UserAPI.java`
- [User API implementation](https://github.com/jeyasinghalex/chatapp/blob/master/src/main/java/userAPI/UserAPIImpl.java): `src/main/java/userAPI/UserAPIImpl.java`

### User domain

- [User model](https://github.com/jeyasinghalex/chatapp/blob/master/src/main/java/model/User.java): `src/main/java/model/User.java`
- [Gender enum](https://github.com/jeyasinghalex/chatapp/blob/master/src/main/java/model/Gender.java): `src/main/java/model/Gender.java`

### Persistence

- [User DAO contract](https://github.com/jeyasinghalex/chatapp/blob/master/src/main/java/database/UserDao.java): `src/main/java/database/UserDao.java`
- [Database connection](https://github.com/jeyasinghalex/chatapp/blob/master/src/main/java/database/dbConnectionImpl.java): `src/main/java/database/dbConnectionImpl.java`
- [Configuration utility](https://github.com/jeyasinghalex/chatapp/blob/master/src/main/java/commen/ConfigUtil.java): `src/main/java/commen/ConfigUtil.java`
- [Database properties](https://github.com/jeyasinghalex/chatapp/blob/master/src/main/resources/config/dbconfig.properties): `src/main/resources/config/dbconfig.properties`

### Web assets

- [Home page](https://github.com/jeyasinghalex/chatapp/blob/master/src/main/SKProject/home.html): `src/main/SKProject/home.html`
- [Home script](https://github.com/jeyasinghalex/chatapp/blob/master/src/main/SKProject/home.js): `src/main/SKProject/home.js`
- [Home styles](https://github.com/jeyasinghalex/chatapp/blob/master/src/main/SKProject/home.css): `src/main/SKProject/home.css`
- [Chat box page](https://github.com/jeyasinghalex/chatapp/blob/master/src/main/SKProject/chatBox.html): `src/main/SKProject/chatBox.html`
- [Chat box styles](https://github.com/jeyasinghalex/chatapp/blob/master/src/main/SKProject/chatBox.css): `src/main/SKProject/chatBox.css`
- [Timer page](https://github.com/jeyasinghalex/chatapp/blob/master/src/main/SKProject/timer.html): `src/main/SKProject/timer.html`
- [Timer script](https://github.com/jeyasinghalex/chatapp/blob/master/src/main/SKProject/timer.js): `src/main/SKProject/timer.js`
- [Timer styles](https://github.com/jeyasinghalex/chatapp/blob/master/src/main/SKProject/timer.css): `src/main/SKProject/timer.css`
- [Site index](https://github.com/jeyasinghalex/chatapp/blob/master/src/main/SKProject/index.html): `src/main/SKProject/index.html`
- [Shared styles](https://github.com/jeyasinghalex/chatapp/blob/master/src/main/SKProject/custom.css): `src/main/SKProject/custom.css`

### Other components

- **API client**

## Connections

- API client → User endpoint: POSTs JSON (evidence: `src/main/java/service/UserService.java`)
- User endpoint → User API implementation: inserts user (evidence: `src/main/java/service/UserService.java`)
- User endpoint → User model: accepts user (evidence: `src/main/java/service/UserService.java`)
- User API implementation → User API contract: implements (evidence: `src/main/java/userAPI/UserAPIImpl.java`)
- User API implementation → User model: updates fields (evidence: `src/main/java/userAPI/UserAPIImpl.java`)
- User API implementation → Database connection: stores user (evidence: `src/main/java/userAPI/UserAPIImpl.java`)
- User model → Gender enum: uses enum (evidence: `src/main/java/model/User.java`)
- Configuration utility → User API implementation: inserts sample (evidence: `src/main/java/commen/ConfigUtil.java`)
- Configuration utility → Database properties: loads properties (evidence: `src/main/java/commen/ConfigUtil.java`)
