Order Local

Order Local Link to heading

Self-Hosted Restaurant Ordering System for Raspberry Pi

Overview Link to heading

Order Local is a self-hosted restaurant ordering system designed to run on Raspberry Pi. Customers scan QR codes at their table to browse the menu and place orders directly from their mobile browsers—no app installation required.

The system prioritizes simplicity and reliability: a single Go binary with zero runtime dependencies, optimized to run on hardware as modest as a Raspberry Pi 3B+ with just 1GB of RAM.

Key Features Link to heading

  • Single Binary Deployment - Pure Go executable with no CGO, no runtime dependencies
  • Low Resource Consumption - Works within 1GB RAM, < 2 second startup time
  • Real-time Updates - Server-Sent Events (SSE) for live order tracking
  • Mobile-first Design - Responsive web UI optimized for customer ordering
  • Role-based Access - Customer (anonymous), Waiter (PIN), Admin (email/password)
  • Clean Architecture - TDD approach with 95%+ test coverage on core components

Technical Implementation Link to heading

Architecture Link to heading

The project follows clean architecture principles with distinct layers:

Domain → Repository → Handler
LayerResponsibility
DomainBusiness logic, models, interfaces
RepositoryData access via sqlc-generated code
HandlerHTTP handlers, SSE, middleware

Technologies Link to heading

CategoryStack
BackendGo 1.22+, Chi Router, golang-jwt
DatabaseSQLite (modernc.org/sqlite - pure Go)
Query Gensqlc (type-safe SQL)
Migrationsgoose
Frontendtempl + templui + HTMX + Alpine.js
StylingTailwind CSS via CDN

Order Status Flow Link to heading

pending → confirmed → preparing → ready → completed
    ↘                                  ↗
      → cancelled ←←←←←←←←←←←←←←←←←←←

Development Highlights Link to heading

  • Test-Driven Development - Tests written before implementation
  • Race Detection - All tests pass with -race flag
  • Pre-commit Hooks - Format → Test → Lint pipeline
  • Conventional Commits - Structured git history

Test Coverage Link to heading

PackageCoverage
internal/auth95.7%
internal/domain90.9%
internal/repository85.4%
internal/config100%

Project Status Link to heading

PhaseStatus
Foundation✅ Complete
Core Backend✅ Complete
API Layer✅ Complete
Frontend✅ Complete
Testing✅ Complete
Raspberry Pi Deployment⏳ Pending

Lessons Learned Link to heading

  • SQLite with pure Go drivers enables truly portable single-binary deployments
  • HTMX + templ provides an excellent developer experience for server-rendered apps
  • SSE is simpler than WebSockets for unidirectional real-time updates
  • Clean architecture pays dividends in testability and maintainability