# dmitri-viggo-barks/shadeglide architecture

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

- Interactive diagram: https://gitdiagram.com/dmitri-viggo-barks/shadeglide
- Repository: https://github.com/dmitri-viggo-barks/shadeglide

## Overview

ShadeGlide is an embedded curtain-control project spanning a wireless Smart Switch, a Rail Bot, electronics, and fabricated bodies. The documented user workflow is to install and power the bot, power the switch, and use the switch to command curtain movement; BLE, motor control, and obstruction stopping are described as capabilities, while firmware milestones remain in progress. The sampled Rail Bot entry point is empty and its configuration marks BLE and application logic as TODO, so the graph shows documented product relationships rather than implemented call flows. Smart Switch firmware and hardware details are not sampled.

Main entry points: [`firmware/rail-bot/main/main.c`](https://github.com/dmitri-viggo-barks/shadeglide/blob/main/firmware/rail-bot/main/main.c) (Rail Bot firmware), [`firmware/smart-switch`](https://github.com/dmitri-viggo-barks/shadeglide/tree/main/firmware/smart-switch) (Smart Switch), [`hardware/electronics`](https://github.com/dmitri-viggo-barks/shadeglide/tree/main/hardware/electronics) (Rechargeable batteries), [`hardware/electronics/hanging-bot`](https://github.com/dmitri-viggo-barks/shadeglide/tree/main/hardware/electronics/hanging-bot) (Motor drive)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Control firmware"]
  node_smart_switch["Smart Switch"]
  node_rail_firmware["Rail Bot firmware<br/>[main.c]"]
  node_rail_config["Bot configuration<br/>[bot-config.h]"]
end

subgraph group_electronics["Electronics"]
  node_ble["BLE link"]
  node_motor["Motor drive"]
  node_tof["ToF sensing"]
  node_switch_electronics["Switch electronics"]
  node_battery["Rechargeable batteries"]
end

subgraph group_fabrication["Mechanical fabrication"]
  node_bot_body["Rail Bot body"]
  node_switch_body["Switch body"]
end

subgraph group_operation["Product operation"]
  node_curtain_rail["Curtain rail"]
  node_curtain["Curtain"]
  node_obstruction["Obstruction"]
end

node_user(("User"))

node_user -->|"operates"| node_smart_switch
node_smart_switch -->|"commands over"| node_ble
node_ble -->|"commands"| node_rail_firmware
node_rail_firmware -->|"drives"| node_motor
node_rail_firmware -->|"checks obstructions"| node_tof
node_tof -->|"detects"| node_obstruction
node_motor -->|"moves"| node_curtain
node_bot_body -->|"installs on"| node_curtain_rail
node_battery -->|"powers"| node_smart_switch
node_battery -->|"powers"| node_rail_firmware
node_switch_electronics -.->|"hosts"| node_smart_switch
node_switch_body -.->|"houses"| node_smart_switch
node_rail_config -.->|"configures"| node_rail_firmware

click node_smart_switch "https://github.com/dmitri-viggo-barks/shadeglide/tree/main/firmware/smart-switch"
click node_rail_firmware "https://github.com/dmitri-viggo-barks/shadeglide/blob/main/firmware/rail-bot/main/main.c"
click node_rail_config "https://github.com/dmitri-viggo-barks/shadeglide/blob/main/firmware/rail-bot/main/bot-config.h"
click node_ble "https://github.com/dmitri-viggo-barks/shadeglide/tree/main/firmware/smart-switch"
click node_motor "https://github.com/dmitri-viggo-barks/shadeglide/tree/main/hardware/electronics/hanging-bot"
click node_tof "https://github.com/dmitri-viggo-barks/shadeglide/tree/main/hardware/electronics/hanging-bot"
click node_switch_electronics "https://github.com/dmitri-viggo-barks/shadeglide/tree/main/hardware/electronics/smart-switch"
click node_battery "https://github.com/dmitri-viggo-barks/shadeglide/tree/main/hardware/electronics"
click node_bot_body "https://github.com/dmitri-viggo-barks/shadeglide/tree/main/hardware/mechanical/hanging-bot"
click node_switch_body "https://github.com/dmitri-viggo-barks/shadeglide/tree/main/hardware/mechanical/smart-swtich"

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_smart_switch,node_rail_firmware,node_rail_config,node_user toneBlue
class node_ble,node_motor,node_tof,node_switch_electronics,node_battery toneAmber
class node_bot_body,node_switch_body toneMint
class node_curtain_rail,node_curtain,node_obstruction toneRose
```

## Components

### Control firmware

- [Smart Switch](https://github.com/dmitri-viggo-barks/shadeglide/tree/main/firmware/smart-switch): `firmware/smart-switch`
- [Rail Bot firmware](https://github.com/dmitri-viggo-barks/shadeglide/blob/main/firmware/rail-bot/main/main.c): `firmware/rail-bot/main/main.c`
- [Bot configuration](https://github.com/dmitri-viggo-barks/shadeglide/blob/main/firmware/rail-bot/main/bot-config.h): `firmware/rail-bot/main/bot-config.h`

### Electronics

- [BLE link](https://github.com/dmitri-viggo-barks/shadeglide/tree/main/firmware/smart-switch): `firmware/smart-switch`
- [Motor drive](https://github.com/dmitri-viggo-barks/shadeglide/tree/main/hardware/electronics/hanging-bot): `hardware/electronics/hanging-bot`
- [ToF sensing](https://github.com/dmitri-viggo-barks/shadeglide/tree/main/hardware/electronics/hanging-bot): `hardware/electronics/hanging-bot`
- [Switch electronics](https://github.com/dmitri-viggo-barks/shadeglide/tree/main/hardware/electronics/smart-switch): `hardware/electronics/smart-switch`
- [Rechargeable batteries](https://github.com/dmitri-viggo-barks/shadeglide/tree/main/hardware/electronics): `hardware/electronics`

### Mechanical fabrication

- [Rail Bot body](https://github.com/dmitri-viggo-barks/shadeglide/tree/main/hardware/mechanical/hanging-bot): `hardware/mechanical/hanging-bot`
- [Switch body](https://github.com/dmitri-viggo-barks/shadeglide/tree/main/hardware/mechanical/smart-swtich): `hardware/mechanical/smart-swtich`

### Product operation

- **Curtain rail**
- **Curtain**
- **Obstruction**

### Other components

- **User**

## Connections

- User → Smart Switch: operates (evidence: `README.md`)
- Smart Switch → BLE link: commands over (evidence: `README.md`)
- BLE link → Rail Bot firmware: commands (evidence: `README.md`)
- Rail Bot firmware → Motor drive: drives (evidence: `README.md`)
- Rail Bot firmware → ToF sensing: checks obstructions (evidence: `README.md`)
- ToF sensing → Obstruction: detects (evidence: `README.md`)
- Motor drive → Curtain: moves (evidence: `README.md`)
- Rail Bot body → Curtain rail: installs on (evidence: `README.md`)
- Rechargeable batteries → Smart Switch: powers (evidence: `README.md`)
- Rechargeable batteries → Rail Bot firmware: powers (evidence: `README.md`)
- Switch electronics → Smart Switch: hosts
- Switch body → Smart Switch: houses
- Bot configuration → Rail Bot firmware: configures
