- Add CLAUDE.md with project-specific instructions - Add .trae/rules/ and AGENT-CAPABILITIES.md - Add .windsurf/rules/ and AGENT-CAPABILITIES.md - Add .gemini/antigravity/README.md - Stack: NestJS 11.1.8, React 19.0.0, PostgreSQL 15+ - Type: PROVIDER (propagates to erp-core) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
156 lines
3.5 KiB
Markdown
156 lines
3.5 KiB
Markdown
# CLAUDE.md - Template SaaS
|
|
|
|
**Hereda de:** workspace-v2/CLAUDE.md
|
|
**Sistema:** SIMCO v4.0.0 + NEXUS v4.0
|
|
**Proyecto:** template-saas
|
|
**Tipo:** PROVIDER (L1A)
|
|
**Versión:** 1.1.0
|
|
**Actualizado:** 2026-01-24
|
|
|
|
---
|
|
|
|
## EXTENSIONES LOCALES
|
|
|
|
Este archivo EXTIENDE (no reemplaza) las reglas del workspace.
|
|
Para reglas base, ver: `../../CLAUDE.md`
|
|
|
|
---
|
|
|
|
## STACK TECNOLÓGICO
|
|
|
|
| Capa | Tecnología | Versión |
|
|
|------|------------|---------|
|
|
| Backend | NestJS | 11.1.8 |
|
|
| Frontend | React | 19.0.0 |
|
|
| Build Tool | Vite | 6.0.6 |
|
|
| Base de Datos | PostgreSQL | 15+ |
|
|
| ORM | TypeORM | 0.3.22 |
|
|
| Cache | Redis (ioredis) | 5.9.0 |
|
|
| Queue | BullMQ | 5.66.4 |
|
|
| Payments | Stripe | 17.5.0 |
|
|
| State Mgmt | Zustand | 5.0.2 |
|
|
| UI Framework | Tailwind CSS | 3.4.17 |
|
|
|
|
---
|
|
|
|
## CREDENCIALES BD
|
|
|
|
```
|
|
Database: template_saas_dev
|
|
User: template_saas_user
|
|
Password: saas_dev_2026
|
|
Port: 5432
|
|
Host: localhost
|
|
```
|
|
|
|
---
|
|
|
|
## DIRECTORIOS CLAVE
|
|
|
|
```
|
|
backend/ → Backend NestJS (19 módulos)
|
|
frontend/ → Frontend React (3 portales)
|
|
database/ddl/ → DDL PostgreSQL (24 tablas)
|
|
docs/ → Documentación técnica
|
|
orchestration/ → Sistema SIMCO local
|
|
.claude/ → Instrucciones Claude Code
|
|
```
|
|
|
|
---
|
|
|
|
## HERENCIA
|
|
|
|
### Este proyecto hereda de:
|
|
- `workspace-v2/orchestration/` → Directivas globales, triggers, modos
|
|
- `workspace-v2/shared/catalog/` → Funcionalidades reutilizables
|
|
|
|
### Este proyecto exporta a:
|
|
- `erp-core` → Patrones base SaaS, auth, multi-tenancy
|
|
- Verticales ERP → Via erp-core (herencia transitiva)
|
|
|
|
---
|
|
|
|
## MÓDULOS BACKEND (19)
|
|
|
|
| Módulo | Descripción |
|
|
|--------|-------------|
|
|
| auth | JWT, OAuth ready, MFA |
|
|
| tenants | Multi-tenancy con RLS |
|
|
| users | Gestión de usuarios |
|
|
| billing | Integración Stripe |
|
|
| plans | Límites y suscripciones |
|
|
| ai | Wrapper multi-LLM |
|
|
| notifications | Email, push, in-app, WebSocket |
|
|
| email | SendGrid, SES, SMTP |
|
|
| whatsapp | WhatsApp Business API |
|
|
| audit | Auditoría de acciones |
|
|
| feature-flags | Toggles dinámicos |
|
|
| webhooks | Outbound con BullMQ |
|
|
| storage | S3, R2, MinIO |
|
|
| analytics | Reportes analíticos |
|
|
| reports | Generación de reportes |
|
|
| health | Health checks |
|
|
| onboarding | Wizard para nuevos tenants |
|
|
| rbac | Control de acceso |
|
|
| superadmin | Portal super admin |
|
|
|
|
---
|
|
|
|
## VALIDACIONES ADICIONALES
|
|
|
|
Además de las validaciones del workspace:
|
|
|
|
1. **Multi-Tenancy:** Todo endpoint debe respetar tenant_id
|
|
2. **RLS:** Las queries deben usar Row Level Security
|
|
3. **Stripe:** Los webhooks deben validar firma
|
|
4. **Tests:** Cobertura mínima 70% para nuevos módulos
|
|
|
|
---
|
|
|
|
## ALIASES LOCALES
|
|
|
|
- `@BACKEND` → backend/src/modules/
|
|
- `@FRONTEND` → frontend/src/
|
|
- `@DDL` → database/ddl/
|
|
- `@DOCS` → docs/
|
|
- `@INVENTARIOS` → orchestration/inventarios/
|
|
- `@CONSTANTS` → .claude/constants/CONSTANTS-PROJECT.yml
|
|
|
|
---
|
|
|
|
## ANTES DE IMPLEMENTAR
|
|
|
|
1. Verificar en `docs/` que existe especificación
|
|
2. Si no existe → DETENER y preguntar
|
|
3. Revisar `orchestration/inventarios/` para estado actual
|
|
4. Validar que no duplica funcionalidad existente
|
|
|
|
---
|
|
|
|
## DESPUÉS DE IMPLEMENTAR
|
|
|
|
1. Actualizar inventarios (BACKEND_INVENTORY.yml, etc.)
|
|
2. Actualizar documentación afectada
|
|
3. Commit y push siguiendo SIMCO-GIT
|
|
4. Evaluar propagación a erp-core
|
|
|
|
---
|
|
|
|
## PROPAGACIÓN
|
|
|
|
Como proyecto PROVIDER, los cambios en template-saas pueden propagarse a:
|
|
|
|
```
|
|
template-saas (PROVIDER)
|
|
↓
|
|
erp-core (INTERMEDIATE)
|
|
↓
|
|
erp-construccion, erp-clinicas, erp-retail, etc. (CONSUMERS)
|
|
```
|
|
|
|
**Regla:** Security fixes se propagan INMEDIATAMENTE.
|
|
|
|
---
|
|
|
|
*Template SaaS v1.1.0 - Sistema SIMCO v4.0.0*
|