๐Ÿ›๏ธ SITE ARCHITECTURE BLUEPRINT

How the whole website fits together โ€” beyond the economy
OverviewForumAuth AIGamesVideo ChatDeploy

๐Ÿ—บ๏ธ SYSTEM OVERVIEW

The site is a monolithic Node.js application โ€” one server.js, one SQLite database, static files. 175+ routes. No microservices, no external dependencies for core features.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ CLIENT (Browser) โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚Forum โ”‚ โ”‚Games โ”‚ โ”‚ Chat โ”‚ โ”‚ Economy โ”‚ โ”‚ โ”‚ โ”‚Pages โ”‚ โ”‚three โ”‚ โ”‚Rooms โ”‚ โ”‚ Panels โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ HTTP + WebSocket โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ SERVER (Node.js) โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ server.js (175+ routes) โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ Auth & Sessions โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ Forum (boards/threads/posts) โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ Games (/ruby, /saga, etc.) โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ AI Brains (SABLE, PROVOLTA) โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ Chat (rooms, DMs) โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ Video (embeds, feed) โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ Economy (8 systems) โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ lib/views.js (templates) โ”‚ โ”‚ โ”‚ โ”‚ lib/db.js (SQLite helpers) โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ SQLite Database โ”‚ โ”‚ Users, sessions, forum, game state, โ”‚ โ”‚ economy (10 tables), chat, media โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
Design principle: One file per concern, but one server. The monolith is a feature โ€” it means one deploy, one backup, one log to read. Complexity goes into the data model, not the infrastructure.

๐Ÿ’ฌ FORUM: ProBoards-Style Community

Old-school forum with modern polish. Categories โ†’ Boards โ†’ Threads โ†’ Posts.

Data Model

Key Features to Build

Design

Red and black, but font never matches background. Category bars: textured (carbon fiber, marble, crystal). Dense, curiosity-rewarding โ€” "a scatter brain genius look so people with ADHD feel this is worth exploring."

๐Ÿ” AUTHENTICATION: Users & Sessions

Crew users: System personas (like 'solid') post as special crew accounts. They bypass normal auth via internal endpoints (/api/internal/*).

๐Ÿค– AI CHARACTERS: SABLE, PROVOLTA, Solid

Three AI personas, each with distinct voice, role, and integration:

CharacterRoleIntegration
SABLEShip's AI, conversational assistantFloating button โ†’ sidebar. Brain: LLM API. Remembers users (long-term memory). Voice synthesis. Action protocol ([ACT:] commands).
PROVOLTAProphetess, nightly chamberPrivate room with 20s cooldown. Speaks aloud. Teal holographic style. Appears on hostility detection or when invoked.
SolidCo-builder, night watchPosts via internal endpoints. Chamber voice. Keeps PROVOLTA company. Has all building codes.

Building Your Own

๐ŸŽฎ GAMES: /ruby, /saga, and Beyond

Three.js building games. Each is a separate route serving a full-page canvas experience.

Architecture

Key Patterns

๐Ÿ“น VIDEO: Short-Form Social Feed

๐Ÿ’ฌ CHAT: Rooms & Real-Time

๐Ÿš€ DEPLOYMENT: Running It All

Server Setup

Deploy Process

  1. Backup database: cp data/app.db data/app.db.bak-$(date +%Y%m%d)
  2. Deploy new code (rsync, git pull, or tarball)
  3. node --check server.js โ€” syntax must pass
  4. systemctl restart app
  5. Verify: check version endpoint, load homepage

Critical Lessons

Cron jobs: Use cron.add for scheduled tasks (manufacturing, expiry, notifications). Each job should be idempotent โ€” safe to run twice.