# oneathetop/implementation architecture

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

- Interactive diagram: https://gitdiagram.com/oneathetop/implementation
- Repository: https://github.com/oneathetop/implementation

## Overview

This repository is a QR-oriented phishing-detection API with a Flutter mobile-app shell. The supported backend workflow accepts a URL at the FastAPI prediction endpoint, applies URL-based risk checks, and returns a prediction with explanations and advice. The tree also contains a separate ML module and an explainer service, but their wiring is not shown in the sampled source. Flutter platform launchers are present; the Dart application source and any mobile-to-backend connection are absent from the supplied tree.

Main entry points: [`backend/app.py`](https://github.com/oneathetop/implementation/blob/master/backend/app.py) (FastAPI Routes), [`backend/services/predictor.py`](https://github.com/oneathetop/implementation/blob/master/backend/services/predictor.py) (URL Risk Predictor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Backend API"]
  node_api_app["FastAPI Routes<br/>[app.py]"]
end

subgraph group_analysis["Risk Analysis"]
  node_predictor["URL Risk Predictor<br/>[predictor.py]"]
  node_explainer["Explainer Service<br/>[explainer.py]"]
end

subgraph group_mobile["Mobile Shell"]
  node_mobile_ios["iOS Launcher<br/>[AppDelegate.swift]"]
  node_mobile_macos["macOS Window"]
  node_mobile_windows["Windows Launcher<br/>[main.cpp]"]
  node_mobile_linux["Linux Launcher<br/>[main.cc]"]
end

subgraph group_ml["ML Components"]
  node_ml_preprocess["Preprocessing<br/>[preprocess.py]"]
  node_ml_features["Feature Extraction"]
  node_ml_train["Model Training<br/>[train.py]"]
  node_ml_predict["ML Prediction<br/>[predict.py]"]
  node_ml_evaluate["Model Evaluation<br/>[evaluate.py]"]
  node_ml_config["ML Configuration<br/>[config.py]"]
end

node_user(("URL Submitter"))
node_result["Risk Result"]

node_user -->|"submits URL"| node_api_app
node_api_app -->|"calls prediction"| node_predictor
node_predictor -->|"returns assessment"| node_api_app
node_api_app -->|"returns response"| node_result

click node_api_app "https://github.com/oneathetop/implementation/blob/master/backend/app.py"
click node_predictor "https://github.com/oneathetop/implementation/blob/master/backend/services/predictor.py"
click node_explainer "https://github.com/oneathetop/implementation/blob/master/backend/services/explainer.py"
click node_ml_preprocess "https://github.com/oneathetop/implementation/blob/master/backend/ML/preprocess.py"
click node_ml_features "https://github.com/oneathetop/implementation/blob/master/backend/ML/feature_extractor.py"
click node_ml_train "https://github.com/oneathetop/implementation/blob/master/backend/ML/train.py"
click node_ml_predict "https://github.com/oneathetop/implementation/blob/master/backend/ML/predict.py"
click node_ml_evaluate "https://github.com/oneathetop/implementation/blob/master/backend/ML/evaluate.py"
click node_ml_config "https://github.com/oneathetop/implementation/blob/master/backend/ML/config.py"
click node_mobile_ios "https://github.com/oneathetop/implementation/blob/master/mobile_app/ios/Runner/AppDelegate.swift"
click node_mobile_macos "https://github.com/oneathetop/implementation/blob/master/mobile_app/macos/Runner/MainFlutterWindow.swift"
click node_mobile_windows "https://github.com/oneathetop/implementation/blob/master/mobile_app/windows/runner/main.cpp"
click node_mobile_linux "https://github.com/oneathetop/implementation/blob/master/mobile_app/linux/runner/main.cc"

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_api_app toneBlue
class node_predictor,node_explainer toneAmber
class node_mobile_ios,node_mobile_macos,node_mobile_windows,node_mobile_linux toneMint
class node_ml_preprocess,node_ml_features,node_ml_train,node_ml_predict,node_ml_evaluate,node_ml_config toneRose
class node_user,node_result toneIndigo
```

## Components

### Backend API

- [FastAPI Routes](https://github.com/oneathetop/implementation/blob/master/backend/app.py): `backend/app.py`

### Risk Analysis

- [URL Risk Predictor](https://github.com/oneathetop/implementation/blob/master/backend/services/predictor.py): `backend/services/predictor.py`
- [Explainer Service](https://github.com/oneathetop/implementation/blob/master/backend/services/explainer.py): `backend/services/explainer.py`

### Mobile Shell

- [iOS Launcher](https://github.com/oneathetop/implementation/blob/master/mobile_app/ios/Runner/AppDelegate.swift): `mobile_app/ios/Runner/AppDelegate.swift`
- [macOS Window](https://github.com/oneathetop/implementation/blob/master/mobile_app/macos/Runner/MainFlutterWindow.swift): `mobile_app/macos/Runner/MainFlutterWindow.swift`
- [Windows Launcher](https://github.com/oneathetop/implementation/blob/master/mobile_app/windows/runner/main.cpp): `mobile_app/windows/runner/main.cpp`
- [Linux Launcher](https://github.com/oneathetop/implementation/blob/master/mobile_app/linux/runner/main.cc): `mobile_app/linux/runner/main.cc`

### ML Components

- [Preprocessing](https://github.com/oneathetop/implementation/blob/master/backend/ML/preprocess.py): `backend/ML/preprocess.py`
- [Feature Extraction](https://github.com/oneathetop/implementation/blob/master/backend/ML/feature_extractor.py): `backend/ML/feature_extractor.py`
- [Model Training](https://github.com/oneathetop/implementation/blob/master/backend/ML/train.py): `backend/ML/train.py`
- [ML Prediction](https://github.com/oneathetop/implementation/blob/master/backend/ML/predict.py): `backend/ML/predict.py`
- [Model Evaluation](https://github.com/oneathetop/implementation/blob/master/backend/ML/evaluate.py): `backend/ML/evaluate.py`
- [ML Configuration](https://github.com/oneathetop/implementation/blob/master/backend/ML/config.py): `backend/ML/config.py`

### Other components

- **URL Submitter**
- **Risk Result**

## Connections

- URL Submitter → FastAPI Routes: submits URL
- FastAPI Routes → URL Risk Predictor: calls prediction
- URL Risk Predictor → FastAPI Routes: returns assessment
- FastAPI Routes → Risk Result: returns response
