refactor: restructure
monorepo with apps/ and services/ directories
467
.claude/plans/monorepo-restructure-migration.md
Normal file
|
|
@ -0,0 +1,467 @@
|
||||||
|
# Monorepo Restructure Migration Plan
|
||||||
|
|
||||||
|
## Target Structure
|
||||||
|
|
||||||
|
```
|
||||||
|
manacore-monorepo/
|
||||||
|
├── apps/ # All product applications
|
||||||
|
│ ├── chat/
|
||||||
|
│ │ ├── apps/
|
||||||
|
│ │ │ ├── backend/ # NestJS API (@chat/backend)
|
||||||
|
│ │ │ ├── mobile/ # Expo (@chat/mobile)
|
||||||
|
│ │ │ ├── web/ # SvelteKit (@chat/web)
|
||||||
|
│ │ │ └── landing/ # Astro (@chat/landing)
|
||||||
|
│ │ ├── packages/
|
||||||
|
│ │ │ └── chat-types/ # Shared types (@chat/types)
|
||||||
|
│ │ ├── package.json
|
||||||
|
│ │ └── CLAUDE.md
|
||||||
|
│ │
|
||||||
|
│ ├── maerchenzauber/
|
||||||
|
│ │ ├── apps/
|
||||||
|
│ │ │ ├── backend/
|
||||||
|
│ │ │ ├── mobile/
|
||||||
|
│ │ │ ├── web/
|
||||||
|
│ │ │ └── landing/
|
||||||
|
│ │ └── packages/
|
||||||
|
│ │
|
||||||
|
│ ├── manadeck/
|
||||||
|
│ │ ├── apps/
|
||||||
|
│ │ │ ├── backend/
|
||||||
|
│ │ │ ├── mobile/
|
||||||
|
│ │ │ ├── web/
|
||||||
|
│ │ │ └── landing/
|
||||||
|
│ │ └── packages/
|
||||||
|
│ │
|
||||||
|
│ ├── memoro/
|
||||||
|
│ │ ├── apps/
|
||||||
|
│ │ │ ├── mobile/
|
||||||
|
│ │ │ ├── web/
|
||||||
|
│ │ │ └── landing/
|
||||||
|
│ │ └── packages/
|
||||||
|
│ │
|
||||||
|
│ ├── picture/
|
||||||
|
│ │ ├── apps/
|
||||||
|
│ │ │ ├── mobile/
|
||||||
|
│ │ │ ├── web/
|
||||||
|
│ │ │ └── landing/
|
||||||
|
│ │ └── packages/
|
||||||
|
│ │
|
||||||
|
│ ├── nutriphi/
|
||||||
|
│ │ ├── apps/
|
||||||
|
│ │ │ ├── backend/
|
||||||
|
│ │ │ ├── mobile/
|
||||||
|
│ │ │ ├── web/
|
||||||
|
│ │ │ └── landing/
|
||||||
|
│ │ └── packages/
|
||||||
|
│ │
|
||||||
|
│ ├── uload/
|
||||||
|
│ │ ├── apps/
|
||||||
|
│ │ │ ├── backend/
|
||||||
|
│ │ │ └── web/
|
||||||
|
│ │ └── packages/
|
||||||
|
│ │
|
||||||
|
│ ├── news/
|
||||||
|
│ │ ├── apps/
|
||||||
|
│ │ │ ├── api/
|
||||||
|
│ │ │ ├── mobile/
|
||||||
|
│ │ │ ├── web/
|
||||||
|
│ │ │ └── landing/
|
||||||
|
│ │ └── packages/
|
||||||
|
│ │
|
||||||
|
│ └── manacore/
|
||||||
|
│ ├── apps/
|
||||||
|
│ │ ├── mobile/
|
||||||
|
│ │ ├── web/
|
||||||
|
│ │ └── landing/
|
||||||
|
│ └── packages/
|
||||||
|
│
|
||||||
|
├── services/ # Standalone microservices
|
||||||
|
│ └── mana-core-auth/ # Central auth service
|
||||||
|
│ ├── src/
|
||||||
|
│ ├── postgres/
|
||||||
|
│ ├── Dockerfile
|
||||||
|
│ └── package.json
|
||||||
|
│
|
||||||
|
├── packages/ # Monorepo-wide shared packages
|
||||||
|
│ ├── shared-auth/
|
||||||
|
│ ├── shared-types/
|
||||||
|
│ ├── shared-utils/
|
||||||
|
│ └── ... (24 packages)
|
||||||
|
│
|
||||||
|
├── docker/
|
||||||
|
│ ├── init-db/
|
||||||
|
│ ├── prometheus/
|
||||||
|
│ ├── grafana/
|
||||||
|
│ └── minio/
|
||||||
|
│
|
||||||
|
├── docker-compose.dev.yml
|
||||||
|
├── docker-compose.yml
|
||||||
|
├── pnpm-workspace.yaml
|
||||||
|
├── turbo.json
|
||||||
|
└── package.json
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Phase 1: Preparation (Pre-Migration)
|
||||||
|
|
||||||
|
### 1.1 Create backup branch
|
||||||
|
```bash
|
||||||
|
git checkout -b backup/pre-restructure
|
||||||
|
git push origin backup/pre-restructure
|
||||||
|
git checkout main
|
||||||
|
git checkout -b feat/monorepo-restructure
|
||||||
|
```
|
||||||
|
|
||||||
|
### 1.2 Create target directories
|
||||||
|
```bash
|
||||||
|
mkdir -p apps
|
||||||
|
mkdir -p services
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Phase 2: Move Product Applications
|
||||||
|
|
||||||
|
### 2.1 Move projects to apps/ folder
|
||||||
|
|
||||||
|
| Source | Destination |
|
||||||
|
|--------|-------------|
|
||||||
|
| `chat/` | `apps/chat/` |
|
||||||
|
| `maerchenzauber/` | `apps/maerchenzauber/` |
|
||||||
|
| `manadeck/` | `apps/manadeck/` |
|
||||||
|
| `memoro/` | `apps/memoro/` |
|
||||||
|
| `picture/` | `apps/picture/` |
|
||||||
|
| `nutriphi/` | `apps/nutriphi/` |
|
||||||
|
| `uload/` | `apps/uload/` |
|
||||||
|
| `news/` | `apps/news/` |
|
||||||
|
| `manacore/` | `apps/manacore/` |
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Move all products to apps/
|
||||||
|
git mv chat apps/chat
|
||||||
|
git mv maerchenzauber apps/maerchenzauber
|
||||||
|
git mv manadeck apps/manadeck
|
||||||
|
git mv memoro apps/memoro
|
||||||
|
git mv picture apps/picture
|
||||||
|
git mv nutriphi apps/nutriphi
|
||||||
|
git mv uload apps/uload
|
||||||
|
git mv news apps/news
|
||||||
|
git mv manacore apps/manacore
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2.2 Restructure backends to apps/ subfolder
|
||||||
|
|
||||||
|
Projects with backends at root level need restructuring:
|
||||||
|
|
||||||
|
| Source | Destination |
|
||||||
|
|--------|-------------|
|
||||||
|
| `apps/chat/backend/` | `apps/chat/apps/backend/` |
|
||||||
|
| `apps/manadeck/backend/` | `apps/manadeck/apps/backend/` |
|
||||||
|
| `apps/nutriphi/backend/` | `apps/nutriphi/apps/backend/` |
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Chat: move backend into apps/
|
||||||
|
mkdir -p apps/chat/apps
|
||||||
|
git mv apps/chat/backend apps/chat/apps/backend
|
||||||
|
|
||||||
|
# Manadeck: move backend into apps/
|
||||||
|
mkdir -p apps/manadeck/apps
|
||||||
|
git mv apps/manadeck/backend apps/manadeck/apps/backend
|
||||||
|
|
||||||
|
# Nutriphi: move backend into apps/
|
||||||
|
mkdir -p apps/nutriphi/apps
|
||||||
|
git mv apps/nutriphi/backend apps/nutriphi/apps/backend
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2.3 Move mana-core-auth to services/
|
||||||
|
```bash
|
||||||
|
git mv mana-core-auth services/mana-core-auth
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Phase 3: Update Configuration Files
|
||||||
|
|
||||||
|
### 3.1 Update pnpm-workspace.yaml
|
||||||
|
|
||||||
|
**New content:**
|
||||||
|
```yaml
|
||||||
|
packages:
|
||||||
|
# Product applications
|
||||||
|
- 'apps/*'
|
||||||
|
- 'apps/*/apps/*'
|
||||||
|
- 'apps/*/packages/*'
|
||||||
|
|
||||||
|
# Standalone services
|
||||||
|
- 'services/*'
|
||||||
|
|
||||||
|
# Shared packages
|
||||||
|
- 'packages/*'
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3.2 Update turbo.json
|
||||||
|
|
||||||
|
No changes needed - turbo.json uses task definitions, not paths.
|
||||||
|
|
||||||
|
### 3.3 Update root package.json scripts
|
||||||
|
|
||||||
|
**Replace scripts section:**
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"scripts": {
|
||||||
|
"dev": "turbo run dev",
|
||||||
|
"build": "turbo run build",
|
||||||
|
"test": "turbo run test",
|
||||||
|
"lint": "turbo run lint",
|
||||||
|
"type-check": "turbo run type-check",
|
||||||
|
"clean": "turbo run clean",
|
||||||
|
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md,svelte,astro}\"",
|
||||||
|
"format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,json,md,svelte,astro}\"",
|
||||||
|
|
||||||
|
"maerchenzauber:dev": "turbo run dev --filter=@maerchenzauber/*...",
|
||||||
|
"manacore:dev": "turbo run dev --filter=@manacore/*...",
|
||||||
|
"manadeck:dev": "turbo run dev --filter=@manadeck/*...",
|
||||||
|
"memoro:dev": "turbo run dev --filter=@memoro/*...",
|
||||||
|
"picture:dev": "turbo run dev --filter=@picture/*...",
|
||||||
|
"uload:dev": "turbo run dev --filter=@uload/*...",
|
||||||
|
"chat:dev": "turbo run dev --filter=@chat/*...",
|
||||||
|
"nutriphi:dev": "turbo run dev --filter=@nutriphi/*...",
|
||||||
|
"news:dev": "turbo run dev --filter=@news/*...",
|
||||||
|
|
||||||
|
"dev:maerchenzauber:web": "pnpm --filter @maerchenzauber/web dev",
|
||||||
|
"dev:maerchenzauber:landing": "pnpm --filter @maerchenzauber/landing dev",
|
||||||
|
"dev:maerchenzauber:backend": "pnpm --filter @maerchenzauber/backend dev",
|
||||||
|
"dev:maerchenzauber:mobile": "pnpm --filter @maerchenzauber/mobile dev",
|
||||||
|
"dev:maerchenzauber:app": "turbo run dev --filter=@maerchenzauber/web --filter=@maerchenzauber/backend",
|
||||||
|
|
||||||
|
"dev:manacore:web": "pnpm --filter @manacore/web dev",
|
||||||
|
"dev:manacore:landing": "pnpm --filter @manacore/landing dev",
|
||||||
|
"dev:manacore:mobile": "pnpm --filter @manacore/mobile dev",
|
||||||
|
|
||||||
|
"dev:manadeck:web": "pnpm --filter @manadeck/web dev",
|
||||||
|
"dev:manadeck:landing": "pnpm --filter @manadeck/landing dev",
|
||||||
|
"dev:manadeck:backend": "pnpm --filter @manadeck/backend dev",
|
||||||
|
"dev:manadeck:mobile": "pnpm --filter @manadeck/mobile dev",
|
||||||
|
"dev:manadeck:app": "turbo run dev --filter=@manadeck/web --filter=@manadeck/backend",
|
||||||
|
|
||||||
|
"dev:memoro:web": "pnpm --filter @memoro/web dev",
|
||||||
|
"dev:memoro:landing": "pnpm --filter @memoro/landing dev",
|
||||||
|
"dev:memoro:mobile": "pnpm --filter @memoro/mobile dev",
|
||||||
|
|
||||||
|
"dev:picture:web": "pnpm --filter @picture/web dev",
|
||||||
|
"dev:picture:landing": "pnpm --filter @picture/landing dev",
|
||||||
|
"dev:picture:mobile": "pnpm --filter @picture/mobile dev",
|
||||||
|
|
||||||
|
"dev:uload:web": "pnpm --filter @uload/web dev",
|
||||||
|
|
||||||
|
"dev:chat:mobile": "pnpm --filter @chat/mobile dev",
|
||||||
|
"dev:chat:web": "pnpm --filter @chat/web dev",
|
||||||
|
"dev:chat:landing": "pnpm --filter @chat/landing dev",
|
||||||
|
"dev:chat:backend": "pnpm --filter @chat/backend start:dev",
|
||||||
|
"dev:chat:app": "turbo run dev --filter=@chat/web --filter=@chat/backend",
|
||||||
|
|
||||||
|
"dev:nutriphi:mobile": "pnpm --filter @nutriphi/mobile dev",
|
||||||
|
"dev:nutriphi:web": "pnpm --filter @nutriphi/web dev",
|
||||||
|
"dev:nutriphi:landing": "pnpm --filter @nutriphi/landing dev",
|
||||||
|
"dev:nutriphi:backend": "pnpm --filter @nutriphi/backend start:dev",
|
||||||
|
"dev:nutriphi:app": "turbo run dev --filter=@nutriphi/web --filter=@nutriphi/backend",
|
||||||
|
|
||||||
|
"dev:news:mobile": "pnpm --filter @news/mobile dev",
|
||||||
|
"dev:news:web": "pnpm --filter @news/web dev",
|
||||||
|
"dev:news:landing": "pnpm --filter @news/landing dev",
|
||||||
|
"dev:news:api": "pnpm --filter @news/api start:dev",
|
||||||
|
"dev:news:app": "turbo run dev --filter=@news/web --filter=@news/api",
|
||||||
|
"news:db:push": "pnpm --filter @manacore/news-database db:push",
|
||||||
|
"news:db:studio": "pnpm --filter @manacore/news-database db:studio",
|
||||||
|
|
||||||
|
"docker:up": "docker compose -f docker-compose.dev.yml up -d postgres redis",
|
||||||
|
"docker:up:auth": "docker compose -f docker-compose.dev.yml --profile auth up -d",
|
||||||
|
"docker:up:chat": "docker compose -f docker-compose.dev.yml --profile chat up -d",
|
||||||
|
"docker:up:all": "docker compose -f docker-compose.dev.yml --profile all up -d",
|
||||||
|
"docker:down": "docker compose -f docker-compose.dev.yml --profile all down",
|
||||||
|
"docker:logs": "docker compose -f docker-compose.dev.yml logs -f",
|
||||||
|
"docker:logs:auth": "docker compose -f docker-compose.dev.yml logs -f mana-core-auth",
|
||||||
|
"docker:logs:chat": "docker compose -f docker-compose.dev.yml logs -f chat-backend",
|
||||||
|
"docker:ps": "docker compose -f docker-compose.dev.yml ps -a",
|
||||||
|
"docker:clean": "docker compose -f docker-compose.dev.yml --profile all down -v"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Phase 4: Update Docker Configuration
|
||||||
|
|
||||||
|
### 4.1 Update docker-compose.dev.yml
|
||||||
|
|
||||||
|
**Key changes:**
|
||||||
|
- mana-core-auth Dockerfile path: `./services/mana-core-auth/Dockerfile`
|
||||||
|
- chat-backend Dockerfile path: `./apps/chat/apps/backend/Dockerfile`
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
services:
|
||||||
|
# ... postgres and redis unchanged ...
|
||||||
|
|
||||||
|
mana-core-auth:
|
||||||
|
profiles: ["auth", "all"]
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: ./services/mana-core-auth/Dockerfile
|
||||||
|
# ... rest unchanged ...
|
||||||
|
|
||||||
|
chat-backend:
|
||||||
|
profiles: ["chat", "all"]
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: ./apps/chat/apps/backend/Dockerfile
|
||||||
|
# ... rest unchanged ...
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4.2 Update individual Dockerfiles
|
||||||
|
|
||||||
|
Each Dockerfile needs path updates for COPY commands.
|
||||||
|
|
||||||
|
**services/mana-core-auth/Dockerfile:**
|
||||||
|
```dockerfile
|
||||||
|
# Update COPY paths
|
||||||
|
COPY services/mana-core-auth/package.json ./services/mana-core-auth/
|
||||||
|
COPY packages/ ./packages/
|
||||||
|
# etc.
|
||||||
|
```
|
||||||
|
|
||||||
|
**apps/chat/apps/backend/Dockerfile:**
|
||||||
|
```dockerfile
|
||||||
|
# Update COPY paths
|
||||||
|
COPY apps/chat/apps/backend/package.json ./apps/chat/apps/backend/
|
||||||
|
COPY apps/chat/packages/ ./apps/chat/packages/
|
||||||
|
COPY packages/ ./packages/
|
||||||
|
# etc.
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Phase 5: Update Internal References
|
||||||
|
|
||||||
|
### 5.1 Update CLAUDE.md files
|
||||||
|
|
||||||
|
Each project's CLAUDE.md needs path updates in documentation.
|
||||||
|
|
||||||
|
### 5.2 Update relative imports in code
|
||||||
|
|
||||||
|
Check for any hardcoded relative paths like:
|
||||||
|
- `../../packages/`
|
||||||
|
- `../../../shared/`
|
||||||
|
|
||||||
|
These may need adjustment.
|
||||||
|
|
||||||
|
### 5.3 Update .env files
|
||||||
|
|
||||||
|
Environment files should still work but verify paths for:
|
||||||
|
- File-based configs
|
||||||
|
- Volume mounts
|
||||||
|
- Any path references
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Phase 6: Validation & Testing
|
||||||
|
|
||||||
|
### 6.1 Reinstall dependencies
|
||||||
|
```bash
|
||||||
|
rm -rf node_modules
|
||||||
|
rm pnpm-lock.yaml
|
||||||
|
pnpm install
|
||||||
|
```
|
||||||
|
|
||||||
|
### 6.2 Verify workspace packages
|
||||||
|
```bash
|
||||||
|
pnpm ls -r --depth 0
|
||||||
|
```
|
||||||
|
|
||||||
|
### 6.3 Test turbo commands
|
||||||
|
```bash
|
||||||
|
pnpm chat:dev # Should start all chat apps
|
||||||
|
pnpm dev:chat:web # Should start just web
|
||||||
|
pnpm type-check # Should check all projects
|
||||||
|
```
|
||||||
|
|
||||||
|
### 6.4 Test Docker
|
||||||
|
```bash
|
||||||
|
pnpm docker:up:all
|
||||||
|
pnpm docker:ps
|
||||||
|
pnpm docker:logs
|
||||||
|
```
|
||||||
|
|
||||||
|
### 6.5 Build all projects
|
||||||
|
```bash
|
||||||
|
pnpm build
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Phase 7: Commit & Merge
|
||||||
|
|
||||||
|
### 7.1 Commit changes
|
||||||
|
```bash
|
||||||
|
git add .
|
||||||
|
git commit -m "refactor: restructure monorepo with apps/ and services/ directories
|
||||||
|
|
||||||
|
- Move all product applications under apps/
|
||||||
|
- Move standalone microservices under services/
|
||||||
|
- Standardize backend location to apps/{project}/apps/backend/
|
||||||
|
- Update pnpm-workspace.yaml for new structure
|
||||||
|
- Update docker-compose paths
|
||||||
|
- Update root package.json scripts"
|
||||||
|
```
|
||||||
|
|
||||||
|
### 7.2 Create PR
|
||||||
|
```bash
|
||||||
|
gh pr create --title "refactor: monorepo restructure" --body "..."
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Rollback Plan
|
||||||
|
|
||||||
|
If issues arise:
|
||||||
|
```bash
|
||||||
|
git checkout main
|
||||||
|
git branch -D feat/monorepo-restructure
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Migration Checklist
|
||||||
|
|
||||||
|
- [ ] Create backup branch
|
||||||
|
- [ ] Create apps/ and services/ directories
|
||||||
|
- [ ] Move 9 product projects to apps/
|
||||||
|
- [ ] Move backends into apps/{project}/apps/backend/
|
||||||
|
- [ ] Move mana-core-auth to services/
|
||||||
|
- [ ] Update pnpm-workspace.yaml
|
||||||
|
- [ ] Update root package.json scripts
|
||||||
|
- [ ] Update docker-compose.dev.yml paths
|
||||||
|
- [ ] Update docker-compose.yml paths (production)
|
||||||
|
- [ ] Update Dockerfiles COPY paths
|
||||||
|
- [ ] Update CLAUDE.md documentation
|
||||||
|
- [ ] Reinstall dependencies (pnpm install)
|
||||||
|
- [ ] Test turbo dev commands
|
||||||
|
- [ ] Test Docker builds
|
||||||
|
- [ ] Run type-check
|
||||||
|
- [ ] Run build
|
||||||
|
- [ ] Commit and create PR
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Estimated Impact
|
||||||
|
|
||||||
|
| Item | Count |
|
||||||
|
|------|-------|
|
||||||
|
| Directories to move | 10 |
|
||||||
|
| Config files to update | 5-6 |
|
||||||
|
| Dockerfiles to update | ~6 |
|
||||||
|
| package.json scripts | ~40 (most unchanged) |
|
||||||
|
| CLAUDE.md files | ~10 |
|
||||||
|
|
||||||
|
**Risk Level:** Medium - Many file moves but package names unchanged
|
||||||
|
**Estimated Time:** 2-4 hours with testing
|
||||||
35
CLAUDE.md
|
|
@ -49,9 +49,29 @@ Each project has its own `CLAUDE.md` with detailed project-specific commands.
|
||||||
|
|
||||||
## Architecture Patterns
|
## Architecture Patterns
|
||||||
|
|
||||||
### Standard Project Structure
|
### Monorepo Structure
|
||||||
```
|
```
|
||||||
project/
|
manacore-monorepo/
|
||||||
|
├── apps/ # All product applications
|
||||||
|
│ ├── chat/
|
||||||
|
│ │ ├── apps/
|
||||||
|
│ │ │ ├── backend/ # NestJS API
|
||||||
|
│ │ │ ├── mobile/ # Expo React Native app
|
||||||
|
│ │ │ ├── web/ # SvelteKit web app
|
||||||
|
│ │ │ └── landing/ # Astro marketing page
|
||||||
|
│ │ └── packages/ # Project-specific shared code
|
||||||
|
│ ├── maerchenzauber/
|
||||||
|
│ ├── manadeck/
|
||||||
|
│ └── ...
|
||||||
|
├── services/ # Standalone microservices
|
||||||
|
│ └── mana-core-auth/ # Central authentication service
|
||||||
|
├── packages/ # Monorepo-wide shared packages
|
||||||
|
└── docker/ # Docker configuration files
|
||||||
|
```
|
||||||
|
|
||||||
|
### Standard Project Structure (inside apps/)
|
||||||
|
```
|
||||||
|
apps/{project}/
|
||||||
├── apps/
|
├── apps/
|
||||||
│ ├── backend/ # NestJS API (when present)
|
│ ├── backend/ # NestJS API (when present)
|
||||||
│ ├── mobile/ # Expo React Native app
|
│ ├── mobile/ # Expo React Native app
|
||||||
|
|
@ -174,11 +194,12 @@ PORT=...
|
||||||
## Project-Specific Documentation
|
## Project-Specific Documentation
|
||||||
|
|
||||||
Each project has its own `CLAUDE.md` with detailed information:
|
Each project has its own `CLAUDE.md` with detailed information:
|
||||||
- `maerchenzauber/CLAUDE.md` - Story generation specifics, AI services
|
- `apps/maerchenzauber/CLAUDE.md` - Story generation specifics, AI services
|
||||||
- `manacore/CLAUDE.md` - Multi-app ecosystem, auth details
|
- `apps/manacore/CLAUDE.md` - Multi-app ecosystem, auth details
|
||||||
- `memoro/CLAUDE.md` - Audio recording, AI processing
|
- `apps/memoro/CLAUDE.md` - Audio recording, AI processing
|
||||||
- `uload/CLAUDE.md` - URL shortener, Drizzle ORM
|
- `apps/uload/CLAUDE.md` - URL shortener, Drizzle ORM
|
||||||
- `chat/CLAUDE.md` - Chat API endpoints, AI models
|
- `apps/chat/CLAUDE.md` - Chat API endpoints, AI models
|
||||||
|
- `services/mana-core-auth/` - Central authentication service
|
||||||
|
|
||||||
Navigate to the specific project directory to work on it.
|
Navigate to the specific project directory to work on it.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,12 @@
|
||||||
## Project Structure
|
## Project Structure
|
||||||
|
|
||||||
```
|
```
|
||||||
chat/
|
apps/chat/
|
||||||
├── apps/
|
├── apps/
|
||||||
|
│ ├── backend/ # NestJS API server (@chat/backend)
|
||||||
│ ├── landing/ # Astro marketing landing page (@chat/landing)
|
│ ├── landing/ # Astro marketing landing page (@chat/landing)
|
||||||
│ ├── web/ # SvelteKit web application (@chat/web)
|
│ ├── web/ # SvelteKit web application (@chat/web)
|
||||||
│ └── mobile/ # Expo/React Native mobile app (@chat/mobile)
|
│ └── mobile/ # Expo/React Native mobile app (@chat/mobile)
|
||||||
├── backend/ # NestJS API server (@chat/backend)
|
|
||||||
├── packages/
|
├── packages/
|
||||||
│ └── chat-types/ # Shared TypeScript types (@chat/types)
|
│ └── chat-types/ # Shared TypeScript types (@chat/types)
|
||||||
└── package.json
|
└── package.json
|
||||||
|
|
@ -35,7 +35,7 @@ pnpm build:preview # Build preview version
|
||||||
pnpm build:prod # Build production version
|
pnpm build:prod # Build production version
|
||||||
```
|
```
|
||||||
|
|
||||||
### Backend (chat/backend)
|
### Backend (apps/chat/apps/backend)
|
||||||
```bash
|
```bash
|
||||||
pnpm start:dev # Start with hot reload
|
pnpm start:dev # Start with hot reload
|
||||||
pnpm build # Build for production
|
pnpm build # Build for production
|
||||||
|
|
@ -15,7 +15,7 @@ COPY pnpm-lock.yaml ./
|
||||||
COPY packages/shared-errors ./packages/shared-errors
|
COPY packages/shared-errors ./packages/shared-errors
|
||||||
|
|
||||||
# Copy chat backend
|
# Copy chat backend
|
||||||
COPY chat/backend ./chat/backend
|
COPY apps/chat/apps/backend ./apps/chat/apps/backend
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN pnpm install --frozen-lockfile
|
RUN pnpm install --frozen-lockfile
|
||||||
|
|
@ -25,7 +25,7 @@ WORKDIR /app/packages/shared-errors
|
||||||
RUN pnpm build
|
RUN pnpm build
|
||||||
|
|
||||||
# Build the backend
|
# Build the backend
|
||||||
WORKDIR /app/chat/backend
|
WORKDIR /app/apps/chat/apps/backend
|
||||||
RUN pnpm build
|
RUN pnpm build
|
||||||
|
|
||||||
# Production stage
|
# Production stage
|
||||||
|
|
@ -43,13 +43,13 @@ COPY --from=builder /app/package.json ./
|
||||||
COPY --from=builder /app/pnpm-lock.yaml ./
|
COPY --from=builder /app/pnpm-lock.yaml ./
|
||||||
COPY --from=builder /app/node_modules ./node_modules
|
COPY --from=builder /app/node_modules ./node_modules
|
||||||
COPY --from=builder /app/packages ./packages
|
COPY --from=builder /app/packages ./packages
|
||||||
COPY --from=builder /app/chat/backend ./chat/backend
|
COPY --from=builder /app/apps/chat/apps/backend ./apps/chat/apps/backend
|
||||||
|
|
||||||
# Copy entrypoint script
|
# Copy entrypoint script
|
||||||
COPY chat/backend/docker-entrypoint.sh /usr/local/bin/
|
COPY apps/chat/apps/backend/docker-entrypoint.sh /usr/local/bin/
|
||||||
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
||||||
|
|
||||||
WORKDIR /app/chat/backend
|
WORKDIR /app/apps/chat/apps/backend
|
||||||
|
|
||||||
# Expose port
|
# Expose port
|
||||||
EXPOSE 3002
|
EXPOSE 3002
|
||||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |