Lumen โ€” Architecture Overview

AI-powered social media agent SaaS platform for content generation, scheduling, publishing, and analytics across 8 platforms

โœ“ Production Live Node.js 22 + Express SQLite + WAL MiniMax + MiMo AI 6 AI Providers 8 Social Platforms
๐Ÿ—๏ธ System Architecture
End-to-end request flow from browser to AI providers

๐ŸŒ Browser

Landing Page (index.html) + SPA Portal (app.html)
Vanilla JS โ€ข 524KB โ€ข 6,878 lines

โ–ผ HTTPS (Port 443)

๐Ÿ”’ Nginx Reverse Proxy

SSL termination โ€ข Static files โ€ข GeoIP country detection
lumen.ivydigitals.com โ†’ 127.0.0.1:4200

โ–ผ HTTP (Port 4200)

๐Ÿ” Auth

HMAC sessions
bcrypt passwords
Owner/Admin/Editor

๐Ÿ“ Posts

AI generation
Multi-platform
Scheduling

๐Ÿค– AI Engine

6 providers
Text + Image
Auto-translate

๐Ÿ“Š Analytics

FB/IG insights
AI suggestions
Campaign sync

๐Ÿ“ฑ Platforms

8 integrations
OAuth tokens
Health checks

๐Ÿ“… Calendar

Content calendar
Best time AI
Evergreen recycle

๐ŸŽฏ Autopilot

90-day strategy
AI content plan
Auto-publish

๐Ÿ’ฐ Billing

Stripe + Nomod
Plan management
Usage tracking

โ–ผ Data & AI Layer

๐Ÿ’พ SQLite Database

37 tables โ€ข WAL mode
better-sqlite3
Multi-tenant isolation

๐Ÿค– MiniMax API

MiniMax-M3
Text generation
Image generation

๐Ÿง  Xiaomi MiMo

mimo-v2.5-pro
Content analysis
Scoring engine

๐Ÿ”„ 4 More Providers

OpenAI โ€ข Anthropic
Google Gemini
Custom endpoints

โš™๏ธ Technology Stack
Production-grade stack running on single VPS
LayerTechnologyVersionPurpose
RuntimeNode.js22.22.3JavaScript runtime via NVM
FrameworkExpress.js4.19+HTTP server & routing
DatabaseSQLite3.xEmbedded DB via better-sqlite3
FrontendVanilla JS SPAโ€”Single HTML (6,878 lines, 524KB)
AI Providers6 providersโ€”MiniMax, MiMo, OpenAI, Anthropic, Gemini, Custom
Image GenMiniMax + Pexelsโ€”AI image generation + stock fallback
Process MgrPM27.0.3Auto-restart, cluster mode
Web ServerNginx1.30.2Reverse proxy, SSL, GeoIP
SSLLet's Encryptโ€”Free SSL via certbot
PaymentsStripe + Nomodโ€”Subscription billing
๐Ÿค– AI Provider Ecosystem
6 integrated AI providers with tenant-level configuration
๐ŸŸฃ

MiniMax

MiniMax-M3 โ€” Primary text generation provider. Also handles image generation via image-01 model. OpenAI-compatible API.

๐Ÿฉท

Xiaomi MiMo

mimo-v2.5-pro โ€” Default analysis engine. Powers content scoring, suggestions, and autopilot strategy generation.

๐ŸŸข

OpenAI

GPT-4o, GPT-4o-mini โ€” Alternative text provider. Also supports DALL-E image generation.

๐ŸŸ 

Anthropic

Claude Sonnet 4 โ€” Advanced reasoning for complex content generation and analysis tasks.

๐Ÿ”ต

Google Gemini

Gemini 2.0 Flash โ€” Fast text generation with Imagen 3.0 for image creation.

โš™๏ธ

Custom

Any OpenAI-compatible API โ€” Self-hosted models, fine-tuned endpoints, or third-party providers.

๐Ÿ“ฑ Supported Platforms
8 social media platforms with direct API integration
๐Ÿ“ธ
Instagram
๐Ÿ“˜
Facebook
๐Ÿฆ
Twitter / X
๐Ÿ’ผ
LinkedIn
๐ŸŽต
TikTok
๐Ÿงต
Threads
๐Ÿฆ‹
Bluesky
๐Ÿ“
WordPress
โœ๏ธ Post Generation Flow
AI-powered content creation across multiple platforms
1
Enter
Topic
โ†’
2
Select Tone
& Length
โ†’
3
Choose
Platforms
โ†’
4
AI Generates
Posts
โ†’
5
Review
& Edit
โ†’
6
Publish
or Schedule
๐Ÿ“

Content Generation

AI generates platform-specific posts from a single topic. Supports 5 tones (Professional, Casual, Exciting, Educational, Promotional) and 3 lengths.

๐Ÿ–ผ๏ธ

Image Generation

AI generates matching images for posts via MiniMax or DALL-E. Fallback to Pexels stock photos. OCR validates no unwanted text overlays.

๐Ÿ”„

Evergreen Recycling

Top-performing posts are automatically recycled and re-published at optimal times. Keeps content fresh without manual effort.

๐ŸŒ

Auto-Translate

Posts can be automatically translated to multiple languages for global audiences. AI maintains tone and context across languages.

๐Ÿค– Autonomous Features
AI-driven automation for hands-off social media management
๐ŸŽฏ

AI Autopilot

90-day content strategy โ€” AI analyzes your brand, audience, and goals to create a complete content calendar with daily post suggestions.

๐Ÿ“Š

AI Analytics

Smart insights โ€” AI analyzes engagement data to suggest optimal posting times, content types, and hashtag strategies.

๐Ÿ“…

Content Calendar+

Bulk generation โ€” Generate an entire month's content in one click. AI creates themed posts for each day based on your strategy.

โฐ

Best Time to Post

AI-optimized scheduling โ€” Machine learning analyzes your audience's activity patterns to recommend optimal posting times.

๐Ÿ”ฅ

Trending Topics

Real-time trends โ€” AI monitors trending topics by country and suggests relevant content ideas to capitalize on viral moments.

๐Ÿ“‹

Topic Sheets

Batch content โ€” Upload Excel sheets with topics and AI generates posts for each row. Perfect for product launches and campaigns.

๐Ÿ“Š Content Pipeline
From idea to published post with full review workflow
1

Draft

AI generates

2

Review

Human edits

3

Approved

Ready to go

4

Scheduled

Set time/date

5

Published

Live on platforms

๐Ÿ’พ Database Schema
37 tables with multi-tenant isolation
TablePurposeKey Fields
lumen_tenantsOrganizations/workspacesname, slug, plan, token_quota, billing_status
lumen_usersUser accountsemail, role, tenant_id, auth_provider
lumen_postsGenerated contenttenant_id, stage, posts (JSON), scheduled_at
lumen_platform_accountsConnected social accountsplatform, credentials_json, tenant_id
lumen_ai_providersAI provider configsprovider, api_key, model, is_default
lumen_plansSubscription planscode, price_cents, token_quota, allowed_platforms
lumen_subscriptionsActive subscriptionstenant_id, plan_id, status, amount_cents
lumen_brand_voiceBrand personalityvoice_description, tone_keywords, forbidden_words
lumen_brand_kitVisual brandinglogo_path, primary_color, font_family
lumen_analytics_snapshotsPlatform analyticsplatform, metrics_json, snapshot_date
lumen_autopilot_strategies90-day content planstenant_id, strategy_json, status
lumen_topic_sheetsBatch content jobstenant_id, file_path, status
๐Ÿ”Œ API Endpoints
15+ route modules with 80+ endpoints
๐Ÿ”

Auth

POST /signup, /login, /logout, /magic-link
Google OAuth integration

๐Ÿ“

Posts

POST /generate, /bulk, /translate
PUT /:id, POST /:id/publish, /schedule

๐Ÿค–

AI

GET /providers, POST /test, /discover
PUT /providers/:id

๐Ÿ“ฑ

Platforms

GET /accounts, POST /accounts
POST /test/:platform, GET /health

๐Ÿ“Š

Analytics

GET /summary, /facebook, /instagram
POST /sync, /suggestions

๐Ÿ“…

Calendar

GET /, PATCH /:id/reschedule
GET /best-times

๐ŸŽฏ

Autopilot

GET /, POST /setup, /regenerate
GET /strategy

๐Ÿ’ฐ

Billing

GET /plans, /status, /me
POST /checkout, /cancel

๐Ÿท๏ธ

Brand

GET/PUT /voice, /kit
POST /kit/logo, GET/POST /pillars

๐Ÿ”ง

Admin

Full CRUD: plans, users, tenants
System health, audit log, MRR

๐Ÿ’ฐ Subscription Plans
SaaS pricing with geo-based currency display
PlanPrice/moTokensImagesSeatsPlatformsTrial
TrialFree200K501All 83 days
Starter$40.501M2001FB, X, IG14 days
Pro โ˜…$299.255M1,00036 platforms + analytics14 days
Business โšก$299.2510M2,0005All 8 + AI analytics14 days
Analytics ๐Ÿ“Š$5498M1,5003All 8 + AI analytics14 days
Agency Autopilot$571.55400K1,0001All 8 (90-day campaign)14 days
๐Ÿ“ˆ Platform Statistics
Current deployment metrics
37
Database Tables
80+
API Endpoints
6
AI Providers
8
Social Platforms
6,878
Frontend Lines
524KB
SPA Size
๐Ÿš€ Deployment
Production setup
Runtime: Node.js 22 (LTS) ยท Express ยท SQLite (WAL) Process: PM2 (single instance, auto-restart + health check) Edge: Nginx reverse proxy ยท TLS via Let's Encrypt Domain: lumen.ivydigitals.com Data: per-tenant SQLite schema, isolated by tenant_id on every query # Scheduled jobs (in-process) */5 * * * * # Publish scheduled posts Daily # Fetch platform analytics + compute best time to post Daily # AI Autopilot content generation Weekly # Autopilot learning refresh Hourly # Topic-sheet processing
๐Ÿ”‘ Demo Access
Provisioned per customer

Lumen demo workspaces are created per customer and their sign-in credentials are shared privately by your account manager. Credentials are never published on this page โ€” every demo account has a unique login on its own /poc-<customer> page, and demo access is time-boxed.

Need a walkthrough? Email lumen@ivydigitals.com and we will set one up.