Sovereign Systems ArchitectureFull-Stack Engineering Case Study

Citadel OS (Portfolio & Control Plane)

The centralized control system and sovereign monitoring platform powering this portfolio ecosystem. Features PROmonitor—a virtual web workstation (/os) with real-time uptime monitoring, telemetry SDK log streaming, SRE AI crash diagnostics, and autonomous GitHub sync.

Full Stack Infrastructure & PROmonitor SRE OSLive System
https://samuelstanley.com● verified system
Citadel OS (Portfolio & Control Plane) interface preview
Technical Case Study

Viewing System

Citadel OS (Portfolio & Control Plane)

ProjectsExecutive Summary
01

Executive Summary

The Business Challenge

Managing multiple client deployments, tracking SSL expirations, intercepting runtime JS crashes, and publishing technical research typically require fragmented third-party SaaS tools, high monthly subscription costs, and manual monitoring.

The Architectural Solution

Citadel OS unifies real-time client health telemetry (/monitor-sdk.js), an interactive PROmonitor virtual workspace (/os) with SRE AI diagnostics via Gemini, automated GitHub repository syncing, and an autonomous AI publishing engine into a single Next.js 16 platform with zero external SaaS dependencies.

Core Capabilities & System Highlights

Web OS Workstation01

PROmonitor Virtual Workstation (/os)

A fully responsive, windowed desktop workspace housing an Uptime Monitor, Log Terminal, Client Registry, Webhook Alert Manager, and SRE AI Diagnostics Engine.

Client Telemetry02

Automated Telemetry SDK (/monitor-sdk.js)

A lightweight client SDK script capturing page view transitions, click breadcrumbs, console warnings/errors, and window-level crash stack traces.

AI Diagnostics03

SRE AI Diagnostics Engine

Analyzes client-side JavaScript crash stack traces using Gemini LLMs to generate instant root-cause summaries and step-by-step code repair recommendations.

Alerting Pipeline04

Webhook Alert Pipeline

Dispatches instant alerts to configured Discord or Slack channels when client target sites experience offline downtime or fatal exceptions.

02

System Architecture & Specs

Frontend & Web OS
Next.js 16React 19TypeScriptTailwindCSS v4Lucide React

Next.js 16 App Router & Draggable Window Manager

React 19 Server Components with Turbopack for sub-100ms render times, combined with desktop glassmorphism window management and responsive mobile fallbacks.

Backend & Telemetry API
Node.jsTypeScriptPrisma ORMREST API

Server Actions & Telemetry API Middleware

Type-safe REST endpoints and Next.js Server Actions handling client pings, log ingestion, and GitHub Webhook synchronization.

Database Layer
PostgreSQLPrisma ORMNeon DB

PostgreSQL & Prisma Client Schema

Relational database schema storing client site records, telemetry execution logs, post metrics, and GitHub repository state with transactional safety.

Automation & DevOps
GitHub ActionsGemini APIVercelDocker

GitHub Actions & Cron Workflows

Automated daily crons executing headless scrapers, multi-model AI synthesis, and direct repository commits for immutable post history.

Key Engineering Trade-offs & Operational Notes

01. One engine, separate concerns

Portfolio presentation, client health monitoring, and AI content creation share a single codebase while maintaining strict modular separation.

02. Repository-backed persistence

Published articles and project listings remain version-controlled in Git, ensuring every edit has a clean historical audit trail.

03. Resilient fallback architecture

The AI generation pipeline seamlessly switches between LLM models if a primary endpoint experiences throttling.

03

Tech Stack & Role Matrix

Every library and framework in Citadel OS (Portfolio & Control Plane) was chosen with intentional architectural trade-offs to balance speed, type safety, security, and scalability.

TechnologyCategorySystem RolePerformance Rationale
Next.js 16FrameworkFull-Stack App Router & Server ComponentsDelivers maximum rendering performance, instant static generation, and unified edge API routes.
TypeScriptLanguageEnd-to-End Type SafetyEliminates runtime errors across database models, API payloads, and component props.
Prisma ORMORMDatabase Access Layer & MigrationsProvides type-safe queries and automated migration scripts for PostgreSQL.
PostgreSQLDatabaseRelational Data StoreStores client sites, diagnostic logs, post metrics, and GitHub sync records with ACID compliance.
Gemini AIAI / MLSRE Diagnostics & Automated ContentHigh-speed LLM inference with structured JSON output and cost-effective multi-model fallback.
TailwindCSS v4UI LibraryModern Styling EngineProvides zero-runtime utility styling and custom CSS design tokens for dark/light themes.
04

Live Preview & Showcase

samuelstanley.com
Citadel OS (Portfolio & Control Plane) live homepage
Automatically capturedCitadel OS (Portfolio & Control Plane) homepage previewOpen live product ↗
05

Metrics & Reliability

99.95%

Uptime SLA

Continuous HTTP & SSL diagnostic ping checks across client sites

< 85ms

Render Latency

Server Component static generation with Turbopack compilation

< 4KB

Telemetry Overheads

Ultra-lightweight asynchronous client monitoring SDK script

Start a Project

Ready to engineer your next product?

Available for full-stack web applications, SaaS platform development, and senior technical consulting.