Mirror of github.com/Memo-2023/mana-monorepo
Find a file
Wuesteon d268e8e463 docs: add comprehensive session report for runtime config implementation
Complete documentation of today's work including:

## What We Accomplished
- Runtime config for Contacts & Calendar apps
- Fixed 10 bugs (2 critical staging issues)
- Created 3-layer protection system (ESLint + Validation + Docs)
- Successfully deployed to staging

## Problems Encountered & Solutions
1. Type errors (zod dependency, onMount return type)
2. Pre-push build failures (MIDDLEWARE_URL, missing zod)
3. CI/CD frozen lockfile mismatch
4. Docker entrypoint absolute path crash
5. Critical: ERR_CONNECTION_REFUSED (missing await)
6. Critical: Window injection in user-settings

## Protection System Created
- Layer 1: ESLint rules (no-floating-promises, no-misused-promises)
- Layer 2: Validation script (450 LOC, scans 22 apps)
- Layer 3: Documentation (650 lines, implementation guide)

## Future Enhancements Plan
- Phase 1: Add validation to pre-push hook (2-3 hours)
- Phase 2: Create shared runtime config package (1 week)
- Phase 3: Project generator CLI (2 weeks)

## Stats
- Added: ~1,130 lines
- Modified: 28 files
- Created: 19 files
- Commits: 6 commits
- Apps completed: 5 (Clock, Chat, Picture, Contacts, Calendar)

This serves as a reference for future runtime config implementations
and documents the entire debugging and implementation process.
2025-12-16 00:34:06 +01:00
.claude 📝 docs: update runtime URL injection checklist 2025-12-15 14:14:58 +01:00
.github chore(ci): add staging config protection and validation 2025-12-10 13:48:45 +01:00
.husky 🔧 chore: add pre-push build validation for changed apps 2025-12-15 19:49:30 +01:00
apps fix(manacore-web): await getAuthUrl() and use runtime config in user-settings 2025-12-16 00:21:23 +01:00
apps-archived feat: major update with network graphs, themes, todo extensions, and more 2025-12-10 02:37:46 +01:00
cicd feat: major update with network graphs, themes, todo extensions, and more 2025-12-10 02:37:46 +01:00
docker fix(staging): use HTTPS staging domains for all client URLs 2025-12-10 03:27:46 +01:00
docs docs: add comprehensive session report for runtime config implementation 2025-12-16 00:34:06 +01:00
games ️ fix(worldream): add a11y attributes to modal and dialog components 2025-12-15 19:14:08 +01:00
packages feat: add multi-layered runtime config protection system 2025-12-16 00:28:57 +01:00
scripts feat: add multi-layered runtime config protection system 2025-12-16 00:28:57 +01:00
services/mana-core-auth refactor(auth): remove themes module from mana-core-auth 2025-12-12 02:35:18 +01:00
tests/e2e first implementation 2025-11-27 17:26:18 +01:00
.dockerignore make auth working 2025-11-26 01:31:12 +01:00
.editorconfig feat: add monorepo configuration and shared packages structure 2025-11-22 23:41:52 +01:00
.env.development 🔧 chore: switch chat backend to OpenRouter API 2025-12-12 20:50:03 +01:00
.env.example add mana core 2025-11-25 18:56:35 +01:00
.gitignore 🙈 chore: ignore claude-flow metrics from git tracking 2025-12-08 14:38:41 +01:00
.nvmrc feat: add monorepo configuration and shared packages structure 2025-11-22 23:41:52 +01:00
.prettierignore fix(ci): build shared packages before tests and fix formatting 2025-12-01 23:15:00 +01:00
.prettierrc feat: add monorepo configuration and shared packages structure 2025-11-22 23:41:52 +01:00
.prettierrc.json fix(cicd): docker paths, formatting config, 2025-11-27 18:33:08 +01:00
APP-IDEAS.md 📝 docs: update COMMANDS.md and add APP-IDEAS.md 2025-12-04 17:28:16 +01:00
AUTH_ANALYSIS_SUMMARY.md 🔒️ feat(auth): centralize JWT validation and add deployment docs 2025-12-01 20:44:45 +01:00
AUTH_ARCHITECTURE_REPORT.md 🔒️ feat(auth): centralize JWT validation and add deployment docs 2025-12-01 20:44:45 +01:00
AUTH_DOCUMENTATION_INDEX.md fix(ci): build shared packages before tests and fix formatting 2025-12-01 23:15:00 +01:00
AUTH_QUICK_REFERENCE.md 🔒️ feat(auth): centralize JWT validation and add deployment docs 2025-12-01 20:44:45 +01:00
AUTH_VALIDATION_CHECKLIST.md 🔒️ feat(auth): centralize JWT validation and add deployment docs 2025-12-01 20:44:45 +01:00
BACKEND_DESIGN_PATTERN_AUDIT.md 🔒️ feat(auth): centralize JWT validation and add deployment docs 2025-12-01 20:44:45 +01:00
CI_CD_IMPLEMENTATION_SUMMARY.md feat: major update with network graphs, themes, todo extensions, and more 2025-12-10 02:37:46 +01:00
CI_CD_README.md first auth impl 2025-12-01 13:30:58 +01:00
CLAUDE.md feat(db): add production-safe migration system with advisory locks 2025-12-09 02:13:11 +01:00
COMMANDS.md chore: various UI improvements and fixes 2025-12-10 20:05:02 +01:00
COMPATIBILITY_MATRIX_AND_REMEDIATION.md 🔒️ feat(auth): centralize JWT validation and add deployment docs 2025-12-01 20:44:45 +01:00
docker-compose.dev.yml chore: update config files and dependencies 2025-12-05 04:20:35 +01:00
docker-compose.production.yml fix: update docker registry to ghcr.io/memo-2023 2025-12-03 01:46:16 +01:00
docker-compose.staging.full.yml refactor(staging): simplify CI/CD to mana-core-auth + chat-backend only 2025-12-05 01:33:01 +01:00
docker-compose.staging.yml 🔧 refactor: implement 12-factor runtime config for all web apps 2025-12-15 21:33:50 +01:00
docker-compose.yml refactor: restructure 2025-11-26 03:03:24 +01:00
DOCKER_REGISTRY_SETUP.md style: auto-format codebase with Prettier 2025-11-27 18:33:16 +01:00
eslint.config.mjs fix lint 2025-12-04 00:32:13 +01:00
FILES_CREATED.md first auth impl 2025-12-01 13:30:58 +01:00
HISTORICAL-ANALYSIS.md Merge branch 'dev-1' into dev 2025-12-05 17:57:26 +01:00
HIVE_MIND_FINAL_REPORT.md feat: major update with network graphs, themes, todo extensions, and more 2025-12-10 02:37:46 +01:00
jest.config.js first implementation 2025-11-27 17:26:18 +01:00
JWT_VALIDATION_REPORT.md 🔒️ feat(auth): centralize JWT validation and add deployment docs 2025-12-01 20:44:45 +01:00
lint-staged.config.js 🔧 chore: add svelte-check to pre-commit hooks 2025-12-15 17:53:52 +01:00
MANACORE-TODOS.md 📝 docs: add release plan and manacore roadmap 2025-12-05 03:38:27 +01:00
MERGE-FIX-SUMMARY.md Merge branch 'dev-1' into dev 2025-12-05 17:57:26 +01:00
package.json feat: add multi-layered runtime config protection system 2025-12-16 00:28:57 +01:00
playwright.config.ts style: auto-format codebase with Prettier 2025-11-27 18:33:16 +01:00
pnpm-lock.yaml fix(deps): add missing zod dependency to Calendar and Chat web apps for CI 2025-12-15 23:41:37 +01:00
pnpm-workspace.yaml chore: archive inactive projects to apps-archived/ 2025-11-29 07:03:59 +01:00
QA_TESTING_CHECKLIST.md add mana core 2025-11-25 18:56:35 +01:00
QUICK_START_CICD.md style: auto-format codebase with Prettier 2025-11-27 18:33:16 +01:00
README.md 📝 docs: add staging URLs and modernize README 2025-12-15 20:27:02 +01:00
RELEASE-PLAN.md 📝 docs: add release plan and manacore roadmap 2025-12-05 03:38:27 +01:00
test-chat-auth.sh Fix wrong type 2025-12-04 23:25:25 +01:00
TEST_CASES_SAMPLES.md add mana core 2025-11-25 18:56:35 +01:00
TESTING_STRATEGY_AUTH_CREDITS.md add mana core 2025-11-25 18:56:35 +01:00
TESTING_STRATEGY_EXECUTIVE_SUMMARY.md style: auto-format codebase with Prettier 2025-11-27 18:33:16 +01:00
TROUBLESHOOTING.md docs: add SvelteKit runtime env injection guidelines and troubleshooting 2025-12-08 20:54:13 +01:00
turbo.json fix: add ^build dependency to type-check task 2025-12-10 21:34:07 +01:00
vitest.config.ts first implementation 2025-11-27 17:26:18 +01:00

Manacore Monorepo

Monorepo containing all Manacore projects with shared packages and unified tooling.

Staging URLs

All services are deployed to staging at *.staging.manacore.ai.

Web Applications

App Staging URL Description
ManaCore https://staging.manacore.ai Central dashboard for all Mana apps
Chat https://chat.staging.manacore.ai AI chat application
Calendar https://calendar.staging.manacore.ai Calendar and scheduling
Clock https://clock.staging.manacore.ai World clock, timers, alarms
Todo https://todo.staging.manacore.ai Task management

Backend APIs

Service Staging URL Port
Auth https://auth.staging.manacore.ai 3001
Chat API https://chat-api.staging.manacore.ai 3002
Calendar API https://calendar-api.staging.manacore.ai 3016
Clock API https://clock-api.staging.manacore.ai 3017
Todo API https://todo-api.staging.manacore.ai 3018

Landing Pages (Cloudflare Pages)

Project URL
Chat https://chat-landing-90m.pages.dev
Picture https://picture-landing.pages.dev
ManaCore https://manacore-landing.pages.dev
ManaDeck https://manadeck-landing.pages.dev
Zitare https://zitare-landing.pages.dev
Presi https://presi-landing.pages.dev

Projects

Project Description Tech Stack
manacore Multi-app ecosystem platform Expo, SvelteKit
chat AI chat application NestJS, Expo, SvelteKit
calendar Calendar & scheduling NestJS, SvelteKit
clock World clock, timers, alarms NestJS, SvelteKit
todo Task management NestJS, SvelteKit
contacts Contact management NestJS, SvelteKit
manadeck Card/deck management NestJS, Expo, SvelteKit
picture AI image generation NestJS, Expo, SvelteKit
zitare Daily inspiration quotes NestJS, Expo, SvelteKit

Getting Started

Prerequisites

  • Node.js 20+
  • pnpm 9.15.0+
  • Docker (for local development)

Installation

# Install pnpm globally (if not installed)
npm install -g pnpm

# Install all dependencies (also generates .env files)
pnpm install

# Start Docker infrastructure
pnpm docker:up

Quick Start

Use dev:*:full commands to start any app with automatic database setup:

pnpm docker:up           # Start PostgreSQL, Redis, MinIO
pnpm dev:chat:full       # Start chat with auth + auto DB setup
pnpm dev:calendar:full   # Start calendar with auth + auto DB setup
pnpm dev:clock:full      # Start clock with auth + auto DB setup
pnpm dev:todo:full       # Start todo with auth + auto DB setup
pnpm dev:manacore:full   # Start manacore with all backends

Development Commands

# Build all projects
pnpm build

# Type check
pnpm type-check

# Lint
pnpm lint

# Format code
pnpm format

Shared Packages

Located in packages/:

Package Description
@manacore/shared-auth Client-side auth for web/mobile
@manacore/shared-nestjs-auth NestJS JWT validation guards
@manacore/shared-ui Shared Svelte UI components
@manacore/shared-storage S3-compatible storage (MinIO/Hetzner)
@manacore/shared-types Common TypeScript types
@manacore/shared-utils Utility functions
@manacore/shared-theme Theme configuration

Repository Structure

manacore-monorepo/
├── apps/                    # Active product applications
│   ├── manacore/            # Central dashboard
│   ├── chat/                # AI chat app
│   ├── calendar/            # Calendar app
│   ├── clock/               # Clock/timer app
│   ├── todo/                # Task management
│   ├── contacts/            # Contact management
│   ├── manadeck/            # Card/deck app
│   ├── picture/             # AI image generation
│   └── zitare/              # Daily quotes
├── apps-archived/           # Archived projects
├── games/                   # Game projects
├── services/
│   └── mana-core-auth/      # Central auth service
├── packages/                # Shared packages
├── docker/                  # Docker configuration
└── .github/workflows/       # CI/CD pipelines

Tooling

  • Package Manager: pnpm 9.15.0
  • Build System: Turborepo
  • Formatting: Prettier
  • Linting: ESLint
  • Git Hooks: Husky (pre-commit, pre-push)
  • Node Version: 20+

Adding Dependencies

# Add to workspace root (dev tools only)
pnpm add -D <package> -w

# Add to specific project
pnpm add <package> --filter @chat/web

# Add to shared package
pnpm add <package> --filter @manacore/shared-utils

Deployment

Deploy Landing Pages

pnpm deploy:landing:chat
pnpm deploy:landing:picture
pnpm deploy:landing:manacore
pnpm deploy:landing:all    # Deploy all landing pages

Deploy to Staging

# Tag-based deployment (triggers CI/CD)
git tag chat-staging-v1.0.0
git push origin chat-staging-v1.0.0

Documentation

License

Private - All rights reserved