# faizan-mk/rishta-and-rang-app architecture

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

- Interactive diagram: https://gitdiagram.com/faizan-mk/rishta-and-rang-app
- Repository: https://github.com/faizan-mk/rishta-and-rang-app

## Overview

Rishta & Rang is an Expo matchmaking app with Supabase-backed identity, profiles, discovery, matches, and messaging, plus subscription entitlements and push notifications. The principal journey is sign-up and profile setup, browsing compatible profiles, liking someone to form a match, then messaging; members can also request a transition to rishta. Routes wire the app’s feature screens, while providers and services hold state and perform backend operations. The README documents broader capabilities; sampled excerpts support detailed links for auth, matches/chat, and push, but not every feature’s internal wiring.

Main entry points: [`src/store/MatchesContext.tsx`](https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/store/MatchesContext.tsx) (Matches state), [`src/store/DiscoveryContext.tsx`](https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/store/DiscoveryContext.tsx) (Discovery state), [`src/services/pushService.ts`](https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/services/pushService.ts) (Push service), [`src/services/authService.ts`](https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/services/authService.ts) (Auth service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and profiles"]
  node_auth_routes["Auth routes"]
  node_auth_screens["Auth screens"]
  node_auth_state["Auth state<br/>[AuthContext.tsx]"]
  node_auth_service["Auth service<br/>[authService.ts]"]
  node_profile_screens["Profile screens"]
  node_profile_state["Profile state<br/>[useProfile.ts]"]
end

subgraph group_matching["Discovery and matching"]
  node_tab_routes["Main tabs"]
  node_discovery_screen["Discovery<br/>[ExploreScreen.tsx]"]
  node_discovery_state["Discovery state"]
  node_discovery_service["Discovery service"]
  node_likes_service["Likes service<br/>[likesService.ts]"]
  node_favorites["Favorites"]
end

subgraph group_conversation["Matches and messaging"]
  node_matches_screen["Matches screen<br/>[MatchesScreen.tsx]"]
  node_matches_state["Matches state<br/>[MatchesContext.tsx]"]
  node_matches_service["Matches and chat service<br/>[matchesService.ts]"]
  node_chat_screen["Chat thread<br/>[ChatScreen.tsx]"]
  node_rishta_screen["Rishta profiles"]
end

subgraph group_trust["Safety and account"]
  node_safety_screens["Safety settings"]
  node_notifications_screen["Notifications"]
end

subgraph group_integrations["Platform integrations"]
  node_billing_service["Billing service<br/>[billingService.ts]"]
  node_push_service["Push service<br/>[pushService.ts]"]
  node_push_function["Push function<br/>[index.ts]"]
  node_supabase[("Supabase")]
  node_revenuecat["RevenueCat"]
end

node_member(("Member"))

node_member -->|"starts account"| node_auth_routes
node_auth_routes -->|"routes to"| node_auth_screens
node_auth_screens -->|"authenticates through"| node_auth_state
node_auth_state -->|"calls"| node_auth_service
node_auth_service -->|"authenticates and reads profiles"| node_supabase
node_member -->|"sets up profile"| node_profile_screens
node_profile_screens -->|"loads profile"| node_profile_state
node_profile_state -->|"uses profile operations"| node_auth_service
node_member -->|"opens app"| node_tab_routes
node_tab_routes -->|"routes to explore"| node_discovery_screen
node_discovery_screen -->|"uses discovery state"| node_discovery_state
node_discovery_state -->|"loads candidates"| node_discovery_service
node_discovery_service -->|"reads profiles"| node_supabase
node_discovery_state -->|"submits likes"| node_likes_service
node_likes_service -->|"records likes and matches"| node_supabase
node_member -->|"manages favorites"| node_favorites
node_favorites -->|"reads and writes favorites"| node_supabase
node_matches_state -->|"loads threads and messages"| node_matches_service
node_matches_service -->|"reads and writes match data"| node_supabase
node_matches_state -->|"provides match state"| node_matches_screen
node_matches_screen -->|"opens thread"| node_chat_screen
node_chat_screen -->|"uses thread state"| node_matches_state
node_matches_state -->|"notifies match events"| node_push_service
node_member -->|"views rishta profiles"| node_rishta_screen
node_member -->|"manages privacy"| node_safety_screens
node_member -->|"views alerts"| node_notifications_screen
node_push_service -->|"invokes"| node_push_function
node_push_function -->|"uses backend data"| node_supabase
node_push_service -->|"registers device token"| node_supabase
node_member -.->|"manages subscription"| node_billing_service
node_billing_service -.->|"checks entitlements"| node_revenuecat

click node_auth_routes "https://github.com/faizan-mk/rishta-and-rang-app/tree/dev-faizan/src/app/(auth)"
click node_auth_screens "https://github.com/faizan-mk/rishta-and-rang-app/tree/dev-faizan/src/screens/auth"
click node_auth_state "https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/store/AuthContext.tsx"
click node_auth_service "https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/services/authService.ts"
click node_profile_screens "https://github.com/faizan-mk/rishta-and-rang-app/tree/dev-faizan/src/screens/profile"
click node_profile_state "https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/hooks/useProfile.ts"
click node_tab_routes "https://github.com/faizan-mk/rishta-and-rang-app/tree/dev-faizan/src/app/(tabs)"
click node_discovery_screen "https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/screens/explore/ExploreScreen.tsx"
click node_discovery_state "https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/store/DiscoveryContext.tsx"
click node_discovery_service "https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/services/discoveryService.ts"
click node_likes_service "https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/services/likesService.ts"
click node_favorites "https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/services/favoritesService.ts"
click node_matches_screen "https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/screens/matches/MatchesScreen.tsx"
click node_matches_state "https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/store/MatchesContext.tsx"
click node_matches_service "https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/services/matchesService.ts"
click node_chat_screen "https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/screens/matches/ChatScreen.tsx"
click node_rishta_screen "https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/screens/profile/RishtaProfileScreen.tsx"
click node_safety_screens "https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/screens/settings/PrivacySafetyScreen.tsx"
click node_notifications_screen "https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/screens/notifications/NotificationsScreen.tsx"
click node_billing_service "https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/services/billingService.ts"
click node_push_service "https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/services/pushService.ts"
click node_push_function "https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/supabase/functions/send-push/index.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_auth_routes,node_auth_screens,node_auth_state,node_auth_service,node_profile_screens,node_profile_state toneBlue
class node_tab_routes,node_discovery_screen,node_discovery_state,node_discovery_service,node_likes_service,node_favorites toneAmber
class node_matches_screen,node_matches_state,node_matches_service,node_chat_screen,node_rishta_screen toneMint
class node_safety_screens,node_notifications_screen toneRose
class node_billing_service,node_push_service,node_push_function,node_supabase,node_revenuecat,node_member toneIndigo
```

## Components

### Entry and profiles

- [Auth routes](https://github.com/faizan-mk/rishta-and-rang-app/tree/dev-faizan/src/app/(auth)): `src/app/(auth)`
- [Auth screens](https://github.com/faizan-mk/rishta-and-rang-app/tree/dev-faizan/src/screens/auth): `src/screens/auth`
- [Auth state](https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/store/AuthContext.tsx): `src/store/AuthContext.tsx`
- [Auth service](https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/services/authService.ts): `src/services/authService.ts`
- [Profile screens](https://github.com/faizan-mk/rishta-and-rang-app/tree/dev-faizan/src/screens/profile): `src/screens/profile`
- [Profile state](https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/hooks/useProfile.ts): `src/hooks/useProfile.ts`

### Discovery and matching

- [Main tabs](https://github.com/faizan-mk/rishta-and-rang-app/tree/dev-faizan/src/app/(tabs)): `src/app/(tabs)`
- [Discovery](https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/screens/explore/ExploreScreen.tsx): `src/screens/explore/ExploreScreen.tsx`
- [Discovery state](https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/store/DiscoveryContext.tsx): `src/store/DiscoveryContext.tsx`
- [Discovery service](https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/services/discoveryService.ts): `src/services/discoveryService.ts`
- [Likes service](https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/services/likesService.ts): `src/services/likesService.ts`
- [Favorites](https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/services/favoritesService.ts): `src/services/favoritesService.ts`

### Matches and messaging

- [Matches screen](https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/screens/matches/MatchesScreen.tsx): `src/screens/matches/MatchesScreen.tsx`
- [Matches state](https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/store/MatchesContext.tsx): `src/store/MatchesContext.tsx`
- [Matches and chat service](https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/services/matchesService.ts): `src/services/matchesService.ts`
- [Chat thread](https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/screens/matches/ChatScreen.tsx): `src/screens/matches/ChatScreen.tsx`
- [Rishta profiles](https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/screens/profile/RishtaProfileScreen.tsx): `src/screens/profile/RishtaProfileScreen.tsx`

### Safety and account

- [Safety settings](https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/screens/settings/PrivacySafetyScreen.tsx): `src/screens/settings/PrivacySafetyScreen.tsx`
- [Notifications](https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/screens/notifications/NotificationsScreen.tsx): `src/screens/notifications/NotificationsScreen.tsx`

### Platform integrations

- [Billing service](https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/services/billingService.ts): `src/services/billingService.ts`
- [Push service](https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/src/services/pushService.ts): `src/services/pushService.ts`
- [Push function](https://github.com/faizan-mk/rishta-and-rang-app/blob/dev-faizan/supabase/functions/send-push/index.ts): `supabase/functions/send-push/index.ts`
- **Supabase**
- **RevenueCat**

### Other components

- **Member**

## Connections

- Member → Auth routes: starts account
- Auth routes → Auth screens: routes to
- Auth screens → Auth state: authenticates through
- Auth state → Auth service: calls
- Auth service → Supabase: authenticates and reads profiles
- Member → Profile screens: sets up profile
- Profile screens → Profile state: loads profile
- Profile state → Auth service: uses profile operations
- Member → Main tabs: opens app
- Main tabs → Discovery: routes to explore
- Discovery → Discovery state: uses discovery state
- Discovery state → Discovery service: loads candidates
- Discovery service → Supabase: reads profiles
- Discovery state → Likes service: submits likes
- Likes service → Supabase: records likes and matches
- Member → Favorites: manages favorites
- Favorites → Supabase: reads and writes favorites
- Matches state → Matches and chat service: loads threads and messages
- Matches and chat service → Supabase: reads and writes match data
- Matches state → Matches screen: provides match state
- Matches screen → Chat thread: opens thread
- Chat thread → Matches state: uses thread state
- Matches state → Push service: notifies match events
- Member → Rishta profiles: views rishta profiles
- Member → Safety settings: manages privacy
- Member → Notifications: views alerts
- Push service → Push function: invokes
- Push function → Supabase: uses backend data
- Push service → Supabase: registers device token
- Member → Billing service: manages subscription
- Billing service → RevenueCat: checks entitlements
