# pro-coder12353/saif-ai architecture

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

- Interactive diagram: https://gitdiagram.com/pro-coder12353/saif-ai
- Repository: https://github.com/pro-coder12353/saif-ai

## Overview

Saif-AI is a browser-based UAE scam-defense app. Users enter from the landing screen, submit suspicious text or an image (optionally using the delivery-scam scan), receive Gemini analysis, and can use multilingual UI and reporting features. App.tsx also contains the map, government-verification, and training views. The README documents Google Maps and Al Ameen capabilities, but their underlying integrations are not shown in the sampled source; those links are marked optional/unverified.

Main entry points: [`App.tsx`](https://github.com/pro-coder12353/saif-ai/blob/main/App.tsx) (App controller), [`components/LandingPage.tsx`](https://github.com/pro-coder12353/saif-ai/blob/main/components/LandingPage.tsx) (Landing screen), [`types.ts`](https://github.com/pro-coder12353/saif-ai/blob/main/types.ts) (App data types), [`services/geminiService.ts`](https://github.com/pro-coder12353/saif-ai/blob/main/services/geminiService.ts) (Gemini analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_app["App controller<br/>[App.tsx]"]
  node_landing["Landing screen<br/>[LandingPage.tsx]"]
  node_uploader["Image uploader<br/>[FileUploader.tsx]"]
  node_delivery["Delivery shield<br/>[App.tsx]"]
  node_threatmap["Threat map<br/>[App.tsx]"]
  node_govverify["Gov-ID view<br/>[App.tsx]"]
  node_training["Cyber training<br/>[App.tsx]"]
  node_reporting["Authority reporting<br/>[App.tsx]"]
end

subgraph group_analysis["Threat analysis"]
  node_gemini["Gemini analysis<br/>[geminiService.ts]"]
end

subgraph group_localization["Localization"]
  node_lingoservice["Translation service<br/>[lingoService.ts]"]
  node_language["Language selector"]
end

subgraph group_shared["Shared UI and types"]
  node_translations["Translation strings<br/>[constants.ts]"]
  node_types["App data types<br/>[types.ts]"]
  node_logo["Saif logo<br/>[Logo.tsx]"]
end

node_resident(("UAE resident"))
node_geminiapi["Google Gemini API"]
node_lingoapi["Lingo.dev API"]
node_maps["Google Maps"]
node_alameen["Al Ameen service"]

node_resident -->|"opens"| node_landing
node_app -->|"renders"| node_landing
node_landing -->|"enters scanner"| node_app
node_app -->|"renders"| node_uploader
node_uploader -->|"passes selected file"| node_app
node_app -->|"requests analysis"| node_gemini
node_gemini -->|"submits content"| node_geminiapi
node_app -->|"requests translations"| node_lingoservice
node_lingoservice -->|"translates text"| node_lingoapi
node_app -->|"renders"| node_language
node_language -->|"lists supported languages"| node_translations
node_app -->|"renders"| node_delivery
node_app -->|"renders"| node_threatmap
node_app -->|"renders"| node_govverify
node_app -->|"renders"| node_training
node_app -->|"renders"| node_reporting
node_threatmap -.->|"visualizes threat data"| node_maps
node_reporting -.->|"prepares reports for"| node_alameen
node_app -->|"renders"| node_logo
node_app -->|"uses view and language types"| node_types
node_landing -->|"renders"| node_logo
node_landing -->|"uses translation type"| node_types
node_gemini -->|"uses language type"| node_types
node_lingoservice -->|"uses translation types"| node_types

click node_app "https://github.com/pro-coder12353/saif-ai/blob/main/App.tsx"
click node_landing "https://github.com/pro-coder12353/saif-ai/blob/main/components/LandingPage.tsx"
click node_uploader "https://github.com/pro-coder12353/saif-ai/blob/main/components/FileUploader.tsx"
click node_delivery "https://github.com/pro-coder12353/saif-ai/blob/main/App.tsx"
click node_threatmap "https://github.com/pro-coder12353/saif-ai/blob/main/App.tsx"
click node_govverify "https://github.com/pro-coder12353/saif-ai/blob/main/App.tsx"
click node_training "https://github.com/pro-coder12353/saif-ai/blob/main/App.tsx"
click node_reporting "https://github.com/pro-coder12353/saif-ai/blob/main/App.tsx"
click node_gemini "https://github.com/pro-coder12353/saif-ai/blob/main/services/geminiService.ts"
click node_lingoservice "https://github.com/pro-coder12353/saif-ai/blob/main/services/lingoService.ts"
click node_language "https://github.com/pro-coder12353/saif-ai/blob/main/components/LanguageSelector.tsx"
click node_translations "https://github.com/pro-coder12353/saif-ai/blob/main/constants.ts"
click node_types "https://github.com/pro-coder12353/saif-ai/blob/main/types.ts"
click node_logo "https://github.com/pro-coder12353/saif-ai/blob/main/components/Logo.tsx"

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_landing,node_uploader,node_delivery,node_threatmap,node_govverify,node_training,node_reporting toneBlue
class node_gemini toneAmber
class node_lingoservice,node_language,node_geminiapi,node_lingoapi toneMint
class node_translations,node_types,node_logo toneRose
class node_resident,node_maps,node_alameen toneIndigo
```

## Components

### App experience

- [App controller](https://github.com/pro-coder12353/saif-ai/blob/main/App.tsx): `App.tsx`
- [Landing screen](https://github.com/pro-coder12353/saif-ai/blob/main/components/LandingPage.tsx): `components/LandingPage.tsx`
- [Image uploader](https://github.com/pro-coder12353/saif-ai/blob/main/components/FileUploader.tsx): `components/FileUploader.tsx`
- [Delivery shield](https://github.com/pro-coder12353/saif-ai/blob/main/App.tsx): `App.tsx`
- [Threat map](https://github.com/pro-coder12353/saif-ai/blob/main/App.tsx): `App.tsx`
- [Gov-ID view](https://github.com/pro-coder12353/saif-ai/blob/main/App.tsx): `App.tsx`
- [Cyber training](https://github.com/pro-coder12353/saif-ai/blob/main/App.tsx): `App.tsx`
- [Authority reporting](https://github.com/pro-coder12353/saif-ai/blob/main/App.tsx): `App.tsx`

### Threat analysis

- [Gemini analysis](https://github.com/pro-coder12353/saif-ai/blob/main/services/geminiService.ts): `services/geminiService.ts`

### Localization

- [Translation service](https://github.com/pro-coder12353/saif-ai/blob/main/services/lingoService.ts): `services/lingoService.ts`
- [Language selector](https://github.com/pro-coder12353/saif-ai/blob/main/components/LanguageSelector.tsx): `components/LanguageSelector.tsx`

### Shared UI and types

- [Translation strings](https://github.com/pro-coder12353/saif-ai/blob/main/constants.ts): `constants.ts`
- [App data types](https://github.com/pro-coder12353/saif-ai/blob/main/types.ts): `types.ts`
- [Saif logo](https://github.com/pro-coder12353/saif-ai/blob/main/components/Logo.tsx): `components/Logo.tsx`

### Other components

- **UAE resident**
- **Google Gemini API**
- **Lingo.dev API**
- **Google Maps**
- **Al Ameen service**

## Connections

- UAE resident → Landing screen: opens (evidence: `README.md`)
- App controller → Landing screen: renders (evidence: `App.tsx`)
- Landing screen → App controller: enters scanner (evidence: `components/LandingPage.tsx`)
- App controller → Image uploader: renders (evidence: `App.tsx`)
- Image uploader → App controller: passes selected file (evidence: `components/FileUploader.tsx`)
- App controller → Gemini analysis: requests analysis (evidence: `App.tsx`)
- Gemini analysis → Google Gemini API: submits content (evidence: `services/geminiService.ts`)
- App controller → Translation service: requests translations (evidence: `App.tsx`)
- Translation service → Lingo.dev API: translates text (evidence: `services/lingoService.ts`)
- App controller → Language selector: renders (evidence: `App.tsx`)
- Language selector → Translation strings: lists supported languages (evidence: `components/LanguageSelector.tsx`)
- App controller → Delivery shield: renders (evidence: `App.tsx`)
- App controller → Threat map: renders (evidence: `App.tsx`)
- App controller → Gov-ID view: renders (evidence: `App.tsx`)
- App controller → Cyber training: renders (evidence: `App.tsx`)
- App controller → Authority reporting: renders (evidence: `App.tsx`)
- Threat map → Google Maps: visualizes threat data (evidence: `README.md`)
- Authority reporting → Al Ameen service: prepares reports for (evidence: `README.md`)
- App controller → Saif logo: renders (evidence: `App.tsx`)
- App controller → App data types: uses view and language types (evidence: `App.tsx`)
- Landing screen → Saif logo: renders (evidence: `components/LandingPage.tsx`)
- Landing screen → App data types: uses translation type (evidence: `components/LandingPage.tsx`)
- Gemini analysis → App data types: uses language type (evidence: `services/geminiService.ts`)
- Translation service → App data types: uses translation types (evidence: `services/lingoService.ts`)
