Technical Architecture

How Louie Is Built

What runs where, what you're acquiring, and why the architecture matters. Written for engineering diligence teams.

Stack

Technology Stack

RuntimeNode.js 20 LTS (.nvmrc pinned)
FrameworkExpress.js — single entry point (server.js), 163 route files
DatabaseSQLite via better-sqlite3 (WAL mode) · Postgres migration schema complete
FrontendVanilla JS/HTML — no framework, no build step, no transpilation
ProcessPM2 cluster mode · zero-downtime reload
DeploymentUbuntu 22.04 VPS · nginx reverse proxy · Let's Encrypt SSL
DesktopElectron packaging (Win/Mac/Linux) · asar bundled · native modules unpacked
AI InferenceAnthropic Claude API (sonnet-4-6 agentic · haiku-4-5 real-time chat)
CommsTwilio / Telnyx — pluggable provider layer (swap via config)
AuthJWT (jsonwebtoken) · requireAuth middleware · TOTP QR for time clock
Data Flow

System Architecture

← on-premises / dealer's server →
YOUR SERVER
Express.js
163 route modules
SQLite DBs (8)
WAL · LUKS encrypted
PM2 Cluster
Zero-downtime reload
Louie Knowledge Base
21,700-token automotive expertise · FTC/TILA/ECOA verbatim · Leadership frameworks · Injected into every AI call
Your Operational Data
Deals · Lenders · Customers · Payroll · Inventory · Service ROs · BHPH Portfolio
↓ optional API calls only (dealer's own credentials)
External Services (Optional)
Claude API (Anthropic)
Twilio / Telnyx
MarketCheck (book values)
Google / Meta Ads
700Credit / SoftPull
Stripe (purchase)
All external calls use the dealer's own API credentials — Louie holds no keys
Layers

Architecture Detail

Data Layer
8 SQLite databases: louieauto.db (primary), simulation.db, bdc.db, hr.db, service.db, parts.db, chat.db, network.db. WAL mode + busy_timeout=5000 on every connection. AES-256 at rest via LUKS encrypted volume. Postgres migration schema complete — 599 tables mapped, ready for multi-tenant scale on acquirer infrastructure.
API Layer
163 Express route files. Single mount point (_mount.js) — one file to understand all routes. JWT auth gates all /api/* endpoints. Whitelist of public routes (demo, chat, punch QR). Multi-rooftop isolation: every query filters by dealershipId(req). No shared data between tenants.
AI Layer
Anthropic Claude sonnet-4-6 for agentic reasoning (tool-use loop in brain-agent.js). Haiku-4-5 for real-time customer chat. 21,700-token industry knowledge base injected into every system prompt — FTC CARS Rule, TILA, ECOA, BHPH economics, leadership frameworks. Core platform runs without any API key.
Security
LUKS encrypted data volume (AES-256). FTC Safeguards Rule compliance tracker. TOTP-style rotating QR time clock (2-minute windows, HMAC-SHA256). Webcam photo on every punch. Geofenced clock-in (GPS Haversine). JWT with configurable expiry. Rate limiting on all public endpoints. No customer PII leaves the server.
Deployment
Single PM2 cluster process — pm2 reload for zero-downtime updates. nginx reverse proxy + SSL (Let's Encrypt auto-renew). Electron desktop app packaged via CI (GitHub Actions electron-build.yml). Win/Mac/Linux installers. No Docker required. Local install runs the identical codebase as the demo server.
Integration Points
Pluggable provider architecture throughout. SMS/voice: Twilio or Telnyx (swap via .env). Credit bureau: 700Credit or SoftPull (mock-until-key). Ad platforms: Google Ads API + Meta Marketing API. MarketCheck for live book values (MARKETCHECK_API_KEY). DMS integration: CSV-via-email today; legacy DMS/legacy CRM software/legacy DMS providers APIs built, gated by vendor agreement transfer.
What You're Acquiring

IP Assets

Technical Diligence Package Available

Full codebase access, architecture deep-dive, and integration roadmap for qualified acquirers.

Contact Brian → brian@louieauto.com