# kumargosala24/smartrentalsystem architecture

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

- Interactive diagram: https://gitdiagram.com/kumargosala24/smartrentalsystem
- Repository: https://github.com/kumargosala24/smartrentalsystem

## Overview

Smart Rental Tracking System is a fleet-rental application: staff monitor equipment, manage rentals and simulated check-in/out, review alerts, forecast demand, and act on reallocation suggestions. The React shell presents these workflows through an API client to a FastAPI service; SQLite persists seeded operational data, while a background simulator updates telemetry and ML modules support anomaly detection, utilization scoring, forecasting, and recommendations. The graph retains the README’s major feature branches. Some backend endpoints and frontend views were not sampled, so their connections are shown only where documented or indexed.

Main entry points: [`frontend/src/App.jsx`](https://github.com/kumargosala24/smartrentalsystem/blob/main/frontend/src/App.jsx) (App Shell), [`frontend/src/api.js`](https://github.com/kumargosala24/smartrentalsystem/blob/main/frontend/src/api.js) (API Client), [`backend/app/main.py`](https://github.com/kumargosala24/smartrentalsystem/blob/main/backend/app/main.py) (REST API), [`backend/app/database.py`](https://github.com/kumargosala24/smartrentalsystem/blob/main/backend/app/database.py) (SQLite Store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Rental Dashboard"]
  node_app["App Shell<br/>[App.jsx]"]
  node_checkin["Check-In / Out<br/>[CheckInOut.jsx]"]
  node_fleet["Fleet View<br/>[Fleet.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_rentals["Rentals View<br/>[Rentals.jsx]"]
  node_alertsview["Alerts View<br/>[Alerts.jsx]"]
  node_detail["Equipment Detail"]
  node_forecastview["Forecast View<br/>[Forecast.jsx]"]
  node_recommendview["Recommendations View"]
  node_api["API Client<br/>[api.js]"]
end

subgraph group_backend["API Service"]
  node_service["REST API<br/>[main.py]"]
  node_config["Runtime Config<br/>[config.py]"]
end

subgraph group_operations["Fleet Operations"]
  node_simulator["Telemetry Simulator<br/>[simulator.py]"]
end

subgraph group_analytics["Intelligence"]
  node_anomaly["Anomaly Engine<br/>[anomaly.py]"]
  node_utilization["Utilization Scoring<br/>[utilization.py]"]
  node_forecast["Demand Forecasting<br/>[forecast.py]"]
  node_recommend["Reallocation Engine<br/>[recommend.py]"]
end

subgraph group_persistence["Data Layer"]
  node_database[("SQLite Store<br/>[database.py]")]
  node_seeddata["Seed Data"]
  node_pgschema["Postgres Reference"]
end

node_staff(("Rental Staff"))

node_staff -->|"uses"| node_app
node_app -->|"renders"| node_checkin
node_app -->|"renders"| node_fleet
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_rentals
node_app -->|"renders"| node_alertsview
node_app -->|"renders"| node_detail
node_app -->|"renders"| node_forecastview
node_app -->|"renders"| node_recommendview
node_checkin -->|"requests equipment and rental actions"| node_api
node_fleet -->|"loads equipment"| node_api
node_forecastview -->|"loads forecasts"| node_api
node_rentals -->|"loads rentals"| node_api
node_recommendview -->|"loads suggestions"| node_api
node_dashboard -.->|"loads summary"| node_api
node_alertsview -.->|"loads alerts"| node_api
node_detail -.->|"loads equipment detail"| node_api
node_api -->|"calls REST endpoints"| node_service
node_service -->|"reads and writes"| node_database
node_service -->|"uses detection engine"| node_anomaly
node_service -->|"uses forecasting engine"| node_forecast
node_service -->|"uses scoring rules"| node_utilization
node_service -->|"uses recommendation engine"| node_recommend
node_service -->|"starts simulator"| node_simulator
node_simulator -->|"scores readings"| node_anomaly
node_simulator -->|"updates telemetry state"| node_database
node_database -->|"loads CSV seed data"| node_seeddata
node_database -->|"uses database path"| node_config
node_anomaly -->|"uses thresholds"| node_config
node_database -.->|"schema reference"| node_pgschema

click node_app "https://github.com/kumargosala24/smartrentalsystem/blob/main/frontend/src/App.jsx"
click node_checkin "https://github.com/kumargosala24/smartrentalsystem/blob/main/frontend/src/components/CheckInOut.jsx"
click node_fleet "https://github.com/kumargosala24/smartrentalsystem/blob/main/frontend/src/components/Fleet.jsx"
click node_dashboard "https://github.com/kumargosala24/smartrentalsystem/blob/main/frontend/src/components/Dashboard.jsx"
click node_rentals "https://github.com/kumargosala24/smartrentalsystem/blob/main/frontend/src/components/Rentals.jsx"
click node_alertsview "https://github.com/kumargosala24/smartrentalsystem/blob/main/frontend/src/components/Alerts.jsx"
click node_detail "https://github.com/kumargosala24/smartrentalsystem/blob/main/frontend/src/components/EquipmentDetail.jsx"
click node_forecastview "https://github.com/kumargosala24/smartrentalsystem/blob/main/frontend/src/components/Forecast.jsx"
click node_recommendview "https://github.com/kumargosala24/smartrentalsystem/blob/main/frontend/src/components/Recommendations.jsx"
click node_api "https://github.com/kumargosala24/smartrentalsystem/blob/main/frontend/src/api.js"
click node_service "https://github.com/kumargosala24/smartrentalsystem/blob/main/backend/app/main.py"
click node_config "https://github.com/kumargosala24/smartrentalsystem/blob/main/backend/app/config.py"
click node_simulator "https://github.com/kumargosala24/smartrentalsystem/blob/main/backend/app/simulator.py"
click node_anomaly "https://github.com/kumargosala24/smartrentalsystem/blob/main/backend/app/ml/anomaly.py"
click node_utilization "https://github.com/kumargosala24/smartrentalsystem/blob/main/backend/app/ml/utilization.py"
click node_forecast "https://github.com/kumargosala24/smartrentalsystem/blob/main/backend/app/ml/forecast.py"
click node_recommend "https://github.com/kumargosala24/smartrentalsystem/blob/main/backend/app/ml/recommend.py"
click node_database "https://github.com/kumargosala24/smartrentalsystem/blob/main/backend/app/database.py"
click node_seeddata "https://github.com/kumargosala24/smartrentalsystem/tree/main/backend/data"
click node_pgschema "https://github.com/kumargosala24/smartrentalsystem/blob/main/database/schema_postgres_reference.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_app,node_checkin,node_fleet,node_dashboard,node_rentals,node_alertsview,node_detail,node_forecastview,node_recommendview,node_api toneBlue
class node_service,node_config toneAmber
class node_simulator toneMint
class node_anomaly,node_utilization,node_forecast,node_recommend toneRose
class node_database,node_seeddata,node_pgschema,node_staff toneIndigo
```

## Components

### Rental Dashboard

- [App Shell](https://github.com/kumargosala24/smartrentalsystem/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Check-In / Out](https://github.com/kumargosala24/smartrentalsystem/blob/main/frontend/src/components/CheckInOut.jsx): `frontend/src/components/CheckInOut.jsx`
- [Fleet View](https://github.com/kumargosala24/smartrentalsystem/blob/main/frontend/src/components/Fleet.jsx): `frontend/src/components/Fleet.jsx`
- [Dashboard](https://github.com/kumargosala24/smartrentalsystem/blob/main/frontend/src/components/Dashboard.jsx): `frontend/src/components/Dashboard.jsx`
- [Rentals View](https://github.com/kumargosala24/smartrentalsystem/blob/main/frontend/src/components/Rentals.jsx): `frontend/src/components/Rentals.jsx`
- [Alerts View](https://github.com/kumargosala24/smartrentalsystem/blob/main/frontend/src/components/Alerts.jsx): `frontend/src/components/Alerts.jsx`
- [Equipment Detail](https://github.com/kumargosala24/smartrentalsystem/blob/main/frontend/src/components/EquipmentDetail.jsx): `frontend/src/components/EquipmentDetail.jsx`
- [Forecast View](https://github.com/kumargosala24/smartrentalsystem/blob/main/frontend/src/components/Forecast.jsx): `frontend/src/components/Forecast.jsx`
- [Recommendations View](https://github.com/kumargosala24/smartrentalsystem/blob/main/frontend/src/components/Recommendations.jsx): `frontend/src/components/Recommendations.jsx`
- [API Client](https://github.com/kumargosala24/smartrentalsystem/blob/main/frontend/src/api.js): `frontend/src/api.js`

### API Service

- [REST API](https://github.com/kumargosala24/smartrentalsystem/blob/main/backend/app/main.py): `backend/app/main.py`
- [Runtime Config](https://github.com/kumargosala24/smartrentalsystem/blob/main/backend/app/config.py): `backend/app/config.py`

### Fleet Operations

- [Telemetry Simulator](https://github.com/kumargosala24/smartrentalsystem/blob/main/backend/app/simulator.py): `backend/app/simulator.py`

### Intelligence

- [Anomaly Engine](https://github.com/kumargosala24/smartrentalsystem/blob/main/backend/app/ml/anomaly.py): `backend/app/ml/anomaly.py`
- [Utilization Scoring](https://github.com/kumargosala24/smartrentalsystem/blob/main/backend/app/ml/utilization.py): `backend/app/ml/utilization.py`
- [Demand Forecasting](https://github.com/kumargosala24/smartrentalsystem/blob/main/backend/app/ml/forecast.py): `backend/app/ml/forecast.py`
- [Reallocation Engine](https://github.com/kumargosala24/smartrentalsystem/blob/main/backend/app/ml/recommend.py): `backend/app/ml/recommend.py`

### Data Layer

- [SQLite Store](https://github.com/kumargosala24/smartrentalsystem/blob/main/backend/app/database.py): `backend/app/database.py`
- [Seed Data](https://github.com/kumargosala24/smartrentalsystem/tree/main/backend/data): `backend/data`
- [Postgres Reference](https://github.com/kumargosala24/smartrentalsystem/blob/main/database/schema_postgres_reference.sql): `database/schema_postgres_reference.sql`

### Other components

- **Rental Staff**

## Connections

- Rental Staff → App Shell: uses (evidence: `README.md`)
- App Shell → Check-In / Out: renders (evidence: `frontend/src/App.jsx`)
- App Shell → Fleet View: renders (evidence: `frontend/src/App.jsx`)
- App Shell → Dashboard: renders (evidence: `frontend/src/App.jsx`)
- App Shell → Rentals View: renders (evidence: `frontend/src/App.jsx`)
- App Shell → Alerts View: renders (evidence: `frontend/src/App.jsx`)
- App Shell → Equipment Detail: renders (evidence: `frontend/src/App.jsx`)
- App Shell → Forecast View: renders (evidence: `frontend/src/App.jsx`)
- App Shell → Recommendations View: renders (evidence: `frontend/src/App.jsx`)
- Check-In / Out → API Client: requests equipment and rental actions (evidence: `frontend/src/components/CheckInOut.jsx`)
- Fleet View → API Client: loads equipment (evidence: `frontend/src/components/Fleet.jsx`)
- Forecast View → API Client: loads forecasts (evidence: `frontend/src/components/Forecast.jsx`)
- Rentals View → API Client: loads rentals (evidence: `frontend/src/components/Rentals.jsx`)
- Recommendations View → API Client: loads suggestions (evidence: `frontend/src/components/Recommendations.jsx`)
- Dashboard → API Client: loads summary
- Alerts View → API Client: loads alerts
- Equipment Detail → API Client: loads equipment detail
- API Client → REST API: calls REST endpoints (evidence: `README.md`)
- REST API → SQLite Store: reads and writes (evidence: `backend/app/main.py`)
- REST API → Anomaly Engine: uses detection engine (evidence: `backend/app/main.py`)
- REST API → Demand Forecasting: uses forecasting engine (evidence: `backend/app/main.py`)
- REST API → Utilization Scoring: uses scoring rules (evidence: `backend/app/main.py`)
- REST API → Reallocation Engine: uses recommendation engine (evidence: `backend/app/main.py`)
- REST API → Telemetry Simulator: starts simulator (evidence: `backend/app/main.py`)
- Telemetry Simulator → Anomaly Engine: scores readings (evidence: `backend/app/simulator.py`)
- Telemetry Simulator → SQLite Store: updates telemetry state (evidence: `README.md`)
- SQLite Store → Seed Data: loads CSV seed data (evidence: `README.md`)
- SQLite Store → Runtime Config: uses database path (evidence: `backend/app/database.py`)
- Anomaly Engine → Runtime Config: uses thresholds (evidence: `backend/app/ml/anomaly.py`)
- SQLite Store → Postgres Reference: schema reference (evidence: `README.md`)
