@mister-industries/tinyservice
v1.1.0
Published
Node.js TypeScript WebSocket service for compiling Arduino projects (tinyStudio backend)
Maintainers
Readme
Arduino WebSocket Service
A Node.js TypeScript WebSocket service for compiling and uploading Arduino projects using Arduino CLI.
Features
- WebSocket Server: Real-time communication with clients
- Arduino CLI Integration: Compile, upload, and verify Arduino sketches
- Board Detection: List connected Arduino boards
- Real-time Output Streaming: See compilation/upload progress in real-time
- Multi-client Support: Handle multiple WebSocket connections simultaneously
- Health Check: HTTP endpoint for service monitoring
- Graceful Shutdown: Proper cleanup on service termination
Prerequisites
Arduino CLI Installation
Download Arduino CLI:
- Visit Arduino CLI releases
- Download the appropriate version for your system
- Extract and place the binary in your PATH
Alternative Installation Methods:
Windows (using Chocolatey):
choco install arduino-climacOS (using Homebrew):
brew install arduino-cliLinux (using curl):
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | shInitialize Arduino CLI:
arduino-cli core update-index arduino-cli core install arduino:avr # For Arduino Uno, Nano, etc.
Node.js
- Node.js 16.x or higher
- npm or yarn package manager
Installation
From the monorepo root:
npm installOr from this package directory:
cd packages/service
npm installUsage
Development Mode
From monorepo root:
npm run dev:serverFrom this package:
npm run devProduction Mode
npm run build
npm startScripts
npm run dev- Start development server with hot reloadnpm run build- Compile TypeScript to JavaScriptnpm start- Start production servernpm run lint- Run ESLintnpm run lint:fix- Fix ESLint issues automatically
API Documentation
See API.md for detailed API documentation.
Testing
See TEST_CLIENT.md for testing instructions.
Environment Variables
| Variable | Default | Description |
| ------------------ | ------------- | ------------------------------ |
| PORT | 3000 | Server port |
| ARDUINO_CLI_PATH | arduino-cli | Path to Arduino CLI executable |
| NODE_ENV | development | Environment mode |
License
MIT
