An over-engineered DIY version of Wheel of Fortune (Wheel or Prizes). The main features are:
- 3 LED strips with individually controllable LEDs (WLED)
- 3 linear servo motors for displaying effect logos
- absolute position optical encoder for wheel position (position depended effects)
- Amplified sound system for theme and effect sound
- ESP32 based LED and servo motor controller
- Orange PI 3 LTS based compute unit
- Node (React + Mantine) app for configuration
- Server stack for metrics, monitoring and backup
Outlook:
Internals:
Services:
For detailed instructions how to build the system, see following readme files:
Code is split to two main parts:
- Python backend (FastAPI)
- Node frontend (React + Mantine)
Finally, frontend static HTML + Javascript files are backed into backend Python package and served via backend FastAPI server.
Python 3.11 is currently preferred, but should also work on any Python >= 3.10
python -m venv venv
source venv/bin/activate
pip install -r dev-requirements.txt
pip install -e .
source venv/bin/activate
python -m wheel_of_fortune
After adding dependency update requirement files by running:
source venv/bin/activate
pip-compile --upgrade -o requirements.txt pyproject.toml \
&& pip-compile --extra dev --upgrade -o dev-requirements.txt pyproject.toml \
&& pip-sync dev-requirements.txt
Install nvm
and node
and install dependencies:
cd wheel_of_fortune/frontend/
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash
source ~/.bashrc
nvm install
nvm use
npm ci
Create .env.local
file for overriding environment:
VITE_API_URL=https://wheel.int.example.com/api/v1
VITE_WS_URL=wss://wheel.int.example.com/api/v1/ws
Run frontend in dev
mode:
nvm use
npm run dev
nvm use
npm run build
To update package-lock.json
and install updates:
npm update
npm install
To also update package.json
file:
npm install -g npm-check-updates
ncu -u
npm install
Usually not needed, as Github actions automatically build and test frontend & docker images. But for completeness, here are commands to do build manually:
cd wheel_of_fortune/frontend/
nvm use
npm ci
npm run build
cd ../..
python -m build
docker build -t wheel_of_fortune .