Storefront is the critical public revenue, product catalog, autonomous optimization, and conversion telemetry gateway in the Hardonia / AI Automated Systems sovereign software stack.
It presents an ultra-fast, local-first catalog of air-gapped AI tools, autonomous workflow suites, deterministic governance packages, and private GPU compute instances β backed by local SQLite persistence, zero cloud analytics leaks, Bayesian multi-armed bandit learning, offline cryptographic license issuance, and strict browser security defenses.
Storefront is built as a domain-driven, modular FastAPI application decoupled into clean layers:
storefront/
βββ app/
β βββ core/ # Core foundations & runtime configuration
β β βββ config.py # Typed Pydantic Settings & stack connective tissue
β β βββ database.py # SQLite connection pool with WAL mode & 15s timeout
β β βββ security.py # HMAC-SHA256 tokens, URL defense, license signing
β β βββ templates.py # Jinja2 environment & custom filters
β β
β βββ middleware/ # High-performance ASGI middleware stack
β β βββ security_headers.py# CSP, X-Frame-Options: DENY, Referrer & Permission policies
β β βββ cors_and_limits.py # Strict CORS origin allowlist & 64KB payload bounds
β β βββ rate_limiter.py # Per-IP token bucket rate limiting with honeypot traps
β β βββ cache_control.py # Immutable asset caching & no-store payment controls
β β βββ request_context.py # Session resolution, request tracking, bot classification
β β
β βββ services/ # Autonomous & business domain services
β β βββ finetuning_service.py # LoRA/QLoRA VRAM budgeting, dataset token sizing, Unsloth recipes
β β βββ benchmark_service.py # TTFT, TPS throughput, quantization retention & KV cache scaling
β β βββ bandit_service.py # Bayesian Beta-Bernoulli Thompson Sampling bandit
β β βββ anomaly_detector.py # Real-time funnel anomaly & conversion stall detector
β β βββ stack_bridge.py # revenue-os, Hermes Ops Nerve Center, Model Zoo & Compute API bridge
β β βββ demand_intelligence.py# Customer inquiry mining & intent gap signals
β β βββ license_service.py # Air-gapped cryptographic software license engine
β β βββ product_service.py # Catalog querying, sorting, enrichment
β β βββ analytics_service.py # SQLite events & aggregation
β β
β βββ routers/ # Domain-driven API & web controllers
β β βββ catalog.py # Home grid, capability filtering, /p/{slug}, /pricing
β β βββ finetuning.py # /tools/finetuning-optimizer, /api/tools/finetune-estimate, recipe export
β β βββ tools.py # /tools/model-benchmarks, /tools/stack-matrix, /tools/redaction-sandbox, /tools/hardware-sizer
β β βββ blueprint.py # Tailored Sovereign Architecture Blueprint generator (/blueprint/{token})
β β βββ commerce.py # Checkout routing, /buyer locker, /order/success, /download/{slug}
β β βββ api_products.py # Public sanitized JSON product catalog
β β βββ api_leads.py # Lead capture, newsletter subscribe, queued privacy erasure
β β βββ api_analytics.py # Privacy funnel truth ingestion, conversion metrics
β β βββ api_flags.py # Live feature flags, A/B experiments, /api/flags/bandit report
β β βββ api_support.py # AI support assistant proxy & /support-widget.js
β β βββ status.py # /health, /status.json, /proof-score, /api/stack/fleet
β β βββ legal.py # Markdown legal reader with directory traversal protection
β β βββ blog.py # Local AI ops field notes & RSS feed
β β βββ seo.py # robots.txt, sitemap.xml, llms.txt, IndexNow, Google verification
β β βββ private_ai_ops.py # Private AI operations landing & synthetic demo suite
β β
β βββ main.py # Application entrypoint & middleware assembly
β
βββ static/ # Fast static CSS, JS, SVGs, and landing assets
βββ tests/ # 100% passing test suite (121 contracts)
β βββ test_finetuning_service.py
β βββ test_benchmark_service.py
β βββ test_expanded_tools_routes.py
β βββ test_threat_model_qa.py
β βββ test_bandit_service.py
β βββ test_anomaly_detector.py
β βββ test_interactive_tools.py
β βββ test_buyer_locker.py
β βββ test_storefront.py
β βββ test_flags.py
β βββ test_funnel_truth.py
β βββ test_private_ai_operations_public.py
β βββ test_observability.py
β βββ test_security_contract.py
β
βββ scripts/ # Operational & developer tooling
β βββ healthcheck.py # CLI deployment health validator
β βββ simulate_stack_bridge.py # Sovereign stack bridge & fleet telemetry probe
β βββ run_bandit_evaluation.py # Thompson Sampling Monte Carlo audit
β βββ seed_sample_catalog.py # Sample catalog seeder
β
βββ systemd/ # Native Linux systemd service unit
β βββ storefront.service
βββ Dockerfile # Multi-stage hardened production container
βββ docker-compose.yml # Containerized orchestration
βββ run.ps1 # PowerShell launcher (Windows)
βββ run.sh # Bash launcher (Linux/macOS)
- Replaces static A/B testing with continuous Bayesian optimization for headlines (
hero_variant) and CTAs (cta_variant). - Samples from
$\text{Beta}(1 + \alpha, 1 + \beta)$ posteriors to balance exploration with exploitation. -
Autonomous Winner Promotion: When a variant reaches
$\ge 99%$ win probability with sufficient sample size, Storefront automatically pins the winning copy without manual intervention.
- Monitors conversion funnels (
landing$\to$ lead_start$\to$ checkout_start$\to$ provider_payment). - Emits structured operational alerts if checkout abandonment spikes or if 5xx errors surge.
- Sentinel Redaction Sandbox (
/tools/redaction-sandbox): Live regex/WASM sanitization demo for HIPAA/GDPR clinical and legal notes. - LLM Hardware Topology Sizer (
/tools/hardware-sizer): Calculates exact VRAM requirements, KV cache overhead, GPU topologies, and power budgets for Llama-3, DeepSeek, and Mistral. - Dynamic Architecture Blueprint (
/blueprint/{token}): Generates personalized enterprise deployment plans on the fly.
- Issues HMAC-SHA256 signed software license certificates (
.lic) for purchased suites. - Buyer Locker (
/buyer) allows verified operators to view entitlement portfolios and download signed update bundles.
Windows PowerShell:
.\run.ps1Linux / macOS:
./run.shServer runs on http://127.0.0.1:8020.
python scripts/simulate_stack_bridge.pyuv run --with pytest --with httpx pytestResult: 105 / 105 tests passing (100% pass rate).
Part of the Hardonia Sovereign AI Operating Stack. Built for independent operators who demand verifiable execution, complete local ownership, and zero data leakage.
