# sakshimehar/tuk-tuk-app architecture

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

- Interactive diagram: https://gitdiagram.com/sakshimehar/tuk-tuk-app
- Repository: https://github.com/sakshimehar/tuk-tuk-app

## Overview

#### Purpose and Runtime
Tuk-Tuk is an Expo/React Native social and dating app for authentication, profile discovery, nearby users, chat, voice parties, blind matching, gifts, wallet/recharge, and VIP gamification. It uses Expo Router file-based navigation and targets native/mobile environments.
Key startup and platform files: `index.js`, `app.json`, `app/_layout.jsx`, `eas.json`.

#### Navigation and App Shell
The root router establishes app-wide navigation; the tab layout organizes the primary signed-in surfaces: Home, Chat, Party, Blind Pick, and Profile. Additional route files handle account/security, onboarding, settings, user profiles, and modal-like flows.
Paths: `app/_layout.jsx`, `app/(tabs)/_layout.jsx`, `app/(tabs)/home.jsx`, `app/(tabs)/party.jsx`, `app/login.jsx`, `app/chat-box.jsx`.

#### Authentication and Session Boundary
Authentication is separated into API calls, persistent/session handling, and global state. Phone verification, Google sign-in, and Facebook native/web mechanisms feed a shared auth/session layer before protected social features consume the active user.
Paths: `src/api/authApi.js`, `src/services/authSessionService.js`, `src/store/authStore.js`, `src/services/firebasePhoneService.js`, `src/hooks/useGoogleSignIn.js`, `src/services/facebookAuthService.js`.

#### Backend Access and Domain Services
`src/api` is the HTTP transport/domain endpoint boundary, centered on Axios; `src/services` composes those APIs into UI-facing operations. This covers profiles, relationships, posts, discovery, party rooms, chat, family/social groups, gifts, gamification, VIP, and wallet operations.
Paths: `src/api/axios.js`, `src/api/profileApi.js`, `src/api/chatApi.js`, `src/api/partyApi.js`, `src/services/publicProfileService.js`, `src/services/partyService.js`, `src/services/walletService.js`.

#### Social Interaction Surfaces
Route screens orchestrate reusable presentation components for chat, user cards/profiles, friends/discovery, party exploration, and monetization panels. Components appear to own feature-specific interaction state while services provide remote data and mutations.
Paths: `Components/ChatBox.jsx`, `Components/PartyExplore.jsx`, `Components/BlindPick.jsx`, `Components/UserProfileView.jsx`, `Components/WalletRechargeSection.jsx`, `Components/VipCenterPanel.jsx`.

#### Realtime Chat and Voice
Chat has a WebSocket transport/service path, while voice-party functionality is isolated around Agora integration, token/UID support, and runtime health checks. Native build customization includes a plugin specifically for Agora screen sharing.
Paths: `src/services/websocket.ts`, `src/services/chatService.js`, `src/services/agoraVoiceService.js`, `src/services/partyVoiceService.js`, `src/services/voice/voiceTokenUtils.js`, `plugins/withoutAgoraScreenShare.js`.

#### Firebase and Notifications
Firebase supports phone authentication and likely push-notification/mobile service integration; Android credentials are included. Notification behavior is abstracted behind its own service rather than embedded in screens.
Paths: `src/lib/firebase.js`, `src/services/firebasePhoneService.js`, `src/services/pushNotificationService.js`, `google-services.json`.

#### Assets, State, and Offline Catalogs
Large bundled media and visual assets support frames, gifts, levels, treasure, and video-rich UI. Local JSON/catalog data can seed or supplement feature displays. Auth and wallet stores provide cross-screen state, with hooks exposing balance, treasure progress, device layout, and keyboard-aware behavior.
Paths: `assets/Gift`, `assets/chatFrames`, `assets/videos`, `src/data/diamondRechargeCatalog.js`, `src/store/walletStore.js`, `src/hooks/useWalletBalance.js`.

Main entry points: [`Components/ChatBox.jsx`](https://github.com/sakshimehar/tuk-tuk-app/blob/main/Components/ChatBox.jsx) (Social feature UI), [`app/_layout.jsx`](https://github.com/sakshimehar/tuk-tuk-app/blob/main/app/_layout.jsx) (Root router), [`src/services/publicProfileService.js`](https://github.com/sakshimehar/tuk-tuk-app/blob/main/src/services/publicProfileService.js) (Domain services), [`app/(tabs)/_layout.jsx`](https://github.com/sakshimehar/tuk-tuk-app/blob/main/app/(tabs)/_layout.jsx) (Signed-in tabs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Mobile App"]
  node_startup(("Expo startup<br/>entrypoint<br/>[index.js]"))
  node_root_router["Root router<br/>navigation<br/>[_layout.jsx]"]
  node_tab_router["Signed-in tabs<br/>navigation<br/>[_layout.jsx]"]
  node_social_routes["Social routes<br/>screens<br/>[home.jsx]"]
  node_feature_components["Social feature UI<br/>components<br/>[ChatBox.jsx]"]
  node_media_assets["Bundled media<br/>assets"]
end

subgraph group_identity["Identity &amp; State"]
  node_auth_api["Auth API<br/>api client<br/>[authApi.js]"]
  node_session_service["Auth session"]
  node_auth_store["Auth store<br/>global state<br/>[authStore.js]"]
  node_wallet_state["Wallet state &amp; catalog<br/>state and catalog<br/>[walletStore.js]"]
end

subgraph group_backend["Backend &amp; Realtime"]
  node_http_client["Axios transport<br/>HTTP client<br/>[axios.js]"]
  node_domain_apis["Domain APIs<br/>API endpoints<br/>[profileApi.js]"]
  node_domain_services["Domain services"]
  node_chat_realtime["Chat realtime<br/>WebSocket service<br/>[websocket.ts]"]
end

subgraph group_platform["Native Integrations"]
  node_agora_voice["Party voice<br/>Agora service"]
  node_firebase["Firebase<br/>mobile backend<br/>[firebase.js]"]
  node_phone_auth["Phone verification<br/>auth service"]
  node_notifications["Push notifications"]
  node_agora_plugin["Agora native plugin<br/>build plugin"]
end

node_startup -->|"starts"| node_root_router
node_root_router -->|"hosts"| node_tab_router
node_root_router -->|"routes to"| node_social_routes
node_tab_router -->|"renders"| node_feature_components
node_social_routes -->|"composes"| node_feature_components
node_root_router -.->|"guards with"| node_auth_store
node_auth_api -->|"auth results"| node_session_service
node_session_service -->|"hydrates"| node_auth_store
node_phone_auth -->|"verifies for"| node_auth_api
node_firebase -->|"provides"| node_phone_auth
node_domain_apis -->|"uses"| node_http_client
node_domain_services -->|"composes"| node_domain_apis
node_feature_components -->|"loads and mutates"| node_domain_services
node_feature_components -->|"exchanges live chat"| node_chat_realtime
node_feature_components -->|"joins voice parties"| node_agora_voice
node_feature_components -->|"reads balance"| node_wallet_state
node_wallet_state -->|"wallet operations"| node_domain_services
node_root_router -.->|"initializes"| node_notifications
node_agora_plugin -.->|"enables native support"| node_agora_voice
node_media_assets -->|"supplies visuals"| node_feature_components

click node_startup "https://github.com/sakshimehar/tuk-tuk-app/blob/main/index.js"
click node_root_router "https://github.com/sakshimehar/tuk-tuk-app/blob/main/app/_layout.jsx"
click node_tab_router "https://github.com/sakshimehar/tuk-tuk-app/blob/main/app/(tabs)/_layout.jsx"
click node_social_routes "https://github.com/sakshimehar/tuk-tuk-app/blob/main/app/(tabs)/home.jsx"
click node_feature_components "https://github.com/sakshimehar/tuk-tuk-app/blob/main/Components/ChatBox.jsx"
click node_auth_api "https://github.com/sakshimehar/tuk-tuk-app/blob/main/src/api/authApi.js"
click node_session_service "https://github.com/sakshimehar/tuk-tuk-app/blob/main/src/services/authSessionService.js"
click node_auth_store "https://github.com/sakshimehar/tuk-tuk-app/blob/main/src/store/authStore.js"
click node_http_client "https://github.com/sakshimehar/tuk-tuk-app/blob/main/src/api/axios.js"
click node_domain_apis "https://github.com/sakshimehar/tuk-tuk-app/blob/main/src/api/profileApi.js"
click node_domain_services "https://github.com/sakshimehar/tuk-tuk-app/blob/main/src/services/publicProfileService.js"
click node_chat_realtime "https://github.com/sakshimehar/tuk-tuk-app/blob/main/src/services/websocket.ts"
click node_agora_voice "https://github.com/sakshimehar/tuk-tuk-app/blob/main/src/services/agoraVoiceService.js"
click node_firebase "https://github.com/sakshimehar/tuk-tuk-app/blob/main/src/lib/firebase.js"
click node_phone_auth "https://github.com/sakshimehar/tuk-tuk-app/blob/main/src/services/firebasePhoneService.js"
click node_notifications "https://github.com/sakshimehar/tuk-tuk-app/blob/main/src/services/pushNotificationService.js"
click node_agora_plugin "https://github.com/sakshimehar/tuk-tuk-app/blob/main/plugins/withoutAgoraScreenShare.js"
click node_wallet_state "https://github.com/sakshimehar/tuk-tuk-app/blob/main/src/store/walletStore.js"
click node_media_assets "https://github.com/sakshimehar/tuk-tuk-app/tree/main/assets/Gift"

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_startup,node_root_router,node_tab_router,node_social_routes,node_feature_components,node_media_assets toneBlue
class node_auth_api,node_session_service,node_auth_store,node_wallet_state toneAmber
class node_http_client,node_domain_apis,node_domain_services,node_chat_realtime toneMint
class node_agora_voice,node_firebase,node_phone_auth,node_notifications,node_agora_plugin toneRose
```

## Components

### Mobile App

Expo Router screens and feature UI.

- [Expo startup](https://github.com/sakshimehar/tuk-tuk-app/blob/main/index.js): entrypoint · Bootstraps the native application. · `index.js`
- [Root router](https://github.com/sakshimehar/tuk-tuk-app/blob/main/app/_layout.jsx): navigation · Establishes app-wide navigation. · `app/_layout.jsx`
- [Signed-in tabs](https://github.com/sakshimehar/tuk-tuk-app/blob/main/app/(tabs)/_layout.jsx): navigation · Primary Home, Chat, Party, Blind Pick, and Profile surfaces. · `app/(tabs)/_layout.jsx`
- [Social routes](https://github.com/sakshimehar/tuk-tuk-app/blob/main/app/(tabs)/home.jsx): screens · Home, party, login, and chat-box route orchestration. · `app/(tabs)/home.jsx`
- [Social feature UI](https://github.com/sakshimehar/tuk-tuk-app/blob/main/Components/ChatBox.jsx): components · Chat, party, blind pick, profile, wallet, and VIP panels. · `Components/ChatBox.jsx`
- [Bundled media](https://github.com/sakshimehar/tuk-tuk-app/tree/main/assets/Gift): assets · Gifts, frames, and video-rich UI assets. · `assets/Gift`

### Identity & State

Authentication, sessions, and shared account state.

- [Auth API](https://github.com/sakshimehar/tuk-tuk-app/blob/main/src/api/authApi.js): api client · `src/api/authApi.js`
- [Auth session](https://github.com/sakshimehar/tuk-tuk-app/blob/main/src/services/authSessionService.js): service · Persists and restores the active session. · `src/services/authSessionService.js`
- [Auth store](https://github.com/sakshimehar/tuk-tuk-app/blob/main/src/store/authStore.js): global state · Exposes active-user state to protected features. · `src/store/authStore.js`
- [Wallet state & catalog](https://github.com/sakshimehar/tuk-tuk-app/blob/main/src/store/walletStore.js): state and catalog · Recharge catalog and cross-screen wallet balance. · `src/store/walletStore.js`

### Backend & Realtime

HTTP domain access and live communication.

- [Axios transport](https://github.com/sakshimehar/tuk-tuk-app/blob/main/src/api/axios.js): HTTP client · Shared backend request boundary. · `src/api/axios.js`
- [Domain APIs](https://github.com/sakshimehar/tuk-tuk-app/blob/main/src/api/profileApi.js): API endpoints · Profile, chat, and party endpoint modules. · `src/api/profileApi.js`
- [Domain services](https://github.com/sakshimehar/tuk-tuk-app/blob/main/src/services/publicProfileService.js): services · UI-facing profile, party, and wallet operations. · `src/services/publicProfileService.js`
- [Chat realtime](https://github.com/sakshimehar/tuk-tuk-app/blob/main/src/services/websocket.ts): WebSocket service · Live chat transport and chat operations. · `src/services/websocket.ts`

### Native Integrations

Firebase, voice, notifications, and native build support.

- [Party voice](https://github.com/sakshimehar/tuk-tuk-app/blob/main/src/services/agoraVoiceService.js): Agora service · Voice rooms, tokens, and party voice coordination. · `src/services/agoraVoiceService.js`
- [Firebase](https://github.com/sakshimehar/tuk-tuk-app/blob/main/src/lib/firebase.js): mobile backend · Phone authentication and mobile integration. · `src/lib/firebase.js`
- [Phone verification](https://github.com/sakshimehar/tuk-tuk-app/blob/main/src/services/firebasePhoneService.js): auth service · `src/services/firebasePhoneService.js`
- [Push notifications](https://github.com/sakshimehar/tuk-tuk-app/blob/main/src/services/pushNotificationService.js): service · `src/services/pushNotificationService.js`
- [Agora native plugin](https://github.com/sakshimehar/tuk-tuk-app/blob/main/plugins/withoutAgoraScreenShare.js): build plugin · Customizes native builds for screen sharing. · `plugins/withoutAgoraScreenShare.js`

## Connections

- Expo startup → Root router: starts
- Root router → Signed-in tabs: hosts
- Root router → Social routes: routes to
- Signed-in tabs → Social feature UI: renders
- Social routes → Social feature UI: composes
- Root router → Auth store: guards with
- Auth API → Auth session: auth results
- Auth session → Auth store: hydrates
- Phone verification → Auth API: verifies for
- Firebase → Phone verification: provides
- Domain APIs → Axios transport: uses
- Domain services → Domain APIs: composes
- Social feature UI → Domain services: loads and mutates
- Social feature UI → Chat realtime: exchanges live chat
- Social feature UI → Party voice: joins voice parties
- Social feature UI → Wallet state & catalog: reads balance
- Wallet state & catalog → Domain services: wallet operations
- Root router → Push notifications: initializes
- Agora native plugin → Party voice: enables native support
- Bundled media → Social feature UI: supplies visuals
