You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.\scripts\dev.ps1 up
# Levanta SQL Server 2022 (:1433) + Service Bus Emulator
2. Backend (.NET 9)
# Copiar configuración de desarrollo
cp src/ERP.Api/appsettings.Development.example.json src/ERP.Api/appsettings.Development.json
# Correr API (aplica migraciones automáticamente al arrancar)
dotnet run --project src/ERP.Api
# → http://localhost:5219# → Swagger: http://localhost:5219/swagger
Dev Auth:"DevAuth:Enabled": true en appsettings.Development.json permite usar la API sin Azure App Registration real.
3. Frontend Web (React 19)
pnpm install
# Copiar variables de entorno
cp apps/web/.env.example apps/web/.env.local
cd apps/web
pnpm dev
# → http://localhost:3000
4. App Mobile (Expo)
# Copiar variables de entorno (editar EXPO_PUBLIC_API_URL con tu IP local)
cp apps/mobile/.env.example apps/mobile/.env.local
cd apps/mobile
npx expo start
# Escanear QR con Expo Go
Dev Auth mobile: establece EXPO_PUBLIC_DEV_AUTH_ENABLED=true en .env.local para entrar sin MSAL.
Variables de entorno
Archivo
Descripción
apps/web/.env.example
Variables Vite (MSAL, API URL, App Insights)
apps/mobile/.env.example
Variables Expo (MSAL, API URL, DevAuth flag)
src/ERP.Api/appsettings.Development.json
Strings de conexión, DevAuth, Azure OpenAI
Testing
Backend
# Todos los tests
dotnet test ERP.sln
# Un proyecto específico
dotnet test tests/ERP.Finance.Tests
Suite
Tests
ERP.SharedKernel.Tests
28
ERP.Core.Tests
40
ERP.Finance.Tests
51
ERP.Billing.Tests
34
ERP.Sales.Tests
25
ERP.Inventory.Tests
28
ERP.Procurement.Tests
19
ERP.HR.Tests
29
ERP.Compliance.Tests
13
ERP.Integration.Tests
46
Total
313 ✅
Frontend
cd apps/web
pnpm test # Vitest (89 tests unitarios + componentes)
pnpm test:coverage # Con reporte de cobertura
pnpm e2e # Playwright E2E (requiere servidor corriendo)
Infraestructura Azure
Todos los recursos están definidos en infra/bicep/:
Recurso
Módulo
App Service + Plan
modules/appservice.bicep
Azure SQL Server
modules/sqlserver.bicep
Azure Key Vault
modules/keyvault.bicep
Service Bus (Namespace + Topics)
modules/servicebus.bicep
Application Insights + Log Analytics
modules/applicationinsights.bicep
Azure OpenAI + model deployments
modules/openai.bicep
Azure Static Web Apps
modules/staticwebapp.bicep
# Deploy a rg-erp-dev
az deployment group create \
--resource-group rg-erp-dev \
--template-file infra/bicep/main.bicep \
--parameters infra/bicep/parameters/dev.bicepparam
JWT en sessionStorage (no localStorage — protección XSS)
✅
Audit log inmutable INSERT-only
✅
CodeQL en CI
✅
AI Chat: input length cap 4096 chars + history depth 20
✅
SQL injection escaping en búsquedas LIKE
✅
Contribuir
Fork el repositorio y crea tu rama desde develop
Sigue las convenciones del proyecto (.editorconfig + Directory.Build.props)
Asegúrate de que dotnet test y pnpm test pasan sin errores
Abre un Pull Request hacia develop
Para cambios en el dominio, agrega tests en la suite correspondiente (tests/ERP.<Modulo>.Tests).
Para cambios de UI, agrega/actualiza tests en apps/web/src/test/.