# verina101/chat-application architecture

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

- Interactive diagram: https://gitdiagram.com/verina101/chat-application
- Repository: https://github.com/verina101/chat-application

## Overview

This is a Qt desktop chat application backed by SQLite. The principal workflow starts at the application entry point, initializes the database, presents login/registration, then opens the chat hub where users select or create conversations and view message history. Separate branches support contacts, profile editing, and creating/viewing expiring stories; chat-room information and message status are additional conversation capabilities. Several feature modules are represented by the source index and README rather than inspected implementation excerpts, so their connections are shown only where documented or evidenced by the index.

Main entry points: [`Chat-Application/Chats.cpp`](https://github.com/verina101/chat-application/blob/master/Chat-Application/Chats.cpp) (Chat hub), [`Chat-Application/Data.cpp`](https://github.com/verina101/chat-application/blob/master/Chat-Application/Data.cpp) (Database access), [`Chat-Application/login.cpp`](https://github.com/verina101/chat-application/blob/master/Chat-Application/login.cpp) (Login and registration), [`Chat-Application/ChatRoom.cpp`](https://github.com/verina101/chat-application/blob/master/Chat-Application/ChatRoom.cpp) (Chat room)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application and access"]
  node_app["Qt application entry<br/>[main.cpp]"]
  node_auth["Login and registration<br/>[login.cpp]"]
  node_data["Database access<br/>[Data.cpp]"]
  node_session["Session and selection state<br/>[MyConstants.cpp]"]
end

subgraph group_conversation["Chats and messaging"]
  node_hub["Chat hub<br/>[Chats.cpp]"]
  node_room["Chat room<br/>[ChatRoom.cpp]"]
  node_message["Message display<br/>[Message.cpp]"]
  node_status["Message status<br/>[MsgStatus.h]"]
  node_roominfo["Room information<br/>[ChatInfo.cpp]"]
  node_chatitem["Chat list item<br/>[ChatItem.cpp]"]
end

subgraph group_people["Contacts and profile"]
  node_contactpicker["Contact and group picker<br/>[showcontact.cpp]"]
  node_addcontact["Add contact<br/>[contact.cpp]"]
  node_contactwidget["Contact widget<br/>[contactwidget.cpp]"]
  node_profile["Profile editing<br/>[profile.cpp]"]
end

subgraph group_stories["Stories"]
  node_storycreate["Create story<br/>[addstory.cpp]"]
  node_storycontacts["Story contacts"]
  node_storyview["View stories<br/>[showstories.cpp]"]
  node_storytime["Story timing<br/>[StoryTime.cpp]"]
  node_saveddata["Saved story data<br/>[saveddata.cpp]"]
  node_datetime["Date and time<br/>[Datetime.cpp]"]
end

node_user(("User"))
node_sqlite[("SQLite database")]

node_user -->|"starts"| node_app
node_app -->|"initializes"| node_data
node_app -->|"shows"| node_auth
node_user -->|"authenticates"| node_auth
node_auth -.->|"opens"| node_hub
node_user -.->|"uses"| node_hub
node_hub -->|"opens"| node_room
node_hub -->|"opens"| node_contactpicker
node_hub -->|"opens"| node_addcontact
node_hub -->|"opens"| node_profile
node_hub -->|"opens"| node_storycreate
node_hub -->|"opens"| node_storycontacts
node_hub -->|"creates"| node_chatitem
node_contactpicker -->|"opens"| node_room
node_contactpicker -->|"creates"| node_contactwidget
node_room -->|"renders"| node_message
node_room -->|"uses"| node_roominfo
node_message -->|"uses"| node_status
node_room -.->|"reads and writes"| node_data
node_contactpicker -->|"reads and writes"| node_data
node_hub -->|"reads"| node_data
node_data -->|"accesses"| node_sqlite
node_storycreate -->|"writes"| node_data
node_storycontacts -->|"opens"| node_storyview
node_storycontacts -->|"uses"| node_saveddata
node_storycontacts -->|"uses"| node_datetime
node_storyview -.->|"uses"| node_storytime
node_profile -.->|"reads and writes"| node_data
node_auth -->|"reads and writes"| node_data
node_auth -.->|"sets session"| node_session
node_hub -->|"reads selection"| node_session

click node_app "https://github.com/verina101/chat-application/blob/master/Chat-Application/main.cpp"
click node_auth "https://github.com/verina101/chat-application/blob/master/Chat-Application/login.cpp"
click node_hub "https://github.com/verina101/chat-application/blob/master/Chat-Application/Chats.cpp"
click node_room "https://github.com/verina101/chat-application/blob/master/Chat-Application/ChatRoom.cpp"
click node_message "https://github.com/verina101/chat-application/blob/master/Chat-Application/Message.cpp"
click node_status "https://github.com/verina101/chat-application/blob/master/Chat-Application/MsgStatus.h"
click node_roominfo "https://github.com/verina101/chat-application/blob/master/Chat-Application/ChatInfo.cpp"
click node_chatitem "https://github.com/verina101/chat-application/blob/master/Chat-Application/ChatItem.cpp"
click node_contactpicker "https://github.com/verina101/chat-application/blob/master/Chat-Application/showcontact.cpp"
click node_addcontact "https://github.com/verina101/chat-application/blob/master/Chat-Application/contact.cpp"
click node_contactwidget "https://github.com/verina101/chat-application/blob/master/Chat-Application/contactwidget.cpp"
click node_profile "https://github.com/verina101/chat-application/blob/master/Chat-Application/profile.cpp"
click node_storycreate "https://github.com/verina101/chat-application/blob/master/Chat-Application/addstory.cpp"
click node_storycontacts "https://github.com/verina101/chat-application/blob/master/Chat-Application/showcontactnamestory.cpp"
click node_storyview "https://github.com/verina101/chat-application/blob/master/Chat-Application/showstories.cpp"
click node_storytime "https://github.com/verina101/chat-application/blob/master/Chat-Application/StoryTime.cpp"
click node_data "https://github.com/verina101/chat-application/blob/master/Chat-Application/Data.cpp"
click node_session "https://github.com/verina101/chat-application/blob/master/Chat-Application/MyConstants.cpp"
click node_saveddata "https://github.com/verina101/chat-application/blob/master/Chat-Application/saveddata.cpp"
click node_datetime "https://github.com/verina101/chat-application/blob/master/Chat-Application/Datetime.cpp"

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_auth,node_data,node_session,node_user toneBlue
class node_hub,node_room,node_message,node_status,node_roominfo,node_chatitem,node_sqlite toneAmber
class node_contactpicker,node_addcontact,node_contactwidget,node_profile toneMint
class node_storycreate,node_storycontacts,node_storyview,node_storytime,node_saveddata,node_datetime toneRose
```

## Components

### Application and access

- [Qt application entry](https://github.com/verina101/chat-application/blob/master/Chat-Application/main.cpp): `Chat-Application/main.cpp`
- [Login and registration](https://github.com/verina101/chat-application/blob/master/Chat-Application/login.cpp): `Chat-Application/login.cpp`
- [Database access](https://github.com/verina101/chat-application/blob/master/Chat-Application/Data.cpp): `Chat-Application/Data.cpp`
- [Session and selection state](https://github.com/verina101/chat-application/blob/master/Chat-Application/MyConstants.cpp): `Chat-Application/MyConstants.cpp`

### Chats and messaging

- [Chat hub](https://github.com/verina101/chat-application/blob/master/Chat-Application/Chats.cpp): `Chat-Application/Chats.cpp`
- [Chat room](https://github.com/verina101/chat-application/blob/master/Chat-Application/ChatRoom.cpp): `Chat-Application/ChatRoom.cpp`
- [Message display](https://github.com/verina101/chat-application/blob/master/Chat-Application/Message.cpp): `Chat-Application/Message.cpp`
- [Message status](https://github.com/verina101/chat-application/blob/master/Chat-Application/MsgStatus.h): `Chat-Application/MsgStatus.h`
- [Room information](https://github.com/verina101/chat-application/blob/master/Chat-Application/ChatInfo.cpp): `Chat-Application/ChatInfo.cpp`
- [Chat list item](https://github.com/verina101/chat-application/blob/master/Chat-Application/ChatItem.cpp): `Chat-Application/ChatItem.cpp`

### Contacts and profile

- [Contact and group picker](https://github.com/verina101/chat-application/blob/master/Chat-Application/showcontact.cpp): `Chat-Application/showcontact.cpp`
- [Add contact](https://github.com/verina101/chat-application/blob/master/Chat-Application/contact.cpp): `Chat-Application/contact.cpp`
- [Contact widget](https://github.com/verina101/chat-application/blob/master/Chat-Application/contactwidget.cpp): `Chat-Application/contactwidget.cpp`
- [Profile editing](https://github.com/verina101/chat-application/blob/master/Chat-Application/profile.cpp): `Chat-Application/profile.cpp`

### Stories

- [Create story](https://github.com/verina101/chat-application/blob/master/Chat-Application/addstory.cpp): `Chat-Application/addstory.cpp`
- [Story contacts](https://github.com/verina101/chat-application/blob/master/Chat-Application/showcontactnamestory.cpp): `Chat-Application/showcontactnamestory.cpp`
- [View stories](https://github.com/verina101/chat-application/blob/master/Chat-Application/showstories.cpp): `Chat-Application/showstories.cpp`
- [Story timing](https://github.com/verina101/chat-application/blob/master/Chat-Application/StoryTime.cpp): `Chat-Application/StoryTime.cpp`
- [Saved story data](https://github.com/verina101/chat-application/blob/master/Chat-Application/saveddata.cpp): `Chat-Application/saveddata.cpp`
- [Date and time](https://github.com/verina101/chat-application/blob/master/Chat-Application/Datetime.cpp): `Chat-Application/Datetime.cpp`

### Other components

- **User**
- **SQLite database**

## Connections

- User → Qt application entry: starts (evidence: `README.md`)
- Qt application entry → Database access: initializes (evidence: `Chat-Application/main.cpp`)
- Qt application entry → Login and registration: shows (evidence: `Chat-Application/main.cpp`)
- User → Login and registration: authenticates (evidence: `README.md`)
- Login and registration → Chat hub: opens
- User → Chat hub: uses
- Chat hub → Chat room: opens (evidence: `Chat-Application/Chats.cpp`)
- Chat hub → Contact and group picker: opens (evidence: `Chat-Application/Chats.cpp`)
- Chat hub → Add contact: opens (evidence: `Chat-Application/Chats.cpp`)
- Chat hub → Profile editing: opens (evidence: `Chat-Application/Chats.cpp`)
- Chat hub → Create story: opens (evidence: `Chat-Application/Chats.cpp`)
- Chat hub → Story contacts: opens (evidence: `Chat-Application/Chats.cpp`)
- Chat hub → Chat list item: creates (evidence: `Chat-Application/Chats.cpp`)
- Contact and group picker → Chat room: opens (evidence: `Chat-Application/showcontact.cpp`)
- Contact and group picker → Contact widget: creates (evidence: `Chat-Application/showcontact.cpp`)
- Chat room → Message display: renders
- Chat room → Room information: uses
- Message display → Message status: uses
- Chat room → Database access: reads and writes
- Contact and group picker → Database access: reads and writes (evidence: `Chat-Application/showcontact.cpp`)
- Chat hub → Database access: reads (evidence: `Chat-Application/Chats.cpp`)
- Database access → SQLite database: accesses (evidence: `README.md`)
- Create story → Database access: writes (evidence: `Chat-Application/addstory.cpp`)
- Story contacts → View stories: opens
- Story contacts → Saved story data: uses
- Story contacts → Date and time: uses
- View stories → Story timing: uses
- Profile editing → Database access: reads and writes
- Login and registration → Database access: reads and writes
- Login and registration → Session and selection state: sets session
- Chat hub → Session and selection state: reads selection (evidence: `Chat-Application/Chats.cpp`)
