trading-platform/docs
Adrian Flores Cortes fc3b1367cf docs(education): Add ET-EDU-008 Video Upload specification (ST4.3.6)
Comprehensive technical specification for multipart video upload system.

Sections:
1. Architecture Overview - Full upload flow diagram
2. Database Schema - education.videos table with JSONB metadata
3. Backend Implementation:
   - storage.service.ts: S3/R2 multipart upload
   - video.service.ts: Upload management & validation
   - video.controller.ts: REST API endpoints
4. Frontend Implementation:
   - video-upload.service.ts: Multipart upload client
   - VideoUploadForm.tsx: 3-step upload UI
5. Video Processing - MVP mock + production options
6. API Reference - Complete endpoint documentation
7. Configuration - S3/R2 setup, env vars, CORS
8. Security - Access control, validation, future improvements
9. Performance - Optimization strategies
10. Testing - Manual & integration test cases
11. Monitoring - Metrics & common issues
12. Future Enhancements - Phase 2 & 3 roadmap
13. Success Metrics - Current status (89% complete)

Technical Details:
- 1,300+ lines of comprehensive documentation
- Complete code examples for all components
- Architecture diagrams (ASCII art)
- Configuration examples (S3, R2, CORS)
- Security best practices
- Production deployment guide
- Troubleshooting section

Key Features Documented:
 Multipart upload (5MB parts)
 Direct S3/R2 upload via presigned URLs
 Parallel upload (max 3 concurrent)
 Real-time progress tracking
 Complete metadata support
 Full CRUD operations
⚠️  Video processing (MVP - upgrade path documented)

Future Production Options:
- FFmpeg (self-hosted)
- AWS MediaConvert (managed)
- Cloudflare Stream (simplest)

Status: BLOCKER-003 (ST4.3) - 100% complete (6/6 tasks done)
Task: #11 ST4.3.6 - Documentación ET-EDU-008 Video Upload

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 20:45:19 -06:00
..
00-notas feat(ml): Complete FASE 11 - BTCUSD update and comprehensive documentation alignment 2026-01-07 09:31:29 -06:00
00-vision-general [DOCS] docs: Add Software Requirements Specification (SRS) 2026-01-25 02:12:17 -06:00
01-arquitectura docs: Move EA bridge architecture to organized location 2026-01-26 18:58:31 -06:00
02-definicion-modulos docs(education): Add ET-EDU-008 Video Upload specification (ST4.3.6) 2026-01-26 20:45:19 -06:00
04-fase-backlog feat(ml): Complete FASE 11 - BTCUSD update and comprehensive documentation alignment 2026-01-07 09:31:29 -06:00
90-transversal docs: Move SECURITY.md to transversal location 2026-01-26 19:03:25 -06:00
95-guias-desarrollo feat(ml): Complete FASE 11 - BTCUSD update and comprehensive documentation alignment 2026-01-07 09:31:29 -06:00
97-adr feat(ml): Complete FASE 11 - BTCUSD update and comprehensive documentation alignment 2026-01-07 09:31:29 -06:00
99-analisis docs(analisis): Add development plan and update _MAP.md 2026-01-07 13:05:40 -06:00
_MAP.md docs: Update _MAP.md after ST3.2 reorganization 2026-01-26 19:06:04 -06:00
API.md docs: Reduce API.md to overview referencing swagger.yml 2026-01-26 19:03:23 -06:00
README.md feat(ml): Complete FASE 11 - BTCUSD update and comprehensive documentation alignment 2026-01-07 09:31:29 -06:00

id title type project version updated_date
README Trading PlatformIA - Documentacion del Proyecto Documentation trading-platform 1.0.0 2026-01-04

Trading PlatformIA - Documentacion del Proyecto

Ultima actualizacion: 2025-12-05 Version: 1.0.0 Estado: En Desarrollo Activo Tipo: SaaS Trading Platform con IA


Proposito

Este directorio contiene la documentacion completa del proyecto Trading PlatformIA, una plataforma SaaS de trading e inversion que integra:

  • Predicciones ML - XGBoost para prediccion de max/min de precios
  • Plataforma Educativa - Cursos de trading con sistema de niveles
  • Trading Dashboard - Charts en tiempo real con predicciones
  • Sistema de Pagos - Integracion completa con Stripe

Estado Actual del Desarrollo

Componentes Implementados

Componente Estado Descripcion
Backend NestJS Completo API REST con TypeORM y PostgreSQL
Frontend React Completo Vite + TailwindCSS + React Router
ML Services Completo FastAPI + XGBoost predictor
Base de Datos Completo PostgreSQL con 5 schemas, 44 tablas
Autenticacion Completo JWT + Refresh Tokens
Modulo Cursos Completo CRUD completo con categorias
Pagos Stripe Completo Suscripciones + Webhooks

Endpoints Disponibles

Backend (NestJS - Puerto 3000):

  • POST /auth/login - Autenticacion
  • POST /auth/register - Registro
  • GET /courses - Listar cursos
  • POST /payments/create-payment-intent - Crear pago
  • POST /payments/subscriptions - Crear suscripcion

ML Services (FastAPI - Puerto 8000):

  • GET /api/predict/{symbol} - Predicciones de precio
  • POST /api/train/{symbol} - Entrenar modelo
  • GET /api/training/status - Estado del entrenamiento
  • GET /health - Health check

Mapa de Navegacion

docs/
├── 00-vision-general/           # Vision, alcance, arquitectura
│   ├── VISION-PRODUCTO.md
│   ├── ARQUITECTURA-GENERAL.md
│   └── STACK-TECNOLOGICO.md
│
├── 01-fase-mvp/                 # FASE 1: MVP (6 epicas)
│   ├── OQI-001-fundamentos-auth/
│   ├── OQI-002-education/
│   ├── OQI-003-trading-charts/
│   ├── OQI-004-investment-accounts/
│   ├── OQI-005-payments-stripe/
│   └── OQI-006-ml-signals/
│
├── 02-fase-growth/              # FASE 2: Crecimiento
│
├── 03-fase-enterprise/          # FASE 3: Enterprise
│
├── 90-transversal/              # Cross-cutting concerns
│   ├── sprints/
│   ├── roadmap/
│   └── inventarios/
│
├── 95-guias-desarrollo/         # Guias tecnicas
│   ├── backend/
│   ├── frontend/
│   ├── ml-engine/
│   └── database/
│
├── 96-quick-reference/          # Referencias rapidas
│
├── 97-adr/                      # Architecture Decision Records
│
└── 98-standards/                # Estandares del proyecto

Stack Tecnologico Actual

Capa Tecnologia Version Estado
Frontend React + Vite + TypeScript 19.x / 6.x / 5.x
UI Framework TailwindCSS + shadcn/ui 3.x
State Management Zustand 5.x
Backend API NestJS + TypeScript 11.x / 5.x
ORM TypeORM 0.3.x
ML Engine Python + FastAPI 3.11 / 0.115
ML Models XGBoost + scikit-learn 2.x / 1.x
Base de Datos PostgreSQL 16.x
Pagos Stripe 20.x
Auth JWT + Passport -

Arquitectura del Sistema

┌─────────────────────────────────────────────────────────────────┐
│                        FRONTEND (React 19)                       │
│                   Vite + TailwindCSS + Zustand                   │
│  ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐           │
│  │  Login   │ │Dashboard │ │ Courses  │ │Predictions│           │
│  └──────────┘ └──────────┘ └──────────┘ └──────────┘           │
│                         Puerto 5173                              │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                    BACKEND API (NestJS 11)                       │
│                   TypeORM + PostgreSQL                           │
│  ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐           │
│  │   Auth   │ │  Users   │ │ Courses  │ │ Payments │           │
│  └──────────┘ └──────────┘ └──────────┘ └──────────┘           │
│                         Puerto 3000                              │
└─────────────────────────────────────────────────────────────────┘
         │                              │
         ▼                              ▼
┌─────────────────┐          ┌─────────────────────────────────────┐
│   PostgreSQL    │          │       ML SERVICES (FastAPI)         │
│   Puerto 5433   │          │           Puerto 8000               │
│                 │          │  ┌──────────┐ ┌──────────┐         │
│ - public        │          │  │ XGBoost  │ │ Feature  │         │
│ - auth          │          │  │ Predictor│ │Engineering│         │
│ - education     │          │  └──────────┘ └──────────┘         │
│ - trading       │          │  ┌──────────┐ ┌──────────┐         │
│ - billing       │          │  │  Market  │ │ Training │         │
│                 │          │  │   Data   │ │ Pipeline │         │
└─────────────────┘          │  └──────────┘ └──────────┘         │
                              └─────────────────────────────────────┘

Configuracion de Stripe

Productos Configurados

Plan Producto ID Price ID Precio
Basic prod_TYA4rxBGz3ZEl1 price_1Sb3k64dPtEGmLmpeAdxvmIu $19/mes
Pro prod_TYA4ZpGaV1eMai price_1Sb3k64dPtEGmLmpm5n5bbJH $49/mes
Premium prod_TYA4MrWX4h8CSF price_1Sb3k74dPtEGmLmpHfLpUkvQ $99/mes

Webhook Endpoint

URL: https://[tu-dominio]/payments/webhook
Eventos:
  - payment_intent.succeeded
  - payment_intent.payment_failed
  - customer.subscription.updated
  - customer.subscription.deleted

Modelo ML - XGBoost Predictor

Caracteristicas (30+ features)

  • Volatilidad: volatility_5, volatility_10, volatility_20, ATR
  • Momentum: momentum_5, momentum_10, momentum_20, ROC
  • Medias Moviles: SMA, EMA, ratios de precio
  • Indicadores: RSI, MACD, Bollinger Bands
  • Volumen: volume_ratio, volume_sma

Metricas de Entrenamiento

Metrica Valor
MAE High 0.099%
MAE Low 0.17%
Samples 500 candles
Horizonte 30 min (6 candles)

Variables de Entorno

Backend (.env)

# Database
DB_HOST=localhost
DB_PORT=5433
DB_DATABASE=trading_platform
DB_USERNAME=trading
DB_PASSWORD=***

# JWT
JWT_SECRET=***
JWT_EXPIRES_IN=1d

# ML Service
ML_SERVICE_URL=http://localhost:8000

# Stripe
STRIPE_SECRET_KEY=sk_test_***
STRIPE_WEBHOOK_SECRET=whsec_***

# App
PORT=3000
FRONTEND_URL=http://localhost:5173

Comandos Utiles

Desarrollo

# Backend
cd apps/backend && npm run start:dev

# Frontend
cd apps/frontend && npm run dev

# ML Services
cd apps/ml-services && conda activate trading-ml && uvicorn src.api.server:app --reload --port 8000

# Base de datos
PGPASSWORD=*** psql -h localhost -p 5433 -U trading -d trading_platform

Build

# Backend
cd apps/backend && npm run build

# Frontend
cd apps/frontend && npm run build

Proximos Pasos

  1. Conectar Backend con PostgreSQL
  2. Implementar modulo de cursos
  3. Conectar Frontend con Backend
  4. Integrar modelos ML reales
  5. Implementar pagos Stripe
  6. Crear pagina de Predictions en Frontend
  7. Implementar WebSocket para precios en tiempo real
  8. Agregar mas instrumentos (ETH, XAU, EUR)
  9. Implementar sistema de notificaciones
  10. Deploy a produccion

Referencias


Documentacion actualizada: 2025-12-05