# manish-12ys/fake-account-detector architecture

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

- Interactive diagram: https://gitdiagram.com/manish-12ys/fake-account-detector
- Repository: https://github.com/manish-12ys/fake-account-detector

## Overview

Fake Account Detector is a Flask dashboard for screening Instagram accounts. Users enter account metadata or optionally fetch a public profile, submit it for feature extraction and model prediction, then receive a verdict, risk score, and reasoning. A separate documented training workflow builds the RandomForest model from the dataset and saves the artifact and evaluation metrics. The fetch implementation and API are sampled; other capabilities are represented from the README, with uncertain internal links omitted.

Main entry points: [`app.py`](https://github.com/manish-12ys/fake-account-detector/blob/main/app.py) (Flask API), [`model.py`](https://github.com/manish-12ys/fake-account-detector/blob/main/model.py) (Training pipeline), [`utils/instagram_fetch.py`](https://github.com/manish-12ys/fake-account-detector/blob/main/utils/instagram_fetch.py) (Profile fetch), [`templates/index.html`](https://github.com/manish-12ys/fake-account-detector/blob/main/templates/index.html) (Dashboard UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_dashboard["Dashboard UI<br/>[index.html]"]
  node_browser["Frontend behavior<br/>[app.js]"]
  node_flask["Flask API<br/>[app.py]"]
end

subgraph group_analysis["Account analysis"]
  node_profile_fetch["Profile fetch<br/>[instagram_fetch.py]"]
  node_feature_engineering["Feature engineering<br/>[features.py]"]
  node_classifier["Classifier inference<br/>[app.py]"]
  node_model_artifact["Trained model<br/>[account_model.pkl]"]
  node_verdict["Risk verdict<br/>[verdict.py]"]
end

subgraph group_training["Model training"]
  node_training_pipeline["Training pipeline<br/>[model.py]"]
  node_training_data[("Training dataset")]
  node_metrics["Evaluation metrics<br/>[metrics.json]"]
end

node_user(("Account reviewer"))
node_instagram["Instagram"]

node_user -->|"uses"| node_dashboard
node_browser -->|"submits requests"| node_flask
node_flask -->|"renders page"| node_dashboard
node_flask -->|"fetches profile"| node_profile_fetch
node_profile_fetch -.->|"loads profile"| node_instagram
node_flask -->|"extracts features"| node_feature_engineering
node_flask -->|"predicts account"| node_classifier
node_classifier -->|"loads model"| node_model_artifact
node_flask -->|"computes verdict"| node_verdict
node_training_pipeline -->|"reads data"| node_training_data
node_training_pipeline -->|"saves model"| node_model_artifact
node_training_pipeline -->|"saves metrics"| node_metrics

click node_dashboard "https://github.com/manish-12ys/fake-account-detector/blob/main/templates/index.html"
click node_browser "https://github.com/manish-12ys/fake-account-detector/blob/main/static/app.js"
click node_flask "https://github.com/manish-12ys/fake-account-detector/blob/main/app.py"
click node_profile_fetch "https://github.com/manish-12ys/fake-account-detector/blob/main/utils/instagram_fetch.py"
click node_feature_engineering "https://github.com/manish-12ys/fake-account-detector/blob/main/utils/features.py"
click node_classifier "https://github.com/manish-12ys/fake-account-detector/blob/main/app.py"
click node_model_artifact "https://github.com/manish-12ys/fake-account-detector/blob/main/model/account_model.pkl"
click node_verdict "https://github.com/manish-12ys/fake-account-detector/blob/main/utils/verdict.py"
click node_training_pipeline "https://github.com/manish-12ys/fake-account-detector/blob/main/model.py"
click node_training_data "https://github.com/manish-12ys/fake-account-detector/blob/main/data/instagram_dataset.csv"
click node_metrics "https://github.com/manish-12ys/fake-account-detector/blob/main/model/metrics.json"

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_dashboard,node_browser,node_flask,node_user toneBlue
class node_profile_fetch,node_feature_engineering,node_classifier,node_model_artifact,node_verdict toneAmber
class node_training_pipeline,node_training_data,node_metrics toneMint
class node_instagram toneIndigo
```

## Components

### Web application

- [Dashboard UI](https://github.com/manish-12ys/fake-account-detector/blob/main/templates/index.html): `templates/index.html`
- [Frontend behavior](https://github.com/manish-12ys/fake-account-detector/blob/main/static/app.js): `static/app.js`
- [Flask API](https://github.com/manish-12ys/fake-account-detector/blob/main/app.py): `app.py`

### Account analysis

- [Profile fetch](https://github.com/manish-12ys/fake-account-detector/blob/main/utils/instagram_fetch.py): `utils/instagram_fetch.py`
- [Feature engineering](https://github.com/manish-12ys/fake-account-detector/blob/main/utils/features.py): `utils/features.py`
- [Classifier inference](https://github.com/manish-12ys/fake-account-detector/blob/main/app.py): `app.py`
- [Trained model](https://github.com/manish-12ys/fake-account-detector/blob/main/model/account_model.pkl): `model/account_model.pkl`
- [Risk verdict](https://github.com/manish-12ys/fake-account-detector/blob/main/utils/verdict.py): `utils/verdict.py`

### Model training

- [Training pipeline](https://github.com/manish-12ys/fake-account-detector/blob/main/model.py): `model.py`
- [Training dataset](https://github.com/manish-12ys/fake-account-detector/blob/main/data/instagram_dataset.csv): `data/instagram_dataset.csv`
- [Evaluation metrics](https://github.com/manish-12ys/fake-account-detector/blob/main/model/metrics.json): `model/metrics.json`

### Other components

- **Account reviewer**
- **Instagram**

## Connections

- Account reviewer → Dashboard UI: uses
- Frontend behavior → Flask API: submits requests
- Flask API → Dashboard UI: renders page
- Flask API → Profile fetch: fetches profile
- Profile fetch → Instagram: loads profile
- Flask API → Feature engineering: extracts features
- Flask API → Classifier inference: predicts account
- Classifier inference → Trained model: loads model
- Flask API → Risk verdict: computes verdict
- Training pipeline → Training dataset: reads data
- Training pipeline → Trained model: saves model
- Training pipeline → Evaluation metrics: saves metrics
