# abhiveeramallu/signalappclone architecture

> Architecture diagram of the GitHub repository abhiveeramallu/signalappclone, 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/abhiveeramallu/signalappclone
- Repository: https://github.com/abhiveeramallu/signalappclone

## Overview

This is an educational Signal-inspired messaging application: a Next.js client backed by a FastAPI API, SQLite persistence, and an authenticated WebSocket endpoint. The main workflow is account access, conversation discovery or creation, then persisted real-time messaging with receipts and typing events. Contacts, group administration, attachments, settings, and responsive chat UI are distinct capabilities. The README documents several frontend behaviors and API features; unsampled implementation details are represented at subsystem level, and edges avoid assuming unshown internal calls.

Main entry points: [`frontend/lib/api.ts`](https://github.com/abhiveeramallu/signalappclone/blob/main/frontend/lib/api.ts) (HTTP API client), [`backend/app/main.py`](https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/main.py) (API application), [`backend/app/websocket/endpoint.py`](https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/websocket/endpoint.py) (WebSocket events), [`frontend/components/layout/AppShell.tsx`](https://github.com/abhiveeramallu/signalappclone/blob/main/frontend/components/layout/AppShell.tsx) (Chat interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_webapp["Chat interface<br/>[AppShell.tsx]"]
  node_authui["Login and registration<br/>[RegisterForm.tsx]"]
  node_conversationui["Conversation discovery"]
  node_chatui["Message experience"]
  node_session["Session state<br/>[auth-context.tsx]"]
  node_api_client["HTTP API client<br/>[api.ts]"]
  node_ws_client["WebSocket client<br/>[ws.tsx]"]
  node_theme["Appearance settings<br/>[theme-context.tsx]"]
end

subgraph group_access["Identity and discovery"]
  node_auth_routes["Authentication<br/>[auth.py]"]
  node_contacts_routes["Contacts<br/>[contacts.py]"]
  node_users_routes["User discovery<br/>[users.py]"]
end

subgraph group_chat["Conversations and messages"]
  node_conversation_routes["Conversation management<br/>[conversations.py]"]
  node_message_routes["Message history<br/>[messages.py]"]
  node_message_service["Message validation and status<br/>[message_service.py]"]
end

subgraph group_realtime["Realtime and attachments"]
  node_websocket_endpoint["WebSocket events<br/>[endpoint.py]"]
  node_connection_manager["Connection manager<br/>[manager.py]"]
  node_uploads["File attachments<br/>[uploads.py]"]
  node_upload_storage[("Attachment files<br/>[config.py]")]
end

subgraph group_storage["Backend foundations"]
  node_models["Messaging data models<br/>[conversation.py]"]
  node_database[("SQLite database<br/>[session.py]")]
  node_security["JWT and access checks<br/>[deps.py]"]
  node_application["API application<br/>[main.py]"]
end

node_person(("User"))

node_person -->|"signs in"| node_authui
node_authui -->|"submits credentials"| node_api_client
node_api_client -->|"calls auth API"| node_auth_routes
node_auth_routes -->|"issues tokens"| node_security
node_session -->|"restores session"| node_api_client
node_person -->|"uses"| node_webapp
node_webapp -->|"opens discovery"| node_conversationui
node_conversationui -->|"requests users and chats"| node_api_client
node_api_client -->|"calls contacts API"| node_contacts_routes
node_api_client -->|"searches users"| node_users_routes
node_api_client -->|"manages conversations"| node_conversation_routes
node_webapp -->|"opens conversation"| node_chatui
node_chatui -->|"loads history"| node_api_client
node_api_client -->|"requests messages"| node_message_routes
node_message_routes -->|"creates messages"| node_message_service
node_message_service -->|"persists message status"| node_models
node_models -.->|"stores records"| node_database
node_application -->|"registers routes"| node_auth_routes
node_application -->|"registers routes"| node_contacts_routes
node_application -->|"registers routes"| node_users_routes
node_application -->|"registers routes"| node_conversation_routes
node_application -->|"registers routes"| node_message_routes
node_application -->|"registers routes"| node_uploads
node_application -->|"registers endpoint"| node_websocket_endpoint
node_ws_client -->|"exchanges events"| node_websocket_endpoint
node_websocket_endpoint -->|"handles message events"| node_message_service
node_websocket_endpoint -->|"dispatches events"| node_connection_manager
node_websocket_endpoint -->|"authenticates users"| node_security
node_api_client -->|"uploads and retrieves files"| node_uploads
node_uploads -.->|"stores attachment files"| node_upload_storage
node_person -->|"sets appearance"| node_theme

click node_webapp "https://github.com/abhiveeramallu/signalappclone/blob/main/frontend/components/layout/AppShell.tsx"
click node_authui "https://github.com/abhiveeramallu/signalappclone/blob/main/frontend/components/auth/RegisterForm.tsx"
click node_conversationui "https://github.com/abhiveeramallu/signalappclone/blob/main/frontend/components/contacts/NewConversationModal.tsx"
click node_chatui "https://github.com/abhiveeramallu/signalappclone/blob/main/frontend/components/chat/MessageComposer.tsx"
click node_session "https://github.com/abhiveeramallu/signalappclone/blob/main/frontend/lib/auth-context.tsx"
click node_api_client "https://github.com/abhiveeramallu/signalappclone/blob/main/frontend/lib/api.ts"
click node_ws_client "https://github.com/abhiveeramallu/signalappclone/blob/main/frontend/lib/ws.tsx"
click node_theme "https://github.com/abhiveeramallu/signalappclone/blob/main/frontend/lib/theme-context.tsx"
click node_auth_routes "https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/routers/auth.py"
click node_contacts_routes "https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/routers/contacts.py"
click node_users_routes "https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/routers/users.py"
click node_conversation_routes "https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/routers/conversations.py"
click node_message_routes "https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/routers/messages.py"
click node_message_service "https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/services/message_service.py"
click node_models "https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/models/conversation.py"
click node_database "https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/db/session.py"
click node_security "https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/core/deps.py"
click node_application "https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/main.py"
click node_websocket_endpoint "https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/websocket/endpoint.py"
click node_connection_manager "https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/websocket/manager.py"
click node_uploads "https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/routers/uploads.py"
click node_upload_storage "https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/core/config.py"

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_webapp,node_authui,node_conversationui,node_chatui,node_session,node_api_client,node_ws_client,node_theme,node_person toneBlue
class node_auth_routes,node_contacts_routes,node_users_routes toneAmber
class node_conversation_routes,node_message_routes,node_message_service toneMint
class node_websocket_endpoint,node_connection_manager,node_uploads,node_upload_storage toneRose
class node_models,node_database,node_security,node_application toneIndigo
```

## Components

### Web client

- [Chat interface](https://github.com/abhiveeramallu/signalappclone/blob/main/frontend/components/layout/AppShell.tsx): `frontend/components/layout/AppShell.tsx`
- [Login and registration](https://github.com/abhiveeramallu/signalappclone/blob/main/frontend/components/auth/RegisterForm.tsx): `frontend/components/auth/RegisterForm.tsx`
- [Conversation discovery](https://github.com/abhiveeramallu/signalappclone/blob/main/frontend/components/contacts/NewConversationModal.tsx): `frontend/components/contacts/NewConversationModal.tsx`
- [Message experience](https://github.com/abhiveeramallu/signalappclone/blob/main/frontend/components/chat/MessageComposer.tsx): `frontend/components/chat/MessageComposer.tsx`
- [Session state](https://github.com/abhiveeramallu/signalappclone/blob/main/frontend/lib/auth-context.tsx): `frontend/lib/auth-context.tsx`
- [HTTP API client](https://github.com/abhiveeramallu/signalappclone/blob/main/frontend/lib/api.ts): `frontend/lib/api.ts`
- [WebSocket client](https://github.com/abhiveeramallu/signalappclone/blob/main/frontend/lib/ws.tsx): `frontend/lib/ws.tsx`
- [Appearance settings](https://github.com/abhiveeramallu/signalappclone/blob/main/frontend/lib/theme-context.tsx): `frontend/lib/theme-context.tsx`

### Identity and discovery

- [Authentication](https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [Contacts](https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/routers/contacts.py): `backend/app/routers/contacts.py`
- [User discovery](https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/routers/users.py): `backend/app/routers/users.py`

### Conversations and messages

- [Conversation management](https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/routers/conversations.py): `backend/app/routers/conversations.py`
- [Message history](https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/routers/messages.py): `backend/app/routers/messages.py`
- [Message validation and status](https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/services/message_service.py): `backend/app/services/message_service.py`

### Realtime and attachments

- [WebSocket events](https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/websocket/endpoint.py): `backend/app/websocket/endpoint.py`
- [Connection manager](https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/websocket/manager.py): `backend/app/websocket/manager.py`
- [File attachments](https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/routers/uploads.py): `backend/app/routers/uploads.py`
- [Attachment files](https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/core/config.py): `backend/app/core/config.py`

### Backend foundations

- [Messaging data models](https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/models/conversation.py): `backend/app/models/conversation.py`
- [SQLite database](https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/db/session.py): `backend/app/db/session.py`
- [JWT and access checks](https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/core/deps.py): `backend/app/core/deps.py`
- [API application](https://github.com/abhiveeramallu/signalappclone/blob/main/backend/app/main.py): `backend/app/main.py`

### Other components

- **User**

## Connections

- User → Login and registration: signs in
- Login and registration → HTTP API client: submits credentials
- HTTP API client → Authentication: calls auth API
- Authentication → JWT and access checks: issues tokens (evidence: `backend/app/routers/auth.py`)
- Session state → HTTP API client: restores session
- User → Chat interface: uses
- Chat interface → Conversation discovery: opens discovery
- Conversation discovery → HTTP API client: requests users and chats
- HTTP API client → Contacts: calls contacts API
- HTTP API client → User discovery: searches users
- HTTP API client → Conversation management: manages conversations
- Chat interface → Message experience: opens conversation
- Message experience → HTTP API client: loads history
- HTTP API client → Message history: requests messages
- Message history → Message validation and status: creates messages (evidence: `backend/app/routers/messages.py`)
- Message validation and status → Messaging data models: persists message status (evidence: `backend/app/services/message_service.py`)
- Messaging data models → SQLite database: stores records
- API application → Authentication: registers routes (evidence: `backend/app/main.py`)
- API application → Contacts: registers routes (evidence: `backend/app/main.py`)
- API application → User discovery: registers routes (evidence: `backend/app/main.py`)
- API application → Conversation management: registers routes (evidence: `backend/app/main.py`)
- API application → Message history: registers routes (evidence: `backend/app/main.py`)
- API application → File attachments: registers routes (evidence: `backend/app/main.py`)
- API application → WebSocket events: registers endpoint (evidence: `backend/app/main.py`)
- WebSocket client → WebSocket events: exchanges events
- WebSocket events → Message validation and status: handles message events (evidence: `backend/app/websocket/endpoint.py`)
- WebSocket events → Connection manager: dispatches events (evidence: `backend/app/websocket/endpoint.py`)
- WebSocket events → JWT and access checks: authenticates users (evidence: `backend/app/websocket/endpoint.py`)
- HTTP API client → File attachments: uploads and retrieves files
- File attachments → Attachment files: stores attachment files (evidence: `backend/app/routers/uploads.py`)
- User → Appearance settings: sets appearance
