# rishikrishnah/robocar architecture

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

- Interactive diagram: https://gitdiagram.com/rishikrishnah/robocar
- Repository: https://github.com/rishikrishnah/robocar

## Overview

This repository looks like a mixed hardware/software project for a “Robocar,” with two distinct execution environments: a Python-based application layer and one or more Arduino firmware sketches.

1. **Top-level role**
   - The repo is not a single monolith; it contains multiple runnable artifacts.
   - The visible split is between host-side code (`app.py`, HTML templates) and embedded code (`.ino` sketches).

2. **Python application entry point**
   - `app.py` is the only obvious host executable.
   - It is likely the main server or orchestration layer for the robot’s UI and any control/monitoring endpoints.

3. **Web/UI layer**
   - `templates/index.html` and `templates/index1.html` indicate server-rendered HTML pages.
   - `index.html` at the repo root suggests either a static landing page or a duplicate/alternate UI entry point.
   - The UI boundary is separate from the firmware boundary.

4. **Embedded firmware project: `air_polution`**
   - `air_polution/air_polution.ino` is a standalone Arduino sketch.
   - The presence of a `templates/` folder inside this sketch directory suggests this subproject also carries web-facing assets or a companion interface, even though the core runtime is still Arduino firmware.

5. **Second firmware variant: `sketch_mar13a`**
   - `sketch_mar13a/sketch_mar13a.ino` is another independent Arduino sketch.
   - This looks like a separate prototype or revision, not a module imported by the Python app.

6. **Architectural boundary**
   - The main system boundary is between the Python/runtime side and the microcontroller side.
   - The repo does not show the transport layer explicitly, so the connection could be serial, Wi‑Fi, HTTP, or another embedded protocol.

7. **Likely data flow**
   - User/browser → Python app → rendered HTML pages.
   - Separately, firmware on the Arduino side handles real-world interaction such as sensing or actuation.
   - Any interaction between the browser/app and the robot hardware would cross the host/embedded boundary.

8. **Repository organization**
   - The directory layout suggests experimentation and parallel prototypes rather than a tightly layered production architecture.
   - Two `.ino` sketches imply iterative development or separate features/projects under the same repo.

9. **Technology stack visible from files**
   - Python for the host application.
   - HTML for the UI.
   - Arduino C++ sketches for embedded device logic.
   - No dependency manifests or build files are visible in the tree, so runtime/framework specifics beyond that are not clear.

10. **What to draw in an architecture diagram**
   - Show a browser/UI tier backed by `app.py`.
   - Show one or more independent Arduino firmware nodes (`air_polution.ino`, `sketch_mar13a.ino`).
   - Draw a boundary between the host app and the embedded device(s), with an unlabeled communication link unless the protocol is known from code.

Main entry points: [`air_polution/air_polution.ino`](https://github.com/rishikrishnah/robocar/blob/main/air_polution/air_polution.ino) (Air sketch), [`app.py`](https://github.com/rishikrishnah/robocar/blob/main/app.py) (App), [`air_polution/templates/index.html`](https://github.com/rishikrishnah/robocar/blob/main/air_polution/templates/index.html) (Air page), [`air_polution/templates/index1.html`](https://github.com/rishikrishnah/robocar/blob/main/air_polution/templates/index1.html) (Air alt page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_host["Host side"]
  node_browser(("User UI<br/>client"))
  node_app_py["App<br/>[app.py]"]
  node_root_index["Landing page<br/>html ui<br/>[index.html]"]
end

subgraph group_embedded["Embedded side"]
  node_air_fw["Air sketch<br/>arduino firmware<br/>[air_polution.ino]"]
  node_air_tpl1["Air page<br/>html template<br/>[index.html]"]
  node_air_tpl2["Air alt page<br/>html template<br/>[index1.html]"]
  node_sketch_fw["Proto sketch<br/>arduino firmware<br/>[sketch_mar13a.ino]"]
end

node_browser -->|"uses"| node_app_py
node_app_py -->|"renders"| node_root_index
node_app_py -.->|"coordination"| node_air_fw
node_air_fw -->|"serves"| node_air_tpl1
node_air_fw -->|"serves"| node_air_tpl2
node_browser -->|"views"| node_air_tpl1
node_browser -->|"views"| node_air_tpl2
node_air_fw -.->|"parallel"| node_sketch_fw

click node_app_py "https://github.com/rishikrishnah/robocar/blob/main/app.py"
click node_root_index "https://github.com/rishikrishnah/robocar/blob/main/index.html"
click node_air_fw "https://github.com/rishikrishnah/robocar/blob/main/air_polution/air_polution.ino"
click node_air_tpl1 "https://github.com/rishikrishnah/robocar/blob/main/air_polution/templates/index.html"
click node_air_tpl2 "https://github.com/rishikrishnah/robocar/blob/main/air_polution/templates/index1.html"
click node_sketch_fw "https://github.com/rishikrishnah/robocar/blob/main/sketch_mar13a/sketch_mar13a.ino"

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_browser,node_app_py,node_root_index toneBlue
class node_air_fw,node_air_tpl1,node_air_tpl2,node_sketch_fw toneAmber
```

## Components

### Host side

Python application and repo-level web UI assets.

- **User UI**: client · Browser or operator-facing entry point for the robot UI.
- [App](https://github.com/rishikrishnah/robocar/blob/main/app.py): python app · Main host-side executable and orchestration layer. · `app.py`
- [Landing page](https://github.com/rishikrishnah/robocar/blob/main/index.html): html ui · Top-level HTML entry page. · `index.html`

### Embedded side

Arduino sketches and their companion assets.

- [Air sketch](https://github.com/rishikrishnah/robocar/blob/main/air_polution/air_polution.ino): arduino firmware · Standalone Arduino firmware for the air_polution subproject. · `air_polution/air_polution.ino`
- [Air page](https://github.com/rishikrishnah/robocar/blob/main/air_polution/templates/index.html): html template · Companion HTML page for the air_polution sketch. · `air_polution/templates/index.html`
- [Air alt page](https://github.com/rishikrishnah/robocar/blob/main/air_polution/templates/index1.html): html template · Second companion HTML page for the air_polution sketch. · `air_polution/templates/index1.html`
- [Proto sketch](https://github.com/rishikrishnah/robocar/blob/main/sketch_mar13a/sketch_mar13a.ino): arduino firmware · Second Arduino prototype or revision sketch. · `sketch_mar13a/sketch_mar13a.ino`

## Connections

- User UI → App: uses · Operator interacts with the Python host app.
- App → Landing page: renders · The host app serves the top-level HTML page.
- App → Air sketch: coordination · Host-side logic likely coordinates with embedded hardware.
- Air sketch → Air page: serves · Embedded subproject includes companion web-facing assets.
- Air sketch → Air alt page: serves · Embedded subproject includes a second companion page.
- User UI → Air page: views · The companion pages can be opened as part of the robot UI.
- User UI → Air alt page: views · Alternative companion page for the same embedded project.
- Air sketch → Proto sketch: parallel · Separate Arduino prototype or variant in the same repo.
