|
| 1 | +# SETUP AND MAP |
| 2 | + |
| 3 | +## Project overview |
| 4 | +Simple goal |
| 5 | +Control tint levels for 18 facade panels and 2 skylights in the OSU trailer |
| 6 | +FastAPI service in Python |
| 7 | +React web app in TypeScript |
| 8 | +Runs on your laptop today |
| 9 | +Swap to the real trailer later |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## File map and what each file does |
| 14 | + |
| 15 | +### Root |
| 16 | +* **README.md** – Top level summary and team list |
| 17 | +* **OVERVIEW.md** – General Overview of each file |
| 18 | +* **DEV-SETUP.md** – Instructions for development setup |
| 19 | +* **LICENSE** – License |
| 20 | +* **CONTRIBUTING.md** – Rules for branches, reviews, commits, and CI |
| 21 | +* **.gitignore** – Keeps build output, local env, and cache out of git |
| 22 | +* **.github/PULL_REQUEST_TEMPLATE.md** – Pull request checklist and sections |
| 23 | +* **.github/workflows/ci.yml** - CI that echoes a message on push and pull request |
| 24 | +* **docs/meeting_template.md** – Skeleton for meeting notes and action items |
| 25 | +* **docs/quick_start_draft.md** – Early draft for a researcher quick start |
| 26 | + |
| 27 | +### Service folder (svc) |
| 28 | +* **svc/main.py** – Starts FastAPI, mounts routes, enables CORS for the web app on port 5173 |
| 29 | +* **svc/requirements.txt** – Python packages used by the service |
| 30 | +* **svc/.env.example** – Sample settings to copy to .env |
| 31 | +* **svc/app/__init__.py** – Empty marker so Python treats app as a package |
| 32 | +* **svc/app/config.py** – Reads env settings, mode (sim or real), file paths for saved data and audit log |
| 33 | +* **svc/app/models.py** – Pydantic models for panels, groups, requests, and responses; snapshot and audit entry shapes |
| 34 | +* **svc/app/routes.py** – API endpoints for the web app (GET health, GET panels, GET groups, POST commands/set-level) |
| 35 | +* **svc/app/service.py** – Core logic layer; picks simulator in sim mode; enforces dwell time and writes audit |
| 36 | +* **svc/app/simulator.py** – In-memory simulator with disk persistence; updates panel levels and saves snapshot |
| 37 | +* **svc/app/state.py** – Load and save snapshot JSON; bootstrap default panels and groups; append one audit line per change |
| 38 | +* **svc/tests/test_basic.py** – Tests health listing, dwell, and group updates |
| 39 | + |
| 40 | +### Web folder (web) |
| 41 | +* **web/index.html** – Root HTML for the React app |
| 42 | +* **web/package.json** – NPM scripts and dependencies |
| 43 | +* **web/tsconfig.json** – TypeScript config with React JSX and Vite types |
| 44 | +* **web/vite.config.ts** – Vite dev server config (port 5173) |
| 45 | +* **web/.env.development** – Points the web app to the service at http://127.0.0.1:8000 |
| 46 | +* **web/src/env.d.ts** – Types for Vite env values |
| 47 | +* **web/src/main.tsx** – React entry and mount |
| 48 | +* **web/src/App.tsx** – Main page with status, group control, and panel grid |
| 49 | +* **web/src/api.ts** – Small client for health, panels, groups, and tint commands |
| 50 | +* **web/src/styles.css** – Theme layout for cards, sliders, chips, and header styling |
| 51 | +* **web/src/components/PanelGrid.tsx** – Cards for each panel with a slider, quick chips, and apply |
0 commit comments