SPB Git

Repository Public MIT

0001-stack-and-monorepo.md 1.7 KB 26 lines markdown

1# ADR-0001 — Stack and monorepo layout23Status: accepted, 2026-11-09.45## Context67The brief asks for a public registry with a web UI, a versioned REST API, a CLI, an SDK and an MCP server, maintained mostly by one person with Claude Code, deployed on the owner's own cluster.89## Decision1011- One pnpm workspace. No Turborepo: there are five small packages and no build graph worth caching.12- `apps/web` — Next.js 16 (App Router), React 19, TypeScript, Tailwind 4. It serves the UI, the REST API under `/api/v1` and the MCP endpoint at `/mcp` from one process and one port.13- `apps/web/src/server` — all business logic as plain TypeScript modules with no Next.js imports. The API entry point is `handleApi(request): Response`. Next route handlers, the admin console and the tests all call the same functions.14- `packages/registry-core` — everything the CLI, API and MCP server must agree on: manifest schema, limits, scopes, tar codec, validator, scanner, install adapters.15- `packages/db`, `packages/sdk`, `packages/cli`, `apps/registry-mcp` as described in the repository map.16- Workspace packages are consumed as TypeScript source (`exports` point at `src/*.ts`). Next transpiles them; `tsx` runs scripts; the CLI is bundled with esbuild for distribution.17- Validation with zod 4. Password hashing with `@node-rs/argon2`. Tests with Vitest and Playwright.1819No separate `apps/api`, `packages/ui` or `packages/config`: they would add indirection without a second consumer.2021## Consequences2223- One deployable, one port, one PM2 process. Simple to operate; no horizontal scaling without first addressing ADR-0004.24- The API is testable without booting Next.js.25- A future split of the API into its own service is mechanical because the router has no framework dependency.26
Files main
Menu

Theme