← BACK TO DOCS

Observability & Ops

Monitoring- en incident workflows uit README_PRODUCTION_DEPLOYMENT.md, DEPLOYMENT_GUIDE.md en infra-notes.

Metrics Stack

  • • Prometheus scrape targets: /metrics (API) & Node Exporter
  • • Grafana dashboards: Core API, Revenue, Livestream QoS
  • • Synthetic load: k6 scripts (tests/load/api-load-test.js)
  • • PM2 process metrics voor bare-metal fallback
sum(rate(teezu_requests_total[5m])) by (route)

Logging & Tracing

  • • Sentry DSN actief voor frontend + backend exceptions
  • • Central log stream (ELK) voor audit & moderation log
  • • Docker logs -f shortcuts voor backend & media
  • • Structured JSON logging met requestId correlatie
docker-compose -f docker-compose.production.yml logs -f backend

Alerting & SLO's

  • • 99.5% uptime SLO · 5m burn alerts → Slack #ops
  • • PagerDuty escalation voor livestream ingest falen
  • • Rate-limit spikes → webhook naar Mod dashboard
  • • Backup cron failures → email (SendGrid)
alert: TeezuHigh5xx

    
                    

Runbooks & Health

  • • Healthchecks: GET /health, GET /api/status
  • • Backups: dagelijkse cron → /backup/*.tar.gz
  • • Disaster: Restore script in backup.sh (MySQL + Mongo)
  • • Firewall hardening via UFW (80/443/22)
curl -s https://api.teezu.online/health | jq '.status'
TeezU Docs
Production Ready v7.0.0 · April 2026

Admin Intelligence Hub

Real-time controlecentrum voor Super Admins en Admins. Monitor community gezondheid, financiële stromen en AI-activiteit.

Total Users
12,450
+12% week
Active Streams
48
Nu Live
Platform Revenue (24h)
€ 8,240
Target: €10k
Reports Pending
12
Avg Action Time: 5m

Mood Distribution

User Growth & Retention

86 REST Endpoints

Volledig gespecificeerd in API_DOCUMENTATION.md en BACKEND_MASTER_SUMMARY.md. JWT vereist, rate-limited en production ready.

Base URL · /api/v1

Auth & Profile · 12

  • POST /auth/login
  • POST /auth/signup
  • GET /auth/me
  • PUT /profile/:id
  • GET /profile/:id/followers

Content & Streams · 22

  • GET /content/feed
  • POST /content/post
  • POST /stream/start
  • GET /stream/active
  • POST /stream/:id/goal

Wallet & Commerce · 14

  • GET /wallet/balance
  • POST /wallet/purchase
  • POST /streams/:id/tip
  • POST /services/book
  • GET /affiliate/stats

AI & Matchmaking · 18

  • POST /ai/genie-request
  • POST /ai/content-coach
  • POST /ai/match-suggestions
  • GET /match/suggestions
  • POST /match/swipe

Rate Limiting & Errors

Standaard 100 requests/min per token met leaky bucket per IP + gebruiker. Responses volgen het uniforme error envelope uit API_DOCUMENTATION.md:

{
    "status": "error",
    "code": "RATE_LIMITED",
    "message": "Te veel requests. Probeer later opnieuw.",
    "retryAfter": 30,
    "requestId": "rl-92af4",
    "meta": {
        "limit": 100,
        "window": "60s"
    }
}

HTTP headers: X-RateLimit-Limit, X-RateLimit-Remaining, Retry-After.

Lucia Auth Session Headers

Alle requests lezen de sessiecookie automatisch (httpOnly, Secure):

Cookie: session=<lucia-session-id>
Content-Type: application/json

Session refresh: automatisch via Lucia middleware · Session invalidation bij logout.

Client Layer
Frontend Web
React 19 + Vite 7
TypeScript 5.9 strict · Tailwind 4
Zustand 5 · TanStack Query v5
Mobile App
React Native (PWA first)
iOS / Android · Standalone
⬇ HTTP / WebSocket ⬇
App Layer
Backend API Gateway (Node.js 22 / Fastify 5)
services/api · Drizzle ORM · Pino logging
Lucia Auth Socket.IO Rate Limit Zod Valid.
⬇ Internal Network ⬇
Data Layer
PostgreSQL 16 Users, Core Data
Redis Cache, Sessions
Pinecone / Weaviate AI Vectors
Media Layer
RTMP Server Port 1935
WebRTC (TURN) Port 3478
Storage (S3) Media Files
Monorepo v3.0 pnpm workspaces + Turborepo · April 2026

System Architecture

Volledige v3.0 tech stack. Monorepo structuur: apps/web (frontend) · services/api (backend) · packages/db (Drizzle schema).

⚛️

Frontend Stack

apps/web
  • React19
  • Vite7
  • TypeScript5.9 strict
  • Tailwind CSS4
  • Zustand5
  • TanStack Queryv5
  • TanStack Routerlatest
  • React Hook Form + Zod
  • Radix UI + Lucide React

Backend Stack

services/api
  • Node.js22 LTS
  • Fastify5 (fast, low overhead)
  • Drizzle ORMtype-safe SQL-first
  • PostgreSQL16
  • Rediscache + pub/sub
  • Socket.IOrealtime
  • Pinostructured logging
  • Lucia Authsession-based
  • bcrypt12 rounds
🏗️

Monorepo & Infra

pnpm workspaces + Turborepo
  • pnpm workspacesorchestration
  • Turborepobuild cache + pipelines
  • apps/webfrontend app
  • services/apibackend API
  • packages/dbDrizzle schema
  • Pinecone / WeaviateVector DB
  • Docker Composeproduction
  • Nginxreverse proxy + TLS
  • VitePWASW + offline

Monorepo Directory Structure

teezu/
├── apps/
│   └── web/                  # React 19 + Vite 7 frontend (apps/web)
├── services/
│   └── api/                  # Fastify 5 + Node.js 22 backend (services/api)
├── packages/
│   ├── db/                   # Drizzle ORM schema + migrations (PostgreSQL 16)
│   ├── types/                # Shared TypeScript types
│   └── ui/                   # Shared Radix UI + Lucide component library
├── turbo.json                # Turborepo pipeline config
└── pnpm-workspace.yaml       # pnpm workspace definition

Auth Flow — Lucia Auth (session-based)

// Login → session creation
POST /api/auth/login
  → Lucia.createSession(userId)
  → Set-Cookie: session=... (httpOnly, Secure)
  → 200 OK + user object

// Session validation (every request)
  → Lucia.validateSession(cookie)
  → inject request.user

// Logout → session revocation
POST /api/auth/logout
  → Lucia.invalidateSession(sessionId)
  → Clear cookie
✅ Session-based advantages
  • • Instant revocation (no JWT blacklist needed)
  • • httpOnly cookies prevent XSS token theft
  • • Server-side session store (Redis backed)
  • • Works seamlessly with Lucia's RBAC helpers
🔐 RBAC — 8 Roles
Viewer · Member · Member+ · Provider · Creator · Mod · Admin · Super Admin

Database Schema

Polyglot persistence strategie: Relationeel voor core data, NoSQL voor AI/Chat.

Core Tables (PostgreSQL 16)

Drizzle ORM (type-safe SQL-first) beheert 20+ tabellen voor auth, content en commerce. Schema in packages/db/schema.ts.

  • users • account, role, wallet_balance
  • posts • media_url, visibility, ai_tags
  • messages • conversation_id, read_state, metadata
  • transactions • sender, receiver, amount, tip_type
  • livestreams • status, viewers, revenue, goals

Feature & AI Tables

Polyglot uitbreidingen voor matching, providers, consent en AI-personalisatie.

  • erotic_dna • vector store voor 8 mood-profielen
  • matches • match_score, matched_at, status
  • provider_services • pricing tiers & availability
  • stream_tips • tip_source, trigger_action, goal_id

Operational Analytics Views

7 materialized views versnellen dashboards voor admins. Alle definities vind je terug in BACKEND_MASTER_SUMMARY.md.

admin_user_analytics
admin_content_analytics
admin_stream_analytics
admin_moderation_analytics
active_users_now
user_unread_notifications
online_presence_stats

Core Workflows

Visuele weergave van de kritieke gebruikersprocessen.

1. Login to Chat Flow (Optimized)

User Action (Login) ⬇ Validation & Auth (Backend generates JWT) ⬇ Preloading (Parallel: Fetch User Data + Init Session) ⬇ Cache Check (Load previous chat context from Redis) ⬇ Render Chat Interface (Instant Load) ⬇ Connect WebSocket (Real-time Sync)

2. Live Streaming Flow

Creator: Start Stream ⬇ Backend: Create Stream Record & Generate RTMP Key ⬇ Creator OBS -> RTMP Ingest (Port 1935) ⬇ Media Server: Transcode to HLS ⬇ Viewer: Fetch .m3u8 Playlist via CDN ⬇ WebSocket: Sync Chat, Tips & Moods (Real-time)

API Reference

Overzicht van de belangrijkste endpoints (Base URL: /api/v1).

AUTH & USERS

POST /auth/login
POST /auth/register
GET /users/:id/profile
PUT /users/:id/settings

STREAMS & CONTENT

POST /streams/start
GET /streams/active
POST /posts/upload
GET /posts/feed

WALLET & COMMERCE

GET /wallet/balance
POST /wallet/purchase
POST /streams/:id/tip
POST /services/book

AI FEATURES

POST /ai/content-coach
POST /ai/genie-request
POST /ai/match-suggestions

RBAC Matrix (8 Roles)

Gedetailleerd overzicht van permissies per gebruikersrol.

Feature Viewer Member Member+ Provider Creator Mod Admin Super Admin
View Content ✅ Safe
Chat / DM
AI Tools Basic Full Pro Creator Full Full Debug
Offer Services
Upload / Stream Limited
Moderation Report Report Self Self
System Config Limited ✅ ROOT

Full AI Ecosystem

35+ Geïntegreerde AI Modules verdeeld over 5 categorieën — v7.0 · April 2026.

🧠 Core AI Tools (11)

🤖 AI Chatters

5 persona-gebaseerde LLMs, 24/7 beschikbaar, geheugen via Vector DB, mood-adaptive reacties.

🎨 My Mood

Mood analyse → dynamische profielkleur. Sentiment scan past UI, content suggesties en AI-reacties realtime aan.

👯 Teezer (AI Clone)

Virtuele AI-kloon van de creator: traint op chatlogs, reageert in stijl van de creator bij afwezigheid.

🧞 TeezMe Request

AI content generation op aanvraag — text, afbeelding, video — gestuurd door gebruikersfantasieën.

📈 AI Content Coach

Analyseert uploads vóór publicatie: belichting, viral hashtags, pakkende titels, ideale posttijden.

📖 Story Builder

Interactieve "Choose your own adventure" verhalen. AI schrijft verder op basis van keuzes van de lezer.

💬 DirtyTalker

48+ vibes, favorieten en API-endpoint voor gepersonaliseerde chat-starters en gespreksopeners.

💘 Your Match AI

Pinecone/Weaviate embeddings, geo filters, kink-matching en compatibility scoring voor ideale matches.

🎬 AI Video Generator

Text-to-video pipeline met queue monitoring en content safety filters. Ondersteunt creator aanvragen.

🖼️ AI Image Generator

Text-to-image met safety scoring, style presets en direct inzetbaar voor creators en teaser content.

🛡️ AI Content Audit (admin)

Pre-scan vóór publicatie op verboden elementen. Toxicity filter, wapen-detectie, leeftijdsverificatie.

⚡ Engagement AI (11)

🌡️ MoodStrip AI

Realtime stemming-strook die publiek & creator vibe synchroniseert tijdens streams.

🔄 StripSync

Synchroniseert creator-acties met stemmen van het publiek via WebSocket tipgebeurtenissen.

💬 Erotic Echo Chat

AI reageert op chatberichten met contextbewuste echo's die de interactie verdiepen.

🔥 SnapHeat AI

Heatmap voor snaps en content engagement — detecteert trending moments in realtime.

🗺️ Mood Room Explorer

Navigeer naar rooms gefilterd op vibe. AI matcht gebruikersstemming met de juiste kamer.

💡 Dirty Prompt Generator

Genereert gepersonaliseerde prompt-starters voor chats en live interacties op basis van profiel.

🏟️ Snap Challenge Arena

Publiek stemt op uitdagingen. AI berekent populariteit en triggert winnaars automatisch.

🔓 Unlockable Fantasies

Vergrendelde content die vrijkomt bij tip-drempels. AI personaliseert de unlock-ervaringen.

💃 AI Strip Companion

Visuele avatar die reageert op tips door van houding en expressie te veranderen.

🎯 Live Strip Goals

AI-gestuurde doelprogress bars die de crowd motiveren. Dynamische milestones per stream.

🎮 Pay-to-Play Quests

Gamified micro-transacties met AI-gegenereerde opdrachten voor viewers en creators.

🧬 Personalization AI (6)

🧬 Erotic DNA Profile

Vectorstore van 8 mood-profielen. Stuurt alle aanbevelingen, matches en AI-reacties.

🗺️ Kink Quest

24+ voorkeuren met 4 intensiteitsniveaus. Onboarding quiz die DNA-profiel opbouwt.

💞 KinkMatch AI

AI vergelijkt kink-profielen voor maximale compatibiliteit. Stuurt matchmaking algoritme.

⚔️ MoodMatch Strip Duel

Twee creators of gebruikers strijden via mood-votes. AI bepaalt winnaar op basis van crowd-energie.

👯 Doppelgänger Creator

Creator traint AI op eigen chatlogs en stijl voor autonome reacties bij afwezigheid.

💌 AI Sext Companion

Gepersonaliseerde AI-gesprekspartner die evolueert op basis van gebruikersinteracties.

🛡️ Consent & Safety AI (4)

🎰 Consent Roulette

Speelse consent-check vóór expliciete interacties. AI stelt grenzen op basis van ingesteld profiel.

🤝 Consent Companion

Scenario-gids met risicoscores, quiz en realtime feedback. Verplicht bij escalerende interacties.

🧊 Freeze & Reveal

Pauze-mechanisme met bevestigingslaag. Creator bevriest sessie; AI bewaakt het proces.

📊 Safety Scoring

Real-time risicoscore per sessie. Automatische escalatie naar moderator bij overschrijding drempelwaarde.

🌐 Community AI (3) + Vector DB

🌙 Erotic Whisper Wall

Anonieme berichten die AI filtert en categoriseert op vibe. Trending whispers verschijnen op community feed.

📡 Community Heatmap & Vibe Tracker

Platform-brede AI-heatmap die populaire content, tijden en moods visualiseert voor iedereen.

🔥 SnapHeat Zones

Geografische en thematische zones geordend op hitte-score. Gebruikers zoeken de warmste plek op.

🔵 Vector DB Layer

Pinecone / Weaviate voor embeddings, matching, vibe-search en AI prompt retrieval. Backbone van alle AI personalisatie.

Security, Safety & Compliance

Samengesteld uit BACKEND_MASTER_SUMMARY.md, HTTPS_COMPLETE_SETUP.md en CONSENT-documentatie. Elke laag is production ready.

Authentication

  • ✅ Lucia Auth — session-based (httpOnly cookie)
  • ✅ Session invalidation & revocation
  • ✅ WebSocket auth handshake
  • ✅ bcrypt hashing (12 rounds)

Authorization

  • 🔐 8 rollen (Viewer → Super Admin)
  • ✔️ Route guards & ownership checks
  • ✔️ Moderator tools & escalation
  • ✔️ Admin override logging

Data Protection

  • 🛡️ Prepared SQL statements
  • 🛡️ File type & size validation
  • 🛡️ Viewer watermarking op media
  • 🛡️ GDPR: Right-to-be-forgotten tools

Operational Safety

  • 🆔 Stripe Identity + Liveness
  • 🚨 Safe Word kill-switch
  • 🤖 AI content audit & toxicity filter
  • 📉 Rate limiting 100 req/min/account

TLS & Hosting

HTTPS Stack • Nginx reverse proxy (443/80)
• Auto-cert renewal (Let’s Encrypt)
• HSTS preload & TLS 1.3
Network hardening • WAF rules voor /api en /ws
• Rate limit 429 responses met retry hints
• Audit logging → moderation_log

Stream & Chat UI

Samenvatting uit CHATBOX_VISUAL_FLOW.md, CHATBOX_OPTIMIZED_FINAL.md en livestream guides.

Desktop 4-Zone Layout

  • 🟥 Zone 1 · 240px · Online users + filters + live badge
  • 🟨 Zone 2 · Flex · Profielkaart + livestream placeholder
  • 🟩 Zone 3 · 300px · Activity feed, consent en goals
  • 🟦 Zone 4 · 140px · Input bar, quick prompts, tip CTA’s
  • 🎨 Mood colors (8) + glow effecten & sticky scroll

Realtime & Monetisation

  • ⚡ WSS: chat, mood voting, goal updates & StripSync
  • 🤖 AI Companion kaarten in feed + voice teases
  • 💰 Tip goals, quick prompts (5-500 tokens), custom tips
  • 🧊 Freeze & Reveal, Unlockables manager, StripDuel
  • 👀 Consent logging + moderator acties direct beschikbaar

Mobile Flow

  • 📱 Swipe-tabs (Public · Private · AI)
  • 👥 Horizontal reel voor online users
  • 🎥 Optionele livestream tile boven de chat
  • 😊 Emoji bar + floating tip button
  • 🛟 Safe-area aware input + drawer navigation

Mobile Navigation

Mobile-first design principes uit MOBILE_OPTIMIZATION_GUIDE.md.

Touch & Typography

  • • Primary actions ≥ 56px · Secondary ≥ 48px
  • • Headers: text-2xl md:text-3xl · Body: text-base md:text-lg
  • • Icon sizing: w-6 h-6 mobile, md:w-5 md:h-5 desktop
  • • Active feedback: active:scale-95 + transition-all

Layout Patterns

  • • Edge-to-edge via -mx-4 containers
  • • Sticky headers: sticky top-0 bg-gray-900/98
  • • Responsive grids: grid-cols-2 md:grid-cols-4
  • • WebRTC mobile constraints: 1280x720 @30fps + playsInline