# marvinwel/ai_inspection_cse_4333_5333 architecture

> Architecture diagram of the GitHub repository marvinwel/ai_inspection_cse_4333_5333, 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/marvinwel/ai_inspection_cse_4333_5333
- Repository: https://github.com/marvinwel/ai_inspection_cse_4333_5333

## Overview

AI Inspector is a cloud-based visual inspection product, demonstrated with package-damage classification. The mobile app captures or selects an image, submits it for cloud inference, and presents the result; it also provides inspection history and statistics. The repository includes a web dashboard and Lambda handlers for image processing, data retrieval, and WebSocket updates. The README documents real-time dashboard updates and notifications, but the sampled source does not expose the backend wiring or persistence details, so those links are shown only where documented or left unverified.

Main entry points: [`ai-inspector-mobile/src/services/inspectionService.js`](https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-mobile/src/services/inspectionService.js) (Inspection API Client), [`ai-inspector-mobile/App.js`](https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-mobile/App.js) (App Navigation), [`lambda-functions/ai_inspection_process_image.py`](https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/lambda-functions/ai_inspection_process_image.py) (Image Processing Handler), [`ai-inspector-mobile/src/screens/CameraScreen.js`](https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-mobile/src/screens/CameraScreen.js) (Capture & Submit)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile App"]
  node_app["App Navigation<br/>[App.js]"]
  node_camera["Capture &amp; Submit<br/>[CameraScreen.js]"]
  node_service["Inspection API Client"]
  node_result["Inspection Result<br/>[ResultScreen.js]"]
  node_home["Overview<br/>[HomeScreen.js]"]
  node_history["Inspection History<br/>[HistoryScreen.js]"]
  node_stats["Inspection Statistics<br/>[StatsScreen.js]"]
  node_profile["User Profile<br/>[ProfileScreen.js]"]
  node_row["Inspection Row<br/>[InspectionRow.js]"]
  node_statcard["Statistics Card<br/>[StatCard.js]"]
  node_theme["App Colors<br/>[colors.js]"]
end

subgraph group_inference["Inspection Backend"]
  node_process["Image Processing Handler"]
  node_modelapi["Inference HTTP Service<br/>[serve.py]"]
  node_model["Image Classifier<br/>[inference.py]"]
  node_fetch["Inspection Fetch Handler"]
end

subgraph group_dashboard["Web Dashboard"]
  node_dashboardapp["Dashboard<br/>[app.js]"]
  node_auth["Dashboard Authentication<br/>[auth.js]"]
end

subgraph group_realtime["Live Updates"]
  node_connections["WebSocket Connections"]
  node_stream["Dashboard Stream"]
  node_notifications["Notifications"]
end

node_operator(("Inspector"))
node_cloud["Cloud API"]

node_operator -->|"uses"| node_app
node_app -->|"routes to"| node_camera
node_app -->|"routes to"| node_result
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_history
node_app -->|"routes to"| node_stats
node_app -->|"routes to"| node_profile
node_camera -->|"submits image"| node_service
node_service -->|"sends image"| node_cloud
node_cloud -->|"returns result"| node_service
node_service -->|"returns inspection"| node_result
node_service -->|"fetches records"| node_cloud
node_home -->|"fetches records"| node_service
node_history -->|"fetches records"| node_service
node_stats -->|"fetches records"| node_service
node_history -->|"renders"| node_row
node_home -->|"renders"| node_row
node_stats -->|"renders"| node_statcard
node_camera -.->|"submits for processing"| node_process
node_process -.->|"invokes inference"| node_modelapi
node_modelapi -->|"calls prediction"| node_model
node_cloud -.->|"routes data requests"| node_fetch
node_process -.->|"updates results"| node_dashboardapp
node_connections -.->|"supports live updates"| node_stream
node_stream -.->|"streams updates"| node_dashboardapp
node_process -.->|"generates alerts"| node_notifications
node_dashboardapp -.->|"uses authentication"| node_auth

click node_app "https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-mobile/App.js"
click node_camera "https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-mobile/src/screens/CameraScreen.js"
click node_service "https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-mobile/src/services/inspectionService.js"
click node_result "https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-mobile/src/screens/ResultScreen.js"
click node_home "https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-mobile/src/screens/HomeScreen.js"
click node_history "https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-mobile/src/screens/HistoryScreen.js"
click node_stats "https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-mobile/src/screens/StatsScreen.js"
click node_profile "https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-mobile/src/screens/ProfileScreen.js"
click node_row "https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-mobile/src/components/InspectionRow.js"
click node_statcard "https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-mobile/src/components/StatCard.js"
click node_theme "https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-mobile/src/theme/colors.js"
click node_process "https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/lambda-functions/ai_inspection_process_image.py"
click node_modelapi "https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/model-container/app/serve.py"
click node_model "https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/model-container/app/inference.py"
click node_fetch "https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/lambda-functions/ai_inspection_fetch_data.py"
click node_dashboardapp "https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-dashboard/app.js"
click node_auth "https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-dashboard/auth.js"
click node_connections "https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/lambda-functions/ai-inspector-websocket-connections.py"
click node_stream "https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/lambda-functions/ai_inspector_stream_dashboard.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_camera,node_service,node_result,node_home,node_history,node_stats,node_profile,node_row,node_statcard,node_theme toneBlue
class node_process,node_modelapi,node_model,node_fetch toneAmber
class node_dashboardapp,node_auth,node_cloud toneMint
class node_connections,node_stream,node_notifications toneRose
class node_operator toneIndigo
```

## Components

### Mobile App

- [App Navigation](https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-mobile/App.js): `ai-inspector-mobile/App.js`
- [Capture & Submit](https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-mobile/src/screens/CameraScreen.js): `ai-inspector-mobile/src/screens/CameraScreen.js`
- [Inspection API Client](https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-mobile/src/services/inspectionService.js): `ai-inspector-mobile/src/services/inspectionService.js`
- [Inspection Result](https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-mobile/src/screens/ResultScreen.js): `ai-inspector-mobile/src/screens/ResultScreen.js`
- [Overview](https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-mobile/src/screens/HomeScreen.js): `ai-inspector-mobile/src/screens/HomeScreen.js`
- [Inspection History](https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-mobile/src/screens/HistoryScreen.js): `ai-inspector-mobile/src/screens/HistoryScreen.js`
- [Inspection Statistics](https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-mobile/src/screens/StatsScreen.js): `ai-inspector-mobile/src/screens/StatsScreen.js`
- [User Profile](https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-mobile/src/screens/ProfileScreen.js): `ai-inspector-mobile/src/screens/ProfileScreen.js`
- [Inspection Row](https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-mobile/src/components/InspectionRow.js): `ai-inspector-mobile/src/components/InspectionRow.js`
- [Statistics Card](https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-mobile/src/components/StatCard.js): `ai-inspector-mobile/src/components/StatCard.js`
- [App Colors](https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-mobile/src/theme/colors.js): `ai-inspector-mobile/src/theme/colors.js`

### Inspection Backend

- [Image Processing Handler](https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/lambda-functions/ai_inspection_process_image.py): `lambda-functions/ai_inspection_process_image.py`
- [Inference HTTP Service](https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/model-container/app/serve.py): `model-container/app/serve.py`
- [Image Classifier](https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/model-container/app/inference.py): `model-container/app/inference.py`
- [Inspection Fetch Handler](https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/lambda-functions/ai_inspection_fetch_data.py): `lambda-functions/ai_inspection_fetch_data.py`

### Web Dashboard

- [Dashboard](https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-dashboard/app.js): `ai-inspector-dashboard/app.js`
- [Dashboard Authentication](https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/ai-inspector-dashboard/auth.js): `ai-inspector-dashboard/auth.js`

### Live Updates

- [WebSocket Connections](https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/lambda-functions/ai-inspector-websocket-connections.py): `lambda-functions/ai-inspector-websocket-connections.py`
- [Dashboard Stream](https://github.com/marvinwel/ai_inspection_cse_4333_5333/blob/main/lambda-functions/ai_inspector_stream_dashboard.py): `lambda-functions/ai_inspector_stream_dashboard.py`
- **Notifications**

### Other components

- **Inspector**
- **Cloud API**

## Connections

- Inspector → App Navigation: uses (evidence: `README.md`)
- App Navigation → Capture & Submit: routes to (evidence: `ai-inspector-mobile/App.js`)
- App Navigation → Inspection Result: routes to (evidence: `ai-inspector-mobile/App.js`)
- App Navigation → Overview: routes to (evidence: `ai-inspector-mobile/App.js`)
- App Navigation → Inspection History: routes to (evidence: `ai-inspector-mobile/App.js`)
- App Navigation → Inspection Statistics: routes to (evidence: `ai-inspector-mobile/App.js`)
- App Navigation → User Profile: routes to (evidence: `ai-inspector-mobile/App.js`)
- Capture & Submit → Inspection API Client: submits image (evidence: `ai-inspector-mobile/src/screens/CameraScreen.js`)
- Inspection API Client → Cloud API: sends image (evidence: `ai-inspector-mobile/src/services/inspectionService.js`)
- Cloud API → Inspection API Client: returns result (evidence: `ai-inspector-mobile/src/services/inspectionService.js`)
- Inspection API Client → Inspection Result: returns inspection
- Inspection API Client → Cloud API: fetches records (evidence: `ai-inspector-mobile/src/services/inspectionService.js`)
- Overview → Inspection API Client: fetches records (evidence: `ai-inspector-mobile/src/screens/HomeScreen.js`)
- Inspection History → Inspection API Client: fetches records (evidence: `ai-inspector-mobile/src/screens/HistoryScreen.js`)
- Inspection Statistics → Inspection API Client: fetches records (evidence: `ai-inspector-mobile/src/screens/StatsScreen.js`)
- Inspection History → Inspection Row: renders (evidence: `ai-inspector-mobile/src/screens/HistoryScreen.js`)
- Overview → Inspection Row: renders (evidence: `ai-inspector-mobile/src/screens/HomeScreen.js`)
- Inspection Statistics → Statistics Card: renders (evidence: `ai-inspector-mobile/src/screens/StatsScreen.js`)
- Capture & Submit → Image Processing Handler: submits for processing (evidence: `README.md`)
- Image Processing Handler → Inference HTTP Service: invokes inference
- Inference HTTP Service → Image Classifier: calls prediction (evidence: `model-container/app/serve.py`)
- Cloud API → Inspection Fetch Handler: routes data requests (evidence: `README.md`)
- Image Processing Handler → Dashboard: updates results (evidence: `README.md`)
- WebSocket Connections → Dashboard Stream: supports live updates
- Dashboard Stream → Dashboard: streams updates (evidence: `README.md`)
- Image Processing Handler → Notifications: generates alerts (evidence: `README.md`)
- Dashboard → Dashboard Authentication: uses authentication
