com um clique
server-architecture-guide
Authoritative guide for the server-side architecture of the react-supabase-boilerplate. Enforces CSR pattern, Kysely best practices, standardized API responses, and strict middleware usage.
Menu
Authoritative guide for the server-side architecture of the react-supabase-boilerplate. Enforces CSR pattern, Kysely best practices, standardized API responses, and strict middleware usage.
Authoritative guide for the monorepo architecture of the react-supabase-boilerplate. Enforces Docker orchestration, Kysely database patterns, and development workflows.
Opinionated backend development standards for Node.js + Express + TypeScript microservices. Covers layered architecture, BaseController pattern, dependency injection, Prisma repositories, Zod validation, unifiedConfig, Sentry error tracking, async safety, and testing discipline.
This skill focuses on backend architecture (Controller/Service/Repository), Prisma interaction, and standardized error/response middleware. Use it when building or modifying backend routes, controllers, or services.
This skill enforces robust, scalable testing methodologies for both the frontend and backend. Use it when writing unit or integration tests, setting up testing frameworks like Vitest, or verifying that features conform to the "Gold Standard".
Authoritative guide for the client-side architecture of the react-supabase-boilerplate. Enforces feature-based modules, Tailwind v4 styling, TanStack ecosystem, and Zustand state patterns.
This skill enforces the strict directory structure and file naming conventions of the project. Use this whenever an agent is creating new files or folders to ensure consistency across the client and server.
| version | 1.0.0 |
| name | server-architecture-guide |
| description | Authoritative guide for the server-side architecture of the react-supabase-boilerplate. Enforces CSR pattern, Kysely best practices, standardized API responses, and strict middleware usage. |
You are an expert backend engineer specializing in Node.js, Express, and Kysely. You must follow this "Gold Standard" architecture.
All features MUST be organized into these layers:
*.route.ts): Define endpoints, apply middleware (Auth, Rate Limiting, Validation).*.controller.ts): Handle HTTP-specific logic, extract inputs, call Services. Use asyncHandler.*.service.ts): Core business logic. Framework-agnostic. Use Repositories.*.repository.ts): Direct Kysely interaction for data persistence. No business logic.errorMiddleware: Catches all exceptions. Returns standardized ApiResponse JSON.asyncHandler: Wraps async controller methods to remove try/catch boilerplate.validateSchema: Uses Zod to validate request bodies/params.authMiddleware: Verifies JWTs, attaches user to request, logs user identity.requireRole(role): RBAC guard for protected routes.db directly. Use Repositories.active helper from @/shared/lib/db-utils or explicit where('deletedAt', 'is', null).kysely-ctl via npm run db:migrate.db.types.ts for generated interfaces.All successful responses MUST use the ApiResponse utility.
return new ApiResponse(res).success(data, 'Message', 200);
T (e.g., TUser).any. Use unknown or specific interfaces.lowercase-with-hyphens.purpose.ts (e.g., user.controller.ts).tests/[feature]/[name].[unit|integration].test.ts.vitest-mock-extended for repository mocking in service tests.