2nd Brain

README

/home/darth/Documents/moltbotShare/MultiApps/README.md

MultiApps (ucall.me) - Monorepo Overview

This repository hosts a multi-app platform under one domain. The backend is the central gateway for auth, access control, and app delivery. The landing UI is a Svelte app. Apps are organized under /apps and are served via /apps/<slug>.

Important rules:

  • Svelte only for apps (no SvelteKit, no TypeScript, no React).
  • Svelte views are presentational only; logic and validation are server-side.
  • Every change must be documented in AblaufProtokoll.md.

Architecture

Core components

  • Backend gateway: backend/server.js
    • Central entrypoint for API and app delivery.
    • Auth, app access checks, and routing live here.
  • Database: MongoDB
    • Core collections: users, apps, translations, highscores, subscriptions.
    • Translations live in DB (no translation folders in active code).
  • Landing UI: frontend-svelte
    • Dynamic app listing (DB + registry).
    • Presentational only; no client-side validation logic.
  • App registry (SSOT): appRegistry.js
    • Slugs, names, embedded flags, dev ports.

Routing and app delivery

  • Apps are delivered under /apps/<slug>.
  • Short URL and QR redirects:
    • /s/:slug -> short URL redirect
    • /q/:slug -> QR code redirect
  • Dev proxy mapping is derived from the registry (backend/config/appDevProxy.js).

Tech stack

  • Node.js + Express (backend/)
  • Svelte (landing and active apps)
  • MongoDB (local dev default)
  • Vite for Svelte dev/build

Project structure

backend/           Central API + app gateway (Express)
frontend-svelte/   Landing UI (Svelte)
apps/              Individual apps and concepts
database/          Legacy routes/models (see notes below)
shared/            Shared utilities
scripts/           Dev orchestration

Apps in /apps

Registry entries (from appRegistry.js)

These are the active slugs and their current folder status:

Registry slugFolder / source pathNotesMigration status
qrcodeapps/qrcodeSvelte app (Vite)Svelte-only
shortenerapps/shortenerSvelte app (Vite)Svelte-only
2048-plusapps/2048-plusSvelte app (Vite)Svelte-only
wordle-plusapps/wordle-plusSvelte app (Vite)Svelte-only
fruits-plusapps/fruits-plusSvelte app (Vite)Svelte-only
bloodapps/blood/WebAppSvelte WebApp used in scripts/dev.js; apps/blood also contains a Next.js app (legacy)Partial (legacy present)
wasserreminderapps/wasserReminder/WebAppSvelte WebApp used in scripts/dev.js; folder also includes server/json toolsPartial (non-Svelte assets/tools present)
wordclockapps/WordClock/WebAppSvelte WebApp used in scripts/dev.js; folder also includes static HTML/JSPartial (legacy static app present)
grammaraiapps/grammarAi/WebAppSvelte WebApp used in scripts/dev.js; apps/grammarAi also contains React/TypeScript (legacy)Partial (legacy present)
qrshortdoorbellapps/QrShortDoorBellDocumentation only (no Svelte app yet)Not started
gamesapps/gamesDocumentation only (no Svelte app yet)Not started
calculatorsapps/calculatorsStatic HTML/JS (no Svelte app yet)Needs migration

Legacy / conceptual folders (not in registry or non-compliant stacks)

These folders exist but are not in the registry and/or use non-Svelte stacks. They must be migrated to Svelte.js (no SvelteKit, no TypeScript, no React):

  • apps/auction (React/Vite app in root; separate backend; Svelte frontend exists in apps/auction/frontend) - needs migration/cleanup
  • apps/grammarAi (React/TypeScript in root, separate from WebApp) - needs migration/cleanup
  • apps/taxiBayTreuhand (Next.js + TypeScript web app, React Native mobile app, plus separate API) - needs migration
  • apps/blood (Next.js app in root, separate from WebApp Svelte app) - needs migration/cleanup
  • apps/URL_shorter (Express/Mongoose service, no Svelte app) - needs migration
  • apps/MadeIn/Projekt (SvelteKit + TypeScript) - needs migration
  • apps/coffefinder (Svelte app with TypeScript files and SvelteKit-style routes like src/routes/+layout.svelte) - needs migration
  • apps/MemeCoinToken (static HTML/documents) - needs migration or archiving
  • apps/platform (documentation only) - needs migration or archiving
  • apps/naviQuiz (documentation only) - needs migration or archiving

Migration checklist (legacy -> Svelte.js)

  • Identify the target Svelte entrypoint and remove React/Next/SvelteKit dependencies.
  • Convert TypeScript files to plain JavaScript where required.
  • Ensure all client logic is moved server-side; keep Svelte views presentational.
  • Replace client-side auth/validation with backend APIs and access checks.
  • Hook translations into DB-only storage (no local translation folders).
  • Add/update registry entry in appRegistry.js and sync DB (npm run db:sync:apps).
  • Ensure dev server is added to scripts/dev.js if it needs a port.
  • Document the migration step in AblaufProtokoll.md.

Development

Prerequisites

  • Node.js
  • MongoDB running locally

Install

npm install

Dev start (recommended)

npm run dev

This runs scripts/dev.js which starts:

  • backend (backend/server.js)
  • landing (frontend-svelte)
  • app dev servers for registry apps with devPort (qrcode, shortener, 2048+, wordle+, fruits+, blood, wasserReminder, wordclock, grammarAi)

Logs are written to dev.log.

Useful scripts (root)

  • npm run dev - full dev orchestration
  • npm run dev:backend - backend only
  • npm run dev:frontend - landing only
  • npm run db:seed - seed apps from /apps
  • npm run db:seed:users - seed test/admin users
  • npm run db:sync:apps - sync registry to DB

URLs (dev)

  • Landing: http://localhost:5173/
  • API: http://localhost:3000/
  • Apps: http://localhost:3000/apps/<slug>

Data and access control

  • Auth uses JWT (httpOnly cookie supported).
  • App access is enforced server-side.
  • Admins are treated as full access.
  • Highscores and translations are stored in MongoDB.

Deployment (summary)

Use a reverse proxy (e.g. nginx) in front of the Node server with HTTPS.

Documentation

  • Rules and constraints: rules.md
  • Architecture and change log: AblaufProtokoll.md
  • Product requirements: PRD.md
  • Baseline plan: Plan.md
Attachments
Noch keine.