# shark6slayer/zynova architecture

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

- Interactive diagram: https://gitdiagram.com/shark6slayer/zynova
- Repository: https://github.com/shark6slayer/zynova

## Overview

This repository is a React/Capacitor client paired with a FastAPI backend for an AI-enabled personal platform. The user enters through the app shell, authenticates through shared client state and the API client, then uses feature areas such as AI, chat, social, search, shopping, food, payments, and video. Backend routing dispatches requests to domain endpoints, which use shared database and service layers. The README is only a Vite template and documents no product capabilities; feature coverage comes from the source tree. Some UI-to-feature and endpoint-to-service links are not verified by excerpts, so they are omitted or marked unverified.

Main entry points: [`backend/app/api/router.py`](https://github.com/shark6slayer/zynova/blob/main/backend/app/api/router.py) (API Router), [`backend/app/database/client.py`](https://github.com/shark6slayer/zynova/blob/main/backend/app/database/client.py) (Mongo Database), [`src/App.tsx`](https://github.com/shark6slayer/zynova/blob/main/src/App.tsx) (Application Entry), [`src/services/apiClient.ts`](https://github.com/shark6slayer/zynova/blob/main/src/services/apiClient.ts) (API Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client App"]
  node_app["Application Entry<br/>[App.tsx]"]
  node_shell["App Shell<br/>[AppShell.tsx]"]
  node_auth["Auth State<br/>[AuthContext.tsx]"]
  node_appstate["App State<br/>[AppContext.tsx]"]
  node_offlinesync["Offline Sync"]
  node_apiclient["API Client<br/>[apiClient.ts]"]
  node_offlinestore[("Offline Store<br/>[offlineStorage.ts]")]
end

subgraph group_backend["API Backend"]
  node_backend_api["Backend API<br/>[main.py]"]
  node_router["API Router<br/>[router.py]"]
end

subgraph group_domain["Platform Domains"]
  node_ai_route["AI Endpoint<br/>[ai.py]"]
  node_auth_route["Auth Endpoint<br/>[auth.py]"]
  node_chat_route["Chat Endpoint<br/>[chat.py]"]
  node_conversation_route["Conversations<br/>[conversations.py]"]
  node_social_route["Social Endpoint<br/>[social.py]"]
  node_search_route["Search Endpoint<br/>[search.py]"]
  node_video_route["Video Endpoint<br/>[videos.py]"]
  node_food_route["Food Endpoint<br/>[food.py]"]
  node_shopping_route["Shopping Endpoint<br/>[shopping.py]"]
  node_payments_route["Payments Endpoint<br/>[payments.py]"]
  node_notifications_route["Notifications<br/>[notifications.py]"]
end

subgraph group_shared["Shared Infrastructure"]
  node_ai_service["AI Engine"]
  node_media_service["Media Service<br/>[media_service.py]"]
  node_identity_service["Identity Service"]
  node_database[("Mongo Database<br/>[client.py]")]
  node_ai_providers["AI Providers<br/>[ai_providers.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"provides state"| node_auth
node_app -->|"provides state"| node_offlinesync
node_app -->|"provides state"| node_appstate
node_app -->|"renders"| node_shell
node_auth -->|"calls"| node_apiclient
node_appstate -->|"calls"| node_apiclient
node_offlinesync -->|"reads queue"| node_offlinestore
node_offlinesync -->|"replays actions"| node_apiclient
node_apiclient -->|"sends requests"| node_backend_api
node_backend_api -->|"mounts routes"| node_router
node_router -->|"dispatches"| node_ai_route
node_router -->|"dispatches"| node_auth_route
node_router -->|"dispatches"| node_chat_route
node_router -->|"dispatches"| node_conversation_route
node_router -->|"dispatches"| node_social_route
node_router -->|"dispatches"| node_search_route
node_router -->|"dispatches"| node_video_route
node_router -->|"dispatches"| node_food_route
node_router -->|"dispatches"| node_shopping_route
node_router -->|"dispatches"| node_payments_route
node_router -->|"dispatches"| node_notifications_route
node_ai_route -->|"calls"| node_ai_service
node_ai_service -->|"selects provider"| node_ai_providers
node_ai_service -->|"stores conversations"| node_database
node_auth_route -->|"reads and writes"| node_database
node_chat_route -->|"reads and writes"| node_database
node_conversation_route -->|"reads and writes"| node_database
node_search_route -->|"queries"| node_database
node_food_route -->|"reads and writes"| node_database
node_video_route -.->|"uses media"| node_media_service
node_social_route -.->|"uses media"| node_media_service
node_search_route -->|"uses identity"| node_identity_service

click node_app "https://github.com/shark6slayer/zynova/blob/main/src/App.tsx"
click node_shell "https://github.com/shark6slayer/zynova/blob/main/src/components/layout/AppShell.tsx"
click node_auth "https://github.com/shark6slayer/zynova/blob/main/src/context/AuthContext.tsx"
click node_appstate "https://github.com/shark6slayer/zynova/blob/main/src/context/AppContext.tsx"
click node_offlinesync "https://github.com/shark6slayer/zynova/blob/main/src/context/OfflineSyncContext.tsx"
click node_apiclient "https://github.com/shark6slayer/zynova/blob/main/src/services/apiClient.ts"
click node_offlinestore "https://github.com/shark6slayer/zynova/blob/main/src/services/offlineStorage.ts"
click node_backend_api "https://github.com/shark6slayer/zynova/blob/main/backend/app/main.py"
click node_router "https://github.com/shark6slayer/zynova/blob/main/backend/app/api/router.py"
click node_ai_route "https://github.com/shark6slayer/zynova/blob/main/backend/app/api/routes/ai.py"
click node_auth_route "https://github.com/shark6slayer/zynova/blob/main/backend/app/api/routes/auth.py"
click node_chat_route "https://github.com/shark6slayer/zynova/blob/main/backend/app/api/routes/chat.py"
click node_conversation_route "https://github.com/shark6slayer/zynova/blob/main/backend/app/api/routes/conversations.py"
click node_social_route "https://github.com/shark6slayer/zynova/blob/main/backend/app/api/routes/social.py"
click node_search_route "https://github.com/shark6slayer/zynova/blob/main/backend/app/api/routes/search.py"
click node_video_route "https://github.com/shark6slayer/zynova/blob/main/backend/app/api/routes/videos.py"
click node_food_route "https://github.com/shark6slayer/zynova/blob/main/backend/app/api/routes/food.py"
click node_shopping_route "https://github.com/shark6slayer/zynova/blob/main/backend/app/api/routes/shopping.py"
click node_payments_route "https://github.com/shark6slayer/zynova/blob/main/backend/app/api/routes/payments.py"
click node_notifications_route "https://github.com/shark6slayer/zynova/blob/main/backend/app/api/routes/notifications.py"
click node_ai_service "https://github.com/shark6slayer/zynova/blob/main/backend/app/services/ai_engine_service.py"
click node_media_service "https://github.com/shark6slayer/zynova/blob/main/backend/app/services/media_service.py"
click node_identity_service "https://github.com/shark6slayer/zynova/blob/main/backend/app/services/identity_service.py"
click node_database "https://github.com/shark6slayer/zynova/blob/main/backend/app/database/client.py"
click node_ai_providers "https://github.com/shark6slayer/zynova/blob/main/backend/app/services/ai_providers.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_app,node_shell,node_auth,node_appstate,node_offlinesync,node_apiclient,node_offlinestore,node_user toneBlue
class node_backend_api,node_router toneAmber
class node_ai_route,node_auth_route,node_chat_route,node_conversation_route,node_social_route,node_search_route,node_video_route,node_food_route,node_shopping_route,node_payments_route,node_notifications_route toneMint
class node_ai_service,node_media_service,node_identity_service,node_database,node_ai_providers toneRose
```

## Components

### Client App

- [Application Entry](https://github.com/shark6slayer/zynova/blob/main/src/App.tsx): `src/App.tsx`
- [App Shell](https://github.com/shark6slayer/zynova/blob/main/src/components/layout/AppShell.tsx): `src/components/layout/AppShell.tsx`
- [Auth State](https://github.com/shark6slayer/zynova/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [App State](https://github.com/shark6slayer/zynova/blob/main/src/context/AppContext.tsx): `src/context/AppContext.tsx`
- [Offline Sync](https://github.com/shark6slayer/zynova/blob/main/src/context/OfflineSyncContext.tsx): `src/context/OfflineSyncContext.tsx`
- [API Client](https://github.com/shark6slayer/zynova/blob/main/src/services/apiClient.ts): `src/services/apiClient.ts`
- [Offline Store](https://github.com/shark6slayer/zynova/blob/main/src/services/offlineStorage.ts): `src/services/offlineStorage.ts`

### API Backend

- [Backend API](https://github.com/shark6slayer/zynova/blob/main/backend/app/main.py): `backend/app/main.py`
- [API Router](https://github.com/shark6slayer/zynova/blob/main/backend/app/api/router.py): `backend/app/api/router.py`

### Platform Domains

- [AI Endpoint](https://github.com/shark6slayer/zynova/blob/main/backend/app/api/routes/ai.py): `backend/app/api/routes/ai.py`
- [Auth Endpoint](https://github.com/shark6slayer/zynova/blob/main/backend/app/api/routes/auth.py): `backend/app/api/routes/auth.py`
- [Chat Endpoint](https://github.com/shark6slayer/zynova/blob/main/backend/app/api/routes/chat.py): `backend/app/api/routes/chat.py`
- [Conversations](https://github.com/shark6slayer/zynova/blob/main/backend/app/api/routes/conversations.py): `backend/app/api/routes/conversations.py`
- [Social Endpoint](https://github.com/shark6slayer/zynova/blob/main/backend/app/api/routes/social.py): `backend/app/api/routes/social.py`
- [Search Endpoint](https://github.com/shark6slayer/zynova/blob/main/backend/app/api/routes/search.py): `backend/app/api/routes/search.py`
- [Video Endpoint](https://github.com/shark6slayer/zynova/blob/main/backend/app/api/routes/videos.py): `backend/app/api/routes/videos.py`
- [Food Endpoint](https://github.com/shark6slayer/zynova/blob/main/backend/app/api/routes/food.py): `backend/app/api/routes/food.py`
- [Shopping Endpoint](https://github.com/shark6slayer/zynova/blob/main/backend/app/api/routes/shopping.py): `backend/app/api/routes/shopping.py`
- [Payments Endpoint](https://github.com/shark6slayer/zynova/blob/main/backend/app/api/routes/payments.py): `backend/app/api/routes/payments.py`
- [Notifications](https://github.com/shark6slayer/zynova/blob/main/backend/app/api/routes/notifications.py): `backend/app/api/routes/notifications.py`

### Shared Infrastructure

- [AI Engine](https://github.com/shark6slayer/zynova/blob/main/backend/app/services/ai_engine_service.py): `backend/app/services/ai_engine_service.py`
- [Media Service](https://github.com/shark6slayer/zynova/blob/main/backend/app/services/media_service.py): `backend/app/services/media_service.py`
- [Identity Service](https://github.com/shark6slayer/zynova/blob/main/backend/app/services/identity_service.py): `backend/app/services/identity_service.py`
- [Mongo Database](https://github.com/shark6slayer/zynova/blob/main/backend/app/database/client.py): `backend/app/database/client.py`
- [AI Providers](https://github.com/shark6slayer/zynova/blob/main/backend/app/services/ai_providers.py): `backend/app/services/ai_providers.py`

### Other components

- **User**

## Connections

- User → Application Entry: uses
- Application Entry → Auth State: provides state (evidence: `src/App.tsx`)
- Application Entry → Offline Sync: provides state (evidence: `src/App.tsx`)
- Application Entry → App State: provides state (evidence: `src/App.tsx`)
- Application Entry → App Shell: renders (evidence: `src/App.tsx`)
- Auth State → API Client: calls (evidence: `src/context/AuthContext.tsx`)
- App State → API Client: calls (evidence: `src/context/AppContext.tsx`)
- Offline Sync → Offline Store: reads queue (evidence: `src/context/OfflineSyncContext.tsx`)
- Offline Sync → API Client: replays actions (evidence: `src/context/OfflineSyncContext.tsx`)
- API Client → Backend API: sends requests (evidence: `src/services/apiClient.ts`)
- Backend API → API Router: mounts routes (evidence: `backend/app/main.py`)
- API Router → AI Endpoint: dispatches (evidence: `backend/app/api/router.py`)
- API Router → Auth Endpoint: dispatches (evidence: `backend/app/api/router.py`)
- API Router → Chat Endpoint: dispatches (evidence: `backend/app/api/router.py`)
- API Router → Conversations: dispatches (evidence: `backend/app/api/router.py`)
- API Router → Social Endpoint: dispatches (evidence: `backend/app/api/router.py`)
- API Router → Search Endpoint: dispatches (evidence: `backend/app/api/router.py`)
- API Router → Video Endpoint: dispatches (evidence: `backend/app/api/router.py`)
- API Router → Food Endpoint: dispatches (evidence: `backend/app/api/router.py`)
- API Router → Shopping Endpoint: dispatches (evidence: `backend/app/api/router.py`)
- API Router → Payments Endpoint: dispatches (evidence: `backend/app/api/router.py`)
- API Router → Notifications: dispatches (evidence: `backend/app/api/router.py`)
- AI Endpoint → AI Engine: calls (evidence: `backend/app/api/routes/ai.py`)
- AI Engine → AI Providers: selects provider (evidence: `backend/app/services/ai_engine_service.py`)
- AI Engine → Mongo Database: stores conversations (evidence: `backend/app/services/ai_engine_service.py`)
- Auth Endpoint → Mongo Database: reads and writes (evidence: `backend/app/api/routes/auth.py`)
- Chat Endpoint → Mongo Database: reads and writes (evidence: `backend/app/api/routes/chat.py`)
- Conversations → Mongo Database: reads and writes (evidence: `backend/app/api/routes/conversations.py`)
- Search Endpoint → Mongo Database: queries (evidence: `backend/app/api/routes/search.py`)
- Food Endpoint → Mongo Database: reads and writes (evidence: `backend/app/api/routes/food.py`)
- Video Endpoint → Media Service: uses media
- Social Endpoint → Media Service: uses media
- Search Endpoint → Identity Service: uses identity (evidence: `backend/app/api/routes/search.py`)
