Mirror of github.com/Memo-2023/mana-monorepo
Find a file
Wuesteon 0fa154c7d6 🐛 fix(shared-auth): add automatic token refresh on 401 responses
- Add backendUrl parameter to initializeWebAuth() for interceptor config
- Expand isTokenExpiredResponse() to match more error patterns:
  - "invalid token", "token validation failed", "claim" (jose errors)
  - ERR_JWT_EXPIRED error code
- Update all web apps to pass backendUrl for automatic refresh:
  - picture (3006), chat (3002), zitare (3007), contacts (3015)
  - calendar (3014), clock (3017), todo (3018)
- Fix API client default port in picture web app

This prevents users from being randomly signed out when JWT expires.
The interceptor now catches 401 responses and automatically refreshes
the token before retrying the request.
2025-12-12 20:47:43 +01:00
.claude fix(todo): use TEXT for user_id columns (Better Auth compatibility) 2025-12-09 16:24:22 +01:00
.claude-flow/metrics 🙈 chore: ignore claude-flow metrics from git tracking 2025-12-08 14:38:41 +01:00
.github chore(ci): add staging config protection and validation 2025-12-10 13:48:45 +01:00
.husky 🔧 chore: add lint-staged for pre-commit formatting 2025-12-03 02:04:41 +01:00
apps 🐛 fix(shared-auth): add automatic token refresh on 401 responses 2025-12-12 20:47:43 +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 feat(splitscreen): add split-screen feature for multi-app side-by-side view 2025-12-12 13:00:26 +01:00
games fix(db): use TEXT for user_id columns across entire codebase 2025-12-09 16:30:51 +01:00
packages 🐛 fix(shared-auth): add automatic token refresh on 401 responses 2025-12-12 20:47:43 +01:00
scripts refactor(todo): rename Labels to Tags for consistency across apps 2025-12-10 21:12:08 +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 refactor(todo): rename Labels to Tags for consistency across apps 2025-12-10 21:12:08 +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
doc_nils.md fix styleing 2025-12-04 23:40:25 +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 fix(staging): use HTTPS staging domains for all client URLs 2025-12-10 03:27:46 +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 Fix wrong type 2025-12-04 23:25:25 +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: major update with network graphs, themes, todo extensions, and more 2025-12-10 02:37:46 +01:00
playwright.config.ts style: auto-format codebase with Prettier 2025-11-27 18:33:16 +01:00
pnpm-lock.yaml feat(splitscreen): add split-screen feature for multi-app side-by-side view 2025-12-12 13:00:26 +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 style: auto-format codebase with Prettier 2025-11-27 18:33:16 +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.

Projects

Project Description Tech Stack
maerchenzauber AI-powered story generation app NestJS, Expo, SvelteKit, Astro
manacore Multi-app ecosystem platform Expo, SvelteKit, Astro
manadeck Card/deck management app NestJS, Expo, SvelteKit
memoro Voice memo & AI analysis app Expo, SvelteKit, Astro

Getting Started

Prerequisites

  • Node.js 20+
  • pnpm 9.15.0+

Installation

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

# Install all dependencies
pnpm install

Development

# Start all projects in dev mode
pnpm run dev

# Start a specific project
pnpm run maerchenzauber:dev
pnpm run manacore:dev
pnpm run manadeck:dev
pnpm run memoro:dev

# Build all projects
pnpm run build

# Run tests
pnpm run test

# Type check
pnpm run type-check

# Format code
pnpm run format

Shared Packages

Located in packages/:

Package Description
@manacore/shared-types Common TypeScript types
@manacore/shared-supabase Unified Supabase client
@manacore/shared-utils Utility functions (date, string, async)
@manacore/shared-ui React Native UI components

Using Shared Packages

// In any project
import { User, ApiResponse } from '@manacore/shared-types';
import { createSupabaseClient } from '@manacore/shared-supabase';
import { formatDate, truncate, retry } from '@manacore/shared-utils';

Repository Structure

manacore-monorepo/
├── packages/                 # Shared packages
│   ├── shared-types/         # TypeScript types
│   ├── shared-supabase/      # Supabase utilities
│   ├── shared-utils/         # Common utilities
│   └── shared-ui/            # React Native components
├── maerchenzauber/           # Storyteller project
├── manacore/                 # Manacore apps project
├── manadeck/                 # ManaDeck project
├── memoro/                   # Memoro project
├── turbo.json                # Turborepo configuration
├── pnpm-workspace.yaml       # Workspace configuration
└── package.json              # Root package

Tooling

  • Package Manager: pnpm 9.15.0
  • Build System: Turborepo
  • Formatting: Prettier
  • Node Version: 20 (see .nvmrc)

Adding Dependencies

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

# Add to specific project
pnpm add <package> --filter maerchenzauber

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

Contributing

  1. Create a feature branch
  2. Make changes
  3. Run pnpm run format and pnpm run type-check
  4. Commit with conventional commit messages
  5. Create pull request

License

Private - All rights reserved