# jron068/perfect_match architecture

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

- Interactive diagram: https://gitdiagram.com/jron068/perfect_match
- Repository: https://github.com/jron068/perfect_match

## Overview

Perfect Match is a Flask makeup-color suggestion and photo try-on application. A visitor uses the web interface to submit a photo and view suggested shades; signed-in users can unlock more choices, retrieve catalog shades, and manage account and analysis history. The backend contains the image/palette logic and serves API routes, with persistent account and analysis data. The README documents the product workflow and optional catalog integration; sampled backend excerpts show skin sampling, shade matching, and database access, but not the photo-upload route or frontend request wiring.

Main entry points: [`app.py`](https://github.com/jron068/perfect_match/blob/main/app.py) (Flask routes), [`perfect_match.db`](https://github.com/jron068/perfect_match/blob/main/perfect_match.db) (Application data), [`frontend/try-it.html`](https://github.com/jron068/perfect_match/blob/main/frontend/try-it.html) (Try-on page), [`frontend/login.html`](https://github.com/jron068/perfect_match/blob/main/frontend/login.html) (Login and registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Web interface"]
  node_web_pages["Web pages<br/>[index.html]"]
  node_web_client["Browser client<br/>[app.js]"]
  node_try_on["Try-on page<br/>[try-it.html]"]
  node_results["Results page<br/>[results.html]"]
  node_auth_pages["Login and registration<br/>[login.html]"]
  node_profile_page["Profile page<br/>[profile.html]"]
  node_history_page["History page<br/>[history.html]"]
end

subgraph group_makeup["Makeup guidance"]
  node_flask_app["Flask routes<br/>[app.py]"]
  node_image_analysis["Photo skin analysis<br/>[app.py]"]
  node_palette_builder["Palette suggestions<br/>[app.py]"]
  node_shade_matching["Catalog shade matching<br/>[app.py]"]
end

subgraph group_accounts["Accounts and history"]
  node_account_routes["Account management<br/>[app.py]"]
  node_analysis_history["Analysis history<br/>[app.py]"]
end

subgraph group_persistence["Persistence"]
  node_database[("Application data<br/>[perfect_match.db]")]
  node_schema["SQL schema<br/>[perfect_match.sql]"]
end

node_visitor(("Visitor"))
node_makeup_api["Makeup API"]

node_visitor -->|"opens"| node_web_pages
node_visitor -->|"chooses face shape"| node_try_on
node_web_client -.->|"requests routes"| node_flask_app
node_try_on -.->|"submits photo"| node_image_analysis
node_image_analysis -.->|"informs suggestions"| node_palette_builder
node_palette_builder -.->|"returns suggestions"| node_results
node_flask_app -.->|"analyzes image"| node_image_analysis
node_flask_app -->|"builds palette"| node_palette_builder
node_flask_app -->|"matches catalog colors"| node_shade_matching
node_flask_app -->|"fetches products"| node_makeup_api
node_visitor -->|"signs in"| node_auth_pages
node_auth_pages -.->|"uses account routes"| node_account_routes
node_visitor -.->|"manages account"| node_profile_page
node_profile_page -.->|"updates account"| node_account_routes
node_visitor -.->|"views analyses"| node_history_page
node_history_page -.->|"requests history"| node_analysis_history
node_flask_app -->|"handles account requests"| node_account_routes
node_flask_app -->|"serves history routes"| node_analysis_history
node_account_routes -->|"reads and writes"| node_database
node_analysis_history -->|"reads and deletes"| node_database
node_schema -->|"defines tables"| node_database

click node_web_pages "https://github.com/jron068/perfect_match/blob/main/frontend/index.html"
click node_web_client "https://github.com/jron068/perfect_match/blob/main/frontend/assets/js/app.js"
click node_try_on "https://github.com/jron068/perfect_match/blob/main/frontend/try-it.html"
click node_results "https://github.com/jron068/perfect_match/blob/main/frontend/results.html"
click node_auth_pages "https://github.com/jron068/perfect_match/blob/main/frontend/login.html"
click node_profile_page "https://github.com/jron068/perfect_match/blob/main/frontend/profile.html"
click node_history_page "https://github.com/jron068/perfect_match/blob/main/frontend/history.html"
click node_flask_app "https://github.com/jron068/perfect_match/blob/main/app.py"
click node_image_analysis "https://github.com/jron068/perfect_match/blob/main/app.py"
click node_palette_builder "https://github.com/jron068/perfect_match/blob/main/app.py"
click node_shade_matching "https://github.com/jron068/perfect_match/blob/main/app.py"
click node_account_routes "https://github.com/jron068/perfect_match/blob/main/app.py"
click node_analysis_history "https://github.com/jron068/perfect_match/blob/main/app.py"
click node_database "https://github.com/jron068/perfect_match/blob/main/perfect_match.db"
click node_schema "https://github.com/jron068/perfect_match/blob/main/perfect_match.sql"

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_web_pages,node_web_client,node_try_on,node_results,node_auth_pages,node_profile_page,node_history_page toneBlue
class node_flask_app,node_image_analysis,node_palette_builder,node_shade_matching toneAmber
class node_account_routes,node_analysis_history,node_makeup_api toneMint
class node_database,node_schema toneRose
class node_visitor toneIndigo
```

## Components

### Web interface

- [Web pages](https://github.com/jron068/perfect_match/blob/main/frontend/index.html): `frontend/index.html`
- [Browser client](https://github.com/jron068/perfect_match/blob/main/frontend/assets/js/app.js): `frontend/assets/js/app.js`
- [Try-on page](https://github.com/jron068/perfect_match/blob/main/frontend/try-it.html): `frontend/try-it.html`
- [Results page](https://github.com/jron068/perfect_match/blob/main/frontend/results.html): `frontend/results.html`
- [Login and registration](https://github.com/jron068/perfect_match/blob/main/frontend/login.html): `frontend/login.html`
- [Profile page](https://github.com/jron068/perfect_match/blob/main/frontend/profile.html): `frontend/profile.html`
- [History page](https://github.com/jron068/perfect_match/blob/main/frontend/history.html): `frontend/history.html`

### Makeup guidance

- [Flask routes](https://github.com/jron068/perfect_match/blob/main/app.py): `app.py`
- [Photo skin analysis](https://github.com/jron068/perfect_match/blob/main/app.py): `app.py`
- [Palette suggestions](https://github.com/jron068/perfect_match/blob/main/app.py): `app.py`
- [Catalog shade matching](https://github.com/jron068/perfect_match/blob/main/app.py): `app.py`

### Accounts and history

- [Account management](https://github.com/jron068/perfect_match/blob/main/app.py): `app.py`
- [Analysis history](https://github.com/jron068/perfect_match/blob/main/app.py): `app.py`

### Persistence

- [Application data](https://github.com/jron068/perfect_match/blob/main/perfect_match.db): `perfect_match.db`
- [SQL schema](https://github.com/jron068/perfect_match/blob/main/perfect_match.sql): `perfect_match.sql`

### Other components

- **Visitor**
- **Makeup API**

## Connections

- Visitor → Web pages: opens (evidence: `README.md`)
- Visitor → Try-on page: chooses face shape (evidence: `README.md`)
- Browser client → Flask routes: requests routes
- Try-on page → Photo skin analysis: submits photo
- Photo skin analysis → Palette suggestions: informs suggestions (evidence: `app.py`)
- Palette suggestions → Results page: returns suggestions
- Flask routes → Photo skin analysis: analyzes image (evidence: `app.py`)
- Flask routes → Palette suggestions: builds palette (evidence: `app.py`)
- Flask routes → Catalog shade matching: matches catalog colors (evidence: `app.py`)
- Flask routes → Makeup API: fetches products (evidence: `README.md`)
- Visitor → Login and registration: signs in (evidence: `README.md`)
- Login and registration → Account management: uses account routes
- Visitor → Profile page: manages account
- Profile page → Account management: updates account
- Visitor → History page: views analyses
- History page → Analysis history: requests history
- Flask routes → Account management: handles account requests (evidence: `app.py`)
- Flask routes → Analysis history: serves history routes (evidence: `app.py`)
- Account management → Application data: reads and writes (evidence: `app.py`)
- Analysis history → Application data: reads and deletes (evidence: `app.py`)
- SQL schema → Application data: defines tables (evidence: `README.md`)
