What problem does it solve?
Maintaining consistency and best practices across a complex monorepo backend (Next.js, tRPC, Express, TypeScript) can be challenging, leading to fragmented code and inconsistent patterns. This Skill provides comprehensive guidelines for Langfuse's backend development.
Core Features & Use Cases
- Layered Architecture Enforcement: Structure tRPC procedures, public API endpoints, and queue processors to delegate business logic to services, ensuring modularity and testability.
- Multi-Tenant Isolation: Implement
projectId filtering and robust authentication (JWT, basic auth) for secure multi-tenant applications.
- Dual Database & Observability: Integrate PostgreSQL (Prisma) and ClickHouse, with OpenTelemetry, DataDog, and
traceException for comprehensive monitoring and error handling.
- Use Case: When creating a new tRPC router for a feature in the Langfuse monorepo, use this skill to ensure your procedures delegate to services, implement Zod validation, use
traceException for error handling, and adhere to the established directory structure and naming conventions.
Quick Start
Create a new tRPC feature in the web package, ensuring it follows the router, procedure, validation, service, and error handling guidelines.