feat(F-001): scaffold modular monolith skeleton with boundary checker

- TypeScript + Fastify skeleton under project/ (src/modules, shared, infrastructure, app)
- scripts/check-module-boundaries.mjs enforcing module public-API rules (tested with fixtures)
- GET /health endpoint, error envelope without stack leakage
- specs/F-001-scaffold (SPEC/DESIGN/TASKS/TESTS), spec/tech.md dependency justification
- 30-ticket MercadoDeVida roadmap in backlog/features.json, spec/roadmap.md
- All gates approved: reviewer, security, qa; verify.sh green
This commit is contained in:
rikrdo
2026-08-14 21:46:54 +02:00
commit 1d4eebca54
76 changed files with 9430 additions and 0 deletions

30
spec/tech.md Normal file
View File

@@ -0,0 +1,30 @@
# Technical Spec — MercadoDeVida vNext
## Stack
- Lenguaje: TypeScript (strict) — backend y frontend
- Framework backend: Fastify 5 (monolito modular; elegido por tipado, simplicidad y ausencia de magia)
- Framework frontend: Next.js + React + Tailwind (llega en F-013; SSG/ISR para SEO)
- Runtime: Node.js >= 22
- Base de datos: PostgreSQL (fuente de verdad) + Redis (solo caché) — desde F-002
## Dependencias (justificación obligatoria por política de seguridad)
| Dependencia | Versión | Justificación |
|---|---|---|
| fastify | ^5.2 | Servidor HTTP tipado, maintained, sin magia; única dep de runtime en F-001 |
| typescript | ^5.7 | Tipado estricto (dev) |
| vitest | ^3 | Tests unit/integración TS-native (dev) |
| eslint + @eslint/js + typescript-eslint + eslint-config-prettier | ^9 / ^8 / ^10 | Linting estándar (dev) |
| prettier | ^3 | Formato consistente (dev) |
Regla: toda dependencia nueva debe agregarse a esta tabla con justificación en el ticket que la introduce.
## Restricciones
- Seguridad: nunca confiar en frontend para precio/stock/descuento/estado de pago; envelopes de error sin stack traces; sin secretos en repo
- Rendimiento: caché solo donde sea medible (F-027)
- Compatibilidad: URLs públicas estables /productos/<slug>, /categoria/<slug>, /marca/<slug>
## Observabilidad
- Logging: estructurado con request_id (F-003)
- Métricas: Prometheus con métricas de negocio (F-029)
- Alertas: fuera de alcance inicial