# lungstardaking/lsdk-mobile architecture

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

- Interactive diagram: https://gitdiagram.com/lungstardaking/lsdk-mobile
- Repository: https://github.com/lungstardaking/lsdk-mobile

## Overview

LSDK Chat is a cross-platform messaging app backed by shared Supabase services. The main user journey is to sign in, open or create a conversation, load and exchange messages, and receive updates through a shared realtime feed. Separate branches provide media sharing, calls, games, status stories, watch-together, reminders, and an AI chat experience. The graph focuses on runtime modules and documented capabilities; several feature links rely on the SOURCE INDEX or README, since their implementation excerpts were not provided.

Main entry points: [`app/chat/[roomId]/index.tsx`](https://github.com/lungstardaking/lsdk-mobile/blob/main/app/chat/%5BroomId%5D/index.tsx) (Conversation screen), [`src/lib/supabase.ts`](https://github.com/lungstardaking/lsdk-mobile/blob/main/src/lib/supabase.ts) (Supabase backend), [`src/features/chat/realtime.ts`](https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/chat/realtime.ts) (Realtime feed), [`app/(tabs)/index.tsx`](https://github.com/lungstardaking/lsdk-mobile/blob/main/app/(tabs)/index.tsx) (Conversation list)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and identity"]
  node_authscreens["Auth screens<br/>[login.tsx]"]
  node_auth["Authentication<br/>[AuthProvider.tsx]"]
end

subgraph group_messaging["Messaging and media"]
  node_chatlist["Conversation list<br/>[index.tsx]"]
  node_roomview["Conversation screen<br/>[index.tsx]"]
  node_roomstate["Room state<br/>[useRoom.ts]"]
  node_chatdata["Chat data API<br/>[api.ts]"]
  node_chatfeed["Realtime feed<br/>[realtime.ts]"]
  node_media["Media storage<br/>[storage.ts]"]
  node_status["Status stories<br/>[useStatus.ts]"]
end

subgraph group_interactive["Interactive features"]
  node_calls["Calls<br/>[CallProvider.tsx]"]
  node_groupcalls["Group calls"]
  node_games["Games<br/>[useGame.ts]"]
  node_watch["Watch together<br/>[useWatch.ts]"]
  node_tools["Reminders and tools<br/>[api.ts]"]
  node_lunex["LUNEX chat<br/>[client.ts]"]
end

subgraph group_platform["Platform services"]
  node_push["Push notifications<br/>[push.ts]"]
  node_backendpush["Push function<br/>[index.ts]"]
  node_supabase[("Supabase backend<br/>[supabase.ts]")]
  node_ui["Shared UI<br/>[ui.tsx]"]
  node_theme["Theme<br/>[ThemeProvider.tsx]"]
end

node_user(("User"))

node_user -->|"signs in"| node_authscreens
node_authscreens -->|"authenticates"| node_auth
node_auth -->|"loads session"| node_supabase
node_user -->|"opens chats"| node_chatlist
node_chatlist -->|"reads identity"| node_auth
node_chatlist -->|"opens room"| node_roomview
node_roomview -->|"uses room state"| node_roomstate
node_roomstate -->|"loads and updates"| node_chatdata
node_roomstate -->|"uploads attachments"| node_media
node_chatdata -->|"queries and writes"| node_supabase
node_chatfeed -->|"subscribes to changes"| node_supabase
node_roomview -->|"listens for updates"| node_chatfeed
node_media -->|"stores media"| node_supabase
node_user -->|"views stories"| node_status
node_status -->|"loads story data"| node_supabase
node_roomview -->|"starts calls"| node_calls
node_roomview -->|"starts group calls"| node_groupcalls
node_calls -->|"uses signaling feed"| node_chatfeed
node_groupcalls -->|"uses signaling feed"| node_chatfeed
node_roomview -->|"opens games"| node_games
node_games -->|"exchanges game events"| node_chatfeed
node_roomview -.->|"opens watch feature"| node_watch
node_roomview -->|"uses chat tools"| node_tools
node_user -->|"uses AI chat"| node_lunex
node_user -->|"receives notifications"| node_push
node_push -.->|"requests push delivery"| node_backendpush
node_backendpush -.->|"uses backend services"| node_supabase
node_roomview -->|"renders controls"| node_ui
node_ui -->|"reads theme"| node_theme

click node_authscreens "https://github.com/lungstardaking/lsdk-mobile/blob/main/app/(auth)/login.tsx"
click node_auth "https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/auth/AuthProvider.tsx"
click node_chatlist "https://github.com/lungstardaking/lsdk-mobile/blob/main/app/(tabs)/index.tsx"
click node_roomview "https://github.com/lungstardaking/lsdk-mobile/blob/main/app/chat/%5BroomId%5D/index.tsx"
click node_roomstate "https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/chat/useRoom.ts"
click node_chatdata "https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/chat/api.ts"
click node_chatfeed "https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/chat/realtime.ts"
click node_media "https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/media/storage.ts"
click node_status "https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/status/useStatus.ts"
click node_calls "https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/calls/CallProvider.tsx"
click node_groupcalls "https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/calls/GroupCallProvider.tsx"
click node_games "https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/games/useGame.ts"
click node_watch "https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/watch/useWatch.ts"
click node_tools "https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/tools/api.ts"
click node_lunex "https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/lunex/client.ts"
click node_push "https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/push/push.ts"
click node_backendpush "https://github.com/lungstardaking/lsdk-mobile/blob/main/backend-additions/functions/push/index.ts"
click node_supabase "https://github.com/lungstardaking/lsdk-mobile/blob/main/src/lib/supabase.ts"
click node_ui "https://github.com/lungstardaking/lsdk-mobile/blob/main/src/components/ui.tsx"
click node_theme "https://github.com/lungstardaking/lsdk-mobile/blob/main/src/theme/ThemeProvider.tsx"

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_authscreens,node_auth,node_user toneBlue
class node_chatlist,node_roomview,node_roomstate,node_chatdata,node_chatfeed,node_media,node_status toneAmber
class node_calls,node_groupcalls,node_games,node_watch,node_tools,node_lunex toneMint
class node_push,node_backendpush,node_supabase,node_ui,node_theme toneRose
```

## Components

### App and identity

- [Auth screens](https://github.com/lungstardaking/lsdk-mobile/blob/main/app/(auth)/login.tsx): `app/(auth)/login.tsx`
- [Authentication](https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/auth/AuthProvider.tsx): `src/features/auth/AuthProvider.tsx`

### Messaging and media

- [Conversation list](https://github.com/lungstardaking/lsdk-mobile/blob/main/app/(tabs)/index.tsx): `app/(tabs)/index.tsx`
- [Conversation screen](https://github.com/lungstardaking/lsdk-mobile/blob/main/app/chat/%5BroomId%5D/index.tsx): `app/chat/[roomId]/index.tsx`
- [Room state](https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/chat/useRoom.ts): `src/features/chat/useRoom.ts`
- [Chat data API](https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/chat/api.ts): `src/features/chat/api.ts`
- [Realtime feed](https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/chat/realtime.ts): `src/features/chat/realtime.ts`
- [Media storage](https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/media/storage.ts): `src/features/media/storage.ts`
- [Status stories](https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/status/useStatus.ts): `src/features/status/useStatus.ts`

### Interactive features

- [Calls](https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/calls/CallProvider.tsx): `src/features/calls/CallProvider.tsx`
- [Group calls](https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/calls/GroupCallProvider.tsx): `src/features/calls/GroupCallProvider.tsx`
- [Games](https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/games/useGame.ts): `src/features/games/useGame.ts`
- [Watch together](https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/watch/useWatch.ts): `src/features/watch/useWatch.ts`
- [Reminders and tools](https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/tools/api.ts): `src/features/tools/api.ts`
- [LUNEX chat](https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/lunex/client.ts): `src/features/lunex/client.ts`

### Platform services

- [Push notifications](https://github.com/lungstardaking/lsdk-mobile/blob/main/src/features/push/push.ts): `src/features/push/push.ts`
- [Push function](https://github.com/lungstardaking/lsdk-mobile/blob/main/backend-additions/functions/push/index.ts): `backend-additions/functions/push/index.ts`
- [Supabase backend](https://github.com/lungstardaking/lsdk-mobile/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- [Shared UI](https://github.com/lungstardaking/lsdk-mobile/blob/main/src/components/ui.tsx): `src/components/ui.tsx`
- [Theme](https://github.com/lungstardaking/lsdk-mobile/blob/main/src/theme/ThemeProvider.tsx): `src/theme/ThemeProvider.tsx`

### Other components

- **User**

## Connections

- User → Auth screens: signs in (evidence: `README.md`)
- Auth screens → Authentication: authenticates
- Authentication → Supabase backend: loads session (evidence: `src/features/auth/AuthProvider.tsx`)
- User → Conversation list: opens chats (evidence: `README.md`)
- Conversation list → Authentication: reads identity (evidence: `app/(tabs)/index.tsx`)
- Conversation list → Conversation screen: opens room (evidence: `app/(tabs)/index.tsx`)
- Conversation screen → Room state: uses room state (evidence: `app/chat/[roomId]/index.tsx`)
- Room state → Chat data API: loads and updates (evidence: `src/features/chat/useRoom.ts`)
- Room state → Media storage: uploads attachments (evidence: `src/features/chat/useRoom.ts`)
- Chat data API → Supabase backend: queries and writes (evidence: `src/features/chat/api.ts`)
- Realtime feed → Supabase backend: subscribes to changes (evidence: `src/features/chat/realtime.ts`)
- Conversation screen → Realtime feed: listens for updates (evidence: `app/chat/[roomId]/index.tsx`)
- Media storage → Supabase backend: stores media (evidence: `src/features/media/storage.ts`)
- User → Status stories: views stories (evidence: `README.md`)
- Status stories → Supabase backend: loads story data (evidence: `src/features/status/useStatus.ts`)
- Conversation screen → Calls: starts calls (evidence: `app/chat/[roomId]/index.tsx`)
- Conversation screen → Group calls: starts group calls (evidence: `app/chat/[roomId]/index.tsx`)
- Calls → Realtime feed: uses signaling feed (evidence: `src/features/calls/CallProvider.tsx`)
- Group calls → Realtime feed: uses signaling feed (evidence: `src/features/calls/GroupCallProvider.tsx`)
- Conversation screen → Games: opens games
- Games → Realtime feed: exchanges game events (evidence: `src/features/games/useGame.ts`)
- Conversation screen → Watch together: opens watch feature
- Conversation screen → Reminders and tools: uses chat tools (evidence: `app/chat/[roomId]/index.tsx`)
- User → LUNEX chat: uses AI chat (evidence: `README.md`)
- User → Push notifications: receives notifications (evidence: `README.md`)
- Push notifications → Push function: requests push delivery
- Push function → Supabase backend: uses backend services
- Conversation screen → Shared UI: renders controls (evidence: `app/chat/[roomId]/index.tsx`)
- Shared UI → Theme: reads theme (evidence: `src/components/ui.tsx`)
