Skip to content

whale-net/everything

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

329 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Everything Monorepo

A modern Bazel monorepo supporting Python, Go, and embedded C++ firmware development with automated release management, Helm chart generation, and multi-platform container builds.

🌟 Key Features

  • Multi-Language Support: Python, Go, and embedded C++ with shared libraries
  • Automated Releases: Intelligent change detection and selective app releases
  • Container Native: Multi-platform Docker images (AMD64/ARM64) with OCI standards
  • Helm Integration: Automatic Kubernetes chart generation from app metadata
  • CI/CD Pipeline: GitHub Actions with parallel builds and comprehensive testing
  • Bazel-First: Fast, cacheable builds with dependency management

πŸ—οΈ Architecture

everything/
β”œβ”€β”€ manman/                  # ManMan - Game server orchestration system
β”‚   β”œβ”€β”€ src/                # Python services (APIs, workers, migrations)
β”‚   └── management-ui/      # Go-based HTMX management interface
β”œβ”€β”€ friendly_computing_machine/  # Slack bot with Temporal workflows
β”œβ”€β”€ firmware/                # Embedded C++ application layer (board-agnostic)
β”‚   β”œβ”€β”€ sensor/             # ISensor interface + host-side test mocks
β”‚   β”œβ”€β”€ mqtt/               # MQTTWriter (zero-allocation) + IPublisher
β”‚   β”œβ”€β”€ network/            # Wi-Fi + MQTT state machine (non-blocking)
β”‚   └── timing/             # pw_chrono-based loop timer (replaces delay())
β”œβ”€β”€ demo/                    # Example applications
β”‚   β”œβ”€β”€ blink/              # ESP32 blink demo (pw_log + esptool flash target)
β”‚   └── hello_*/            # Go / Python / gRPC examples
β”œβ”€β”€ libs/                    # Shared libraries
β”‚   β”œβ”€β”€ python/             # Python libs (alembic, cli, gunicorn, logging, postgres, rmq, retry)
β”‚   └── go/                 # Go libs (htmxauth)
β”œβ”€β”€ generated/              # Generated OpenAPI clients (py/, go/)
β”œβ”€β”€ tools/                   # Build and release tooling
β”‚   β”œβ”€β”€ firmware/           # ESP32 cc_toolchain, board constraints, flash infra
β”‚   β”œβ”€β”€ bazel/              # Shared Bazel macros (esp32_firmware(), etc.)
β”‚   β”œβ”€β”€ helm/               # Helm chart generation
β”‚   β”œβ”€β”€ release_helper/     # Release automation
β”‚   └── tilt/               # Local development with Tilt
β”œβ”€β”€ docs/                    # Documentation
β”œβ”€β”€ .github/workflows/      # CI/CD pipelines
β”œβ”€β”€ BUILD.bazel             # Root build configuration
└── MODULE.bazel            # External dependencies (incl. Pigweed, Xtensa GCC)

Core Principles:

  • Bazel-First Architecture: All operations use Bazel for consistency
  • True Cross-Compilation: Platform transitions for correct ARM64 wheel selection
  • Monorepo Structure: Multiple apps and shared libraries in a single repository
  • Release Automation: Comprehensive CI/CD with intelligent change detection

Main Projects

Project Description Documentation
ManMan Game server orchestration (V2 Go + V1 Python legacy) MANMAN_STRUCTURE.md, manmanv2/README.md
Friendly Computing Machine Slack bot with Temporal workflow support friendly_computing_machine/README.md
Firmware ESP32 embedded firmware (Pigweed + Arduino core + Bazel cc_toolchain) tools/firmware/README.md, firmware/README.md

πŸš€ Quick Start

Prerequisites

  • Bazel 8.3+ with bzlmod support
  • usbipd-win (WSL2 only, for ESP32 flashing β€” see tools/firmware/README.md)
  • Docker (for container images)
  • Git (for version control)
  • Python Virtual Environment (recommended)

Installation

# Install Bazelisk (manages Bazel versions)
brew install bazelisk

# Verify installation
bazel version

# Create Python virtual environment
uv venv && source .venv/bin/activate

Build and Test

# Build everything
bazel build //...

# Run tests
bazel test //...

# Run example apps
bazel run //demo/hello_python:hello-python
bazel run //demo/hello_go:hello-go

Verify Setup

# Check Bazel version
bazel version

# Test build system
bazel build //demo/hello_python:hello-python

# Verify release system
bazel query "kind('app_metadata', //...)"

For complete setup instructions, see: docs/SETUP.md

πŸ“š Documentation

Comprehensive guides for working with the monorepo:

Additional resources:

🎯 Common Tasks

Adding a New Python App

mkdir my_python_app
cd my_python_app
# Create main.py, test_main.py, __init__.py, BUILD.bazel

See the complete guide: docs/DEVELOPMENT.md

Adding Dependencies

# Add to pyproject.toml
uv lock --python 3.13
# Use @pypi//:package-name in BUILD.bazel

See the complete guide: docs/DEPENDENCIES.md

Building and Running Apps

# Build an app
bazel build //path/to/app:app_name

# Run an app
bazel run //path/to/app:app_name

# Test an app
bazel test //path/to/app:test_target

Building and Flashing Firmware (ESP32)

# Host-side tests β€” runs on your machine, no board needed
bazel test //firmware/...
bazel test //demo/blink:blink_logic_test

# Build flashable image (requires --config=esp32)
bazel build //demo/blink:blink_bin --config=esp32

# Flash to board (WSL2: attach CP2102 via usbipd first)
bazel run //demo/blink:flash -- /dev/ttyUSB0

See tools/firmware/README.md for toolchain details and adding new boards.

Releasing Apps

Use GitHub Actions UI (recommended):

  1. Go to Actions β†’ Release workflow
  2. Specify apps and version
  3. Run with or without dry-run

See the complete guide: docs/RELEASE.md

🀝 Contributing & Support

Getting Help

Repository Structure

β”œβ”€β”€ manman/                # ManMan - Game server orchestration
β”œβ”€β”€ friendly_computing_machine/  # Slack bot with Temporal
β”œβ”€β”€ demo/                  # Example applications
β”œβ”€β”€ libs/                  # Shared libraries (python/, go/)
β”œβ”€β”€ generated/            # Generated OpenAPI clients
β”œβ”€β”€ tools/                 # Build and release tooling
β”œβ”€β”€ docs/                  # Documentation
β”œβ”€β”€ .github/workflows/     # CI/CD workflows
β”œβ”€β”€ BUILD.bazel           # Root build configuration
└── MODULE.bazel          # External dependencies

Future Improvements

Areas that could be enhanced:

  • Enhanced Go Support: Enable gazelle rules for better Go dependency management
  • Testing Strategy: Expand test utilities and integration testing capabilities
  • Documentation: Auto-generation from code for better consistency