# web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app architecture

> Architecture diagram of the GitHub repository web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app
- Repository: https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app

## Overview

HomeVal is a Vietnam housing price-estimation application with account history, market insights, model administration, and Premium sandbox billing. The main user journey is property entry in the frontend, API submission, model-backed estimation, and a result that can be saved for later comparison or export. The backend also provides authentication and admin workflows. The graph includes documented but unsampled capabilities, while omitting uncertain internal links where excerpts do not establish the caller or data flow.

Main entry points: [`frontend/js/api.js`](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/api.js) (Frontend API), [`backend/routers/homeval.py`](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/backend/routers/homeval.py) (Estimation routes), [`backend/routers/auth.py`](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/backend/routers/auth.py) (Auth routes), [`frontend/js/pages/predict.js`](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/pages/predict.js) (Property form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User experience"]
  node_property_form["Property form<br/>[predict.js]"]
  node_web_api["Frontend API<br/>[api.js]"]
  node_result_view["Estimate result<br/>[predict-result.js]"]
  node_history["Saved predictions<br/>[predictions.js]"]
  node_compare["Compare and export<br/>[compare.js]"]
  node_market["Market insights<br/>[insights.js]"]
  node_charts["Charts<br/>[charts.js]"]
  node_property_data["Property fields<br/>[property.js]"]
end

subgraph group_api["Application API"]
  node_app["FastAPI app<br/>[main.py]"]
end

subgraph group_identity["Identity and access"]
  node_session["Browser session<br/>[auth.js]"]
  node_auth_routes["Auth routes<br/>[auth.py]"]
  node_access["Access checks<br/>[deps.py]"]
  node_credentials["Token and passwords<br/>[security.py]"]
  node_login_limits["Login limits<br/>[rate_limit.py]"]
end

subgraph group_estimation["Estimation and models"]
  node_homeval_routes["Estimation routes<br/>[homeval.py]"]
  node_ml["Training and inference<br/>[ml.py]"]
  node_store[("Application database<br/>[database.py]")]
  node_entities["Domain records<br/>[models.py]"]
end

subgraph group_operations["Admin and insights"]
  node_admin_screens["Admin screens<br/>[admin.js]"]
  node_dataset_admin["Dataset management<br/>[admin-datasets.js]"]
  node_model_admin["Model management<br/>[admin-models.js]"]
  node_premium["Premium upgrade<br/>[premium-upgrade.js]"]
end

node_visitor(("HomeVal user"))

node_visitor -->|"enters details"| node_property_form
node_property_form -->|"uses fields"| node_property_data
node_property_form -->|"submits estimate"| node_web_api
node_web_api -.->|"calls API"| node_app
node_app -->|"registers routes"| node_auth_routes
node_app -->|"registers routes"| node_homeval_routes
node_homeval_routes -->|"runs inference"| node_ml
node_homeval_routes -->|"reads and writes"| node_store
node_homeval_routes -->|"uses records"| node_entities
node_ml -.->|"produces estimate"| node_visitor
node_homeval_routes -.->|"returns result"| node_result_view
node_result_view -.->|"saves history"| node_history
node_history -->|"selects estimates"| node_compare
node_compare -->|"loads predictions"| node_web_api
node_market -->|"loads market data"| node_web_api
node_market -->|"renders charts"| node_charts
node_visitor -->|"signs in"| node_session
node_session -.->|"authenticates"| node_auth_routes
node_auth_routes -->|"checks identity"| node_access
node_auth_routes -->|"hashes and issues tokens"| node_credentials
node_auth_routes -->|"limits login attempts"| node_login_limits
node_admin_screens -.->|"opens datasets"| node_dataset_admin
node_dataset_admin -->|"manages uploads"| node_web_api
node_model_admin -.->|"manages models"| node_web_api
node_web_api -->|"starts training"| node_homeval_routes
node_premium -->|"starts checkout"| node_web_api
node_homeval_routes -.->|"records billing"| node_store

click node_property_form "https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/pages/predict.js"
click node_web_api "https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/api.js"
click node_result_view "https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/pages/predict-result.js"
click node_history "https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/pages/predictions.js"
click node_compare "https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/pages/compare.js"
click node_market "https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/pages/insights.js"
click node_charts "https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/charts.js"
click node_property_data "https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/property.js"
click node_session "https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/auth.js"
click node_app "https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/backend/main.py"
click node_auth_routes "https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/backend/routers/auth.py"
click node_access "https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/backend/deps.py"
click node_credentials "https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/backend/security.py"
click node_login_limits "https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/backend/rate_limit.py"
click node_homeval_routes "https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/backend/routers/homeval.py"
click node_ml "https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/backend/ml.py"
click node_store "https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/backend/database.py"
click node_entities "https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/backend/models.py"
click node_admin_screens "https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/pages/admin.js"
click node_dataset_admin "https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/pages/admin-datasets.js"
click node_model_admin "https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/pages/admin-models.js"
click node_premium "https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/components/premium-upgrade.js"

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_property_form,node_web_api,node_result_view,node_history,node_compare,node_market,node_charts,node_property_data,node_visitor toneBlue
class node_app toneAmber
class node_session,node_auth_routes,node_access,node_credentials,node_login_limits toneMint
class node_homeval_routes,node_ml,node_store,node_entities toneRose
class node_admin_screens,node_dataset_admin,node_model_admin,node_premium toneIndigo
```

## Components

### User experience

- [Property form](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/pages/predict.js): `frontend/js/pages/predict.js`
- [Frontend API](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/api.js): `frontend/js/api.js`
- [Estimate result](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/pages/predict-result.js): `frontend/js/pages/predict-result.js`
- [Saved predictions](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/pages/predictions.js): `frontend/js/pages/predictions.js`
- [Compare and export](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/pages/compare.js): `frontend/js/pages/compare.js`
- [Market insights](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/pages/insights.js): `frontend/js/pages/insights.js`
- [Charts](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/charts.js): `frontend/js/charts.js`
- [Property fields](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/property.js): `frontend/js/property.js`

### Application API

- [FastAPI app](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/backend/main.py): `backend/main.py`

### Identity and access

- [Browser session](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/auth.js): `frontend/js/auth.js`
- [Auth routes](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/backend/routers/auth.py): `backend/routers/auth.py`
- [Access checks](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/backend/deps.py): `backend/deps.py`
- [Token and passwords](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/backend/security.py): `backend/security.py`
- [Login limits](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/backend/rate_limit.py): `backend/rate_limit.py`

### Estimation and models

- [Estimation routes](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/backend/routers/homeval.py): `backend/routers/homeval.py`
- [Training and inference](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/backend/ml.py): `backend/ml.py`
- [Application database](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/backend/database.py): `backend/database.py`
- [Domain records](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/backend/models.py): `backend/models.py`

### Admin and insights

- [Admin screens](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/pages/admin.js): `frontend/js/pages/admin.js`
- [Dataset management](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/pages/admin-datasets.js): `frontend/js/pages/admin-datasets.js`
- [Model management](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/pages/admin-models.js): `frontend/js/pages/admin-models.js`
- [Premium upgrade](https://github.com/web-fda-neu/ai66b-group-5-d3-house-price-prediction-web-app/blob/main/frontend/js/components/premium-upgrade.js): `frontend/js/components/premium-upgrade.js`

### Other components

- **HomeVal user**

## Connections

- HomeVal user → Property form: enters details (evidence: `README.md`)
- Property form → Property fields: uses fields (evidence: `frontend/js/pages/predict.js`)
- Property form → Frontend API: submits estimate (evidence: `frontend/js/pages/predict.js`)
- Frontend API → FastAPI app: calls API
- FastAPI app → Auth routes: registers routes (evidence: `backend/main.py`)
- FastAPI app → Estimation routes: registers routes (evidence: `backend/main.py`)
- Estimation routes → Training and inference: runs inference (evidence: `backend/routers/homeval.py`)
- Estimation routes → Application database: reads and writes (evidence: `backend/routers/homeval.py`)
- Estimation routes → Domain records: uses records (evidence: `backend/routers/homeval.py`)
- Training and inference → HomeVal user: produces estimate
- Estimation routes → Estimate result: returns result
- Estimate result → Saved predictions: saves history
- Saved predictions → Compare and export: selects estimates (evidence: `README.md`)
- Compare and export → Frontend API: loads predictions (evidence: `frontend/js/pages/compare.js`)
- Market insights → Frontend API: loads market data (evidence: `frontend/js/pages/insights.js`)
- Market insights → Charts: renders charts (evidence: `frontend/js/pages/insights.js`)
- HomeVal user → Browser session: signs in (evidence: `README.md`)
- Browser session → Auth routes: authenticates
- Auth routes → Access checks: checks identity (evidence: `backend/routers/auth.py`)
- Auth routes → Token and passwords: hashes and issues tokens (evidence: `backend/routers/auth.py`)
- Auth routes → Login limits: limits login attempts (evidence: `backend/routers/auth.py`)
- Admin screens → Dataset management: opens datasets
- Dataset management → Frontend API: manages uploads (evidence: `frontend/js/pages/admin-datasets.js`)
- Model management → Frontend API: manages models
- Frontend API → Estimation routes: starts training (evidence: `frontend/js/api.js`)
- Premium upgrade → Frontend API: starts checkout (evidence: `frontend/js/components/premium-upgrade.js`)
- Estimation routes → Application database: records billing (evidence: `backend/routers/homeval.py`)
