Structure: - control-plane/: Registries, SIMCO directives, CI/CD templates - projects/: Gamilit, ERP-Suite, Trading-Platform, Betting-Analytics - shared/: Libs catalog, knowledge-base Key features: - Centralized port, domain, database, and service registries - 23 SIMCO directives + 6 fundamental principles - NEXUS agent profiles with delegation rules - Validation scripts for workspace integrity - Dockerfiles for all services - Path aliases for quick reference 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
494 lines
9.1 KiB
Markdown
494 lines
9.1 KiB
Markdown
# GAMILIT - TAREAS DE IMPLEMENTACION
|
|
|
|
**Proyecto:** Gamilit Platform
|
|
**Fase:** 4.1 - Migracion de Gamilit
|
|
**Estado:** Planificado
|
|
|
|
---
|
|
|
|
## RESUMEN DE TAREAS
|
|
|
|
| Grupo | Tareas | Esfuerzo Total |
|
|
|-------|--------|----------------|
|
|
| T4.1.1 Estructura | 4 | 2 horas |
|
|
| T4.1.2 Service Descriptors | 2 | 2 horas |
|
|
| T4.1.3 Migracion Codigo | 4 | 4 horas |
|
|
| T4.1.4 Docker Compose | 3 | 3 horas |
|
|
| T4.1.5 Orchestration | 2 | 1 hora |
|
|
| T4.1.6 Validacion | 3 | 2 horas |
|
|
| **TOTAL** | **18** | **14 horas** |
|
|
|
|
---
|
|
|
|
## T4.1.1 ESTRUCTURA BASE
|
|
|
|
### T4.1.1.1 Crear estructura de carpetas
|
|
|
|
**Esfuerzo:** 0.5 horas
|
|
|
|
```bash
|
|
# Crear estructura base
|
|
mkdir -p gamilit-platform/{apps/{backend,frontend,database/{ddl,seeds,migrations}},docker,orchestration,docs,.github/workflows}
|
|
```
|
|
|
|
### T4.1.1.2 Crear package.json root
|
|
|
|
**Esfuerzo:** 0.5 horas
|
|
|
|
```json
|
|
{
|
|
"name": "gamilit-platform",
|
|
"version": "1.0.0",
|
|
"private": true,
|
|
"workspaces": [
|
|
"apps/backend",
|
|
"apps/frontend"
|
|
],
|
|
"scripts": {
|
|
"dev": "concurrently \"npm run dev:backend\" \"npm run dev:frontend\"",
|
|
"dev:backend": "npm -w apps/backend run dev",
|
|
"dev:frontend": "npm -w apps/frontend run dev",
|
|
"build": "npm run build:backend && npm run build:frontend",
|
|
"build:backend": "npm -w apps/backend run build",
|
|
"build:frontend": "npm -w apps/frontend run build",
|
|
"test": "npm run test:backend && npm run test:frontend",
|
|
"lint": "npm run lint:backend && npm run lint:frontend"
|
|
}
|
|
}
|
|
```
|
|
|
|
### T4.1.1.3 Crear README.md
|
|
|
|
**Esfuerzo:** 0.5 horas
|
|
|
|
### T4.1.1.4 Crear .gitignore
|
|
|
|
**Esfuerzo:** 0.5 horas
|
|
|
|
---
|
|
|
|
## T4.1.2 SERVICE DESCRIPTORS
|
|
|
|
### T4.1.2.1 Crear service.descriptor.yml para Backend
|
|
|
|
**Esfuerzo:** 1 hora
|
|
|
|
**Ubicacion:** apps/backend/service.descriptor.yml
|
|
|
|
```yaml
|
|
# service.descriptor.yml - Gamilit API
|
|
service:
|
|
name: "gamilit-api"
|
|
type: "backend"
|
|
runtime: "node"
|
|
version: "1.0.0"
|
|
description: "API principal de Gamilit - Plataforma de gamificacion educativa"
|
|
owner_agent: "NEXUS-BACKEND"
|
|
|
|
repository:
|
|
name: "gamilit-platform"
|
|
path: "apps/backend"
|
|
main_branch: "main"
|
|
|
|
ports:
|
|
internal: 3000
|
|
registry_ref: "projects.gamilit.api"
|
|
protocol: "http"
|
|
|
|
domains:
|
|
registry_ref: "gamilit"
|
|
overrides:
|
|
local: "api.gamilit.localhost"
|
|
|
|
database:
|
|
registry_ref: "gamilit"
|
|
role: "runtime"
|
|
schemas:
|
|
- "public"
|
|
- "auth"
|
|
- "gamification"
|
|
|
|
environments:
|
|
deployed_to:
|
|
- "local"
|
|
- "development"
|
|
- "production"
|
|
default: "local"
|
|
|
|
healthcheck:
|
|
path: "/health"
|
|
interval: "30s"
|
|
timeout: "5s"
|
|
retries: 3
|
|
|
|
dependencies:
|
|
services: []
|
|
databases:
|
|
- "gamilit_db"
|
|
external:
|
|
- name: "stripe"
|
|
url: "https://api.stripe.com"
|
|
required: false
|
|
|
|
ci:
|
|
pipeline: "node-backend-standard"
|
|
tests: true
|
|
lint: true
|
|
build: true
|
|
docker: true
|
|
docker_image: "gamilit-api"
|
|
docker_registry: "ghcr.io/tu-org"
|
|
|
|
observability:
|
|
metrics:
|
|
enabled: true
|
|
path: "/metrics"
|
|
logging:
|
|
level: "info"
|
|
format: "json"
|
|
|
|
metadata:
|
|
created: "2025-01-01"
|
|
updated: "2025-12-18"
|
|
tags:
|
|
- "api"
|
|
- "nestjs"
|
|
- "gamification"
|
|
```
|
|
|
|
### T4.1.2.2 Crear service.descriptor.yml para Frontend
|
|
|
|
**Esfuerzo:** 1 hora
|
|
|
|
**Ubicacion:** apps/frontend/service.descriptor.yml
|
|
|
|
```yaml
|
|
# service.descriptor.yml - Gamilit Web
|
|
service:
|
|
name: "gamilit-web"
|
|
type: "frontend"
|
|
runtime: "static"
|
|
version: "1.0.0"
|
|
description: "Frontend web de Gamilit"
|
|
owner_agent: "NEXUS-FRONTEND"
|
|
|
|
repository:
|
|
name: "gamilit-platform"
|
|
path: "apps/frontend"
|
|
main_branch: "main"
|
|
|
|
ports:
|
|
internal: 3001
|
|
registry_ref: "projects.gamilit.web"
|
|
protocol: "http"
|
|
|
|
domains:
|
|
registry_ref: "gamilit"
|
|
overrides:
|
|
local: "gamilit.localhost"
|
|
|
|
database:
|
|
registry_ref: null
|
|
|
|
environments:
|
|
deployed_to:
|
|
- "local"
|
|
- "development"
|
|
- "production"
|
|
default: "local"
|
|
|
|
healthcheck:
|
|
path: "/"
|
|
interval: "60s"
|
|
|
|
dependencies:
|
|
services:
|
|
- name: "gamilit-api"
|
|
required: true
|
|
healthcheck: "http://gamilit-api:3000/health"
|
|
databases: []
|
|
external: []
|
|
|
|
ci:
|
|
pipeline: "react-frontend-standard"
|
|
tests: true
|
|
lint: true
|
|
build: true
|
|
docker: true
|
|
docker_image: "gamilit-web"
|
|
|
|
metadata:
|
|
created: "2025-01-01"
|
|
updated: "2025-12-18"
|
|
tags:
|
|
- "frontend"
|
|
- "react"
|
|
```
|
|
|
|
---
|
|
|
|
## T4.1.3 MIGRACION DE CODIGO
|
|
|
|
### T4.1.3.1 Migrar Backend
|
|
|
|
**Esfuerzo:** 1.5 horas
|
|
|
|
```bash
|
|
# Copiar codigo backend
|
|
cp -r workspace/projects/gamilit/backend/* gamilit-platform/apps/backend/
|
|
|
|
# Actualizar paths en imports si es necesario
|
|
# Actualizar tsconfig.json paths
|
|
```
|
|
|
|
**Verificaciones:**
|
|
- [ ] package.json actualizado
|
|
- [ ] tsconfig.json paths correctos
|
|
- [ ] Imports actualizados
|
|
- [ ] Variables de entorno documentadas
|
|
|
|
### T4.1.3.2 Migrar Frontend
|
|
|
|
**Esfuerzo:** 1.5 horas
|
|
|
|
```bash
|
|
# Copiar codigo frontend
|
|
cp -r workspace/projects/gamilit/frontend/* gamilit-platform/apps/frontend/
|
|
|
|
# Actualizar API URLs para usar variables de entorno
|
|
```
|
|
|
|
**Verificaciones:**
|
|
- [ ] package.json actualizado
|
|
- [ ] API URLs usan env vars
|
|
- [ ] Build funciona
|
|
|
|
### T4.1.3.3 Migrar Database Scripts
|
|
|
|
**Esfuerzo:** 0.5 horas
|
|
|
|
```bash
|
|
# Copiar DDL y seeds
|
|
cp -r workspace/projects/gamilit/database/* gamilit-platform/apps/database/
|
|
```
|
|
|
|
### T4.1.3.4 Actualizar Referencias
|
|
|
|
**Esfuerzo:** 0.5 horas
|
|
|
|
- Actualizar imports relativos
|
|
- Actualizar paths en configuraciones
|
|
- Verificar que no hay referencias hardcodeadas al workspace
|
|
|
|
---
|
|
|
|
## T4.1.4 DOCKER COMPOSE
|
|
|
|
### T4.1.4.1 Crear docker-compose.yml
|
|
|
|
**Esfuerzo:** 1.5 horas
|
|
|
|
**Ubicacion:** docker/docker-compose.yml
|
|
|
|
```yaml
|
|
version: "3.8"
|
|
|
|
x-logging: &default-logging
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
|
|
services:
|
|
gamilit-api:
|
|
build:
|
|
context: ../apps/backend
|
|
dockerfile: Dockerfile
|
|
container_name: gamilit-api
|
|
restart: unless-stopped
|
|
expose:
|
|
- "3000"
|
|
environment:
|
|
- NODE_ENV=${NODE_ENV:-development}
|
|
- PORT=3000
|
|
- DATABASE_URL=${DATABASE_URL}
|
|
- JWT_SECRET=${JWT_SECRET}
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.gamilit-api.rule=Host(`api.gamilit.localhost`)"
|
|
- "traefik.http.services.gamilit-api.loadbalancer.server.port=3000"
|
|
networks:
|
|
- gamilit_${ENV:-local}
|
|
- infra_shared
|
|
logging:
|
|
<<: *default-logging
|
|
|
|
gamilit-web:
|
|
build:
|
|
context: ../apps/frontend
|
|
dockerfile: Dockerfile
|
|
container_name: gamilit-web
|
|
restart: unless-stopped
|
|
expose:
|
|
- "3001"
|
|
environment:
|
|
- NODE_ENV=${NODE_ENV:-development}
|
|
- REACT_APP_API_URL=http://api.gamilit.localhost
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.gamilit-web.rule=Host(`gamilit.localhost`)"
|
|
- "traefik.http.services.gamilit-web.loadbalancer.server.port=3001"
|
|
networks:
|
|
- gamilit_${ENV:-local}
|
|
- infra_shared
|
|
depends_on:
|
|
- gamilit-api
|
|
logging:
|
|
<<: *default-logging
|
|
|
|
networks:
|
|
gamilit_${ENV:-local}:
|
|
external: true
|
|
infra_shared:
|
|
external: true
|
|
```
|
|
|
|
### T4.1.4.2 Crear .env.example
|
|
|
|
**Esfuerzo:** 0.5 horas
|
|
|
|
```bash
|
|
# .env.example
|
|
NODE_ENV=development
|
|
ENV=local
|
|
|
|
# Database
|
|
DATABASE_URL=postgresql://gamilit_app:password@postgres:5432/gamilit_db
|
|
|
|
# JWT
|
|
JWT_SECRET=your-secret-key-here
|
|
JWT_EXPIRES_IN=1d
|
|
|
|
# API (for frontend)
|
|
REACT_APP_API_URL=http://api.gamilit.localhost
|
|
```
|
|
|
|
### T4.1.4.3 Crear Dockerfiles
|
|
|
|
**Esfuerzo:** 1 hora
|
|
|
|
- apps/backend/Dockerfile
|
|
- apps/frontend/Dockerfile
|
|
|
|
---
|
|
|
|
## T4.1.5 ORCHESTRATION
|
|
|
|
### T4.1.5.1 Migrar Orchestration
|
|
|
|
**Esfuerzo:** 0.5 horas
|
|
|
|
```bash
|
|
# Copiar orchestration
|
|
cp -r workspace/projects/gamilit/orchestration/* gamilit-platform/orchestration/
|
|
```
|
|
|
|
### T4.1.5.2 Actualizar Inventarios
|
|
|
|
**Esfuerzo:** 0.5 horas
|
|
|
|
- Actualizar paths en inventarios
|
|
- Actualizar referencias al nuevo repo
|
|
|
|
---
|
|
|
|
## T4.1.6 VALIDACION
|
|
|
|
### T4.1.6.1 Validar Service Descriptors
|
|
|
|
**Esfuerzo:** 0.5 horas
|
|
|
|
```bash
|
|
# Validar YAML
|
|
python3 -c "import yaml; yaml.safe_load(open('apps/backend/service.descriptor.yml'))"
|
|
python3 -c "import yaml; yaml.safe_load(open('apps/frontend/service.descriptor.yml'))"
|
|
|
|
# Validar contra registries
|
|
./control-plane/devtools/scripts/validation/validate-service-descriptors.sh
|
|
```
|
|
|
|
### T4.1.6.2 Validar Build
|
|
|
|
**Esfuerzo:** 1 hora
|
|
|
|
```bash
|
|
# Build backend
|
|
cd apps/backend && npm install && npm run build
|
|
|
|
# Build frontend
|
|
cd apps/frontend && npm install && npm run build
|
|
```
|
|
|
|
### T4.1.6.3 Validar Docker
|
|
|
|
**Esfuerzo:** 0.5 horas
|
|
|
|
```bash
|
|
# Levantar servicios
|
|
cd docker && docker-compose up -d
|
|
|
|
# Verificar health
|
|
curl http://api.gamilit.localhost/health
|
|
curl http://gamilit.localhost
|
|
```
|
|
|
|
---
|
|
|
|
## CRONOGRAMA SUGERIDO
|
|
|
|
```
|
|
DIA 1 (4 horas):
|
|
- T4.1.1 Estructura base
|
|
- T4.1.2 Service descriptors
|
|
- T4.1.3.1-2 Migrar backend y frontend
|
|
|
|
DIA 2 (4 horas):
|
|
- T4.1.3.3-4 Migrar database y actualizar referencias
|
|
- T4.1.4 Docker compose completo
|
|
- T4.1.5 Orchestration
|
|
|
|
DIA 3 (2 horas):
|
|
- T4.1.6 Validacion completa
|
|
- Documentacion final
|
|
- Preparar para siguiente proyecto
|
|
```
|
|
|
|
---
|
|
|
|
## DEPENDENCIAS
|
|
|
|
```
|
|
T4.1.1.1 (Estructura)
|
|
|
|
|
+-> T4.1.2 (Service Descriptors)
|
|
+-> T4.1.3 (Migracion Codigo)
|
|
|
|
|
v
|
|
T4.1.4 (Docker Compose)
|
|
|
|
|
v
|
|
T4.1.5 (Orchestration)
|
|
|
|
|
v
|
|
T4.1.6 (Validacion)
|
|
```
|
|
|
|
---
|
|
|
|
**Documento generado por:** Tech-Leader
|