# egormarkor/legitcheck architecture

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

- Interactive diagram: https://gitdiagram.com/egormarkor/legitcheck
- Repository: https://github.com/egormarkor/legitcheck

## Overview

Legitcheck is a Django service that routes requests to separate web and PC web applications by domain, alongside a React Native client using Telegram-based login and verdict/payment features. The main user journey is authenticate, submit or look up a product check, then view its verdict; the backend also has persistent user, verdict, photo, and payment-related domain models. README evidence establishes host routing, while sampled mobile code establishes client actions. Backend API-to-client endpoint matching and several integrations are not verified from the available excerpts, so those links are omitted or marked unverified.

Main entry points: [`mobile-native/src/navigation/RootNavigator.tsx`](https://github.com/egormarkor/legitcheck/blob/main/mobile-native/src/navigation/RootNavigator.tsx) (App navigation), [`mobile-native/src/api/client.ts`](https://github.com/egormarkor/legitcheck/blob/main/mobile-native/src/api/client.ts) (API client), [`mobile-native/src/screens/AuthScreen.tsx`](https://github.com/egormarkor/legitcheck/blob/main/mobile-native/src/screens/AuthScreen.tsx) (Telegram login), [`webapp/views.py`](https://github.com/egormarkor/legitcheck/blob/main/webapp/views.py) (Web app handlers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Native mobile client"]
  node_root_nav["App navigation<br/>[RootNavigator.tsx]"]
  node_auth_screen["Telegram login<br/>[AuthScreen.tsx]"]
  node_home_screen["Home<br/>[HomeScreen.tsx]"]
  node_check_screen["Submit check<br/>[CheckScreen.tsx]"]
  node_verdicts_screen["Verdict list<br/>[VerdictsScreen.tsx]"]
  node_detail_screen["Verdict detail"]
  node_account_screen["Account<br/>[AccountScreen.tsx]"]
  node_payment_screen["Payment<br/>[PaymentScreen.tsx]"]
  node_auth_context["Auth state<br/>[AuthContext.tsx]"]
  node_api_client["API client<br/>[client.ts]"]
end

subgraph group_backend["Django service"]
  node_django["Django runtime"]
  node_web_routes["Web app routes<br/>[urls.py]"]
  node_pc_routes["PC app routes<br/>[urls.py]"]
  node_web_views["Web app handlers<br/>[views.py]"]
  node_pc_views["PC app handlers<br/>[views.py]"]
end

subgraph group_domain["Product data"]
  node_web_models[("Web domain models<br/>[models.py]")]
  node_pc_models[("PC domain models<br/>[models.py]")]
  node_image_utils["Photo processing<br/>[image_utils.py]"]
end

subgraph group_integrations["External integrations"]
  node_telegram_bot["Telegram bot"]
  node_telegram_service["Telegram services<br/>[telegram.py]"]
end

node_mobile_user(("Mobile user"))
node_telegram(("Telegram"))
node_api_service{{"HTTP API"}}

node_mobile_user -->|"uses"| node_root_nav
node_root_nav -->|"routes to"| node_auth_screen
node_root_nav -->|"routes to"| node_home_screen
node_root_nav -->|"routes to"| node_check_screen
node_root_nav -->|"routes to"| node_verdicts_screen
node_root_nav -->|"routes to"| node_account_screen
node_root_nav -->|"routes to"| node_detail_screen
node_root_nav -->|"routes to"| node_payment_screen
node_auth_screen -->|"requests login"| node_api_client
node_auth_screen -->|"sets user"| node_auth_context
node_auth_context -->|"fetches user"| node_api_client
node_check_screen -->|"submits checks"| node_api_client
node_detail_screen -->|"loads verdict"| node_api_client
node_account_screen -->|"loads account"| node_api_client
node_payment_screen -->|"requests payment"| node_api_client
node_api_client -->|"sends HTTP"| node_api_service
node_api_service -.->|"may dispatch"| node_web_views
node_django -->|"selects by host"| node_web_routes
node_django -->|"selects by host"| node_pc_routes
node_web_views -->|"uses domain data"| node_web_models
node_web_views -->|"calls service"| node_telegram_service
node_pc_views -->|"uses domain data"| node_pc_models
node_pc_models -->|"references users"| node_web_models
node_web_models -->|"watermarks photos"| node_image_utils
node_pc_models -->|"watermarks photos"| node_image_utils
node_telegram_bot -->|"uses service"| node_telegram_service
node_telegram_bot -.->|"communicates"| node_telegram

click node_root_nav "https://github.com/egormarkor/legitcheck/blob/main/mobile-native/src/navigation/RootNavigator.tsx"
click node_auth_screen "https://github.com/egormarkor/legitcheck/blob/main/mobile-native/src/screens/AuthScreen.tsx"
click node_home_screen "https://github.com/egormarkor/legitcheck/blob/main/mobile-native/src/screens/HomeScreen.tsx"
click node_check_screen "https://github.com/egormarkor/legitcheck/blob/main/mobile-native/src/screens/CheckScreen.tsx"
click node_verdicts_screen "https://github.com/egormarkor/legitcheck/blob/main/mobile-native/src/screens/VerdictsScreen.tsx"
click node_detail_screen "https://github.com/egormarkor/legitcheck/blob/main/mobile-native/src/screens/VerdictDetailScreen.tsx"
click node_account_screen "https://github.com/egormarkor/legitcheck/blob/main/mobile-native/src/screens/AccountScreen.tsx"
click node_payment_screen "https://github.com/egormarkor/legitcheck/blob/main/mobile-native/src/screens/PaymentScreen.tsx"
click node_auth_context "https://github.com/egormarkor/legitcheck/blob/main/mobile-native/src/context/AuthContext.tsx"
click node_api_client "https://github.com/egormarkor/legitcheck/blob/main/mobile-native/src/api/client.ts"
click node_django "https://github.com/egormarkor/legitcheck/blob/main/legitcheck/host_routing_middleware.py"
click node_web_routes "https://github.com/egormarkor/legitcheck/blob/main/webapp/urls.py"
click node_pc_routes "https://github.com/egormarkor/legitcheck/blob/main/pcwebapp/urls.py"
click node_web_views "https://github.com/egormarkor/legitcheck/blob/main/webapp/views.py"
click node_pc_views "https://github.com/egormarkor/legitcheck/blob/main/pcwebapp/views.py"
click node_web_models "https://github.com/egormarkor/legitcheck/blob/main/webapp/models.py"
click node_pc_models "https://github.com/egormarkor/legitcheck/blob/main/pcwebapp/models.py"
click node_image_utils "https://github.com/egormarkor/legitcheck/blob/main/webapp/image_utils.py"
click node_telegram_bot "https://github.com/egormarkor/legitcheck/blob/main/telegram_login_bot.py"
click node_telegram_service "https://github.com/egormarkor/legitcheck/blob/main/webapp/telegram.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_root_nav,node_auth_screen,node_home_screen,node_check_screen,node_verdicts_screen,node_detail_screen,node_account_screen,node_payment_screen,node_auth_context,node_api_client,node_mobile_user toneBlue
class node_django,node_web_routes,node_pc_routes,node_web_views,node_pc_views toneAmber
class node_web_models,node_pc_models,node_image_utils,node_api_service toneMint
class node_telegram_bot,node_telegram_service toneRose
class node_telegram toneIndigo
```

## Components

### Native mobile client

- [App navigation](https://github.com/egormarkor/legitcheck/blob/main/mobile-native/src/navigation/RootNavigator.tsx): `mobile-native/src/navigation/RootNavigator.tsx`
- [Telegram login](https://github.com/egormarkor/legitcheck/blob/main/mobile-native/src/screens/AuthScreen.tsx): `mobile-native/src/screens/AuthScreen.tsx`
- [Home](https://github.com/egormarkor/legitcheck/blob/main/mobile-native/src/screens/HomeScreen.tsx): `mobile-native/src/screens/HomeScreen.tsx`
- [Submit check](https://github.com/egormarkor/legitcheck/blob/main/mobile-native/src/screens/CheckScreen.tsx): `mobile-native/src/screens/CheckScreen.tsx`
- [Verdict list](https://github.com/egormarkor/legitcheck/blob/main/mobile-native/src/screens/VerdictsScreen.tsx): `mobile-native/src/screens/VerdictsScreen.tsx`
- [Verdict detail](https://github.com/egormarkor/legitcheck/blob/main/mobile-native/src/screens/VerdictDetailScreen.tsx): `mobile-native/src/screens/VerdictDetailScreen.tsx`
- [Account](https://github.com/egormarkor/legitcheck/blob/main/mobile-native/src/screens/AccountScreen.tsx): `mobile-native/src/screens/AccountScreen.tsx`
- [Payment](https://github.com/egormarkor/legitcheck/blob/main/mobile-native/src/screens/PaymentScreen.tsx): `mobile-native/src/screens/PaymentScreen.tsx`
- [Auth state](https://github.com/egormarkor/legitcheck/blob/main/mobile-native/src/context/AuthContext.tsx): `mobile-native/src/context/AuthContext.tsx`
- [API client](https://github.com/egormarkor/legitcheck/blob/main/mobile-native/src/api/client.ts): `mobile-native/src/api/client.ts`

### Django service

- [Django runtime](https://github.com/egormarkor/legitcheck/blob/main/legitcheck/host_routing_middleware.py): `legitcheck/host_routing_middleware.py`
- [Web app routes](https://github.com/egormarkor/legitcheck/blob/main/webapp/urls.py): `webapp/urls.py`
- [PC app routes](https://github.com/egormarkor/legitcheck/blob/main/pcwebapp/urls.py): `pcwebapp/urls.py`
- [Web app handlers](https://github.com/egormarkor/legitcheck/blob/main/webapp/views.py): `webapp/views.py`
- [PC app handlers](https://github.com/egormarkor/legitcheck/blob/main/pcwebapp/views.py): `pcwebapp/views.py`

### Product data

- [Web domain models](https://github.com/egormarkor/legitcheck/blob/main/webapp/models.py): `webapp/models.py`
- [PC domain models](https://github.com/egormarkor/legitcheck/blob/main/pcwebapp/models.py): `pcwebapp/models.py`
- [Photo processing](https://github.com/egormarkor/legitcheck/blob/main/webapp/image_utils.py): `webapp/image_utils.py`

### External integrations

- [Telegram bot](https://github.com/egormarkor/legitcheck/blob/main/telegram_login_bot.py): `telegram_login_bot.py`
- [Telegram services](https://github.com/egormarkor/legitcheck/blob/main/webapp/telegram.py): `webapp/telegram.py`

### Other components

- **Mobile user**
- **Telegram**
- **HTTP API**

## Connections

- Mobile user → App navigation: uses (evidence: `mobile-native/src/navigation/RootNavigator.tsx`)
- App navigation → Telegram login: routes to (evidence: `mobile-native/src/navigation/RootNavigator.tsx`)
- App navigation → Home: routes to (evidence: `mobile-native/src/navigation/RootNavigator.tsx`)
- App navigation → Submit check: routes to (evidence: `mobile-native/src/navigation/RootNavigator.tsx`)
- App navigation → Verdict list: routes to (evidence: `mobile-native/src/navigation/RootNavigator.tsx`)
- App navigation → Account: routes to (evidence: `mobile-native/src/navigation/RootNavigator.tsx`)
- App navigation → Verdict detail: routes to (evidence: `mobile-native/src/navigation/RootNavigator.tsx`)
- App navigation → Payment: routes to (evidence: `mobile-native/src/navigation/RootNavigator.tsx`)
- Telegram login → API client: requests login (evidence: `mobile-native/src/screens/AuthScreen.tsx`)
- Telegram login → Auth state: sets user (evidence: `mobile-native/src/screens/AuthScreen.tsx`)
- Auth state → API client: fetches user (evidence: `mobile-native/src/context/AuthContext.tsx`)
- Submit check → API client: submits checks (evidence: `mobile-native/src/screens/CheckScreen.tsx`)
- Verdict detail → API client: loads verdict (evidence: `mobile-native/src/screens/VerdictDetailScreen.tsx`)
- Account → API client: loads account (evidence: `mobile-native/src/screens/AccountScreen.tsx`)
- Payment → API client: requests payment (evidence: `mobile-native/src/screens/PaymentScreen.tsx`)
- API client → HTTP API: sends HTTP (evidence: `mobile-native/src/api/client.ts`)
- HTTP API → Web app handlers: may dispatch
- Django runtime → Web app routes: selects by host (evidence: `README.md`)
- Django runtime → PC app routes: selects by host (evidence: `README.md`)
- Web app handlers → Web domain models: uses domain data (evidence: `webapp/views.py`)
- Web app handlers → Telegram services: calls service (evidence: `webapp/views.py`)
- PC app handlers → PC domain models: uses domain data (evidence: `pcwebapp/views.py`)
- PC domain models → Web domain models: references users (evidence: `pcwebapp/models.py`)
- Web domain models → Photo processing: watermarks photos (evidence: `webapp/models.py`)
- PC domain models → Photo processing: watermarks photos (evidence: `pcwebapp/models.py`)
- Telegram bot → Telegram services: uses service (evidence: `telegram_login_bot.py`)
- Telegram bot → Telegram: communicates
