Architecture & Evolutionary Roadmap

A Local-First, Modular Gateway for Sovereign Operations

Designed for engineers who value zero-bloat binaries, standard library idioms, and complete ownership of their data layer.

1. The Master Gateway & Sub-Mux Plugin Pattern

MARS is anchored by a lightweight Go master router (mars.go). Abandoning heavy frameworks and microservice sprawl, every applet implements a single uniform Go interface—exposing a self-contained http.Handler with its own templates, routes, and static file server.

// Uniform MARS Microapp Contract
plannerHandler := planner.NewHandler("planner.db")
mux.Handle("/planner/", plannerHandler)

watchlistHandler := watchlist.NewHandler("watchlist.db")
mux.Handle("/watchlist/", watchlistHandler)

propertyHandler := property.NewHandler("./property.db")
mux.Handle("/property/", http.StripPrefix("/property", propertyHandler))

Because each module encapsulates its own attachment file server (e.g., /watchlist/attachments/{SYMBOL}/), adding or removing an applet requires zero global route pollution.

2. The Data Layer & tinybd

For developers who treat SQLite as a Swiss-army knife, tinybd occupies a complementary niche: it strips away relational schemas, SQL parsing overhead, and CGO bindings in favor of an ultra-lean, pure-Go embedded document store.

3. Cryptographic Isolation & Encryption at Rest

Every tinybd vault is initialized with a domain-specific cryptographic key at the microapp boundary. Writes use authenticated symmetric encryption (AES-256-GCM variant): structured payloads are serialized, paired with a cryptographically random nonce, and sealed before touching disk.

Even if a backup archive or physical drive is misplaced, the underlying *.db files remain opaque ciphertext at rest—while remaining effortlessly portable when paired with your recovery key.

4. Open-Core & Three-Tier Distribution Roadmap

How MARS scales from a single personal workstation to a shareable open ecosystem.

TIER 1

The Sovereign Capsule

Zip the complete directory tree—compiled binary, encrypted *.db vaults, and attachment folders—to hand off an entire estate or project archive to a trusted family member.

TIER 2

Open Modular Core

Publish the core MARS gateway and plugin specification under an open license so developers can roll their own constellations or contribute community microapps.

TIER 3

Surgical Data Exchange

Share individual YAML records, ticker dossiers, or clean-formatted notes between independent MARS nodes—or into standard editors via Copy Clean.