GithubHelp home page GithubHelp logo

ardiloot / wheel-of-fortune Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 54.79 MB

Wheel of fortune

Dockerfile 0.07% Shell 0.01% Python 2.04% JavaScript 3.98% HTML 7.15% TypeScript 0.93% Batchfile 0.01% C++ 55.06% C 29.32% CSS 1.44%

wheel-of-fortune's Introduction

Wheel of Fortune

Overview

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:

  1. Mechanical setup
  2. Electrical setup
  3. Embedded software
  4. Server software

Development

Code is split to two main parts:

  1. Python backend (FastAPI)
  2. Node frontend (React + Mantine)

Finally, frontend static HTML + Javascript files are backed into backend Python package and served via backend FastAPI server.

Backend

Development environment

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 .

Running backend

source venv/bin/activate
python -m wheel_of_fortune

Updating requirements

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

Frontend

Setup development environment

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

Developer mode

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

Release build

nvm use
npm run build

Update packages

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

Build steps

Usually not needed, as Github actions automatically build and test frontend & docker images. But for completeness, here are commands to do build manually:

Frontend

cd wheel_of_fortune/frontend/
nvm use
npm ci
npm run build
cd ../..

Backend

python -m build

Docker image

docker build -t wheel_of_fortune .

wheel-of-fortune's People

Contributors

ardiloot avatar renovate[bot] avatar

Watchers

 avatar  avatar

wheel-of-fortune's Issues

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Location: renovate.json
Error type: The renovate configuration file contains some invalid settings
Message: The following managers configured in enabledManagers are not supported: "docker, ci"

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

docker-compose
embedded_software/docker_stack/docker-compose.yml
  • traefik v2.11.3
  • ghcr.io/ardiloot/wheel-of-fortune v1.1.0
server/metrics/docker-compose.yml
  • traefik v2.11.3
  • ghcr.io/linuxserver/librespeed 5.3.3
  • influxdb 2.7.6
  • grafana/loki 2.9.8
  • grafana/grafana 10.4.3
  • grafana/promtail 3.0.0
  • telegraf 1.30.3
  • kopia/kopia 0.17
dockerfile
Dockerfile
  • node 20.8.0-slim
  • python 3.11.5-slim
  • python 3.11.5-slim
github-actions
.github/workflows/build-docker-image.yml
  • actions/checkout v4
  • docker/setup-qemu-action v3
  • docker/setup-buildx-action v3
  • docker/login-action v3
  • docker/metadata-action v5
  • docker/build-push-action v5
.github/workflows/release.yml
  • actions/checkout v4
  • actions/setup-python v5
  • softprops/action-gh-release v2
.github/workflows/wled-ci.yml
  • actions/checkout v4
  • actions/cache v4
  • actions/setup-python v5
  • actions/checkout v4
  • actions/cache v4
  • actions/cache v4
  • actions/setup-python v5
  • actions/upload-artifact v4
  • actions/upload-artifact v4
  • actions/download-artifact v4
  • softprops/action-gh-release v2

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.