Files
agent-park/.planning/codebase/STACK.md
T
2026-04-20 18:59:15 +08:00

7.1 KiB

Technology Stack

Analysis Date: 2026-04-20

Languages

Primary:

  • TypeScript 5.x - Main application, API, Prisma helpers, hooks, and tooling live in src/**/*.ts, src/**/*.tsx, prisma/seed.ts, tailwind.config.ts, and vitest.config.ts; the compiler is declared in package.json.

Secondary:

  • JavaScript - Runtime and framework config live in next.config.js, postcss.config.mjs, and scripts/generate-n8n-context.mjs.
  • CSS - Global styling and external font/icon imports live in src/app/globals.css.
  • JSON - Repo and content config live in package.json, tsconfig.json, .eslintrc.json, .prettierrc.json, vercel.json, docs/integrations/n8n/registry.json, and src/messages/*.json.
  • Prisma schema DSL - Database schema, datasource, enums, and vector column definitions live in prisma/schema.prisma.
  • SQL migrations - Prisma migration output lives in prisma/migrations/*/migration.sql.
  • Markdown - Integration contracts and workflow docs live in docs/integrations/n8n/*.md, docs/integrations/n8n/workflows/*.md, and mirrored GSD docs in .planning/codebase/N8N-CONTEXT.md and .planning/codebase/N8N-DATAFLOW.md.

Runtime

Environment:

  • Node.js 22.x - Containerized runtime is pinned by Dockerfile and Dockerfile.runtime, both based on node:22-bookworm.
  • Server runtime is Next.js App Router with standalone output enabled in next.config.js and consumed by Dockerfile.runtime.
  • Local runtime version pin file is not committed. No .nvmrc, .node-version, or .tool-versions file is present at repo root.

Package Manager:

  • pnpm - All install/build/test scripts in package.json, vercel.json, Dockerfile, and nixpacks.toml use pnpm.
  • Lockfile: present in pnpm-lock.yaml.

Frameworks

Core:

  • Next.js 15.1.11 - App Router pages, layouts, metadata routes, and route handlers live in src/app/**/*; framework config is in next.config.js.
  • React 19.0.0 and react-dom 19.0.0 - UI runtime for components in src/components/**/* and route segments in src/app/**/*.
  • next-intl ^4.0.2 - Locale middleware and message loading are wired through next.config.js, src/middleware.ts, src/i18n/request.ts, and localized routes under src/app/[locale].
  • Prisma ^6.1.0 / @prisma/client ^6.1.0 - ORM and generated client used by src/lib/prisma.ts, src/hooks/useProjects.ts, src/hooks/useHome.ts, and route handlers under src/app/api/**/*.
  • Zod ^3.24.1 - Runtime validation is centralized in src/lib/validations.ts and consumed by API routes such as src/app/api/search/ai/route.ts and src/app/api/webhook/signals/route.ts.

Testing:

  • Vitest ^2.1.8 - Unit-style tests are configured in vitest.config.ts and run against src/**/*.test.ts.
  • Playwright: Not detected in committed dependencies or config. No playwright.config.* file and no committed e2e/ directory are present.

Build/Dev:

  • Tailwind CSS ^3.4.17 - Utility styling is configured in tailwind.config.ts and loaded from src/app/globals.css.
  • tailwindcss-animate ^1.0.7 - Tailwind plugin registered in tailwind.config.ts.
  • PostCSS ^8 with autoprefixer ^10.4.20 - CSS processing is configured in postcss.config.mjs.
  • ESLint ^9 with eslint-config-next 15.1.11 and eslint-config-prettier ^9.1.0 - Linting rules are configured in .eslintrc.json.
  • Prettier ^3.4.2 - Formatting rules are configured in .prettierrc.json.
  • ts-node ^10.9.2 - Used by the Prisma seed command configured in package.json.

Key Dependencies

Critical:

  • next 15.1.11 - Main web framework for src/app/**/*.
  • react 19.0.0 and react-dom 19.0.0 - Required by all React components in src/components/**/*.
  • @prisma/client ^6.1.0 - Data access layer instantiated in src/lib/prisma.ts.
  • prisma ^6.1.0 - Schema and migration tooling for prisma/schema.prisma and prisma/migrations/*.
  • next-intl ^4.0.2 - Locale-aware routing and translations for src/middleware.ts, src/i18n/request.ts, and src/messages/*.json.
  • zod ^3.24.1 - Request validation for search, tags, and webhook contracts in src/lib/validations.ts.

Infrastructure:

  • @vercel/analytics ^1.6.1 - Client analytics are mounted in src/app/VercelMetrics.tsx.
  • @vercel/speed-insights ^1.3.1 - Frontend performance telemetry is mounted in src/app/VercelMetrics.tsx.
  • react-markdown ^10.1.0, remark-gfm ^4.0.1, and rehype-sanitize ^6.0.0 - Markdown rendering and sanitization stack used by src/components/project/MarkdownContent.tsx.
  • lucide-react ^0.468.0 - Icon package optimized through experimental.optimizePackageImports in next.config.js.

Configuration

Environment:

  • Database connectivity is anchored by DATABASE_URL in prisma/schema.prisma and normalized by buildPrismaDataSourceUrl() in src/lib/prisma-url.ts.
  • Optional Postgres mTLS/SSL overlay is configured in src/lib/prisma-url.ts using PG_SSL_ROOT_CERT_B64, PG_SSL_IDENTITY_P12_B64, PG_SSL_IDENTITY_PASSWORD, PG_SSL_CERT_DIR, and PG_SSL_MODE.
  • Internal machine-to-machine auth uses WEBHOOK_API_KEY in src/lib/auth.ts.
  • Outbound AI search proxying uses N8N_AI_SEARCH_WEBHOOK in src/app/api/search/ai/route.ts.
  • Canonical URL generation uses NEXT_PUBLIC_SITE_URL in src/app/robots.ts and src/app/sitemap.ts.
  • Vercel-only telemetry gating uses VERCEL_ENV in src/app/layout.tsx.
  • Template env files exist as .env.example, .env.local, and .env; contents were not read.

Build:

  • next.config.js enables output: "standalone", wires next-intl, configures remote image hosts, and optimizes lucide-react imports.
  • tsconfig.json enables strict TypeScript, noUncheckedIndexedAccess, noImplicitReturns, noFallthroughCasesInSwitch, and the @/* alias.
  • tailwind.config.ts and postcss.config.mjs define the frontend styling pipeline.
  • vercel.json defines install/build commands, the nextjs framework target, and region hkg1.
  • Dockerfile, Dockerfile.runtime, and nixpacks.toml define container build and runtime packaging.
  • scripts/generate-n8n-context.mjs generates docs/integrations/n8n/CONTEXT.generated.md and the GSD mirror .planning/codebase/N8N-CONTEXT.md.

Platform Requirements

Development:

  • Node.js 22-compatible runtime and pnpm are required to run package.json scripts.
  • PostgreSQL is required because prisma/schema.prisma uses the postgresql provider.
  • Prisma client generation is part of the build path in vercel.json, Dockerfile, and nixpacks.toml.
  • The n8n context refresh flow requires pnpm n8n:context, which runs scripts/generate-n8n-context.mjs.

Production:

  • Vercel is a first-class deployment target via vercel.json and the telemetry components in src/app/VercelMetrics.tsx.
  • Container deployment is also supported through Dockerfile, Dockerfile.runtime, and nixpacks.toml.
  • Production data storage is PostgreSQL via Prisma, with a vector column in prisma/schema.prisma used by semantic-search-related workflows documented under docs/integrations/n8n/.
  • Standalone Next.js output is expected by Dockerfile.runtime, which boots .next/standalone/server.js.

Stack analysis: 2026-04-20