# hellojoyworldz/slash2 architecture

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

- Interactive diagram: https://gitdiagram.com/hellojoyworldz/slash2
- Repository: https://github.com/hellojoyworldz/slash2

## Overview

Slash is a cross-platform messaging and link-organizing app: users sign in, create or share messages, then browse them by friend/category, tag, or automatic link classification. The frontend also supports room selection, customizable tabs, and theme preferences; the backend handles authentication, message enrichment, and friend/tag management. The graph follows relationships visible in excerpts or SOURCE INDEX references. Several product areas are represented at their directory or screen level because their implementation was not sampled; desktop OAuth details are likewise limited.

Main entry points: [`backend/src/messages/messages.service.ts`](https://github.com/hellojoyworldz/slash2/blob/main/backend/src/messages/messages.service.ts) (Message processing), [`frontend/src/api.ts`](https://github.com/hellojoyworldz/slash2/blob/main/frontend/src/api.ts) (API client), [`backend/src/auth/auth.service.ts`](https://github.com/hellojoyworldz/slash2/blob/main/backend/src/auth/auth.service.ts) (Auth service), [`frontend/src/screens`](https://github.com/hellojoyworldz/slash2/tree/main/frontend/src/screens) (Product screens)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_frontend["App navigation<br/>[_layout.tsx]"]
  node_screens["Product screens"]
  node_api["API client<br/>[api.ts]"]
  node_preferences["User preferences<br/>[tab-menu.ts]"]
  node_theme["Theme system<br/>[theme-context.tsx]"]
  node_themevalues["Theme values<br/>[theme.ts]"]
  node_desktop["Desktop shell<br/>[main.js]"]
end

subgraph group_identity["Identity"]
  node_authstate["Session state<br/>[auth.tsx]"]
  node_authui["Sign-in screens<br/>[LoginScreen.tsx]"]
  node_authcontroller["Auth endpoints<br/>[auth.controller.ts]"]
  node_authservice["Auth service<br/>[auth.service.ts]"]
  node_authguard["JWT guard<br/>[jwt-auth.guard.ts]"]
  node_providers["Social providers"]
  node_users["User records<br/>[user.entity.ts]"]
end

subgraph group_messages["Messages and discovery"]
  node_messagesui["Chat and rooms<br/>[ChatScreen.tsx]"]
  node_roomstate["Selected room<br/>[selected-room.tsx]"]
  node_messagecontroller["Message endpoints"]
  node_messageservice["Message processing"]
  node_classifier["Link classifier"]
  node_preview["Link preview"]
  node_messageentity["Message records<br/>[message.entity.ts]"]
  node_events["Live events<br/>[events.service.ts]"]
end

subgraph group_social["Friends and tags"]
  node_friendsui["Friend management<br/>[FriendsScreen.tsx]"]
  node_friends["Friend service<br/>[friends.service.ts]"]
  node_friendentity["Friend records<br/>[friend.entity.ts]"]
  node_tagsui["Tag screens<br/>[TagsScreen.tsx]"]
  node_tagservice["Tag service<br/>[tags.service.ts]"]
  node_tagentity["Tag records<br/>[tag.entity.ts]"]
end

subgraph group_server["Backend services"]
  node_database[("Relational database")]
end

node_person(("App user"))

node_person -->|"uses"| node_frontend
node_frontend -->|"routes to"| node_screens
node_screens -->|"requests data"| node_api
node_screens -->|"reads session"| node_authstate
node_person -->|"signs in"| node_authui
node_authui -.->|"updates session"| node_authstate
node_authstate -->|"loads profile"| node_api
node_api -.->|"calls auth routes"| node_authcontroller
node_authcontroller -->|"delegates"| node_authservice
node_authservice -->|"verifies identity"| node_providers
node_authservice -->|"reads and updates"| node_users
node_authguard -->|"uses JWT payload"| node_authservice
node_api -->|"calls message routes"| node_messagecontroller
node_messagecontroller -->|"delegates"| node_messageservice
node_messageservice -->|"classifies links"| node_classifier
node_messageservice -->|"fetches previews"| node_preview
node_messageservice -->|"reads and writes"| node_messageentity
node_messageservice -->|"uses friend records"| node_friendentity
node_messageservice -->|"uses tag records"| node_tagentity
node_messageservice -->|"emits events"| node_events
node_messagesui -->|"selects room"| node_roomstate
node_person -->|"manages friends"| node_friendsui
node_api -.->|"calls friend routes"| node_friends
node_friends -->|"reads and writes"| node_friendentity
node_person -->|"organizes tags"| node_tagsui
node_api -.->|"calls tag routes"| node_tagservice
node_tagservice -->|"reads and writes"| node_tagentity
node_preferences -->|"persists settings"| node_api
node_theme -->|"derives colors"| node_themevalues
node_person -->|"uses desktop app"| node_desktop
node_messageservice -.->|"persists message data"| node_database
node_authservice -.->|"persists identity data"| node_database

click node_frontend "https://github.com/hellojoyworldz/slash2/blob/main/frontend/src/app/(tabs)/_layout.tsx"
click node_screens "https://github.com/hellojoyworldz/slash2/tree/main/frontend/src/screens"
click node_api "https://github.com/hellojoyworldz/slash2/blob/main/frontend/src/api.ts"
click node_authstate "https://github.com/hellojoyworldz/slash2/blob/main/frontend/src/auth.tsx"
click node_authui "https://github.com/hellojoyworldz/slash2/blob/main/frontend/src/screens/LoginScreen.tsx"
click node_authcontroller "https://github.com/hellojoyworldz/slash2/blob/main/backend/src/auth/auth.controller.ts"
click node_authservice "https://github.com/hellojoyworldz/slash2/blob/main/backend/src/auth/auth.service.ts"
click node_authguard "https://github.com/hellojoyworldz/slash2/blob/main/backend/src/auth/jwt-auth.guard.ts"
click node_providers "https://github.com/hellojoyworldz/slash2/tree/main/backend/src/auth/providers"
click node_users "https://github.com/hellojoyworldz/slash2/blob/main/backend/src/users/user.entity.ts"
click node_messagesui "https://github.com/hellojoyworldz/slash2/blob/main/frontend/src/screens/ChatScreen.tsx"
click node_roomstate "https://github.com/hellojoyworldz/slash2/blob/main/frontend/src/selected-room.tsx"
click node_messagecontroller "https://github.com/hellojoyworldz/slash2/blob/main/backend/src/messages/messages.controller.ts"
click node_messageservice "https://github.com/hellojoyworldz/slash2/blob/main/backend/src/messages/messages.service.ts"
click node_classifier "https://github.com/hellojoyworldz/slash2/blob/main/backend/src/messages/link-classifier.service.ts"
click node_preview "https://github.com/hellojoyworldz/slash2/blob/main/backend/src/messages/link-preview.service.ts"
click node_messageentity "https://github.com/hellojoyworldz/slash2/blob/main/backend/src/messages/message.entity.ts"
click node_events "https://github.com/hellojoyworldz/slash2/blob/main/backend/src/events/events.service.ts"
click node_friendsui "https://github.com/hellojoyworldz/slash2/blob/main/frontend/src/screens/FriendsScreen.tsx"
click node_friends "https://github.com/hellojoyworldz/slash2/blob/main/backend/src/friends/friends.service.ts"
click node_friendentity "https://github.com/hellojoyworldz/slash2/blob/main/backend/src/friends/friend.entity.ts"
click node_tagsui "https://github.com/hellojoyworldz/slash2/blob/main/frontend/src/screens/TagsScreen.tsx"
click node_tagservice "https://github.com/hellojoyworldz/slash2/blob/main/backend/src/tags/tags.service.ts"
click node_tagentity "https://github.com/hellojoyworldz/slash2/blob/main/backend/src/tags/tag.entity.ts"
click node_preferences "https://github.com/hellojoyworldz/slash2/blob/main/frontend/src/tab-menu.ts"
click node_theme "https://github.com/hellojoyworldz/slash2/blob/main/frontend/src/theme-context.tsx"
click node_themevalues "https://github.com/hellojoyworldz/slash2/blob/main/frontend/src/theme.ts"
click node_desktop "https://github.com/hellojoyworldz/slash2/blob/main/desktop/main.js"

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_frontend,node_screens,node_api,node_preferences,node_theme,node_themevalues,node_desktop,node_person toneBlue
class node_authstate,node_authui,node_authcontroller,node_authservice,node_authguard,node_providers,node_users toneAmber
class node_messagesui,node_roomstate,node_messagecontroller,node_messageservice,node_classifier,node_preview,node_messageentity,node_events toneMint
class node_friendsui,node_friends,node_friendentity,node_tagsui,node_tagservice,node_tagentity toneRose
class node_database toneIndigo
```

## Components

### Client experience

- [App navigation](https://github.com/hellojoyworldz/slash2/blob/main/frontend/src/app/(tabs)/_layout.tsx): `frontend/src/app/(tabs)/_layout.tsx`
- [Product screens](https://github.com/hellojoyworldz/slash2/tree/main/frontend/src/screens): `frontend/src/screens`
- [API client](https://github.com/hellojoyworldz/slash2/blob/main/frontend/src/api.ts): `frontend/src/api.ts`
- [User preferences](https://github.com/hellojoyworldz/slash2/blob/main/frontend/src/tab-menu.ts): `frontend/src/tab-menu.ts`
- [Theme system](https://github.com/hellojoyworldz/slash2/blob/main/frontend/src/theme-context.tsx): `frontend/src/theme-context.tsx`
- [Theme values](https://github.com/hellojoyworldz/slash2/blob/main/frontend/src/theme.ts): `frontend/src/theme.ts`
- [Desktop shell](https://github.com/hellojoyworldz/slash2/blob/main/desktop/main.js): `desktop/main.js`

### Identity

- [Session state](https://github.com/hellojoyworldz/slash2/blob/main/frontend/src/auth.tsx): `frontend/src/auth.tsx`
- [Sign-in screens](https://github.com/hellojoyworldz/slash2/blob/main/frontend/src/screens/LoginScreen.tsx): `frontend/src/screens/LoginScreen.tsx`
- [Auth endpoints](https://github.com/hellojoyworldz/slash2/blob/main/backend/src/auth/auth.controller.ts): `backend/src/auth/auth.controller.ts`
- [Auth service](https://github.com/hellojoyworldz/slash2/blob/main/backend/src/auth/auth.service.ts): `backend/src/auth/auth.service.ts`
- [JWT guard](https://github.com/hellojoyworldz/slash2/blob/main/backend/src/auth/jwt-auth.guard.ts): `backend/src/auth/jwt-auth.guard.ts`
- [Social providers](https://github.com/hellojoyworldz/slash2/tree/main/backend/src/auth/providers): `backend/src/auth/providers`
- [User records](https://github.com/hellojoyworldz/slash2/blob/main/backend/src/users/user.entity.ts): `backend/src/users/user.entity.ts`

### Messages and discovery

- [Chat and rooms](https://github.com/hellojoyworldz/slash2/blob/main/frontend/src/screens/ChatScreen.tsx): `frontend/src/screens/ChatScreen.tsx`
- [Selected room](https://github.com/hellojoyworldz/slash2/blob/main/frontend/src/selected-room.tsx): `frontend/src/selected-room.tsx`
- [Message endpoints](https://github.com/hellojoyworldz/slash2/blob/main/backend/src/messages/messages.controller.ts): `backend/src/messages/messages.controller.ts`
- [Message processing](https://github.com/hellojoyworldz/slash2/blob/main/backend/src/messages/messages.service.ts): `backend/src/messages/messages.service.ts`
- [Link classifier](https://github.com/hellojoyworldz/slash2/blob/main/backend/src/messages/link-classifier.service.ts): `backend/src/messages/link-classifier.service.ts`
- [Link preview](https://github.com/hellojoyworldz/slash2/blob/main/backend/src/messages/link-preview.service.ts): `backend/src/messages/link-preview.service.ts`
- [Message records](https://github.com/hellojoyworldz/slash2/blob/main/backend/src/messages/message.entity.ts): `backend/src/messages/message.entity.ts`
- [Live events](https://github.com/hellojoyworldz/slash2/blob/main/backend/src/events/events.service.ts): `backend/src/events/events.service.ts`

### Friends and tags

- [Friend management](https://github.com/hellojoyworldz/slash2/blob/main/frontend/src/screens/FriendsScreen.tsx): `frontend/src/screens/FriendsScreen.tsx`
- [Friend service](https://github.com/hellojoyworldz/slash2/blob/main/backend/src/friends/friends.service.ts): `backend/src/friends/friends.service.ts`
- [Friend records](https://github.com/hellojoyworldz/slash2/blob/main/backend/src/friends/friend.entity.ts): `backend/src/friends/friend.entity.ts`
- [Tag screens](https://github.com/hellojoyworldz/slash2/blob/main/frontend/src/screens/TagsScreen.tsx): `frontend/src/screens/TagsScreen.tsx`
- [Tag service](https://github.com/hellojoyworldz/slash2/blob/main/backend/src/tags/tags.service.ts): `backend/src/tags/tags.service.ts`
- [Tag records](https://github.com/hellojoyworldz/slash2/blob/main/backend/src/tags/tag.entity.ts): `backend/src/tags/tag.entity.ts`

### Backend services

- **Relational database**

### Other components

- **App user**

## Connections

- App user → App navigation: uses
- App navigation → Product screens: routes to (evidence: `frontend/src/app/(tabs)/_layout.tsx`)
- Product screens → API client: requests data (evidence: `frontend/src/screens/ChatScreen.tsx`)
- Product screens → Session state: reads session (evidence: `frontend/src/screens/ChatScreen.tsx`)
- App user → Sign-in screens: signs in
- Sign-in screens → Session state: updates session
- Session state → API client: loads profile (evidence: `frontend/src/auth.tsx`)
- API client → Auth endpoints: calls auth routes
- Auth endpoints → Auth service: delegates (evidence: `backend/src/auth/auth.controller.ts`)
- Auth service → Social providers: verifies identity (evidence: `backend/src/auth/auth.service.ts`)
- Auth service → User records: reads and updates (evidence: `backend/src/auth/auth.service.ts`)
- JWT guard → Auth service: uses JWT payload (evidence: `backend/src/auth/jwt-auth.guard.ts`)
- API client → Message endpoints: calls message routes (evidence: `frontend/src/api.ts`)
- Message endpoints → Message processing: delegates (evidence: `backend/src/messages/messages.controller.ts`)
- Message processing → Link classifier: classifies links (evidence: `backend/src/messages/messages.service.ts`)
- Message processing → Link preview: fetches previews (evidence: `backend/src/messages/messages.service.ts`)
- Message processing → Message records: reads and writes (evidence: `backend/src/messages/messages.service.ts`)
- Message processing → Friend records: uses friend records (evidence: `backend/src/messages/messages.service.ts`)
- Message processing → Tag records: uses tag records (evidence: `backend/src/messages/messages.service.ts`)
- Message processing → Live events: emits events (evidence: `backend/src/messages/messages.service.ts`)
- Chat and rooms → Selected room: selects room (evidence: `frontend/src/screens/ChatScreen.tsx`)
- App user → Friend management: manages friends
- API client → Friend service: calls friend routes
- Friend service → Friend records: reads and writes (evidence: `backend/src/friends/friends.service.ts`)
- App user → Tag screens: organizes tags
- API client → Tag service: calls tag routes
- Tag service → Tag records: reads and writes (evidence: `backend/src/tags/tags.service.ts`)
- User preferences → API client: persists settings (evidence: `frontend/src/tab-menu.ts`)
- Theme system → Theme values: derives colors (evidence: `frontend/src/theme-context.tsx`)
- App user → Desktop shell: uses desktop app
- Message processing → Relational database: persists message data
- Auth service → Relational database: persists identity data
