Admin Intelligence Hub
Real-time controlecentrum voor Super Admins en Admins. Monitor community gezondheid, financiële stromen en AI-activiteit.
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.
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.
System Architecture
Volledige v3.0 tech stack. Monorepo structuur: apps/web (frontend) · services/api (backend) · packages/db (Drizzle schema).
Frontend Stack
- React19
- Vite7
- TypeScript5.9 strict
- Tailwind CSS4
- Zustand5
- TanStack Queryv5
- TanStack Routerlatest
- React Hook Form + Zod✓
- Radix UI + Lucide React✓
Backend Stack
- 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 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
- • 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
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.
Core Workflows
Visuele weergave van de kritieke gebruikersprocessen.
1. Login to Chat Flow (Optimized)
2. Live Streaming Flow
API Reference
Overzicht van de belangrijkste endpoints (Base URL: /api/v1).
AUTH & USERS
STREAMS & CONTENT
WALLET & COMMERCE
AI FEATURES
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)
5 persona-gebaseerde LLMs, 24/7 beschikbaar, geheugen via Vector DB, mood-adaptive reacties.
Mood analyse → dynamische profielkleur. Sentiment scan past UI, content suggesties en AI-reacties realtime aan.
Virtuele AI-kloon van de creator: traint op chatlogs, reageert in stijl van de creator bij afwezigheid.
AI content generation op aanvraag — text, afbeelding, video — gestuurd door gebruikersfantasieën.
Analyseert uploads vóór publicatie: belichting, viral hashtags, pakkende titels, ideale posttijden.
Interactieve "Choose your own adventure" verhalen. AI schrijft verder op basis van keuzes van de lezer.
48+ vibes, favorieten en API-endpoint voor gepersonaliseerde chat-starters en gespreksopeners.
Pinecone/Weaviate embeddings, geo filters, kink-matching en compatibility scoring voor ideale matches.
Text-to-video pipeline met queue monitoring en content safety filters. Ondersteunt creator aanvragen.
Text-to-image met safety scoring, style presets en direct inzetbaar voor creators en teaser content.
Pre-scan vóór publicatie op verboden elementen. Toxicity filter, wapen-detectie, leeftijdsverificatie.
⚡ Engagement AI (11)
Realtime stemming-strook die publiek & creator vibe synchroniseert tijdens streams.
Synchroniseert creator-acties met stemmen van het publiek via WebSocket tipgebeurtenissen.
AI reageert op chatberichten met contextbewuste echo's die de interactie verdiepen.
Heatmap voor snaps en content engagement — detecteert trending moments in realtime.
Navigeer naar rooms gefilterd op vibe. AI matcht gebruikersstemming met de juiste kamer.
Genereert gepersonaliseerde prompt-starters voor chats en live interacties op basis van profiel.
Publiek stemt op uitdagingen. AI berekent populariteit en triggert winnaars automatisch.
Vergrendelde content die vrijkomt bij tip-drempels. AI personaliseert de unlock-ervaringen.
Visuele avatar die reageert op tips door van houding en expressie te veranderen.
AI-gestuurde doelprogress bars die de crowd motiveren. Dynamische milestones per stream.
Gamified micro-transacties met AI-gegenereerde opdrachten voor viewers en creators.
🧬 Personalization AI (6)
Vectorstore van 8 mood-profielen. Stuurt alle aanbevelingen, matches en AI-reacties.
24+ voorkeuren met 4 intensiteitsniveaus. Onboarding quiz die DNA-profiel opbouwt.
AI vergelijkt kink-profielen voor maximale compatibiliteit. Stuurt matchmaking algoritme.
Twee creators of gebruikers strijden via mood-votes. AI bepaalt winnaar op basis van crowd-energie.
Creator traint AI op eigen chatlogs en stijl voor autonome reacties bij afwezigheid.
Gepersonaliseerde AI-gesprekspartner die evolueert op basis van gebruikersinteracties.
🛡️ Consent & Safety AI (4)
Speelse consent-check vóór expliciete interacties. AI stelt grenzen op basis van ingesteld profiel.
Scenario-gids met risicoscores, quiz en realtime feedback. Verplicht bij escalerende interacties.
Pauze-mechanisme met bevestigingslaag. Creator bevriest sessie; AI bewaakt het proces.
Real-time risicoscore per sessie. Automatische escalatie naar moderator bij overschrijding drempelwaarde.
🌐 Community AI (3) + Vector DB
Anonieme berichten die AI filtert en categoriseert op vibe. Trending whispers verschijnen op community feed.
Platform-brede AI-heatmap die populaire content, tijden en moods visualiseert voor iedereen.
Geografische en thematische zones geordend op hitte-score. Gebruikers zoeken de warmste plek op.
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
• Auto-cert renewal (Let’s Encrypt)
• HSTS preload & TLS 1.3
• 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