# ranielletuazon/tribo-connect architecture

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

- Interactive diagram: https://gitdiagram.com/ranielletuazon/tribo-connect
- Repository: https://github.com/ranielletuazon/tribo-connect

## Overview

TriboConnect is an Expo mobile app for community communication and safety. Users enter through authentication and profile setup, then use the home hub to access community announcements, a social feed, messaging, emergency contacts, incident reporting, identity verification, and Tribobot. Firebase provides authentication and Firestore-backed profile and community data; callable Cloud Functions handle reports and verification/OTP operations. The map reflects the sampled screens and explicit function exports; several feature screens and service implementations were not sampled, so their internal wiring is left unspecified.

Main entry points: [`src/app/(tabs)/index.tsx`](https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(tabs)/index.tsx) (Home hub), [`functions/src/index.ts`](https://github.com/ranielletuazon/tribo-connect/blob/main/functions/src/index.ts) (Cloud Functions exports), [`src/app/(auth)/login.tsx`](https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(auth)/login.tsx) (Sign in / register), [`src/providers/auth-provider.tsx`](https://github.com/ranielletuazon/tribo-connect/blob/main/src/providers/auth-provider.tsx) (Auth and profile state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Access and identity"]
  node_landing["Welcome<br/>[index.tsx]"]
  node_auth["Sign in / register<br/>[login.tsx]"]
  node_otp["OTP verification<br/>[otp-verify.tsx]"]
  node_setup["Account setup<br/>[account-setup.tsx]"]
  node_authprovider["Auth and profile state<br/>[auth-provider.tsx]"]
end

subgraph group_community["Community space"]
  node_home["Home hub<br/>[index.tsx]"]
  node_feed["Community feed<br/>[index.tsx]"]
  node_posts["Post operations<br/>[posts.ts]"]
  node_announcements["Announcements<br/>[index.tsx]"]
  node_announcementdata["Announcement mapping<br/>[announcements.ts]"]
end

subgraph group_safety["Safety services"]
  node_emergency["Emergency contacts<br/>[index.tsx]"]
  node_report["Incident report<br/>[index.tsx]"]
  node_verification["Identity verification<br/>[verify.tsx]"]
  node_verificationlib["Verification client<br/>[verification.ts]"]
end

subgraph group_messaging["Communication"]
  node_chat["Conversations<br/>[index.tsx]"]
  node_conversation["Conversation view"]
  node_tribobot["Tribobot<br/>[index.tsx]"]
end

subgraph group_services["Backend services"]
  node_firebase["Firebase configuration<br/>[firebase.ts]"]
  node_firestore[("Firestore")]
  node_cloudfunctions["Cloud Functions exports<br/>[index.ts]"]
  node_otpfunc["OTP functions<br/>[otp.ts]"]
  node_reportfunc["Report function<br/>[report.ts]"]
  node_verificationfunc["Verification functions<br/>[verification.ts]"]
end

node_resident(("Community member"))

node_resident -->|"opens app"| node_landing
node_landing -->|"starts sign-in"| node_auth
node_auth -->|"signs in"| node_authprovider
node_auth -->|"continues registration"| node_otp
node_otp -->|"requests or verifies OTP"| node_cloudfunctions
node_cloudfunctions -->|"exports"| node_otpfunc
node_authprovider -->|"uses authentication"| node_firebase
node_authprovider -->|"watches profile"| node_firestore
node_auth -->|"sets up account"| node_setup
node_resident -->|"uses services"| node_home
node_home -->|"opens feed"| node_feed
node_feed -->|"reads and updates posts"| node_firestore
node_feed -->|"maps post data"| node_posts
node_home -->|"opens announcements"| node_announcements
node_announcements -->|"reads announcements"| node_firestore
node_announcements -->|"maps announcement data"| node_announcementdata
node_home -->|"opens contacts"| node_emergency
node_home -->|"opens reporting"| node_report
node_report -->|"submits report"| node_cloudfunctions
node_cloudfunctions -->|"exports"| node_reportfunc
node_home -->|"opens verification"| node_verification
node_verification -->|"uses verification operations"| node_verificationlib
node_verificationlib -->|"calls verification functions"| node_cloudfunctions
node_cloudfunctions -->|"exports"| node_verificationfunc
node_home -->|"opens messaging"| node_chat
node_chat -->|"reads conversations and users"| node_firestore
node_chat -->|"opens conversation"| node_conversation
node_home -->|"opens assistant"| node_tribobot
node_firebase -->|"configures client access"| node_firestore

click node_landing "https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/index.tsx"
click node_auth "https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(auth)/login.tsx"
click node_otp "https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(auth)/otp-verify.tsx"
click node_setup "https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(auth)/account-setup.tsx"
click node_authprovider "https://github.com/ranielletuazon/tribo-connect/blob/main/src/providers/auth-provider.tsx"
click node_home "https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(tabs)/index.tsx"
click node_feed "https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(tabs)/feed/index.tsx"
click node_posts "https://github.com/ranielletuazon/tribo-connect/blob/main/src/lib/posts.ts"
click node_announcements "https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(tabs)/community/index.tsx"
click node_announcementdata "https://github.com/ranielletuazon/tribo-connect/blob/main/src/lib/announcements.ts"
click node_emergency "https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(tabs)/emergency/index.tsx"
click node_report "https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(tabs)/report/index.tsx"
click node_verification "https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(tabs)/profile/verify.tsx"
click node_verificationlib "https://github.com/ranielletuazon/tribo-connect/blob/main/src/lib/verification.ts"
click node_chat "https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(tabs)/chat/index.tsx"
click node_conversation "https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(tabs)/chat/%5BconversationId%5D.tsx"
click node_tribobot "https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(tabs)/tribobot/index.tsx"
click node_firebase "https://github.com/ranielletuazon/tribo-connect/blob/main/src/lib/firebase.ts"
click node_cloudfunctions "https://github.com/ranielletuazon/tribo-connect/blob/main/functions/src/index.ts"
click node_otpfunc "https://github.com/ranielletuazon/tribo-connect/blob/main/functions/src/otp.ts"
click node_reportfunc "https://github.com/ranielletuazon/tribo-connect/blob/main/functions/src/report.ts"
click node_verificationfunc "https://github.com/ranielletuazon/tribo-connect/blob/main/functions/src/verification.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_landing,node_auth,node_otp,node_setup,node_authprovider toneBlue
class node_home,node_feed,node_posts,node_announcements,node_announcementdata toneAmber
class node_emergency,node_report,node_verification,node_verificationlib toneMint
class node_chat,node_conversation,node_tribobot toneRose
class node_firebase,node_firestore,node_cloudfunctions,node_otpfunc,node_reportfunc,node_verificationfunc,node_resident toneIndigo
```

## Components

### Access and identity

- [Welcome](https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/index.tsx): `src/app/index.tsx`
- [Sign in / register](https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(auth)/login.tsx): `src/app/(auth)/login.tsx`
- [OTP verification](https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(auth)/otp-verify.tsx): `src/app/(auth)/otp-verify.tsx`
- [Account setup](https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(auth)/account-setup.tsx): `src/app/(auth)/account-setup.tsx`
- [Auth and profile state](https://github.com/ranielletuazon/tribo-connect/blob/main/src/providers/auth-provider.tsx): `src/providers/auth-provider.tsx`

### Community space

- [Home hub](https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(tabs)/index.tsx): `src/app/(tabs)/index.tsx`
- [Community feed](https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(tabs)/feed/index.tsx): `src/app/(tabs)/feed/index.tsx`
- [Post operations](https://github.com/ranielletuazon/tribo-connect/blob/main/src/lib/posts.ts): `src/lib/posts.ts`
- [Announcements](https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(tabs)/community/index.tsx): `src/app/(tabs)/community/index.tsx`
- [Announcement mapping](https://github.com/ranielletuazon/tribo-connect/blob/main/src/lib/announcements.ts): `src/lib/announcements.ts`

### Safety services

- [Emergency contacts](https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(tabs)/emergency/index.tsx): `src/app/(tabs)/emergency/index.tsx`
- [Incident report](https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(tabs)/report/index.tsx): `src/app/(tabs)/report/index.tsx`
- [Identity verification](https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(tabs)/profile/verify.tsx): `src/app/(tabs)/profile/verify.tsx`
- [Verification client](https://github.com/ranielletuazon/tribo-connect/blob/main/src/lib/verification.ts): `src/lib/verification.ts`

### Communication

- [Conversations](https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(tabs)/chat/index.tsx): `src/app/(tabs)/chat/index.tsx`
- [Conversation view](https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(tabs)/chat/%5BconversationId%5D.tsx): `src/app/(tabs)/chat/[conversationId].tsx`
- [Tribobot](https://github.com/ranielletuazon/tribo-connect/blob/main/src/app/(tabs)/tribobot/index.tsx): `src/app/(tabs)/tribobot/index.tsx`

### Backend services

- [Firebase configuration](https://github.com/ranielletuazon/tribo-connect/blob/main/src/lib/firebase.ts): `src/lib/firebase.ts`
- **Firestore**
- [Cloud Functions exports](https://github.com/ranielletuazon/tribo-connect/blob/main/functions/src/index.ts): `functions/src/index.ts`
- [OTP functions](https://github.com/ranielletuazon/tribo-connect/blob/main/functions/src/otp.ts): `functions/src/otp.ts`
- [Report function](https://github.com/ranielletuazon/tribo-connect/blob/main/functions/src/report.ts): `functions/src/report.ts`
- [Verification functions](https://github.com/ranielletuazon/tribo-connect/blob/main/functions/src/verification.ts): `functions/src/verification.ts`

### Other components

- **Community member**

## Connections

- Community member → Welcome: opens app
- Welcome → Sign in / register: starts sign-in
- Sign in / register → Auth and profile state: signs in
- Sign in / register → OTP verification: continues registration
- OTP verification → Cloud Functions exports: requests or verifies OTP
- Cloud Functions exports → OTP functions: exports
- Auth and profile state → Firebase configuration: uses authentication
- Auth and profile state → Firestore: watches profile
- Sign in / register → Account setup: sets up account
- Community member → Home hub: uses services
- Home hub → Community feed: opens feed
- Community feed → Firestore: reads and updates posts
- Community feed → Post operations: maps post data
- Home hub → Announcements: opens announcements
- Announcements → Firestore: reads announcements
- Announcements → Announcement mapping: maps announcement data
- Home hub → Emergency contacts: opens contacts
- Home hub → Incident report: opens reporting
- Incident report → Cloud Functions exports: submits report
- Cloud Functions exports → Report function: exports
- Home hub → Identity verification: opens verification
- Identity verification → Verification client: uses verification operations
- Verification client → Cloud Functions exports: calls verification functions
- Cloud Functions exports → Verification functions: exports
- Home hub → Conversations: opens messaging
- Conversations → Firestore: reads conversations and users
- Conversations → Conversation view: opens conversation
- Home hub → Tribobot: opens assistant
- Firebase configuration → Firestore: configures client access
