A high-performance Go implementation of the LacyLights lighting control system backend. This server provides a GraphQL API for managing theatrical lighting fixtures, scenes, cue lists, and real-time DMX output via Art-Net.
- GraphQL API: Full-featured API for lighting control operations
- Art-Net Support: Real-time DMX output over UDP (Art-Net protocol)
- SQLite Database: Lightweight, embedded database using Prisma-style schema
- Cross-Platform: Builds for Linux (ARM/AMD64), macOS, and Windows
- Raspberry Pi Ready: Optimized for deployment on Raspberry Pi hardware
- Go 1.21 or later
- Make (optional, for convenience commands)
# Build the server
make build
# Run with default settings
./build/bin/server
# Run with custom settings
DATABASE_URL="file:./data.db" PORT=4000 ./build/bin/server| Variable | Default | Description |
|---|---|---|
PORT |
4000 |
HTTP server port |
DATABASE_URL |
file:./lacylights.db |
SQLite database path |
ARTNET_ENABLED |
true |
Enable/disable Art-Net output |
ARTNET_BROADCAST_ADDRESS |
255.255.255.255 |
Art-Net broadcast address |
lacylights-go/
├── cmd/server/ # Main application entry point
├── internal/
│ ├── config/ # Configuration management
│ ├── database/ # Database layer and migrations
│ ├── graph/ # GraphQL resolvers and schema
│ ├── models/ # Domain models
│ └── artnet/ # Art-Net protocol implementation
├── pkg/ # Public packages
├── test/ # Integration tests
├── go.mod
├── go.sum
└── Makefile
# Run tests
make test
# Run tests with coverage
make test-coverage
# Run linter
make lint
# Generate GraphQL code
make generate
# Build for all platforms
make build-all
# Clean build artifacts
make cleanThe GraphQL API is defined in internal/graph/schema.graphqls. After modifying the schema, regenerate the resolver code:
make generateprojects- List all projectsproject(id: ID!)- Get a specific projectfixtureDefinitions- List fixture definitionssystemInfo- Get system status and configurationdmxOutput(universe: Int!)- Get current DMX channel values
createProject/updateProject/deleteProject- Project managementcreateScene/updateScene/deleteScene- Scene managementcreateCueList/addCueToCueList- Cue list managementstartCueList/nextCue/stopCueList- Playback controlsetChannelValue- Direct DMX controlfadeToBlack- Emergency blackout
dmxOutput- Real-time DMX value updatesplaybackStatus- Cue list playback state changes
# Build for Raspberry Pi (ARM64)
GOOS=linux GOARCH=arm64 go build -o lacylights-arm64 ./cmd/server
# Build for older Raspberry Pi (ARM32)
GOOS=linux GOARCH=arm GOARM=7 go build -o lacylights-arm ./cmd/serverRun unit tests:
make testRun with coverage report:
make test-coverage
open coverage.htmlFor comprehensive implementation plans and architecture decisions, see the parent directory documentation:
- LACYLIGHTS_GO_REWRITE_PLAN.md - Complete Go rewrite implementation plan and architecture
- RASPBERRY_PI_PRODUCT_PLAN.md - Turnkey Raspberry Pi product architecture and deployment
- GO_DISTRIBUTION_PLAN.md - Binary distribution and release workflow coordination
- CONTRACT_TESTING_PLAN.md - Contract test suite for API compatibility verification
- lacylights-fe - Next.js frontend
- lacylights-mcp - MCP server for AI integration
- lacylights-test - Contract test suite
- lacylights-rpi - Raspberry Pi deployment
MIT License - See LICENSE for details.