Platform architecture · .NET 8 · NATS

MFcore

Multi Folder Core — a way of building software as self-contained module "legos" that communicate over a message backbone, so any single module can be deleted and rewritten without breaking anything else.

Role
Architect & developer
Stack
.NET 8 · NATS JetStream · Blazor
Domain
Modular platform architecture
Status
Actively developed
MFcore Command Center — live module health, system diagnostics, and telemetry
The Command Center — live module fleet, health, and telemetry
MFcore Ecosystem Monitor — fleet health, module grid, and telemetry
The Ecosystem Monitor — every module in the fleet, its status, and live telemetry
MFcore in motion — the ecosystem running live
30+ self-contained modules
4 tiers of isolation
0 shared state between modules
NATS JetStream backbone

The problem it solves

The long-standing problem with software isn't the software — it's the development process itself. Codebases grow into tangled monoliths, a change in one area breaks another, and the whole system slowly degrades. Every large project I've inherited or maintained has had some version of this disease.

MFcore (short for Multi Folder Core) is my answer: an architecture where the only hard requirement is a small CORE layer, and everything else is an independent folder — a module — that plugs in, does one job, and can be ripped out and replaced at any time without touching a single line of the rest of the system.

The "way" more than the code

MFcore is less a product and more a discipline. The rules — one folder per module, no cross-folder dependencies, message-only communication, identity-verified connections — are the product. The C# implementation is just the first proof.

How the layers fit together

The system is split into four tiers. Modules in different tiers never talk directly — every message flows through a NATS JetStream backbone, which acts as both post office and firewall.

TierJobExamples
COREIdentity, registry, and health — the only mandatory layerMF.Core.IAM, MF.Core.Registrar, MF.Core.Contracts
ACTActive execution workers — database reads/writes, commands, integrationsCommandCenter, DBRead, DBWrite, EmailSender, GpsReceiver, Tailscale, ModHunter
LALogic assistance — background automation and data manipulationWeather, NewsIngester, SecAdvisories, LiquidityScanner, the MarketScan scanner family
APPVisual & interactive — serves websites, dashboards, and portalsServiceMonitor, ThreatPortal, DbViewer, GeoFence, ComsCenter, MarketScan UI, RemoteViewer

Modules identify themselves

Every module declares an immutable SacDefinition at boot: who it is, which tier it belongs to, exactly which message subjects it publishes and subscribes to, and what it depends on. The Registrar verifies those declarations and maps them into NATS KV stores under a sac.{ModuleId} registry key. A module can't accidentally reach into conversations it wasn't built for — its surface area is declared up front and enforced cryptographically.

Zero-trust isolation

No module has direct network access to another — not even by accident. Every connection is authenticated with NATS decentralized NKeys and JWTs: each module carries an encrypted private seed, proves its identity at boot, and receives scoped publish/subscribe permissions. An ACT-tier worker is cryptographically blocked from subscribing to MF.CORE.> administrative subjects, no matter what its code tries to do.

Tokens expire and refresh automatically — a TokenStore requests a fresh JWT at 80% of token lifetime, and reconnect callbacks always present the freshest credentials. The practical result: compromising one component leaves the rest of the system isolated and untouched.

Self-monitoring by default

Modules register status in KV keys with a 90-second TTL, so a crashed module stops being "online" within seconds — no polling, no manual health checks. Dependency watching is reactive: modules subscribe to their dependencies' status keys and react to changes the moment they happen.

MFcore Command Center — live telemetry, module fleet list, and log stream
The Command Center console — 36/50 modules online, live log stream, weather and news feeds pulled in by the LA-tier collectors
MFcore Command Center module detail view with dedicated log terminal
Drill into any module — autostart policy, SAC contract spec, session log counts, and its own dedicated log terminal
MFcore DbViewer browsing the gps_locations telemetry table
DbViewer — browsing the live gps_locations table, 39,543 rows written by MF.Act.GpsReceiver

What the modules actually do

The tier structure isn't theoretical — the fleet runs real work:

  • MarketScan Orchestrator — an algorithmic trade scanner whose scoring scanners (relative strength, opening range, accumulation, growth, value) each run as their own LA-tier module, publishing candidates to a shared pipeline.
  • ThreatPortal — a canonical security feed aggregating CVEs, CISA KEV alerts, and advisories into one searchable portal.
  • ServiceMonitor & Ecosystem Monitor — the system watching itself: per-module CPU, memory, network, and status across the whole fleet.
  • GeoFence + GpsReceiver — location-triggered automation with rules and telemetry stores.
  • WrenAI — an AI integration module, dropped in like any other folder.
  • Weather, NewsIngester, SecAdvisories, CommunitySignal — always-on background collectors feeding the canonical data stores.
MarketScan Orchestrator — live trade candidates and daily summaries
MarketScan Orchestrator — one APP-tier module consuming a family of LA-tier scanners
MFcore ThreatPortal — security intelligence aggregation
ThreatPortal — CVEs, CISA KEV alerts, and advisories in one canonical feed

The fleet's own interfaces

Every APP-tier module serves its own UI — same pattern, different job. These are all live, captured from a running fleet:

MFcore ComsCenter — all-bands communications monitor with weather and WiFi scanning
ComsCenter — an all-bands comms monitor: WiFi/network/Bluetooth scanning alongside local weather, one APP module wired to its LA collectors
MFcore GpsReceiver — OwnTracks setup guide and real-time map routing
GpsReceiver — an MQTT/JWT telemetry server with an OwnTracks phone setup guide and live map routing over the Tailscale mesh
MFcore GeoFence — zone configuration and geospatial rule deployment
GeoFence — define radial or polygon zones, set enter/exit trigger conditions, and deploy geofence rules to the fleet
MFcore Tailscale module — tailnet identity, peers mesh, and tunnel diagnostics
Tailscale — tailnet identity, the peer mesh with per-device test pings, and a tunnel diagnostics console
MFcore EmailNotifier — alert rule configurator with anti-spam analytics
EmailNotifier — alert rules driven by telemetry triggers (CVSS thresholds, template placeholders) with anti-spam cooldowns and dispatch audits
MFcore WrenAI — proximity intelligence chat interface
WrenAI — an AI integration module dropped in like any other folder: ask natural-language questions about nearby device telemetry

Why folders beat monoliths

The whole design optimizes for one metric: how cheap is it to change in five years?

  • Hot-swappable — delete an entire module folder and replace it with a new implementation, in any language, without changing a line elsewhere. Because communication is message-based, the replacement just needs to speak the same subjects.
  • Debuggable in isolation — a module folder is a couple thousand lines, not a warehouse. Turn off everything else, send it test messages, watch it behave. No live database or production network required — a local NATS Docker container is the whole test rig.
  • Crash shielding — a background service that runs out of memory takes itself down, not the system. The backbone holds queued data and registers the offline status until it's back.
  • Environment-agnostic — no cloud lock-in. The same fleet runs on a local machine, a WSL2/Docker host, or a dedicated server, and moves wherever the hardware economics make sense.
Health metricDesign target
Cross-folder dependenciesZero — enforced, not encouraged
Hot-swap a moduleUnder 15 seconds, no recompile of the rest
Crash detectionWithin one 90-second status TTL
Failed message handlingDead-letter queue, 3 delivery attempts before termination

Audited, not assumed

A formal verification audit was run against the first phase, and the findings drove a fix roadmap before any production use: real cryptographic JWT signing in IAM (replacing a stub), genuine database connection pooling (replacing simulated delays), TTL enforcement on status keys, dynamic reconnect auth callbacks, and true JetStream queue-group load balancing. The architecture is treated as a living thing that gets verified, not a diagram that gets trusted.

Status

MFcore is under active development and running locally as a live fleet — 36 of 50 registered modules online with the Command Center, Ecosystem Monitor, DbViewer, MarketScan, and ThreatPortal all operational. It's the platform my next generation of shop-floor and data tools is being built on: the module that auto-draws plate pipe supports, the BOM-vs-CAD verification agent, and the rest of the pipeline all plug into this same spine.

Related projects