# yalnezami/messageit-api-f architecture

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

- Interactive diagram: https://gitdiagram.com/yalnezami/messageit-api-f
- Repository: https://github.com/yalnezami/messageit-api-f

## Overview

Messageit-api-f is a Feathers chat API serving REST and Socket.io clients. The principal workflow is client authentication, then conversation and message operations with related membership, delivery, visibility, read-state, typing, and file services; social contacts and user profiles are additional capabilities. The app composes authentication, MongoDB, channels, and registered services. The README documents local semantic message search through Ollama, but the excerpts do not show its routing into the message service, so that integration is marked unverified. Service registration and selected cross-service calls are evidenced; most service internals were not sampled.

Main entry points: [`src/services/index.ts`](https://github.com/yalnezami/messageit-api-f/blob/main/src/services/index.ts) (Service registry), [`src/app.ts`](https://github.com/yalnezami/messageit-api-f/blob/main/src/app.ts) (REST and realtime API), [`src/services/friends/friends.class.ts`](https://github.com/yalnezami/messageit-api-f/blob/main/src/services/friends/friends.class.ts) (Friendships), [`src/services/users/users.class.ts`](https://github.com/yalnezami/messageit-api-f/blob/main/src/services/users/users.class.ts) (User accounts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["API runtime"]
  node_client["Feathers client<br/>[client.ts]"]
  node_api["REST and realtime API<br/>[app.ts]"]
  node_auth["Authentication<br/>[authentication.ts]"]
  node_registry["Service registry<br/>[index.ts]"]
  node_mongo[("MongoDB<br/>[mongodb.ts]")]
end

subgraph group_identity["Identity and social"]
  node_user["User accounts<br/>[users.class.ts]"]
  node_myusers["User profiles<br/>[my-users.class.ts]"]
  node_friendrequests["Friend requests"]
  node_friends["Friendships<br/>[friends.class.ts]"]
  node_acceptations["Friend acceptations"]
end

subgraph group_messaging["Chat and messaging"]
  node_conversations["Conversations"]
  node_members["Conversation members<br/>[members.ts]"]
  node_messages["Messages<br/>[messages.class.ts]"]
  node_files["Message files"]
  node_visibility["Message visibility"]
  node_receiving["Message delivery"]
  node_seen["Read receipts"]
  node_typing["Typing state<br/>[is-typing.ts]"]
  node_emojis["Emojis<br/>[emojis.ts]"]
  node_rights["Group rights"]
end

subgraph group_support["Search and shared state"]
  node_semantic["Semantic search<br/>[semantic-search.ts]"]
  node_ollama["Ollama"]
end

node_person(("Chat user"))

node_person -->|"uses"| node_client
node_client -->|"connects"| node_api
node_api -->|"configures"| node_auth
node_api -->|"configures"| node_registry
node_api -->|"configures"| node_mongo
node_registry -->|"registers"| node_user
node_registry -->|"registers"| node_myusers
node_registry -->|"registers"| node_friendrequests
node_registry -->|"registers"| node_friends
node_registry -->|"registers"| node_acceptations
node_registry -->|"registers"| node_conversations
node_registry -->|"registers"| node_members
node_registry -->|"registers"| node_messages
node_registry -->|"registers"| node_files
node_registry -->|"registers"| node_visibility
node_registry -->|"registers"| node_receiving
node_registry -->|"registers"| node_seen
node_registry -->|"registers"| node_typing
node_registry -->|"registers"| node_emojis
node_registry -->|"registers"| node_rights
node_user -->|"creates profile"| node_myusers
node_user -->|"checks names"| node_friendrequests
node_friends -->|"creates acceptation"| node_acceptations
node_friends -->|"removes request"| node_friendrequests
node_friends -->|"loads profiles"| node_myusers
node_person -.->|"searches messages"| node_semantic
node_semantic -.->|"requests embeddings"| node_ollama

click node_client "https://github.com/yalnezami/messageit-api-f/blob/main/src/client.ts"
click node_user "https://github.com/yalnezami/messageit-api-f/blob/main/src/services/users/users.class.ts"
click node_myusers "https://github.com/yalnezami/messageit-api-f/blob/main/src/services/my-users/my-users.class.ts"
click node_friendrequests "https://github.com/yalnezami/messageit-api-f/blob/main/src/services/friend-requests/friend-requests.class.ts"
click node_friends "https://github.com/yalnezami/messageit-api-f/blob/main/src/services/friends/friends.class.ts"
click node_acceptations "https://github.com/yalnezami/messageit-api-f/blob/main/src/services/friend-acceptations/friend-acceptations.class.ts"
click node_conversations "https://github.com/yalnezami/messageit-api-f/blob/main/src/services/conversations/conversations.class.ts"
click node_members "https://github.com/yalnezami/messageit-api-f/blob/main/src/services/members/members.ts"
click node_messages "https://github.com/yalnezami/messageit-api-f/blob/main/src/services/messages/messages.class.ts"
click node_files "https://github.com/yalnezami/messageit-api-f/blob/main/src/services/message-files/message-files.class.ts"
click node_visibility "https://github.com/yalnezami/messageit-api-f/blob/main/src/services/message-visibility/message-visibility.ts"
click node_receiving "https://github.com/yalnezami/messageit-api-f/blob/main/src/services/message-recieving/message-recieving.ts"
click node_seen "https://github.com/yalnezami/messageit-api-f/blob/main/src/services/message-seen/message-seen.class.ts"
click node_typing "https://github.com/yalnezami/messageit-api-f/blob/main/src/services/is-typing/is-typing.ts"
click node_emojis "https://github.com/yalnezami/messageit-api-f/blob/main/src/services/emojis/emojis.ts"
click node_rights "https://github.com/yalnezami/messageit-api-f/blob/main/src/services/group-rights/group-rights.class.ts"
click node_semantic "https://github.com/yalnezami/messageit-api-f/blob/main/src/services/messages/semantic-search.ts"
click node_api "https://github.com/yalnezami/messageit-api-f/blob/main/src/app.ts"
click node_auth "https://github.com/yalnezami/messageit-api-f/blob/main/src/authentication.ts"
click node_registry "https://github.com/yalnezami/messageit-api-f/blob/main/src/services/index.ts"
click node_mongo "https://github.com/yalnezami/messageit-api-f/blob/main/src/mongodb.ts"

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_client,node_api,node_auth,node_registry,node_mongo,node_person toneBlue
class node_user,node_myusers,node_friendrequests,node_friends,node_acceptations toneAmber
class node_conversations,node_members,node_messages,node_files,node_visibility,node_receiving,node_seen,node_typing,node_emojis,node_rights toneMint
class node_semantic,node_ollama toneRose
```

## Components

### API runtime

- [Feathers client](https://github.com/yalnezami/messageit-api-f/blob/main/src/client.ts): `src/client.ts`
- [REST and realtime API](https://github.com/yalnezami/messageit-api-f/blob/main/src/app.ts): `src/app.ts`
- [Authentication](https://github.com/yalnezami/messageit-api-f/blob/main/src/authentication.ts): `src/authentication.ts`
- [Service registry](https://github.com/yalnezami/messageit-api-f/blob/main/src/services/index.ts): `src/services/index.ts`
- [MongoDB](https://github.com/yalnezami/messageit-api-f/blob/main/src/mongodb.ts): `src/mongodb.ts`

### Identity and social

- [User accounts](https://github.com/yalnezami/messageit-api-f/blob/main/src/services/users/users.class.ts): `src/services/users/users.class.ts`
- [User profiles](https://github.com/yalnezami/messageit-api-f/blob/main/src/services/my-users/my-users.class.ts): `src/services/my-users/my-users.class.ts`
- [Friend requests](https://github.com/yalnezami/messageit-api-f/blob/main/src/services/friend-requests/friend-requests.class.ts): `src/services/friend-requests/friend-requests.class.ts`
- [Friendships](https://github.com/yalnezami/messageit-api-f/blob/main/src/services/friends/friends.class.ts): `src/services/friends/friends.class.ts`
- [Friend acceptations](https://github.com/yalnezami/messageit-api-f/blob/main/src/services/friend-acceptations/friend-acceptations.class.ts): `src/services/friend-acceptations/friend-acceptations.class.ts`

### Chat and messaging

- [Conversations](https://github.com/yalnezami/messageit-api-f/blob/main/src/services/conversations/conversations.class.ts): `src/services/conversations/conversations.class.ts`
- [Conversation members](https://github.com/yalnezami/messageit-api-f/blob/main/src/services/members/members.ts): `src/services/members/members.ts`
- [Messages](https://github.com/yalnezami/messageit-api-f/blob/main/src/services/messages/messages.class.ts): `src/services/messages/messages.class.ts`
- [Message files](https://github.com/yalnezami/messageit-api-f/blob/main/src/services/message-files/message-files.class.ts): `src/services/message-files/message-files.class.ts`
- [Message visibility](https://github.com/yalnezami/messageit-api-f/blob/main/src/services/message-visibility/message-visibility.ts): `src/services/message-visibility/message-visibility.ts`
- [Message delivery](https://github.com/yalnezami/messageit-api-f/blob/main/src/services/message-recieving/message-recieving.ts): `src/services/message-recieving/message-recieving.ts`
- [Read receipts](https://github.com/yalnezami/messageit-api-f/blob/main/src/services/message-seen/message-seen.class.ts): `src/services/message-seen/message-seen.class.ts`
- [Typing state](https://github.com/yalnezami/messageit-api-f/blob/main/src/services/is-typing/is-typing.ts): `src/services/is-typing/is-typing.ts`
- [Emojis](https://github.com/yalnezami/messageit-api-f/blob/main/src/services/emojis/emojis.ts): `src/services/emojis/emojis.ts`
- [Group rights](https://github.com/yalnezami/messageit-api-f/blob/main/src/services/group-rights/group-rights.class.ts): `src/services/group-rights/group-rights.class.ts`

### Search and shared state

- [Semantic search](https://github.com/yalnezami/messageit-api-f/blob/main/src/services/messages/semantic-search.ts): `src/services/messages/semantic-search.ts`
- **Ollama**

### Other components

- **Chat user**

## Connections

- Chat user → Feathers client: uses
- Feathers client → REST and realtime API: connects (evidence: `src/client.ts`)
- REST and realtime API → Authentication: configures (evidence: `src/app.ts`)
- REST and realtime API → Service registry: configures (evidence: `src/app.ts`)
- REST and realtime API → MongoDB: configures (evidence: `src/app.ts`)
- Service registry → User accounts: registers (evidence: `src/services/index.ts`)
- Service registry → User profiles: registers (evidence: `src/services/index.ts`)
- Service registry → Friend requests: registers (evidence: `src/services/index.ts`)
- Service registry → Friendships: registers (evidence: `src/services/index.ts`)
- Service registry → Friend acceptations: registers (evidence: `src/services/index.ts`)
- Service registry → Conversations: registers (evidence: `src/services/index.ts`)
- Service registry → Conversation members: registers (evidence: `src/services/index.ts`)
- Service registry → Messages: registers (evidence: `src/services/index.ts`)
- Service registry → Message files: registers (evidence: `src/services/index.ts`)
- Service registry → Message visibility: registers (evidence: `src/services/index.ts`)
- Service registry → Message delivery: registers (evidence: `src/services/index.ts`)
- Service registry → Read receipts: registers (evidence: `src/services/index.ts`)
- Service registry → Typing state: registers (evidence: `src/services/index.ts`)
- Service registry → Emojis: registers (evidence: `src/services/index.ts`)
- Service registry → Group rights: registers (evidence: `src/services/index.ts`)
- User accounts → User profiles: creates profile (evidence: `src/services/users/users.class.ts`)
- User accounts → Friend requests: checks names (evidence: `src/services/users/users.class.ts`)
- Friendships → Friend acceptations: creates acceptation (evidence: `src/services/friends/friends.class.ts`)
- Friendships → Friend requests: removes request (evidence: `src/services/friends/friends.class.ts`)
- Friendships → User profiles: loads profiles (evidence: `src/services/friends/friends.class.ts`)
- Chat user → Semantic search: searches messages
- Semantic search → Ollama: requests embeddings
