diff --git a/orchestration/inventarios/BACKEND_INVENTORY.yml b/orchestration/inventarios/BACKEND_INVENTORY.yml new file mode 100644 index 0000000..d5c76e6 --- /dev/null +++ b/orchestration/inventarios/BACKEND_INVENTORY.yml @@ -0,0 +1,210 @@ +# ═══════════════════════════════════════════════════════════════════════════════ +# BACKEND_INVENTORY.yml - Trading Platform +# ═══════════════════════════════════════════════════════════════════════════════ + +version: "1.0.0" +fecha_actualizacion: "2026-01-24" +proyecto: "trading-platform" + +# ═══════════════════════════════════════════════════════════════════════════════ +# RESUMEN +# ═══════════════════════════════════════════════════════════════════════════════ + +resumen: + total_modulos: 11 + total_controllers: 22 + total_services: 32 + total_endpoints: 50 + ubicacion: "apps/backend/src/" + framework: "Express.js 5.0.1" + lenguaje: "TypeScript 5.3.3" + +# ═══════════════════════════════════════════════════════════════════════════════ +# MODULOS +# ═══════════════════════════════════════════════════════════════════════════════ + +modulos: + + auth: + descripcion: "Autenticacion OAuth, Email, SMS, 2FA" + controllers: 5 + services: 5 + routes: 1 + dtos: 6 + servicios_detalle: + - token.service.ts + - email.service.ts + - oauth.service.ts + - phone.service.ts + - twofa.service.ts + + users: + descripcion: "Gestion de perfiles de usuario" + controllers: 0 + services: 1 + routes: 1 + + trading: + descripcion: "Orders, trades, signals, bots" + controllers: 0 + services: 8 + routes: 1 + servicios_detalle: + - signal.service.ts + - order.service.ts + - trade.service.ts + - bot.service.ts + - watchlist.service.ts + - position.service.ts + - backtest.service.ts + - market-data.service.ts + + education: + descripcion: "Cursos, quizzes, gamificacion" + controllers: 3 + services: 4 + routes: 1 + servicios_detalle: + - course.service.ts + - enrollment.service.ts + - gamification.service.ts + - quiz.service.ts + + investment: + descripcion: "Productos, cuentas, portafolio" + controllers: 0 + services: 3 + routes: 1 + servicios_detalle: + - account.service.ts + - product.service.ts + - transaction.service.ts + + payments: + descripcion: "Stripe, wallets, subscriptions" + controllers: 0 + services: 3 + routes: 1 + servicios_detalle: + - stripe.service.ts + - wallet.service.ts + - subscription.service.ts + + ml: + descripcion: "Predicciones, modelos, backtesting" + controllers: 0 + services: 6 + routes: 1 + servicios_detalle: + - prediction.service.ts + - model.service.ts + - backtest.service.ts + - feature.service.ts + - risk.service.ts + - ensemble.service.ts + + admin: + descripcion: "Stats, modelos ML, agentes" + controllers: 0 + services: 1 + routes: 1 + + llm: + descripcion: "LLM agent, estrategias" + controllers: 0 + services: 1 + routes: 1 + + agents: + descripcion: "Trading agents orquestacion" + controllers: 0 + services: 1 + routes: 1 + + portfolio: + descripcion: "Portfolio management" + controllers: 0 + services: 1 + routes: 1 + +# ═══════════════════════════════════════════════════════════════════════════════ +# RUTAS API +# ═══════════════════════════════════════════════════════════════════════════════ + +rutas_api: + base: "/api/v1" + endpoints: + - path: "/auth" + descripcion: "OAuth, Email, SMS, 2FA" + - path: "/users" + descripcion: "Perfil, settings" + - path: "/trading" + descripcion: "Orders, trades, signals, bots" + - path: "/education" + descripcion: "Cursos, quizzes, gamification" + - path: "/investment" + descripcion: "Productos, cuentas, transacciones" + - path: "/payments" + descripcion: "Stripe, wallets, subscriptions" + - path: "/admin" + descripcion: "Stats, ML models, agents" + - path: "/ml" + descripcion: "Predicciones, modelos" + - path: "/llm" + descripcion: "Estrategias LLM" + - path: "/portfolio" + descripcion: "Portafolio" + - path: "/agents" + descripcion: "Trading agents" + + health: + - path: "/health" + descripcion: "Quick check" + - path: "/health/full" + descripcion: "Sistema completo" + - path: "/health/services" + descripcion: "Health por servicio" + +# ═══════════════════════════════════════════════════════════════════════════════ +# INFRAESTRUCTURA +# ═══════════════════════════════════════════════════════════════════════════════ + +infraestructura: + middleware: + - auth.middleware.ts + - error-handler.ts + - not-found.ts + - rate-limiter.ts + + websocket: + - websocket.server.ts + - trading-stream.service.ts + + config: + - swagger.config.ts + - index.ts + +# ═══════════════════════════════════════════════════════════════════════════════ +# INTEGRACIONES +# ═══════════════════════════════════════════════════════════════════════════════ + +integraciones: + base_datos: + - PostgreSQL + - Redis + pagos: + - Stripe + oauth: + - Google + - Facebook + - GitHub + - Apple + comunicacion: + - Twilio + - Nodemailer + llm: + - OpenAI + - Anthropic + trading: + - Binance + - MetaTrader diff --git a/orchestration/inventarios/DATABASE_INVENTORY.yml b/orchestration/inventarios/DATABASE_INVENTORY.yml new file mode 100644 index 0000000..7d4c056 --- /dev/null +++ b/orchestration/inventarios/DATABASE_INVENTORY.yml @@ -0,0 +1,184 @@ +# ═══════════════════════════════════════════════════════════════════════════════ +# DATABASE_INVENTORY.yml - Trading Platform +# ═══════════════════════════════════════════════════════════════════════════════ + +version: "1.0.0" +fecha_actualizacion: "2026-01-24" +proyecto: "trading-platform" + +# ═══════════════════════════════════════════════════════════════════════════════ +# RESUMEN +# ═══════════════════════════════════════════════════════════════════════════════ + +resumen: + total_schemas: 11 + total_tablas: 77 + total_archivos_ddl: 114 + ubicacion_ddl: "apps/database/ddl/schemas/" + motor: "PostgreSQL 16" + features: + - "Particiones temporales" + - "UUIDs como PKs" + - "JSONB para datos flexibles" + - "Triggers de auditoria" + +# ═══════════════════════════════════════════════════════════════════════════════ +# SCHEMAS +# ═══════════════════════════════════════════════════════════════════════════════ + +schemas: + + auth: + descripcion: "Autenticacion, sesiones, OAuth" + tablas: 10 + critico: true + tablas_lista: + - users + - user_profiles + - oauth_accounts + - sessions + - email_verifications + - phone_verifications + - password_reset_tokens + - auth_logs + - login_attempts + - rate_limiting_config + + trading: + descripcion: "Orders, trades, signals, bots" + tablas: 10 + critico: true + tablas_lista: + - orders + - trades + - positions + - signals + - bots + - watchlists + - watchlist_items + - symbols + - paper_balances + - trading_metrics + + financial: + descripcion: "Pagos, wallets, subscriptions" + tablas: 9 + critico: true + tablas_lista: + - payments + - subscriptions + - wallets + - wallet_transactions + - wallet_audit_log + - wallet_limits + - invoices + - payment_methods + - customers + + ml: + descripcion: "Modelos ML, predicciones, backtesting" + tablas: 10 + critico: true + tablas_lista: + - models + - model_versions + - predictions + - prediction_outcomes + - backtest_runs + - feature_store + - llm_predictions + - llm_decisions + - llm_prediction_outcomes + - risk_events + + education: + descripcion: "Cursos, quizzes, gamificacion" + tablas: 11 + critico: false + tablas_lista: + - courses + - modules + - lessons + - categories + - enrollments + - quiz_questions + - quizzes + - quiz_attempts + - user_gamification_profile + - user_achievements + - certificates + + investment: + descripcion: "Productos de inversion, cuentas" + tablas: 6 + critico: false + tablas_lista: + - accounts + - products + - transactions + - daily_performance + - distributions + - withdrawal_requests + + market_data: + descripcion: "Datos de mercado OHLCV" + tablas: 3 + critico: true + tablas_lista: + - tickers + - ohlcv_5m + - ohlcv_15m + + llm: + descripcion: "LLM memory, conversaciones" + tablas: 4 + critico: false + tablas_lista: + - conversations + - messages + - embeddings + - user_memory + + audit: + descripcion: "Auditoria y logs del sistema" + tablas: 7 + critico: false + tablas_lista: + - audit_logs + - security_events + - system_events + - trading_audit + - api_request_logs + - data_access_logs + - compliance_logs + + portfolio: + descripcion: "Gestion de portafolio" + tablas: 4 + critico: false + nota: "Parte integrada con trading/investment" + + system: + descripcion: "Configuracion del sistema" + tablas: 3 + critico: false + +# ═══════════════════════════════════════════════════════════════════════════════ +# CARACTERISTICAS ESPECIALES +# ═══════════════════════════════════════════════════════════════════════════════ + +caracteristicas: + particiones: + - tabla: "auth.auth_logs" + tipo: "temporal" + columna: "created_at" + + indices_especiales: + - "GIN para JSONB" + - "BTREE para busquedas" + - "Indices parciales para queries frecuentes" + + constraints: + - "Foreign keys con ON DELETE CASCADE/SET NULL" + - "Check constraints para validacion" + - "Unique constraints compuestos" diff --git a/orchestration/inventarios/FRONTEND_INVENTORY.yml b/orchestration/inventarios/FRONTEND_INVENTORY.yml new file mode 100644 index 0000000..f99f479 --- /dev/null +++ b/orchestration/inventarios/FRONTEND_INVENTORY.yml @@ -0,0 +1,249 @@ +# ═══════════════════════════════════════════════════════════════════════════════ +# FRONTEND_INVENTORY.yml - Trading Platform +# ═══════════════════════════════════════════════════════════════════════════════ + +version: "1.0.0" +fecha_actualizacion: "2026-01-24" +proyecto: "trading-platform" + +# ═══════════════════════════════════════════════════════════════════════════════ +# RESUMEN +# ═══════════════════════════════════════════════════════════════════════════════ + +resumen: + total_paginas: 27 + total_componentes: 16 + total_stores: 4 + total_services: 9 + total_hooks: 2 + ubicacion: "apps/frontend/src/" + framework: "React 18.2.0" + build_tool: "Vite 6.2.0" + lenguaje: "TypeScript 5.3.3" + +# ═══════════════════════════════════════════════════════════════════════════════ +# PAGINAS POR MODULO +# ═══════════════════════════════════════════════════════════════════════════════ + +paginas: + + auth: + cantidad: 6 + lista: + - Login.tsx + - Register.tsx + - ForgotPassword.tsx + - VerifyEmail.tsx + - ResetPassword.tsx + - AuthCallback.tsx + + dashboard: + cantidad: 1 + lista: + - Dashboard.tsx + + trading: + cantidad: 1 + lista: + - Trading.tsx + + ml: + cantidad: 1 + lista: + - MLDashboard.tsx + + backtesting: + cantidad: 1 + lista: + - BacktestingDashboard.tsx + + investment: + cantidad: 3 + lista: + - Investment.tsx + - Portfolio.tsx + - Products.tsx + + education: + cantidad: 6 + lista: + - Courses.tsx + - CourseDetail.tsx + - MyLearning.tsx + - Leaderboard.tsx + - Lesson.tsx + - Quiz.tsx + + payments: + cantidad: 2 + lista: + - Pricing.tsx + - Billing.tsx + + admin: + cantidad: 4 + lista: + - AdminDashboard.tsx + - MLModelsPage.tsx + - AgentsPage.tsx + - PredictionsPage.tsx + + assistant: + cantidad: 1 + lista: + - Assistant.tsx + + settings: + cantidad: 1 + lista: + - Settings.tsx + +# ═══════════════════════════════════════════════════════════════════════════════ +# COMPONENTES +# ═══════════════════════════════════════════════════════════════════════════════ + +componentes: + + chat: + cantidad: 4 + lista: + - ChatInput.tsx + - ChatMessage.tsx + - ChatPanel.tsx + - ChatWidget.tsx + + education: + cantidad: 6 + lista: + - AchievementBadge.tsx + - CourseCard.tsx + - LeaderboardTable.tsx + - QuizQuestion.tsx + - StreakCounter.tsx + - XPProgress.tsx + + payments: + cantidad: 4 + lista: + - PricingCard.tsx + - SubscriptionCard.tsx + - UsageProgress.tsx + - WalletCard.tsx + + backtesting: + cantidad: 5 + lista: + - EquityCurveChart.tsx + - PerformanceMetricsPanel.tsx + - PredictionChart.tsx + - StrategyComparisonChart.tsx + - TradesTable.tsx + + admin: + cantidad: 2 + lista: + - AgentStatsCard.tsx + - MLModelCard.tsx + + layout: + cantidad: 2 + lista: + - MainLayout.tsx + - AuthLayout.tsx + +# ═══════════════════════════════════════════════════════════════════════════════ +# STATE MANAGEMENT +# ═══════════════════════════════════════════════════════════════════════════════ + +stores: + framework: "Zustand 4.4.7" + lista: + - auth.store.ts + - trading.store.ts + - dashboard.store.ts + - app.store.ts + +# ═══════════════════════════════════════════════════════════════════════════════ +# SERVICES API +# ═══════════════════════════════════════════════════════════════════════════════ + +services: + cantidad: 9 + lista: + - auth.service.ts + - trading.service.ts + - ml.service.ts + - education.service.ts + - investment.service.ts + - payments.service.ts + - admin.service.ts + - assistant.service.ts + - portfolio.service.ts + +# ═══════════════════════════════════════════════════════════════════════════════ +# HOOKS CUSTOM +# ═══════════════════════════════════════════════════════════════════════════════ + +hooks: + cantidad: 2 + lista: + - useAuth.ts + - useTrading.ts + +# ═══════════════════════════════════════════════════════════════════════════════ +# RUTAS +# ═══════════════════════════════════════════════════════════════════════════════ + +rutas: + publicas: + - /login + - /register + - /forgot-password + - /verify-email + - /auth/callback + + protegidas: + - /dashboard + - /trading + - /ml-dashboard + - /backtesting + - /investment + - /education/courses + - /education/my-learning + - /education/leaderboard + - /pricing + - /billing + - /settings + - /assistant + + admin: + - /admin + - /admin/models + - /admin/agents + - /admin/predictions + + fullscreen: + - /education/courses/:courseSlug/lesson/:lessonId + - /education/courses/:courseSlug/lesson/:lessonId/quiz + +# ═══════════════════════════════════════════════════════════════════════════════ +# LIBRERIAS +# ═══════════════════════════════════════════════════════════════════════════════ + +librerias: + core: + - "React Router v6" + - "TanStack Query (React Query)" + - "React Hook Form" + - "Zod" + ui: + - "Tailwind CSS 3.4" + - "Lucide React" + charts: + - "Recharts 3.5" + - "Lightweight Charts 4.1" + utilities: + - "Axios" + - "Date-fns" + payments: + - "Stripe"