
Lunaar Vision
AI Visual-Commerce Engine and Public API
Overview
Lunaar Vision is the production .NET 9 backend behind the Lunaar visual-commerce AI platform. Built as two independent Clean Architecture surfaces on a shared core, it powers both the consumer product and a developer-facing Public API that resells the same AI engine over API keys, a credit balance and an MCP tool surface. All heavy AI work runs asynchronously through a RabbitMQ pipeline with dedicated worker processes.
What It Does
It exposes ten distinct AI visual services and runs each request as an async, credit-metered job: the caller is charged, the job is queued to RabbitMQ, a worker calls the AI model and stores the result to S3, and the client is updated live over Server-Sent Events. Beyond generation, it handles authentication, subscriptions and payments, an affiliate program, rate limiting and reliable delivery, so front-ends and external developers consume finished capabilities rather than raw ML plumbing.
Key Features
Ten AI services: sketch-to-render, apparel/studio try-on and poses, jewelry and glasses try-on, product shots and variants, food visuals, image-to-3D, 3D-to-AR (GLB to USDZ) and image upscaling
Public API product that resells the engine to external developers via X-Api-Key auth, per-call credit costs and audit logging
MCP integration: a manifest-driven surface exposing 13 MCP tools that map to REST endpoints, gated by API key and credits
Credit economy with an atomic, ledgered wallet and idempotent refunds that are automatically restored when a provider call fails
Subscriptions and payments through iyzico, including saved cards, renewals, coupons/promotions and an in-house tiered-commission affiliate program
Multi-provider auth: JWT bearer plus Google OAuth on the consumer API, and a dual API-key + developer-JWT scheme on the Public API
Async generation over a RabbitMQ topic exchange with per-service consumers and live status streamed via Server-Sent Events
Per-user, multi-period rate limiting on the consumer API and per-API-key fixed-window limiting on the Public API
Technical Highlights
Key Achievements
Turned a single AI engine into two products - a consumer backend and a monetized, API-key + MCP developer platform - from one shared codebase
Guaranteed no credit is lost on failure through idempotent refunds plus outbox delivery and scheduled refund-recovery jobs
Scaled long-running AI generation with an event-driven queue, per-service worker consumers and live SSE status updates
Shipped a full commerce layer: iyzico subscriptions and saved cards, coupons/promotions, and a tiered-commission affiliate program with payout exports
Operationalized the platform with separate worker processes, Kubernetes deployments, Loki logging and real readiness health checks
Impact & Results
Lunaar Vision is the engine the entire Lunaar ecosystem runs on, and the layer that makes the AI itself a sellable product through the Public API, API keys and MCP. It demonstrates end-to-end command of Clean Architecture, event-driven distributed systems, the outbox pattern, NoSQL data design and production-grade payment, auth and observability concerns.