This project controls an RGB LED strip and exposes a Telegram bot for interaction. The backend is written in TypeScript and relies on environment variables defined in src/backend/config.ts.
Create a .env file in the project root with the following variables:
TZ– optional timezone string that will be assigned toprocess.env.TZ.routerMac– MAC address of the router interface used to query connected devices.routerDevice– substring of your phone/host name as reported by the router.routerEndpoint– base URL of the router API.routerPassword– password for the router API.tgAllowedUsers– comma separated list of Telegram user IDs allowed to use the bot.tgApiKey– Telegram Bot API key.externalUrl– public URL used by Telegram Web App.
Example .env file:
TZ=Europe/Berlin
routerMac=AA:BB:CC:DD:EE:FF
routerDevice=my-phone
routerEndpoint=http://router.local
routerPassword=your-router-password
tgAllowedUsers=123456789
tgApiKey=123456:ABC-DEF
externalUrl=https://example.comUse your preferred package manager to install dependencies:
npm install
# or
pnpm installCompile the project with
npm run build
# or
pnpm buildDuring development use
npm run devAfter building you can serve the production build with
npm startRun the server with NODE_ENV=production so that debugging routes such as
/debug/stream are disabled.
- Message @BotFather and run
/newbot. - Choose a name and username for your bot.
- BotFather will provide a token – put it in
tgApiKeyinside.env. - Use @userinfobot to find your numeric user ID.
- Set this ID (or multiple comma‑separated IDs) in
tgAllowedUsers.