Sonora Digital Corp — System Architecture

MVP v1.0 • OVH VPS Self-Hosted • 2026-07-15

Users Browser / Mobile Admin Laptop SSH Tunnel :8085 HTTP OVH VPS — sdc-prod (149.56.46.173) Landing Pública HTML + Tailwind CDN GET / Dashboard SPA React + Vite + shadcn/ui TanStack Query + Router /dashboard/* Pack Gateway FastAPI + Uvicorn main.py · chat.py · auth.py security.py · models.py supabase_client.py :8085 — systemd Auth & Security JWT Validation (PyJWT) 7 Security Headers Admin API Leads CRUD OpenRouter API LLM Inference (Free models) Pack Registry 2 packs · YAML config chat completions JWT verify fetch + JWT validate Supabase Self-Hosted (Docker Compose — 10 containers) Kong API Gateway :8000 REST via ANON_KEY / SERVICE_KEY GoTrue Auth Service PostgREST RESTful API PostgreSQL 17 :5433 Realtime WebSocket Storage File/Image Studio Supabase UI Imgproxy Image Opt. Tables: chat_history leads ★ niches ★ product_packs ★ joyeria_productos joyeria_cotizaciones ★ = creadas hoy (2026-07-15) Legend Frontend Backend Database Security External Auth Flow

Frontend

  • • React 18 + Vite 5 + TypeScript
  • • shadcn/ui + Tailwind + Design Tokens SDC
  • • TanStack Query v5 + react-router-dom v6
  • • Zod v4 + react-hook-form
  • • Landing: HTML + Tailwind CDN (sin framework)

Backend

  • • FastAPI + Uvicorn (systemd, puerto 8085)
  • • 14 endpoints públicos + protegidos
  • • JWT validation (PyJWT + HS256)
  • • 7 security headers (CSP, XSS, XFO, etc.)
  • • OpenRouter integration (free LLMs)

Data & Infrastructure

  • • Supabase self-hosted (10 Docker containers)
  • • PostgreSQL 17 (6 tablas, RLS policies)
  • • OVH VPS (Ubuntu 26.04, 5.8GB RAM)
  • • 2 packs registrados (joyeria, musica)
  • • 4 nichos + 4 packs en catálogo público