# MiInventario - Contexto del Proyecto ## Identificacion | Campo | Valor | |-------|-------| | **Nombre** | MiInventario | | **Codigo** | MII | | **Tipo** | Standalone SaaS | | **Nivel SIMCO** | L2-A (Standalone) | | **Estado** | Desarrollo Activo | | **Version** | 1.0.0 | | **Creado** | 2026-01-10 | | **Actualizado** | 2026-01-10 | --- ## Descripcion SaaS Movil que permite a negocios pequenos (tienditas, miscelaneas, puestos) en Mexico generar inventario automatico a partir de un video de anaqueles (30-60 segundos). El sistema utiliza inteligencia artificial para detectar productos (SKU) y contarlos. --- ## Propuesta de Valor 1. **Automatizacion** - Inventario en segundos, no horas 2. **Accesibilidad** - Pagos en efectivo (OXXO, 7-Eleven) 3. **Aprendizaje Continuo** - El modelo mejora con retroalimentacion 4. **Crecimiento Organico** - Sistema de referidos multinivel 5. **Costo Justo** - Precio = 2x costo IA (transparente) --- ## Stack Tecnologico | Componente | Tecnologia | Version | |------------|------------|---------| | Mobile | React Native (Expo) | SDK 52 | | Navegacion | expo-router | 4.x | | Estado | Zustand | 5.x | | Backend | NestJS + TypeScript | 10.x | | Base de Datos | PostgreSQL + TypeORM | 15.x | | Cache/Cola | Redis + Bull | 7.x | | Almacenamiento | S3 Compatible (MinIO) | - | | Pagos | Stripe + Agregadores | - | | Notificaciones | Firebase FCM | - | | IA | OpenAI GPT-4o Vision + Claude | - | --- ## Variables del Proyecto ### Database ```yaml DB_NAME: miinventario_dev DB_PORT: 5433 ORM: TypeORM SCHEMA: public # Schema unico en lugar de multiples TABLAS: 13 ENUMS: 10 INDICES: 17 FOREIGN_KEYS: 13 MIGRACION: 1768099560565-Init ``` ### Backend ```yaml BACKEND_PORT: 3142 MODULOS_IMPLEMENTADOS: 11 ENDPOINTS: 45 TESTS_E2E: 53 MODULES: - auth # Autenticacion JWT, OTP - users # Gestion usuarios - stores # Gestion tiendas multi-tenant - inventory # Items de inventario - videos # Upload y procesamiento - credits # Sistema de creditos - payments # Procesamiento pagos Stripe - referrals # Sistema referidos - notifications # Push notifications FCM - ia-provider # Abstraccion IA (OpenAI/Claude) - health # Health checks ``` ### Mobile ```yaml MOBILE_PORT: 8082 SCREENS_IMPLEMENTADOS: 20 STORES: 7 SERVICES: 10 NAVEGACION: expo-router (file-based) SCREENS: - Auth: login, register, verify-otp - Tabs: home, scan, inventory, profile - Credits: buy, history - Stores: index, new, [id] - Inventory: [id] - Notifications: index - Referrals: index - Profile: edit - Payments: methods - Help: index - Support: index - Legal: terms, privacy ``` --- ## Arquitectura de Carpetas ``` miinventario/ ├── apps/ │ ├── backend/ # API NestJS │ │ └── src/ │ │ ├── modules/ # 11 modulos implementados │ │ ├── config/ # Configuracion TypeORM │ │ └── migrations/ # Migraciones DB │ └── mobile/ # React Native Expo │ └── src/ │ ├── app/ # expo-router screens │ ├── stores/ # Zustand stores │ ├── services/ # API services │ └── types/ # TypeScript types ├── database/ │ ├── schemas/ # (No usado - TypeORM migrations) │ └── seeds/ # Datos iniciales ├── docs/ # Documentacion SIMCO │ ├── 00-vision-general/ │ ├── 01-epicas/ │ ├── 02-especificaciones/ │ ├── 02-integraciones/ │ ├── 90-transversal/ │ └── 97-adr/ ├── orchestration/ # Orquestacion │ ├── 00-guidelines/ │ ├── inventarios/ │ ├── environment/ │ ├── trazas/ │ └── analisis/ └── deploy/ # Configuracion despliegue ``` --- ## Puertos Asignados (Desarrollo) | Servicio | Puerto | Notas | |----------|--------|-------| | PostgreSQL | 5433 | Docker | | Redis | 6380 | Docker | | MinIO (S3 API) | 9002 | Docker | | MinIO (Console) | 9003 | Docker | | Backend API | 3142 | NestJS | | Mobile (Expo) | 8082 | Expo dev server | --- ## Epicas y Progreso ### FASE 1: MVP Core - 100% COMPLETADO | ID | Nombre | SP | Estado | |----|--------|-----|--------| | MII-001 | Infraestructura Base | 8 | Completado | | MII-002 | Autenticacion | 13 | Completado | | MII-003 | Gestion de Tiendas | 8 | Completado | | MII-004 | Captura de Video | 21 | Completado | | MII-005 | Procesamiento IA | 34 | Completado | | MII-006 | Reportes de Inventario | 13 | Completado | ### FASE 2: Retroalimentacion - 0% PENDIENTE | ID | Nombre | SP | Estado | |----|--------|-----|--------| | MII-007 | Retroalimentacion y Correcciones | 13 | Pendiente | | MII-008 | Validacion Aleatoria | 8 | Pendiente | ### FASE 3: Monetizacion - 100% COMPLETADO | ID | Nombre | SP | Estado | |----|--------|-----|--------| | MII-009 | Wallet y Creditos | 13 | Completado | | MII-010 | Paquetes de Recarga | 8 | Completado | | MII-011 | Pagos con Tarjeta | 8 | Completado | | MII-012 | Pagos OXXO | 13 | Completado | | MII-013 | Pagos 7-Eleven | 8 | Completado | ### FASE 4: Crecimiento - 60% PARCIAL | ID | Nombre | SP | Estado | |----|--------|-----|--------| | MII-014 | Sistema de Referidos | 21 | Completado | | MII-015 | Administracion SaaS | 13 | Pendiente | **Total: 15 epicas, ~202 Story Points** **Completadas: 11/15 epicas (73%)** --- ## Integraciones Externas | Servicio | Proposito | Prioridad | Estado | |----------|-----------|-----------|--------| | Stripe | Pagos tarjeta + OXXO | P0 | Implementado | | Agregador 7-Eleven | Pagos efectivo | P1 | Planificado | | Firebase FCM | Push notifications | P1 | Implementado | | S3/MinIO | Almacenamiento videos | P0 | Implementado | | OpenAI GPT-4o | Deteccion productos | P0 | Implementado | | Anthropic Claude | Fallback IA | P0 | Implementado | --- ## Modelo de Negocio | Concepto | Descripcion | |----------|-------------| | **Unidad** | Credito/Token | | **Costo** | 2x COGS IA | | **Paquetes** | $50, $100, $200, $500 MXN | | **Referidos** | 1 credito por activacion | | **Regla** | Referido activado = compra + primer inventario | --- ## Estado Actual de Implementacion | Componente | Estado | Progreso | |------------|--------|----------| | Documentacion | Actualizada | 80% | | Database | Implementado | 100% (13 tablas) | | Backend | Implementado | 100% (11 modulos, 45 endpoints) | | Mobile | Implementado | 100% (20 screens, 7 stores) | | Integraciones | Parcial | 83% (5/6 activas) | | Tests E2E | Implementado | 53 tests pasando | --- ## Referencias ### Documentacion Principal - [Vision del Proyecto](../../docs/00-vision-general/VISION-PROYECTO.md) - [Requerimientos Funcionales](../../docs/00-vision-general/REQUERIMIENTOS-FUNCIONALES.md) - [Arquitectura Tecnica](../../docs/00-vision-general/ARQUITECTURA-TECNICA.md) - [Mapa de Documentacion](../../docs/_MAP.md) ### Orchestration del Workspace - [SIMCO Directivas](/home/isem/workspace-v2/orchestration/directivas/simco/) - [Principios](/home/isem/workspace-v2/orchestration/directivas/principios/) - [Templates](/home/isem/workspace-v2/orchestration/templates/) - [Catalogo Compartido](/home/isem/workspace-v2/shared/catalog/) ### Inventarios - [Master Inventory](../inventarios/MASTER_INVENTORY.yml) (v2.0.0) - [Database Inventory](../inventarios/DATABASE_INVENTORY.yml) (v2.0.0) - [Backend Inventory](../inventarios/BACKEND_INVENTORY.yml) (v2.0.0) - [Frontend Inventory](../inventarios/FRONTEND_INVENTORY.yml) (v2.0.0) --- **Ultima Actualizacion:** 2026-01-10 **Version SIMCO:** 4.0.0