# jeevilucky143143-create/imgx-ai architecture

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

- Interactive diagram: https://gitdiagram.com/jeevilucky143143-create/imgx-ai
- Repository: https://github.com/jeevilucky143143-create/imgx-ai

## Overview

IMGX.AI is a web platform for authenticated, hierarchical image classification. A user registers or signs in, submits an image, receives a prediction with confidence and alternatives, and can inspect or clear saved classification history. The README documents the ResNet-50, taxonomy, co-occurrence, and uncertainty capabilities; source excerpts show the API, persistence setup, and frontend session/API behavior, but do not expose the full classifier implementation or all page-to-service calls.

Main entry points: [`backend/main.py`](https://github.com/jeevilucky143143-create/imgx-ai/blob/main/backend/main.py) (FastAPI routes), [`src/services/api.js`](https://github.com/jeevilucky143143-create/imgx-ai/blob/main/src/services/api.js) (API client), [`src/App.jsx`](https://github.com/jeevilucky143143-create/imgx-ai/blob/main/src/App.jsx) (App and routes), [`src/context/AuthContext.jsx`](https://github.com/jeevilucky143143-create/imgx-ai/blob/main/src/context/AuthContext.jsx) (Session state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_frontend["App and routes<br/>[App.jsx]"]
  node_authui["Session state<br/>[AuthContext.jsx]"]
  node_classifyui["Image submission<br/>[ClassifyPage.jsx]"]
  node_resultui["Prediction details<br/>[ResultPage.jsx]"]
  node_historyui["History explorer<br/>[HistoryPage.jsx]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["API and identity"]
  node_server["FastAPI routes<br/>[main.py]"]
  node_auth["JWT and passwords<br/>[auth.py]"]
  node_dependencies["Request dependencies<br/>[dependencies.py]"]
  node_schemas["API schemas<br/>[schemas.py]"]
end

subgraph group_vision["Vision classification"]
  node_classifier["Image classifier<br/>[classifier.py]"]
  node_taxonomy["Hierarchical taxonomy<br/>[taxonomy.py]"]
  node_analyzers["Domain analyzers"]
  node_human["Human detection<br/>[human_detector.py]"]
end

subgraph group_persistence["Persistence"]
  node_database[("ORM and database<br/>[database.py]")]
  node_models["User and history records<br/>[models.py]"]
end

subgraph group_integrations["External services"]
  node_storage[("Supabase image storage")]
end

node_user(("User"))

node_user -->|"uses"| node_frontend
node_frontend -->|"provides session"| node_authui
node_authui -->|"auth requests"| node_api_client
node_classifyui -->|"submits image"| node_api_client
node_api_client -->|"REST requests"| node_server
node_server -->|"hashes and signs"| node_auth
node_server -->|"resolves access"| node_dependencies
node_server -->|"validates payloads"| node_schemas
node_server -->|"runs inference"| node_classifier
node_classifier -->|"classifies hierarchy"| node_taxonomy
node_server -->|"opens sessions"| node_database
node_database -->|"maps records"| node_models
node_server -->|"persists history"| node_models
node_server -.->|"uploads image"| node_storage
node_resultui -->|"loads image URL"| node_api_client
node_historyui -->|"reads and clears"| node_api_client
node_server -.->|"analyzes domains"| node_analyzers
node_server -.->|"checks humans"| node_human

click node_frontend "https://github.com/jeevilucky143143-create/imgx-ai/blob/main/src/App.jsx"
click node_authui "https://github.com/jeevilucky143143-create/imgx-ai/blob/main/src/context/AuthContext.jsx"
click node_classifyui "https://github.com/jeevilucky143143-create/imgx-ai/blob/main/src/pages/ClassifyPage.jsx"
click node_resultui "https://github.com/jeevilucky143143-create/imgx-ai/blob/main/src/pages/ResultPage.jsx"
click node_historyui "https://github.com/jeevilucky143143-create/imgx-ai/blob/main/src/pages/HistoryPage.jsx"
click node_api_client "https://github.com/jeevilucky143143-create/imgx-ai/blob/main/src/services/api.js"
click node_server "https://github.com/jeevilucky143143-create/imgx-ai/blob/main/backend/main.py"
click node_auth "https://github.com/jeevilucky143143-create/imgx-ai/blob/main/backend/auth.py"
click node_dependencies "https://github.com/jeevilucky143143-create/imgx-ai/blob/main/backend/dependencies.py"
click node_schemas "https://github.com/jeevilucky143143-create/imgx-ai/blob/main/backend/schemas.py"
click node_classifier "https://github.com/jeevilucky143143-create/imgx-ai/blob/main/backend/classifier.py"
click node_taxonomy "https://github.com/jeevilucky143143-create/imgx-ai/blob/main/backend/taxonomy.py"
click node_analyzers "https://github.com/jeevilucky143143-create/imgx-ai/blob/main/backend/domain_analyzers.py"
click node_human "https://github.com/jeevilucky143143-create/imgx-ai/blob/main/backend/human_detector.py"
click node_database "https://github.com/jeevilucky143143-create/imgx-ai/blob/main/backend/database.py"
click node_models "https://github.com/jeevilucky143143-create/imgx-ai/blob/main/backend/models.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_frontend,node_authui,node_classifyui,node_resultui,node_historyui,node_api_client,node_user toneBlue
class node_server,node_auth,node_dependencies,node_schemas toneAmber
class node_classifier,node_taxonomy,node_analyzers,node_human toneMint
class node_database,node_models toneRose
class node_storage toneIndigo
```

## Components

### Web application

- [App and routes](https://github.com/jeevilucky143143-create/imgx-ai/blob/main/src/App.jsx): `src/App.jsx`
- [Session state](https://github.com/jeevilucky143143-create/imgx-ai/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Image submission](https://github.com/jeevilucky143143-create/imgx-ai/blob/main/src/pages/ClassifyPage.jsx): `src/pages/ClassifyPage.jsx`
- [Prediction details](https://github.com/jeevilucky143143-create/imgx-ai/blob/main/src/pages/ResultPage.jsx): `src/pages/ResultPage.jsx`
- [History explorer](https://github.com/jeevilucky143143-create/imgx-ai/blob/main/src/pages/HistoryPage.jsx): `src/pages/HistoryPage.jsx`
- [API client](https://github.com/jeevilucky143143-create/imgx-ai/blob/main/src/services/api.js): `src/services/api.js`

### API and identity

- [FastAPI routes](https://github.com/jeevilucky143143-create/imgx-ai/blob/main/backend/main.py): `backend/main.py`
- [JWT and passwords](https://github.com/jeevilucky143143-create/imgx-ai/blob/main/backend/auth.py): `backend/auth.py`
- [Request dependencies](https://github.com/jeevilucky143143-create/imgx-ai/blob/main/backend/dependencies.py): `backend/dependencies.py`
- [API schemas](https://github.com/jeevilucky143143-create/imgx-ai/blob/main/backend/schemas.py): `backend/schemas.py`

### Vision classification

- [Image classifier](https://github.com/jeevilucky143143-create/imgx-ai/blob/main/backend/classifier.py): `backend/classifier.py`
- [Hierarchical taxonomy](https://github.com/jeevilucky143143-create/imgx-ai/blob/main/backend/taxonomy.py): `backend/taxonomy.py`
- [Domain analyzers](https://github.com/jeevilucky143143-create/imgx-ai/blob/main/backend/domain_analyzers.py): `backend/domain_analyzers.py`
- [Human detection](https://github.com/jeevilucky143143-create/imgx-ai/blob/main/backend/human_detector.py): `backend/human_detector.py`

### Persistence

- [ORM and database](https://github.com/jeevilucky143143-create/imgx-ai/blob/main/backend/database.py): `backend/database.py`
- [User and history records](https://github.com/jeevilucky143143-create/imgx-ai/blob/main/backend/models.py): `backend/models.py`

### External services

- **Supabase image storage**

### Other components

- **User**

## Connections

- User → App and routes: uses
- App and routes → Session state: provides session
- Session state → API client: auth requests
- Image submission → API client: submits image
- API client → FastAPI routes: REST requests
- FastAPI routes → JWT and passwords: hashes and signs
- FastAPI routes → Request dependencies: resolves access
- FastAPI routes → API schemas: validates payloads
- FastAPI routes → Image classifier: runs inference
- Image classifier → Hierarchical taxonomy: classifies hierarchy
- FastAPI routes → ORM and database: opens sessions
- ORM and database → User and history records: maps records
- FastAPI routes → User and history records: persists history
- FastAPI routes → Supabase image storage: uploads image
- Prediction details → API client: loads image URL
- History explorer → API client: reads and clears
- FastAPI routes → Domain analyzers: analyzes domains
- FastAPI routes → Human detection: checks humans
