# yadhiragvdev/billetes-project architecture

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

- Interactive diagram: https://gitdiagram.com/yadhiragvdev/billetes-project
- Repository: https://github.com/yadhiragvdev/billetes-project

## Overview

This Django application lets users submit banknote images and view denomination and condition results. The principal workflow is browser upload or camera capture, request handling, quality analysis and model-based denomination prediction, then saving a detection record for the result and later history or statistics. Separate branches cover account/profile management and informational pages. The README documents image processing, results, and SQLite; the excerpts show the request, analysis, prediction, and persistence calls. Other page wiring is represented only where routes or documentation support it.

Main entry points: [`detector/views.py`](https://github.com/yadhiragvdev/billetes-project/blob/main/detector/views.py) (Request handling), [`detector/models.py`](https://github.com/yadhiragvdev/billetes-project/blob/main/detector/models.py) (Detection records), [`detector/urls.py`](https://github.com/yadhiragvdev/billetes-project/blob/main/detector/urls.py) (App routes), [`detector/forms.py`](https://github.com/yadhiragvdev/billetes-project/blob/main/detector/forms.py) (Account forms)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_routes["App routes<br/>[urls.py]"]
  node_upload_ui["Image preview<br/>[preview.js]"]
  node_request["Request handling<br/>[views.py]"]
end

subgraph group_analysis["Banknote analysis"]
  node_quality["Quality analysis<br/>[calidad.py]"]
  node_denomination["Denomination prediction<br/>[predictor.py]"]
end

subgraph group_records["Records and insights"]
  node_detection["Detection records<br/>[models.py]"]
  node_database[("Application database")]
  node_results["Results and details<br/>[views.py]"]
  node_history_stats["History and statistics<br/>[views.py]"]
end

subgraph group_accounts["Accounts"]
  node_account_views["Account and profile flows<br/>[views.py]"]
  node_account_forms["Account forms<br/>[forms.py]"]
  node_profile["User profile<br/>[models.py]"]
end

node_user(("User"))

node_user -->|"uses web app"| node_routes
node_routes -->|"routes requests"| node_request
node_upload_ui -->|"posts image"| node_routes
node_request -->|"analyzes quality"| node_quality
node_request -->|"predicts denomination"| node_denomination
node_request -->|"creates record"| node_detection
node_detection -.->|"persists data"| node_database
node_request -.->|"renders result"| node_results
node_results -.->|"reads record"| node_detection
node_request -->|"queries records"| node_history_stats
node_history_stats -->|"reads records"| node_detection
node_request -.->|"handles accounts"| node_account_views
node_account_views -->|"uses forms"| node_account_forms
node_account_forms -->|"validates profile"| node_profile
node_account_views -.->|"creates profile"| node_profile
node_request -->|"saves confirmation"| node_detection

click node_routes "https://github.com/yadhiragvdev/billetes-project/blob/main/detector/urls.py"
click node_upload_ui "https://github.com/yadhiragvdev/billetes-project/blob/main/detector/static/detector/js/preview.js"
click node_request "https://github.com/yadhiragvdev/billetes-project/blob/main/detector/views.py"
click node_quality "https://github.com/yadhiragvdev/billetes-project/blob/main/detector/services/calidad.py"
click node_denomination "https://github.com/yadhiragvdev/billetes-project/blob/main/detector/predictor.py"
click node_detection "https://github.com/yadhiragvdev/billetes-project/blob/main/detector/models.py"
click node_results "https://github.com/yadhiragvdev/billetes-project/blob/main/detector/views.py"
click node_history_stats "https://github.com/yadhiragvdev/billetes-project/blob/main/detector/views.py"
click node_account_views "https://github.com/yadhiragvdev/billetes-project/blob/main/detector/views.py"
click node_account_forms "https://github.com/yadhiragvdev/billetes-project/blob/main/detector/forms.py"
click node_profile "https://github.com/yadhiragvdev/billetes-project/blob/main/detector/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_routes,node_upload_ui,node_request,node_user toneBlue
class node_quality,node_denomination toneAmber
class node_detection,node_database,node_results,node_history_stats toneMint
class node_account_views,node_account_forms,node_profile toneRose
```

## Components

### Web experience

- [App routes](https://github.com/yadhiragvdev/billetes-project/blob/main/detector/urls.py): `detector/urls.py`
- [Image preview](https://github.com/yadhiragvdev/billetes-project/blob/main/detector/static/detector/js/preview.js): `detector/static/detector/js/preview.js`
- [Request handling](https://github.com/yadhiragvdev/billetes-project/blob/main/detector/views.py): `detector/views.py`

### Banknote analysis

- [Quality analysis](https://github.com/yadhiragvdev/billetes-project/blob/main/detector/services/calidad.py): `detector/services/calidad.py`
- [Denomination prediction](https://github.com/yadhiragvdev/billetes-project/blob/main/detector/predictor.py): `detector/predictor.py`

### Records and insights

- [Detection records](https://github.com/yadhiragvdev/billetes-project/blob/main/detector/models.py): `detector/models.py`
- **Application database**
- [Results and details](https://github.com/yadhiragvdev/billetes-project/blob/main/detector/views.py): `detector/views.py`
- [History and statistics](https://github.com/yadhiragvdev/billetes-project/blob/main/detector/views.py): `detector/views.py`

### Accounts

- [Account and profile flows](https://github.com/yadhiragvdev/billetes-project/blob/main/detector/views.py): `detector/views.py`
- [Account forms](https://github.com/yadhiragvdev/billetes-project/blob/main/detector/forms.py): `detector/forms.py`
- [User profile](https://github.com/yadhiragvdev/billetes-project/blob/main/detector/models.py): `detector/models.py`

### Other components

- **User**

## Connections

- User → App routes: uses web app (evidence: `README.md`)
- App routes → Request handling: routes requests (evidence: `detector/urls.py`)
- Image preview → App routes: posts image (evidence: `detector/static/detector/js/preview.js`)
- Request handling → Quality analysis: analyzes quality (evidence: `detector/views.py`)
- Request handling → Denomination prediction: predicts denomination (evidence: `detector/views.py`)
- Request handling → Detection records: creates record (evidence: `detector/views.py`)
- Detection records → Application database: persists data
- Request handling → Results and details: renders result (evidence: `detector/views.py`)
- Results and details → Detection records: reads record (evidence: `detector/views.py`)
- Request handling → History and statistics: queries records (evidence: `detector/views.py`)
- History and statistics → Detection records: reads records (evidence: `detector/views.py`)
- Request handling → Account and profile flows: handles accounts (evidence: `detector/views.py`)
- Account and profile flows → Account forms: uses forms (evidence: `detector/views.py`)
- Account forms → User profile: validates profile (evidence: `detector/forms.py`)
- Account and profile flows → User profile: creates profile (evidence: `detector/views.py`)
- Request handling → Detection records: saves confirmation (evidence: `detector/views.py`)
