Kalmalyzer / stb

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

STB Config service example

This is a demonstration of how to create a configuration service for a device, such a a set-top box. It consists of two parts:

  • There is a web frontend. This is a single-page application, built using Vue 3.

  • There is a backend API. This is built using Golang. This contains all code that will run on the box itself. Here is where the logic for poking the box's local configuration files.

These components are packaged up as Docker containers, and are ready to be deployed onto the box itself.

Development & building

  • Install Visual Studio Code

  • Install Golang 1.18+

  • Install nvm

  • Activate the appropriate Node version by doing nvm use $(cat frontend/.nvmrc) in each terminal window

Develop & test locally

Build & deploy

  • Build backend container: make build-backend

  • Build frontend site: make build-frontend-site

  • Start containers: make run-deployment -- site is available at http://localhost:80/

Notes

  • The username/password for local use can be found in the Makefile

  • The username/password for deployment can be found in compose.yaml

  • After modifying the OpenAPI specification, regenerate glue code via make generate-apis

  • The current version uses 10MB RAM for the web container, and 5MB RAM for the backend API

About


Languages

Language:Go 42.4%Language:TypeScript 38.3%Language:Vue 11.2%Language:Makefile 4.4%Language:Shell 2.3%Language:HTML 1.0%Language:Dockerfile 0.4%