# ade-nugraha306/smartphone-price-predictions architecture

> Architecture diagram of the GitHub repository ade-nugraha306/smartphone-price-predictions, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ade-nugraha306/smartphone-price-predictions
- Repository: https://github.com/ade-nugraha306/smartphone-price-predictions

## Overview

Smartphone Price Predict is a Flutter client backed by a FastAPI service and a Random Forest classifier. Its main workflow is: the user enters phone specifications, the client sends them as JSON, the backend predicts a price category and estimated range, and the client displays the result. The tree also shows About and license screens. Backend implementation details beyond the documented model workflow were not sampled, so those internal relationships are limited to what the README states.

Main entry points: [`frontend/lib/screens/predict_screen.dart`](https://github.com/ade-nugraha306/smartphone-price-predictions/blob/main/frontend/lib/screens/predict_screen.dart) (Prediction screen), [`frontend/lib/services/api_services.dart`](https://github.com/ade-nugraha306/smartphone-price-predictions/blob/main/frontend/lib/services/api_services.dart) (API client), [`backend/app.py`](https://github.com/ade-nugraha306/smartphone-price-predictions/blob/main/backend/app.py) (Prediction API), [`frontend/lib/main.dart`](https://github.com/ade-nugraha306/smartphone-price-predictions/blob/main/frontend/lib/main.dart) (Flutter app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Flutter client"]
  node_app["Flutter app<br/>[main.dart]"]
  node_prediction_ui["Prediction screen"]
  node_api_client["API client<br/>[api_services.dart]"]
  node_prediction_model["Prediction result<br/>[prediction.dart]"]
  node_about_screens["About and license"]
end

subgraph group_service["Prediction service"]
  node_api["Prediction API<br/>[app.py]"]
end

subgraph group_model["Classifier"]
  node_classifier["Random Forest<br/>[rf_price_model.pkl]"]
end

node_user(("App user"))

node_user -->|"enters specs"| node_prediction_ui
node_app -->|"provides UI"| node_prediction_ui
node_app -.->|"offers information"| node_about_screens
node_prediction_ui -->|"submits specs"| node_api_client
node_api_client -->|"sends JSON"| node_api
node_api -->|"predicts category"| node_classifier
node_api -->|"returns category and range"| node_api_client
node_api_client -.->|"provides result"| node_prediction_model
node_prediction_ui -->|"displays result"| node_user

click node_app "https://github.com/ade-nugraha306/smartphone-price-predictions/blob/main/frontend/lib/main.dart"
click node_prediction_ui "https://github.com/ade-nugraha306/smartphone-price-predictions/blob/main/frontend/lib/screens/predict_screen.dart"
click node_api_client "https://github.com/ade-nugraha306/smartphone-price-predictions/blob/main/frontend/lib/services/api_services.dart"
click node_prediction_model "https://github.com/ade-nugraha306/smartphone-price-predictions/blob/main/frontend/lib/models/prediction.dart"
click node_about_screens "https://github.com/ade-nugraha306/smartphone-price-predictions/tree/main/frontend/lib/screens/about"
click node_api "https://github.com/ade-nugraha306/smartphone-price-predictions/blob/main/backend/app.py"
click node_classifier "https://github.com/ade-nugraha306/smartphone-price-predictions/blob/main/backend/data/rf_price_model.pkl"

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_app,node_prediction_ui,node_api_client,node_prediction_model,node_about_screens,node_user toneBlue
class node_api toneAmber
class node_classifier toneMint
```

## Components

### Flutter client

- [Flutter app](https://github.com/ade-nugraha306/smartphone-price-predictions/blob/main/frontend/lib/main.dart): `frontend/lib/main.dart`
- [Prediction screen](https://github.com/ade-nugraha306/smartphone-price-predictions/blob/main/frontend/lib/screens/predict_screen.dart): `frontend/lib/screens/predict_screen.dart`
- [API client](https://github.com/ade-nugraha306/smartphone-price-predictions/blob/main/frontend/lib/services/api_services.dart): `frontend/lib/services/api_services.dart`
- [Prediction result](https://github.com/ade-nugraha306/smartphone-price-predictions/blob/main/frontend/lib/models/prediction.dart): `frontend/lib/models/prediction.dart`
- [About and license](https://github.com/ade-nugraha306/smartphone-price-predictions/tree/main/frontend/lib/screens/about): `frontend/lib/screens/about`

### Prediction service

- [Prediction API](https://github.com/ade-nugraha306/smartphone-price-predictions/blob/main/backend/app.py): `backend/app.py`

### Classifier

- [Random Forest](https://github.com/ade-nugraha306/smartphone-price-predictions/blob/main/backend/data/rf_price_model.pkl): `backend/data/rf_price_model.pkl`

### Other components

- **App user**

## Connections

- App user → Prediction screen: enters specs (evidence: `README.md`)
- Flutter app → Prediction screen: provides UI (evidence: `README.md`)
- Flutter app → About and license: offers information
- Prediction screen → API client: submits specs (evidence: `README.md`)
- API client → Prediction API: sends JSON (evidence: `README.md`)
- Prediction API → Random Forest: predicts category (evidence: `README.md`)
- Prediction API → API client: returns category and range (evidence: `README.md`)
- API client → Prediction result: provides result
- Prediction screen → App user: displays result (evidence: `README.md`)
