# mathanponsingh/vhero-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/mathanponsingh/vhero-frontend
- Repository: https://github.com/mathanponsingh/vhero-frontend

## Overview

VHERO is an Expo React Native frontend whose demonstrated user workflow is email-based sign-in: a user requests an OTP, enters the code, and reaches the Home screen after verification. Authentication requests are sent to the backend; the app also has an Explore route and shared theme support. The supplied excerpts show the main screen-to-API calls and navigation. Other route wiring and unsampled theme details are not inferred.

Main entry points: [`src/app/verify-otp.tsx`](https://github.com/mathanponsingh/vhero-frontend/blob/main/src/app/verify-otp.tsx) (OTP verification), [`src/api/authentication.ts`](https://github.com/mathanponsingh/vhero-frontend/blob/main/src/api/authentication.ts) (Authentication API), [`src/app/index.tsx`](https://github.com/mathanponsingh/vhero-frontend/blob/main/src/app/index.tsx) (Email sign-in), [`src/hooks/use-theme.ts`](https://github.com/mathanponsingh/vhero-frontend/blob/main/src/hooks/use-theme.ts) (Theme hook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_auth_flow["Authentication flow"]
  node_login_screen["Email sign-in<br/>[index.tsx]"]
  node_otp_screen["OTP verification<br/>[verify-otp.tsx]"]
  node_auth_api["Authentication API<br/>[authentication.ts]"]
end

subgraph group_app_shell["App screens"]
  node_home_screen["Home screen<br/>[Home.tsx]"]
  node_explore_screen["Explore screen<br/>[explore.tsx]"]
  node_root_layout["App layout<br/>[_layout.tsx]"]
end

subgraph group_shared_ui["Shared UI"]
  node_api_config["API and OTP values<br/>[value.ts]"]
  node_theme_hook["Theme hook<br/>[use-theme.ts]"]
  node_color_scheme["Color scheme hook"]
  node_theme_colors["Theme colors<br/>[theme.ts]"]
end

node_user(("User"))
node_backend{{"VHERO backend"}}

node_user -->|"enters email"| node_login_screen
node_login_screen -->|"requests OTP"| node_auth_api
node_auth_api -->|"sends requests"| node_backend
node_login_screen -->|"routes with email"| node_otp_screen
node_user -->|"enters code"| node_otp_screen
node_otp_screen -->|"verifies or resends"| node_auth_api
node_auth_api -->|"reads API URL"| node_api_config
node_otp_screen -->|"reads OTP settings"| node_api_config
node_otp_screen -->|"routes after verify"| node_home_screen
node_theme_hook -->|"gets scheme"| node_color_scheme
node_theme_hook -->|"selects colors"| node_theme_colors

click node_login_screen "https://github.com/mathanponsingh/vhero-frontend/blob/main/src/app/index.tsx"
click node_otp_screen "https://github.com/mathanponsingh/vhero-frontend/blob/main/src/app/verify-otp.tsx"
click node_auth_api "https://github.com/mathanponsingh/vhero-frontend/blob/main/src/api/authentication.ts"
click node_api_config "https://github.com/mathanponsingh/vhero-frontend/blob/main/src/constants/value.ts"
click node_home_screen "https://github.com/mathanponsingh/vhero-frontend/blob/main/src/app/Home.tsx"
click node_explore_screen "https://github.com/mathanponsingh/vhero-frontend/blob/main/src/app/explore.tsx"
click node_root_layout "https://github.com/mathanponsingh/vhero-frontend/blob/main/src/app/_layout.tsx"
click node_theme_hook "https://github.com/mathanponsingh/vhero-frontend/blob/main/src/hooks/use-theme.ts"
click node_color_scheme "https://github.com/mathanponsingh/vhero-frontend/blob/main/src/hooks/use-color-scheme.ts"
click node_theme_colors "https://github.com/mathanponsingh/vhero-frontend/blob/main/src/constants/theme.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_login_screen,node_otp_screen,node_auth_api,node_user toneBlue
class node_home_screen,node_explore_screen,node_root_layout toneAmber
class node_api_config,node_theme_hook,node_color_scheme,node_theme_colors toneMint
class node_backend toneIndigo
```

## Components

### Authentication flow

- [Email sign-in](https://github.com/mathanponsingh/vhero-frontend/blob/main/src/app/index.tsx): `src/app/index.tsx`
- [OTP verification](https://github.com/mathanponsingh/vhero-frontend/blob/main/src/app/verify-otp.tsx): `src/app/verify-otp.tsx`
- [Authentication API](https://github.com/mathanponsingh/vhero-frontend/blob/main/src/api/authentication.ts): `src/api/authentication.ts`

### App screens

- [Home screen](https://github.com/mathanponsingh/vhero-frontend/blob/main/src/app/Home.tsx): `src/app/Home.tsx`
- [Explore screen](https://github.com/mathanponsingh/vhero-frontend/blob/main/src/app/explore.tsx): `src/app/explore.tsx`
- [App layout](https://github.com/mathanponsingh/vhero-frontend/blob/main/src/app/_layout.tsx): `src/app/_layout.tsx`

### Shared UI

- [API and OTP values](https://github.com/mathanponsingh/vhero-frontend/blob/main/src/constants/value.ts): `src/constants/value.ts`
- [Theme hook](https://github.com/mathanponsingh/vhero-frontend/blob/main/src/hooks/use-theme.ts): `src/hooks/use-theme.ts`
- [Color scheme hook](https://github.com/mathanponsingh/vhero-frontend/blob/main/src/hooks/use-color-scheme.ts): `src/hooks/use-color-scheme.ts`
- [Theme colors](https://github.com/mathanponsingh/vhero-frontend/blob/main/src/constants/theme.ts): `src/constants/theme.ts`

### Other components

- **User**
- **VHERO backend**

## Connections

- User → Email sign-in: enters email (evidence: `src/app/index.tsx`)
- Email sign-in → Authentication API: requests OTP (evidence: `src/app/index.tsx`)
- Authentication API → VHERO backend: sends requests (evidence: `src/api/authentication.ts`)
- Email sign-in → OTP verification: routes with email (evidence: `src/app/index.tsx`)
- User → OTP verification: enters code (evidence: `src/app/verify-otp.tsx`)
- OTP verification → Authentication API: verifies or resends (evidence: `src/app/verify-otp.tsx`)
- Authentication API → API and OTP values: reads API URL (evidence: `src/api/authentication.ts`)
- OTP verification → API and OTP values: reads OTP settings (evidence: `src/app/verify-otp.tsx`)
- OTP verification → Home screen: routes after verify (evidence: `src/app/verify-otp.tsx`)
- Theme hook → Color scheme hook: gets scheme (evidence: `src/hooks/use-theme.ts`)
- Theme hook → Theme colors: selects colors (evidence: `src/hooks/use-theme.ts`)
