# ============================================================================= # ENVIRONMENT-INVENTORY.yml - TRADING-PLATFORM # ============================================================================= # Inventario de Entorno de Desarrollo # Generado por: @PERFIL_DEVENV # Basado en: orchestration/templates/TEMPLATE-ENVIRONMENT-INVENTORY.yml # ============================================================================= version: "1.0.0" fecha_creacion: "2026-01-04" fecha_actualizacion: "2026-01-04" responsable: "@PERFIL_DEVENV" # ----------------------------------------------------------------------------- # IDENTIFICACION DEL PROYECTO # ----------------------------------------------------------------------------- proyecto: nombre: "Trading Platform" alias: "trading" nivel: "NIVEL_2A" tipo: "standalone" estado: "desarrollo" descripcion: "Plataforma de trading algoritmico con ML" # ----------------------------------------------------------------------------- # HERRAMIENTAS Y RUNTIME # ----------------------------------------------------------------------------- herramientas: runtime: node: version: "20.x" requerido: true notas: "Para backend NestJS y frontend React" python: version: "3.11" requerido: true notas: "Para servicios ML y trading agents" package_managers: npm: version: "10.x" requerido: true pip: version: "23.x" requerido: true poetry: version: "1.7.x" requerido: false notas: "Opcional para servicios Python" build_tools: - nombre: "Vite" version: "5.x" uso: "Frontend build" - nombre: "TypeScript" version: "5.x" uso: "Compilacion TS" - nombre: "NestJS CLI" version: "10.x" uso: "Backend build" linters: - nombre: "ESLint" version: "8.x" config: ".eslintrc.js" - nombre: "Prettier" version: "3.x" config: ".prettierrc" - nombre: "Ruff" version: "0.1.x" config: "pyproject.toml" uso: "Python linting" testing: - nombre: "Jest" version: "29.x" tipo: "unit backend" config: "jest.config.js" - nombre: "Vitest" version: "1.x" tipo: "unit frontend" config: "vitest.config.ts" - nombre: "Pytest" version: "7.x" tipo: "unit python" config: "pytest.ini" # ----------------------------------------------------------------------------- # SERVICIOS Y PUERTOS # ----------------------------------------------------------------------------- servicios: frontend: nombre: "trading-frontend" framework: "React" version: "18.x" puerto: 3080 comando_dev: "npm run dev" ubicacion: "apps/frontend/" url_local: "http://localhost:3080" backend: nombre: "trading-backend" framework: "NestJS" version: "10.x" puerto: 3081 comando_dev: "npm run start:dev" ubicacion: "apps/backend/" url_local: "http://localhost:3081" api_prefix: "/api/v1" websocket: nombre: "trading-websocket" puerto: 3082 uso: "Real-time market data" ml_engine: nombre: "ml-engine" framework: "FastAPI" puerto: 3083 comando_dev: "uvicorn main:app --reload --port 3083" ubicacion: "apps/ml-engine/" url_local: "http://localhost:3083" data_service: nombre: "data-service" framework: "FastAPI" puerto: 3084 comando_dev: "uvicorn main:app --reload --port 3084" ubicacion: "apps/data-service/" url_local: "http://localhost:3084" llm_agent: nombre: "llm-agent" framework: "FastAPI" puerto: 3085 comando_dev: "uvicorn main:app --reload --port 3085" ubicacion: "apps/llm-agent/" url_local: "http://localhost:3085" trading_agents: nombre: "trading-agents" framework: "FastAPI" puerto: 3086 comando_dev: "uvicorn main:app --reload --port 3086" ubicacion: "apps/trading-agents/" url_local: "http://localhost:3086" ollama_webui: nombre: "ollama-webui" puerto: 3087 url_local: "http://localhost:3087" ollama: nombre: "ollama" puerto: 11434 url_local: "http://localhost:11434" # ----------------------------------------------------------------------------- # BASE DE DATOS # ----------------------------------------------------------------------------- base_de_datos: principal: engine: "PostgreSQL" version: "15" host: "localhost" puerto: 5432 ambientes: development: nombre: "trading_platform" usuario: "trading_user" password_ref: "DB_PASSWORD en .env" test: nombre: "trading_test" usuario: "trading_user" password_ref: "DB_PASSWORD en .env" schemas: - nombre: "public" descripcion: "Schema principal" - nombre: "trading" descripcion: "Trading data y estrategias" - nombre: "analytics" descripcion: "Analisis y reportes" conexion_ejemplo: "postgresql://trading_user:{password}@localhost:5432/trading_platform" secundaria: nombre: "trading_trading" uso: "data-service historical data" usuario: "trading_user" puerto: 5432 redis: host: "localhost" puerto: 6379 uso: "cache, sessions, real-time data" # ----------------------------------------------------------------------------- # VARIABLES DE ENTORNO # ----------------------------------------------------------------------------- variables_entorno: archivo_ejemplo: "apps/backend/.env.example" variables: - nombre: "NODE_ENV" descripcion: "Ambiente de ejecucion" requerido: true sensible: false ejemplo: "development" - nombre: "PORT" descripcion: "Puerto del servidor backend" requerido: true sensible: false ejemplo: "3081" - nombre: "DATABASE_URL" descripcion: "Connection string de PostgreSQL" requerido: true sensible: true ejemplo: "postgresql://trading_user:password@localhost:5432/trading_platform" - nombre: "REDIS_URL" descripcion: "Connection string de Redis" requerido: true sensible: false ejemplo: "redis://localhost:6379" - nombre: "JWT_SECRET" descripcion: "Secreto para JWT" requerido: true sensible: true ejemplo: "" - nombre: "OLLAMA_HOST" descripcion: "Host de Ollama para LLM" requerido: false sensible: false ejemplo: "http://localhost:11434" - nombre: "FRONTEND_URL" descripcion: "URL del frontend" requerido: true sensible: false ejemplo: "http://localhost:3080" # ----------------------------------------------------------------------------- # CONTENEDORES DOCKER # ----------------------------------------------------------------------------- docker: compose_file: "docker-compose.yml" services: - nombre: "db" imagen: "postgres:15-alpine" puerto_host: 5432 puerto_container: 5432 volumes: - "postgres_data:/var/lib/postgresql/data" - nombre: "redis" imagen: "redis:7-alpine" puerto_host: 6379 puerto_container: 6379 - nombre: "ollama" imagen: "ollama/ollama" puerto_host: 11434 puerto_container: 11434 volumes: - "ollama_data:/root/.ollama" volumes: - nombre: "postgres_data" descripcion: "Datos de PostgreSQL" - nombre: "ollama_data" descripcion: "Modelos de Ollama" networks: - nombre: "trading_network" driver: "bridge" # ----------------------------------------------------------------------------- # SCRIPTS DE DESARROLLO # ----------------------------------------------------------------------------- scripts: setup: descripcion: "Configurar entorno desde cero" pasos: - "npm install" - "pip install -r requirements.txt" - "cp .env.example .env" - "docker-compose up -d db redis" - "npm run migration:run" desarrollo: frontend: "cd apps/frontend && npm run dev" backend: "cd apps/backend && npm run start:dev" ml_engine: "cd apps/ml-engine && uvicorn main:app --reload --port 3083" all_python: "./scripts/start-python-services.sh" testing: unit_ts: "npm run test" unit_python: "pytest" e2e: "npm run test:e2e" build: frontend: "cd apps/frontend && npm run build" backend: "cd apps/backend && npm run build" # ----------------------------------------------------------------------------- # INSTRUCCIONES DE SETUP # ----------------------------------------------------------------------------- setup_instrucciones: | ## Setup del Entorno de Desarrollo - Trading Platform ### Prerequisitos - Node.js 20.x - Python 3.11 - PostgreSQL 15 (o Docker) - Redis 7 (o Docker) - npm 10.x, pip ### Pasos 1. Clonar repositorio: ```bash git clone cd trading-platform ``` 2. Instalar dependencias Node: ```bash npm install ``` 3. Instalar dependencias Python: ```bash pip install -r requirements.txt ``` 4. Configurar variables de entorno: ```bash cp .env.example .env # Editar .env con valores locales ``` 5. Levantar servicios Docker: ```bash docker-compose up -d db redis ollama ``` 6. Ejecutar migraciones: ```bash npm run migration:run ``` 7. Iniciar desarrollo: ```bash # Terminal 1 - Backend cd apps/backend && npm run start:dev # Terminal 2 - Frontend cd apps/frontend && npm run dev # Terminal 3 - ML Engine cd apps/ml-engine && uvicorn main:app --reload --port 3083 ``` ### Verificar - Frontend: http://localhost:3080 - Backend: http://localhost:3081/api/v1 - ML Engine: http://localhost:3083/docs - WebSocket: ws://localhost:3082 # ----------------------------------------------------------------------------- # TROUBLESHOOTING # ----------------------------------------------------------------------------- troubleshooting: - problema: "Puertos en rango 3080-3087 en uso" solucion: "Verificar con lsof -i :308X. Terminar proceso conflictivo" - problema: "Error de conexion a BD" solucion: "Verificar que PostgreSQL esta corriendo. Revisar credenciales en .env" - problema: "Ollama no responde" solucion: "docker-compose logs ollama. Verificar que el modelo esta descargado" - problema: "Servicios Python fallan" solucion: "Verificar version Python 3.11. pip install -r requirements.txt" # ----------------------------------------------------------------------------- # REFERENCIAS # ----------------------------------------------------------------------------- referencias: perfil_devenv: "orchestration/agents/perfiles/PERFIL-DEVENV.md" inventario_master: "orchestration/inventarios/DEVENV-MASTER-INVENTORY.yml" inventario_puertos: "orchestration/inventarios/DEVENV-PORTS-INVENTORY.yml" contexto_proyecto: "orchestration/00-guidelines/CONTEXTO-PROYECTO.md" # ============================================================================= # FIN DE INVENTARIO # =============================================================================