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

View File

@@ -0,0 +1,11 @@
import type { FastifyInstance } from 'fastify';
interface HealthResponse {
status: 'ok';
}
export async function registerHealthRoutes(app: FastifyInstance): Promise<void> {
app.get('/health', async (): Promise<HealthResponse> => {
return { status: 'ok' };
});
}

View File

@@ -0,0 +1,5 @@
/**
* Public API of the health module. Everything a module exposes to the
* outside world goes through this file.
*/
export { registerHealthRoutes } from './api/health.routes.js';

View File

@@ -0,0 +1,18 @@
import Fastify from 'fastify';
import { describe, expect, it } from 'vitest';
import { registerHealthRoutes } from '../index.js';
describe('health module API', () => {
it('GET /health returns 200 and status ok', async () => {
const app = Fastify({ logger: false });
await app.register(async (instance) => {
await registerHealthRoutes(instance);
});
const response = await app.inject({ method: 'GET', url: '/health' });
expect(response.statusCode).toBe(200);
expect(response.json()).toEqual({ status: 'ok' });
await app.close();
});
});