Sistema NEXUS v3.4 migrado con: Estructura principal: - core/orchestration: Sistema SIMCO + CAPVED (27 directivas, 28 perfiles) - core/catalog: Catalogo de funcionalidades reutilizables - shared/knowledge-base: Base de conocimiento compartida - devtools/scripts: Herramientas de desarrollo - control-plane/registries: Control de servicios y CI/CD - orchestration/: Configuracion de orquestacion de agentes Proyectos incluidos (11): - gamilit (submodule -> GitHub) - trading-platform (OrbiquanTIA) - erp-suite con 5 verticales: - erp-core, construccion, vidrio-templado - mecanicas-diesel, retail, clinicas - betting-analytics - inmobiliaria-analytics - platform_marketing_content - pos-micro, erp-basico Configuracion: - .gitignore completo para Node.js/Python/Docker - gamilit como submodule (git@github.com:rckrdmrd/gamilit-workspace.git) - Sistema de puertos estandarizado (3005-3199) Generated with NEXUS v3.4 Migration System EPIC-010: Configuracion Git y Repositorios
336 lines
9.3 KiB
Bash
Executable File
336 lines
9.3 KiB
Bash
Executable File
#!/bin/bash
|
||
# =============================================================================
|
||
# Development Helper Script
|
||
# ISEM Workspace - Multi-project development tool
|
||
# =============================================================================
|
||
|
||
set -e
|
||
|
||
# Colors
|
||
RED='\033[0;31m'
|
||
GREEN='\033[0;32m'
|
||
YELLOW='\033[1;33m'
|
||
BLUE='\033[0;34m'
|
||
NC='\033[0m' # No Color
|
||
|
||
# Workspace root
|
||
WORKSPACE_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||
|
||
# =============================================================================
|
||
# Helper Functions
|
||
# =============================================================================
|
||
|
||
print_header() {
|
||
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
||
echo -e "${BLUE} $1${NC}"
|
||
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
||
}
|
||
|
||
print_success() {
|
||
echo -e "${GREEN}✓ $1${NC}"
|
||
}
|
||
|
||
print_warning() {
|
||
echo -e "${YELLOW}⚠ $1${NC}"
|
||
}
|
||
|
||
print_error() {
|
||
echo -e "${RED}✗ $1${NC}"
|
||
}
|
||
|
||
print_info() {
|
||
echo -e "${BLUE}ℹ $1${NC}"
|
||
}
|
||
|
||
# =============================================================================
|
||
# Commands
|
||
# =============================================================================
|
||
|
||
cmd_help() {
|
||
print_header "ISEM Workspace Developer Tools"
|
||
echo ""
|
||
echo "Usage: ./dev.sh <command> [options]"
|
||
echo ""
|
||
echo "Commands:"
|
||
echo " status Show status of all projects"
|
||
echo " start <project> Start development server for a project"
|
||
echo " stop <project> Stop development server"
|
||
echo " build <project> Build a project"
|
||
echo " test <project> Run tests for a project"
|
||
echo " lint <project> Lint a project"
|
||
echo " install Install all dependencies"
|
||
echo " docker-up Start all Docker services"
|
||
echo " docker-down Stop all Docker services"
|
||
echo " db-reset Reset development databases"
|
||
echo " ports Show port usage"
|
||
echo ""
|
||
echo "Projects:"
|
||
echo " gamilit Gamilit platform (backend + frontend)"
|
||
echo " trading Trading Platform (all services)"
|
||
echo " erp-core ERP Core"
|
||
echo " mecanicas Mecánicas Diesel vertical"
|
||
echo " all All projects"
|
||
echo ""
|
||
echo "Examples:"
|
||
echo " ./dev.sh start gamilit"
|
||
echo " ./dev.sh build trading"
|
||
echo " ./dev.sh docker-up"
|
||
}
|
||
|
||
cmd_status() {
|
||
print_header "Workspace Status"
|
||
|
||
echo ""
|
||
echo "📦 Projects:"
|
||
echo ""
|
||
|
||
# Gamilit
|
||
if [ -d "$WORKSPACE_ROOT/projects/gamilit" ]; then
|
||
echo -e " ${GREEN}●${NC} Gamilit"
|
||
if [ -f "$WORKSPACE_ROOT/projects/gamilit/apps/backend/package.json" ]; then
|
||
echo " Backend: $(cd $WORKSPACE_ROOT/projects/gamilit/apps/backend && node -p "require('./package.json').version" 2>/dev/null || echo 'N/A')"
|
||
fi
|
||
fi
|
||
|
||
# Trading Platform
|
||
if [ -d "$WORKSPACE_ROOT/projects/trading-platform" ]; then
|
||
echo -e " ${GREEN}●${NC} Trading Platform"
|
||
echo " Apps: backend, frontend, data-service, trading-agents, llm-agent"
|
||
fi
|
||
|
||
# ERP Suite
|
||
if [ -d "$WORKSPACE_ROOT/projects/erp-suite" ]; then
|
||
echo -e " ${GREEN}●${NC} ERP Suite"
|
||
echo " Verticales: mecanicas-diesel, construccion, clinicas, retail, vidrio-templado"
|
||
fi
|
||
|
||
echo ""
|
||
echo "🔌 Port Assignments:"
|
||
cmd_ports_internal
|
||
}
|
||
|
||
cmd_ports() {
|
||
print_header "Port Usage"
|
||
cmd_ports_internal
|
||
}
|
||
|
||
cmd_ports_internal() {
|
||
echo ""
|
||
echo " Gamilit:"
|
||
echo " Backend: 3000"
|
||
echo " Frontend: 5173"
|
||
echo " Database: 5432"
|
||
echo ""
|
||
echo " Trading Platform:"
|
||
echo " Backend: 3001"
|
||
echo " Frontend: 5174"
|
||
echo " Data Service: 8001"
|
||
echo " Trading Agents: 8002"
|
||
echo " LLM Agent: 8003"
|
||
echo " Database: 5433"
|
||
echo ""
|
||
echo " ERP Suite:"
|
||
echo " ERP Core Backend: 3010"
|
||
echo " ERP Core Frontend: 5175"
|
||
echo " Mecánicas Backend: 3011"
|
||
echo " Construcción Backend: 3012"
|
||
echo " Database: 5434"
|
||
}
|
||
|
||
cmd_start() {
|
||
local project=$1
|
||
|
||
case $project in
|
||
gamilit)
|
||
print_header "Starting Gamilit"
|
||
cd "$WORKSPACE_ROOT/projects/gamilit"
|
||
npm run dev
|
||
;;
|
||
trading)
|
||
print_header "Starting Trading Platform"
|
||
cd "$WORKSPACE_ROOT/projects/trading-platform"
|
||
docker-compose up -d
|
||
;;
|
||
erp-core)
|
||
print_header "Starting ERP Core"
|
||
cd "$WORKSPACE_ROOT/projects/erp-suite/apps/erp-core/backend"
|
||
npm run dev
|
||
;;
|
||
mecanicas)
|
||
print_header "Starting Mecánicas Diesel"
|
||
cd "$WORKSPACE_ROOT/projects/erp-suite/apps/verticales/mecanicas-diesel/backend"
|
||
npm run dev
|
||
;;
|
||
*)
|
||
print_error "Unknown project: $project"
|
||
echo "Available: gamilit, trading, erp-core, mecanicas"
|
||
exit 1
|
||
;;
|
||
esac
|
||
}
|
||
|
||
cmd_build() {
|
||
local project=$1
|
||
|
||
case $project in
|
||
gamilit)
|
||
print_header "Building Gamilit"
|
||
cd "$WORKSPACE_ROOT/projects/gamilit/apps/backend"
|
||
npm run build
|
||
cd "$WORKSPACE_ROOT/projects/gamilit/apps/frontend"
|
||
npm run build
|
||
print_success "Gamilit built successfully"
|
||
;;
|
||
trading)
|
||
print_header "Building Trading Platform"
|
||
cd "$WORKSPACE_ROOT/projects/trading-platform/apps/backend"
|
||
npm run build
|
||
cd "$WORKSPACE_ROOT/projects/trading-platform/apps/frontend"
|
||
npm run build
|
||
print_success "Trading Platform built successfully"
|
||
;;
|
||
all)
|
||
cmd_build gamilit
|
||
cmd_build trading
|
||
;;
|
||
*)
|
||
print_error "Unknown project: $project"
|
||
exit 1
|
||
;;
|
||
esac
|
||
}
|
||
|
||
cmd_install() {
|
||
print_header "Installing Dependencies"
|
||
|
||
# Core modules
|
||
if [ -f "$WORKSPACE_ROOT/core/modules/package.json" ]; then
|
||
print_info "Installing core/modules..."
|
||
cd "$WORKSPACE_ROOT/core/modules"
|
||
npm install
|
||
fi
|
||
|
||
# Gamilit
|
||
if [ -f "$WORKSPACE_ROOT/projects/gamilit/package.json" ]; then
|
||
print_info "Installing Gamilit..."
|
||
cd "$WORKSPACE_ROOT/projects/gamilit"
|
||
npm install
|
||
fi
|
||
|
||
# Trading Platform
|
||
for app in backend frontend; do
|
||
if [ -f "$WORKSPACE_ROOT/projects/trading-platform/apps/$app/package.json" ]; then
|
||
print_info "Installing Trading Platform $app..."
|
||
cd "$WORKSPACE_ROOT/projects/trading-platform/apps/$app"
|
||
npm install
|
||
fi
|
||
done
|
||
|
||
# Data service (Python)
|
||
if [ -f "$WORKSPACE_ROOT/projects/trading-platform/apps/data-service/requirements.txt" ]; then
|
||
print_info "Installing Trading Platform data-service..."
|
||
cd "$WORKSPACE_ROOT/projects/trading-platform/apps/data-service"
|
||
pip install -r requirements.txt
|
||
fi
|
||
|
||
print_success "All dependencies installed"
|
||
}
|
||
|
||
cmd_docker_up() {
|
||
print_header "Starting Docker Services"
|
||
|
||
cd "$WORKSPACE_ROOT"
|
||
|
||
# Start databases
|
||
docker-compose -f docker-compose.yml up -d
|
||
|
||
print_success "Docker services started"
|
||
print_info "Run 'docker-compose logs -f' to see logs"
|
||
}
|
||
|
||
cmd_docker_down() {
|
||
print_header "Stopping Docker Services"
|
||
|
||
cd "$WORKSPACE_ROOT"
|
||
docker-compose down
|
||
|
||
print_success "Docker services stopped"
|
||
}
|
||
|
||
cmd_lint() {
|
||
local project=$1
|
||
|
||
case $project in
|
||
gamilit)
|
||
print_header "Linting Gamilit"
|
||
cd "$WORKSPACE_ROOT/projects/gamilit/apps/backend"
|
||
npm run lint
|
||
cd "$WORKSPACE_ROOT/projects/gamilit/apps/frontend"
|
||
npm run lint
|
||
;;
|
||
trading)
|
||
print_header "Linting Trading Platform"
|
||
cd "$WORKSPACE_ROOT/projects/trading-platform/apps/backend"
|
||
npm run lint
|
||
cd "$WORKSPACE_ROOT/projects/trading-platform/apps/frontend"
|
||
npm run lint
|
||
;;
|
||
all)
|
||
cmd_lint gamilit
|
||
cmd_lint trading
|
||
;;
|
||
*)
|
||
print_error "Unknown project: $project"
|
||
exit 1
|
||
;;
|
||
esac
|
||
|
||
print_success "Linting completed"
|
||
}
|
||
|
||
# =============================================================================
|
||
# Main
|
||
# =============================================================================
|
||
|
||
main() {
|
||
local command=$1
|
||
shift || true
|
||
|
||
case $command in
|
||
help|--help|-h|"")
|
||
cmd_help
|
||
;;
|
||
status)
|
||
cmd_status
|
||
;;
|
||
start)
|
||
cmd_start "$@"
|
||
;;
|
||
build)
|
||
cmd_build "$@"
|
||
;;
|
||
install)
|
||
cmd_install
|
||
;;
|
||
docker-up)
|
||
cmd_docker_up
|
||
;;
|
||
docker-down)
|
||
cmd_docker_down
|
||
;;
|
||
ports)
|
||
cmd_ports
|
||
;;
|
||
lint)
|
||
cmd_lint "$@"
|
||
;;
|
||
*)
|
||
print_error "Unknown command: $command"
|
||
cmd_help
|
||
exit 1
|
||
;;
|
||
esac
|
||
}
|
||
|
||
main "$@"
|