# grigory-shvechkov/cics-256-final-project architecture

> Architecture diagram of the GitHub repository grigory-shvechkov/cics-256-final-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/grigory-shvechkov/cics-256-final-project
- Repository: https://github.com/grigory-shvechkov/cics-256-final-project

## Overview

##### Project type and purpose
- This is a hybrid embedded-full-stack robotics project (“Robot Spider”) combining:
- An embedded firmware layer (PlatformIO/Arduino) that runs on a microcontroller and drives servos (legs.cpp, main.ino).
- A single-page web interface (Svelte/SvelteKit) for controlling or visualizing the robot, built via the “web-app” directory and then embedded into the firmware under src/web-ui.

##### File structure
Top level:
- platformio.ini – defines the microcontroller platform, framework (Arduino/ESP32 or similar), build flags.
- / – header files (legs.h, limits.h) defining servo-leg abstractions and constraints.
- src/legs.cpp & src/main.ino – firmware code: abstracts leg movements, Wi-Fi and web server initialization, serves static web UI.
- src/web-ui/… – the compiled static assets (HTML, CSS, JS bundles) that the microcontroller’s embedded server will host (e.g., on SPIFFS/LittleFS).
web-app/ (separate Svelte development workspace):
- src/routes & src/lib – SvelteKit application: components (buttons, sliders), page layouts, styles (Tailwind), utilities.
- package.json, vite.config.ts, svelte.config.js – build toolchain configuration.

##### README
- “CICS 256 Final Project” – confirms this is a capstone combining embedded robotics control with a web UI.
- “Robot Spider” – suggests servo-leg control visualized or commanded via browser.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Embedded Layer
    subgraph "Embedded Layer"
        MCU["ESP32 MCU Firmware"]:::embedded
        Servo["Servo Abstraction & Constraints"]:::embedded
        WebServer["Embedded Web Server\n(Wi-Fi + HTTP)"]:::embedded
        FS["SPIFFS/LittleFS Storage"]:::fs
        MCU --> Servo
        MCU --> WebServer
        WebServer --> FS
    end

    %% Web Layer
    subgraph "Web Layer"
        Browser["Web Browser Client"]:::frontend
        SPA["Svelte SPA"]:::frontend
        Routes["SPA Routes & Layouts"]:::frontend
        UIComp["UI Components"]:::frontend
        Utils["Utility Functions"]:::frontend
        Styles["Global Styles & Entry"]:::frontend
        DocsFW["README.md"]:::doc
        DocsWEB["web-app/README.md"]:::doc
        Index["Component Index"]:::frontend
        Typings["Typings"]:::frontend

        SPA --> Routes
        SPA --> UIComp
        SPA --> Utils
        SPA --> Styles
        SPA --> Index
        SPA --> Typings
        Routes --> Styles
        Browser --> SPA
        DevFW --> DocsFW
        DevWEB --> DocsWEB
    end

    %% Development Toolchains
    DevFW["Firmware Dev Toolchain\n(PlatformIO)"]:::build
    DevWEB["Web-App Dev Toolchain\n(Node.js,npm,Vite)"]:::build

    DevFW --> MCU
    DevFW --> Servo
    DevFW --> WebServer
    DevWEB --> SPA
    DevWEB --> Styles
    DevWEB --> Routes

    %% Build Pipelines
    DevWEB -.-> FS
    FS -.-> MCU
    DevFW -.-> MCU

    %% Runtime Interaction
    WIFI["Wi-Fi Network"]:::wireless
    Browser --> WIFI
    WebServer --> WIFI
    Browser -->|"HTTP GET static assets"|WebServer
    Browser -->|"HTTP POST/WebSocket"|WebServer
    WebServer -->|"Serve files"|FS

    %% Click Events
    click MCU "https://github.com/grigory-shvechkov/cics-256-final-project/blob/main/platformio.ini"
    click MCU "https://github.com/grigory-shvechkov/cics-256-final-project/blob/main/src/main.ino"
    click MCU "https://github.com/grigory-shvechkov/cics-256-final-project/blob/main/src/legs.cpp"
    click Servo "https://github.com/grigory-shvechkov/cics-256-final-project/blob/main/include/legs.h"
    click Servo "https://github.com/grigory-shvechkov/cics-256-final-project/blob/main/include/limits.h"
    click WebServer "https://github.com/grigory-shvechkov/cics-256-final-project/blob/main/src/main.ino"
    click FS "https://github.com/grigory-shvechkov/cics-256-final-project/tree/main/src/web-ui/"
    click Routes "https://github.com/grigory-shvechkov/cics-256-final-project/tree/main/web-app/src/routes"
    click UIComp "https://github.com/grigory-shvechkov/cics-256-final-project/blob/main/web-app/src/lib/components/ui/button/button.svelte"
    click UIComp "https://github.com/grigory-shvechkov/cics-256-final-project/blob/main/web-app/src/lib/components/ui/slider/slider.svelte"
    click Utils "https://github.com/grigory-shvechkov/cics-256-final-project/blob/main/web-app/src/lib/utils.ts"
    click BuildCfg "https://github.com/grigory-shvechkov/cics-256-final-project/blob/main/web-app/package.json"
    click BuildCfg "https://github.com/grigory-shvechkov/cics-256-final-project/blob/main/web-app/vite.config.ts"
    click BuildCfg "https://github.com/grigory-shvechkov/cics-256-final-project/blob/main/web-app/svelte.config.js"
    click BuildCfg "https://github.com/grigory-shvechkov/cics-256-final-project/blob/main/web-app/tailwind.config.js"
    click Styles "https://github.com/grigory-shvechkov/cics-256-final-project/blob/main/web-app/src/app.css"
    click Styles "https://github.com/grigory-shvechkov/cics-256-final-project/blob/main/web-app/src/app.html"
    click DocsFW "https://github.com/grigory-shvechkov/cics-256-final-project/blob/main/README.md"
    click DocsWEB "https://github.com/grigory-shvechkov/cics-256-final-project/blob/main/web-app/README.md"
    click Index "https://github.com/grigory-shvechkov/cics-256-final-project/blob/main/web-app/src/lib/index.ts"
    click Typings "https://github.com/grigory-shvechkov/cics-256-final-project/blob/main/web-app/src/app.d.ts"

    %% Styles
    classDef embedded fill:#bbbbbb,stroke:#333,stroke-width:1px
    classDef fs fill:#ffcc66,stroke:#993300,stroke-width:1px
    classDef frontend fill:#88ccff,stroke:#0066cc,stroke-width:1px
    classDef build fill:#ccffcc,stroke:#339933,stroke-width:1px
    classDef wireless fill:#ccffff,stroke:#008888,stroke-width:1px
    classDef doc fill:#ddccff,stroke:#660099,stroke-width:1px
```
