# akila20040720/autoinsightcs70 architecture

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

- Interactive diagram: https://gitdiagram.com/akila20040720/autoinsightcs70
- Repository: https://github.com/akila20040720/autoinsightcs70

## Overview

AutoInsight combines a Sri Lankan vehicle-marketplace experience with a backend refresh and listing API. The user-facing path is to browse/search listings, inspect vehicle details, and compare vehicles; supporting pages provide product, source, FAQ, and contact information. The backend refresh pipeline accepts manual or scraped source data, normalizes listings, and exposes marketplace data backed by MongoDB. The README documents these capabilities, but most frontend and server implementation files were not sampled, so uncertain call-level links are omitted or marked unverified.

Main entry points: [`autoinsight-frontend/auto-frontend/src/App.tsx`](https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/auto-frontend/src/App.tsx) (React app shell), [`autoinsight-frontend/auto-frontend/src/services/vehicleDataService.ts`](https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/auto-frontend/src/services/vehicleDataService.ts) (Vehicle data client), [`autoinsight-frontend/backend/pipeline.py`](https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/backend/pipeline.py) (Refresh pipeline), [`autoinsight-frontend/auto-frontend/src/page/SearchResults.tsx`](https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/auto-frontend/src/page/SearchResults.tsx) (Search marketplace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Marketplace experience"]
  node_app["React app shell<br/>[App.tsx]"]
  node_marketplace["Search marketplace<br/>[SearchResults.tsx]"]
  node_detail["Vehicle details<br/>[VehicleDetail.tsx]"]
  node_compare["Vehicle comparison"]
  node_supportpages["Product information<br/>[Features.tsx]"]
  node_datasources["Data sources<br/>[DataSources.tsx]"]
  node_contact["Contact<br/>[Contact.tsx]"]
end

subgraph group_services["Frontend services"]
  node_vehicledata["Vehicle data client"]
  node_localstorage["Marketplace storage"]
end

subgraph group_backend["Marketplace backend"]
  node_api["Marketplace API<br/>[server.py]"]
  node_repository[("Listing repository<br/>[repository.py]")]
end

subgraph group_refresh["Data refresh"]
  node_pipeline["Refresh pipeline<br/>[pipeline.py]"]
  node_scraper["Listing scraper<br/>[scrape.py]"]
  node_validation["Model validation"]
end

node_visitor(("Vehicle shopper"))
node_externaldata(("Vehicle listing sources"))

node_visitor -->|"browses"| node_app
node_app -->|"routes to"| node_marketplace
node_app -->|"routes to"| node_supportpages
node_app -.->|"routes to"| node_datasources
node_app -->|"routes to"| node_contact
node_marketplace -.->|"requests listings"| node_vehicledata
node_detail -.->|"loads vehicle data"| node_vehicledata
node_compare -.->|"loads vehicle data"| node_vehicledata
node_marketplace -.->|"uses saved state"| node_localstorage
node_vehicledata -.->|"calls API"| node_api
node_api -.->|"reads listings"| node_repository
node_pipeline -->|"loads scrape source"| node_scraper
node_pipeline -->|"validates model data"| node_validation
node_externaldata -.->|"provides listings"| node_scraper
node_pipeline -.->|"refreshes listings"| node_repository

click node_app "https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/auto-frontend/src/App.tsx"
click node_marketplace "https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/auto-frontend/src/page/SearchResults.tsx"
click node_detail "https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/auto-frontend/src/page/VehicleDetail.tsx"
click node_compare "https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/auto-frontend/src/page/VehicleComparison.tsx"
click node_supportpages "https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/auto-frontend/src/page/Features.tsx"
click node_datasources "https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/auto-frontend/src/page/DataSources.tsx"
click node_contact "https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/auto-frontend/src/page/Contact.tsx"
click node_vehicledata "https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/auto-frontend/src/services/vehicleDataService.ts"
click node_localstorage "https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/auto-frontend/src/services/marketplaceStorage.ts"
click node_api "https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/backend/server.py"
click node_repository "https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/backend/repository.py"
click node_pipeline "https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/backend/pipeline.py"
click node_scraper "https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/backend/scrape.py"
click node_validation "https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/backend/model_validation.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_app,node_marketplace,node_detail,node_compare,node_supportpages,node_datasources,node_contact toneBlue
class node_vehicledata,node_localstorage toneAmber
class node_api,node_repository toneMint
class node_pipeline,node_scraper,node_validation toneRose
class node_visitor,node_externaldata toneIndigo
```

## Components

### Marketplace experience

- [React app shell](https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/auto-frontend/src/App.tsx): `autoinsight-frontend/auto-frontend/src/App.tsx`
- [Search marketplace](https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/auto-frontend/src/page/SearchResults.tsx): `autoinsight-frontend/auto-frontend/src/page/SearchResults.tsx`
- [Vehicle details](https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/auto-frontend/src/page/VehicleDetail.tsx): `autoinsight-frontend/auto-frontend/src/page/VehicleDetail.tsx`
- [Vehicle comparison](https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/auto-frontend/src/page/VehicleComparison.tsx): `autoinsight-frontend/auto-frontend/src/page/VehicleComparison.tsx`
- [Product information](https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/auto-frontend/src/page/Features.tsx): `autoinsight-frontend/auto-frontend/src/page/Features.tsx`
- [Data sources](https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/auto-frontend/src/page/DataSources.tsx): `autoinsight-frontend/auto-frontend/src/page/DataSources.tsx`
- [Contact](https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/auto-frontend/src/page/Contact.tsx): `autoinsight-frontend/auto-frontend/src/page/Contact.tsx`

### Frontend services

- [Vehicle data client](https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/auto-frontend/src/services/vehicleDataService.ts): `autoinsight-frontend/auto-frontend/src/services/vehicleDataService.ts`
- [Marketplace storage](https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/auto-frontend/src/services/marketplaceStorage.ts): `autoinsight-frontend/auto-frontend/src/services/marketplaceStorage.ts`

### Marketplace backend

- [Marketplace API](https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/backend/server.py): `autoinsight-frontend/backend/server.py`
- [Listing repository](https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/backend/repository.py): `autoinsight-frontend/backend/repository.py`

### Data refresh

- [Refresh pipeline](https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/backend/pipeline.py): `autoinsight-frontend/backend/pipeline.py`
- [Listing scraper](https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/backend/scrape.py): `autoinsight-frontend/backend/scrape.py`
- [Model validation](https://github.com/akila20040720/autoinsightcs70/blob/main/autoinsight-frontend/backend/model_validation.py): `autoinsight-frontend/backend/model_validation.py`

### Other components

- **Vehicle shopper**
- **Vehicle listing sources**

## Connections

- Vehicle shopper → React app shell: browses (evidence: `README.md`)
- React app shell → Search marketplace: routes to (evidence: `README.md`)
- React app shell → Product information: routes to (evidence: `README.md`)
- React app shell → Data sources: routes to (evidence: `autoinsight-frontend/auto-frontend/src/App.tsx`)
- React app shell → Contact: routes to (evidence: `README.md`)
- Search marketplace → Vehicle data client: requests listings
- Vehicle details → Vehicle data client: loads vehicle data
- Vehicle comparison → Vehicle data client: loads vehicle data
- Search marketplace → Marketplace storage: uses saved state
- Vehicle data client → Marketplace API: calls API
- Marketplace API → Listing repository: reads listings
- Refresh pipeline → Listing scraper: loads scrape source (evidence: `autoinsight-frontend/backend/pipeline.py`)
- Refresh pipeline → Model validation: validates model data (evidence: `autoinsight-frontend/backend/pipeline.py`)
- Vehicle listing sources → Listing scraper: provides listings
- Refresh pipeline → Listing repository: refreshes listings
