# hemalv02/otagai architecture

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

- Interactive diagram: https://gitdiagram.com/hemalv02/otagai
- Repository: https://github.com/hemalv02/otagai

## Overview

Otagai is a neighbourhood mutual-aid mobile app. Residents join trusted circles, browse or publish tool/skill listings, draft and send help requests, coordinate offers through chat and exchanges, then confirm completion and thank each other. The API also supports family proxy requests, safety controls, media, notifications, and AI-assisted drafting and matching. The graph combines documented product flows with the sampled API entry point and data layer; many individual route-to-service calls were not shown, so those links are omitted rather than inferred.

Main entry points: [`backend/app/main.py`](https://github.com/hemalv02/otagai/blob/main/backend/app/main.py) (FastAPI API), [`mobile/src/app/(community)/(tabs)/index.tsx`](https://github.com/hemalv02/otagai/blob/main/mobile/src/app/(community)/(tabs)/index.tsx) (Expo app), [`backend/app/services/requests/service.py`](https://github.com/hemalv02/otagai/blob/main/backend/app/services/requests/service.py) (Help requests), [`backend/app/services/exchanges/service.py`](https://github.com/hemalv02/otagai/blob/main/backend/app/services/exchanges/service.py) (Exchanges)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Mobile client"]
  node_mobile["Expo app<br/>[index.tsx]"]
end

subgraph group_community["Community workflows"]
  node_circles["Circle membership<br/>[service.py]"]
  node_listings["Tool listings<br/>[service.py]"]
  node_requests["Help requests<br/>[service.py]"]
  node_ripple["Request ripple<br/>[ripple.py]"]
  node_exchanges["Exchanges<br/>[service.py]"]
  node_chat["Exchange chat<br/>[service.py]"]
  node_family["Family proxy<br/>[service.py]"]
  node_safety["Safety controls<br/>[blocks.py]"]
end

subgraph group_assistance["Ask and AI"]
  node_assistant["Ask assistant<br/>[service.py]"]
  node_ai["AI services<br/>[service.py]"]
  node_media["Media processing<br/>[service.py]"]
  node_openai["OpenAI"]
end

subgraph group_platform["API and platform"]
  node_api["FastAPI API<br/>[main.py]"]
  node_storage["Media storage<br/>[service.py]"]
  node_notifications["Notifications<br/>[service.py]"]
  node_actors["Actor permissions<br/>[service.py]"]
  node_database[("PostgreSQL data<br/>[connection.py]")]
  node_enums["Domain state types<br/>[enums.py]"]
  node_redis[("Redis")]
  node_auth["Supabase Auth"]
  node_push["Expo Push"]
end

node_resident(("Resident"))

node_resident -->|"uses"| node_mobile
node_mobile -->|"signs in"| node_auth
node_mobile -->|"HTTPS requests"| node_api
node_api -->|"routes circle work"| node_circles
node_api -->|"routes listings"| node_listings
node_api -->|"routes requests"| node_requests
node_api -->|"routes Ask"| node_assistant
node_resident -->|"browses or lists"| node_listings
node_resident -->|"sends request"| node_requests
node_requests -.->|"widens audience"| node_ripple
node_resident -->|"coordinates help"| node_exchanges
node_exchanges -->|"coordinates details"| node_chat
node_resident -->|"acts with permission"| node_family
node_assistant -.->|"requests assistance"| node_ai
node_ai -->|"uses AI"| node_openai
node_resident -->|"provides photos or voice"| node_media
node_media -.->|"stores files"| node_storage
node_api -->|"opens database"| node_database
node_api -->|"initializes Redis"| node_redis
node_api -->|"checks permissions"| node_actors
node_api -.->|"delivers notifications"| node_notifications
node_notifications -->|"sends device push"| node_push
node_resident -.->|"manages blocks"| node_safety
node_resident -->|"confirms completion"| node_exchanges
node_enums -.->|"defines stored states"| node_database

click node_mobile "https://github.com/hemalv02/otagai/blob/main/mobile/src/app/(community)/(tabs)/index.tsx"
click node_api "https://github.com/hemalv02/otagai/blob/main/backend/app/main.py"
click node_circles "https://github.com/hemalv02/otagai/blob/main/backend/app/services/circles/service.py"
click node_listings "https://github.com/hemalv02/otagai/blob/main/backend/app/services/listings/service.py"
click node_requests "https://github.com/hemalv02/otagai/blob/main/backend/app/services/requests/service.py"
click node_ripple "https://github.com/hemalv02/otagai/blob/main/backend/app/services/requests/ripple.py"
click node_exchanges "https://github.com/hemalv02/otagai/blob/main/backend/app/services/exchanges/service.py"
click node_chat "https://github.com/hemalv02/otagai/blob/main/backend/app/services/chat/service.py"
click node_family "https://github.com/hemalv02/otagai/blob/main/backend/app/services/relationships/service.py"
click node_safety "https://github.com/hemalv02/otagai/blob/main/backend/app/repositories/blocks.py"
click node_assistant "https://github.com/hemalv02/otagai/blob/main/backend/app/services/assistant/service.py"
click node_ai "https://github.com/hemalv02/otagai/blob/main/backend/app/services/ai/service.py"
click node_media "https://github.com/hemalv02/otagai/blob/main/backend/app/services/media/service.py"
click node_storage "https://github.com/hemalv02/otagai/blob/main/backend/app/services/storage/service.py"
click node_notifications "https://github.com/hemalv02/otagai/blob/main/backend/app/services/notifications/service.py"
click node_actors "https://github.com/hemalv02/otagai/blob/main/backend/app/services/actors/service.py"
click node_database "https://github.com/hemalv02/otagai/blob/main/backend/app/database/connection.py"
click node_enums "https://github.com/hemalv02/otagai/blob/main/backend/app/database/models/enums.py"

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_mobile toneBlue
class node_circles,node_listings,node_requests,node_ripple,node_exchanges,node_chat,node_family,node_safety toneAmber
class node_assistant,node_ai,node_media,node_openai toneMint
class node_api,node_storage,node_notifications,node_actors,node_database,node_enums,node_redis,node_auth,node_push toneRose
class node_resident toneIndigo
```

## Components

### Mobile client

- [Expo app](https://github.com/hemalv02/otagai/blob/main/mobile/src/app/(community)/(tabs)/index.tsx): `mobile/src/app/(community)/(tabs)/index.tsx`

### Community workflows

- [Circle membership](https://github.com/hemalv02/otagai/blob/main/backend/app/services/circles/service.py): `backend/app/services/circles/service.py`
- [Tool listings](https://github.com/hemalv02/otagai/blob/main/backend/app/services/listings/service.py): `backend/app/services/listings/service.py`
- [Help requests](https://github.com/hemalv02/otagai/blob/main/backend/app/services/requests/service.py): `backend/app/services/requests/service.py`
- [Request ripple](https://github.com/hemalv02/otagai/blob/main/backend/app/services/requests/ripple.py): `backend/app/services/requests/ripple.py`
- [Exchanges](https://github.com/hemalv02/otagai/blob/main/backend/app/services/exchanges/service.py): `backend/app/services/exchanges/service.py`
- [Exchange chat](https://github.com/hemalv02/otagai/blob/main/backend/app/services/chat/service.py): `backend/app/services/chat/service.py`
- [Family proxy](https://github.com/hemalv02/otagai/blob/main/backend/app/services/relationships/service.py): `backend/app/services/relationships/service.py`
- [Safety controls](https://github.com/hemalv02/otagai/blob/main/backend/app/repositories/blocks.py): `backend/app/repositories/blocks.py`

### Ask and AI

- [Ask assistant](https://github.com/hemalv02/otagai/blob/main/backend/app/services/assistant/service.py): `backend/app/services/assistant/service.py`
- [AI services](https://github.com/hemalv02/otagai/blob/main/backend/app/services/ai/service.py): `backend/app/services/ai/service.py`
- [Media processing](https://github.com/hemalv02/otagai/blob/main/backend/app/services/media/service.py): `backend/app/services/media/service.py`
- **OpenAI**

### API and platform

- [FastAPI API](https://github.com/hemalv02/otagai/blob/main/backend/app/main.py): `backend/app/main.py`
- [Media storage](https://github.com/hemalv02/otagai/blob/main/backend/app/services/storage/service.py): `backend/app/services/storage/service.py`
- [Notifications](https://github.com/hemalv02/otagai/blob/main/backend/app/services/notifications/service.py): `backend/app/services/notifications/service.py`
- [Actor permissions](https://github.com/hemalv02/otagai/blob/main/backend/app/services/actors/service.py): `backend/app/services/actors/service.py`
- [PostgreSQL data](https://github.com/hemalv02/otagai/blob/main/backend/app/database/connection.py): `backend/app/database/connection.py`
- [Domain state types](https://github.com/hemalv02/otagai/blob/main/backend/app/database/models/enums.py): `backend/app/database/models/enums.py`
- **Redis**
- **Supabase Auth**
- **Expo Push**

### Other components

- **Resident**

## Connections

- Resident → Expo app: uses (evidence: `README.md`)
- Expo app → Supabase Auth: signs in (evidence: `README.md`)
- Expo app → FastAPI API: HTTPS requests (evidence: `README.md`)
- FastAPI API → Circle membership: routes circle work (evidence: `backend/app/main.py`)
- FastAPI API → Tool listings: routes listings (evidence: `backend/app/main.py`)
- FastAPI API → Help requests: routes requests (evidence: `backend/app/main.py`)
- FastAPI API → Ask assistant: routes Ask (evidence: `backend/app/main.py`)
- Resident → Tool listings: browses or lists (evidence: `README.md`)
- Resident → Help requests: sends request (evidence: `README.md`)
- Help requests → Request ripple: widens audience (evidence: `backend/app/services/requests/service.py`)
- Resident → Exchanges: coordinates help (evidence: `README.md`)
- Exchanges → Exchange chat: coordinates details (evidence: `README.md`)
- Resident → Family proxy: acts with permission (evidence: `README.md`)
- Ask assistant → AI services: requests assistance (evidence: `backend/app/services/assistant/service.py`)
- AI services → OpenAI: uses AI (evidence: `README.md`)
- Resident → Media processing: provides photos or voice (evidence: `README.md`)
- Media processing → Media storage: stores files (evidence: `backend/app/services/media/service.py`)
- FastAPI API → PostgreSQL data: opens database (evidence: `backend/app/main.py`)
- FastAPI API → Redis: initializes Redis (evidence: `backend/app/main.py`)
- FastAPI API → Actor permissions: checks permissions (evidence: `README.md`)
- FastAPI API → Notifications: delivers notifications
- Notifications → Expo Push: sends device push (evidence: `README.md`)
- Resident → Safety controls: manages blocks
- Resident → Exchanges: confirms completion (evidence: `README.md`)
- Domain state types → PostgreSQL data: defines stored states
