# Paths de Trabajo - Template-SaaS

**Version:** 1.0
**Fecha:** 2026-01-24

---

## Paths Base

| Variable | Valor |
|----------|-------|
| WORKSPACE_ROOT | /home/isem/workspace-v2 |
| PROJECT_ROOT | /home/isem/workspace-v2/projects/template-saas |

---

## Database (DDL)

| Path | Descripcion |
|------|-------------|
| `apps/database/ddl/` | Archivos DDL ordenados |
| `apps/database/ddl/schemas/` | DDL por schema |
| `apps/database/scripts/` | Scripts de mantenimiento |
| `apps/database/seeds/` | Datos de prueba |
| `apps/database/seeds/dev/` | Seeds de desarrollo |
| `apps/database/seeds/prod/` | Seeds de produccion |

### Schemas DDL

```
00-extensions.sql
01-create-schemas.sql
02-auth.sql
03-tenants.sql
04-users.sql
05-billing.sql
06-plans.sql
07-notifications.sql
08-audit.sql
09-ai.sql
10-storage.sql
11-webhooks.sql
12-feature-flags.sql
13-whatsapp.sql
```

---

## Backend (NestJS)

| Path | Descripcion |
|------|-------------|
| `apps/backend/src/` | Codigo fuente |
| `apps/backend/src/modules/` | Modulos NestJS |
| `apps/backend/src/shared/` | Codigo compartido |
| `apps/backend/src/shared/guards/` | Guards de autenticacion |
| `apps/backend/src/shared/decorators/` | Decoradores custom |
| `apps/backend/tests/` | Tests |

### Modulos Backend

```
modules/
├── auth/
├── tenants/
├── users/
├── billing/
├── plans/
├── notifications/
├── audit/
├── ai/
├── storage/
├── webhooks/
├── feature-flags/
└── whatsapp/
```

---

## Frontend (React + Vite)

| Path | Descripcion |
|------|-------------|
| `apps/frontend/src/` | Codigo fuente |
| `apps/frontend/src/portals/` | Portales (user, admin, superadmin) |
| `apps/frontend/src/shared/` | Componentes compartidos |
| `apps/frontend/src/shared/components/` | UI components |
| `apps/frontend/src/stores/` | Zustand stores |
| `apps/frontend/src/services/` | API services |

### Portales Frontend

```
portals/
├── user/           # Portal usuario final (/)
├── admin/          # Portal admin de tenant (/admin)
└── superadmin/     # Portal superadmin (/superadmin)
```

---

## Documentacion

| Path | Descripcion |
|------|-------------|
| `docs/` | Documentacion del proyecto |
| `docs/00-vision-general/` | Vision y alcance |
| `docs/01-modulos/` | Especificaciones de modulos |
| `docs/02-integraciones/` | Integraciones externas |
| `docs/architecture/adr/` | Architecture Decision Records |

---

## Orchestration

| Path | Descripcion |
|------|-------------|
| `orchestration/` | Sistema de orquestacion local |
| `orchestration/inventarios/` | Inventarios del proyecto |
| `orchestration/trazas/` | Trazas de ejecucion |
| `orchestration/CONTEXT-MAP.yml` | Mapa de contexto NEXUS |
| `orchestration/PROXIMA-ACCION.md` | Estado y siguiente paso |

---

## Quick Reference

```bash
# DDL
@DDL          = apps/database/ddl/schemas/
@DDL_ROOT     = apps/database/ddl/
@SEEDS        = apps/database/seeds/

# Backend
@BACKEND      = apps/backend/src/modules/
@BACKEND_ROOT = apps/backend/src/

# Frontend
@FRONTEND     = apps/frontend/src/portals/
@FRONTEND_ROOT = apps/frontend/src/

# Inventarios
@INV_MASTER   = orchestration/inventarios/MASTER_INVENTORY.yml
@INV_DB       = orchestration/inventarios/DATABASE_INVENTORY.yml
@INV_BE       = orchestration/inventarios/BACKEND_INVENTORY.yml
@INV_FE       = orchestration/inventarios/FRONTEND_INVENTORY.yml
```

---

**Actualizado:** 2026-01-24
