This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Novu is a notification infrastructure platform built as a monorepo using Nx with pnpm workspaces. It provides a unified API for multi-channel notifications (email, SMS, push, in-app, chat) with an embeddable inbox component, workflow engine, and comprehensive provider ecosystem.
Technology Stack:
- Backend: Node.js + TypeScript, NestJS, MongoDB, Redis, Bull queues
- Frontend: React 18 + TypeScript, Vite, TanStack Query, Radix UI, Tailwind CSS
- Monorepo: Nx workspace with pnpm workspaces
Key Applications (apps/):
api- Core NestJS backend service (REST API, authentication, business logic)dashboard- Modern React dashboard built with Vite (primary UI)web- Legacy React dashboard (CRA-based, maintained for compatibility)worker- Background job processing service (Bull queues)ws- WebSocket service for real-time updateswebhook- Webhook delivery serviceinbound-mail- Email parsing service
Key Libraries (libs/):
application-generic- Common business logic, CQRS patterns, auth decoratorsdal- Data Access Layer (MongoDB models, repositories)design-system- Shared UI components and themesinternal-sdk- TypeScript SDK with auto-generated types
NPM Packages (packages/):
framework- Core notification framework and workflow enginejs- Client-side JavaScript SDKreact- React notification components (inbox, preferences)providers- Channel integrations (email, SMS, push, chat providers)shared- Common types, constants, utilities
🚀 Quick Start:
# Complete setup (first time)
pnpm setup:project
# Interactive development helper (most useful!)
pnpm start # or: pnpm jarvis🏃 Running Services:
# Core development stack
pnpm start:api:dev # API service with hot reload
pnpm start:dashboard # New React dashboard
pnpm start:web # Legacy web app
pnpm start:worker # Background worker
pnpm start:ws # WebSocket service🏗️ Building:
pnpm build:v2 # Build core v2 services (recommended)
pnpm build # Build all projects
pnpm build:api # Build specific service🧪 Testing:
# API tests
cd apps/api && pnpm test # Unit tests
cd apps/api && pnpm test:e2e:novu-v2 # E2E tests
# Frontend E2E tests
cd apps/web && pnpm test:e2e # Playwright tests
cd apps/dashboard && pnpm test:e2e # Dashboard E2E tests🔍 Code Quality:
pnpm lint # Lint entire codebase
pnpm typecheck # Run TypeScript checksFrom .cursor/rules/novu.mdc:
- Write concise, technical TypeScript code with accurate examples
- Use functional and declarative programming patterns; avoid classes
- Use descriptive variable names with auxiliary verbs (isLoading, hasError)
- Use lowercase with dashes for directories and files (e.g., components/auth-wizard)
- Favor named exports for components
- Prefer interfaces over types (backend), types over interfaces (frontend)
- Add blank lines before return statements
- Import "motion-react" from "motion/react"
- Git commits: use proper scope (dashboard, web, api, worker, shared, etc.)
Dashboard-specific (.cursor/rules/dashboard.mdc):
- Do not attempt to build/run dashboard (user will be running it)
- Use lowercase with dashes for directories and files
- Favor named exports for components
Enterprise Architecture:
- Multi-tenant with organization/environment isolation
- Enterprise features conditionally loaded from
/enterprisefolder - RBAC (Role-Based Access Control) throughout
Provider System:
- Plugin-based architecture for notification channels
- Support for 50+ providers across email, SMS, push, chat
- Easy integration of custom providers
Workflow Engine:
- Visual workflow builder with step-based configuration
- Conditional logic, delays, and multi-channel orchestration
- Template engine with Handlebars and LiquidJS support
Key File Locations:
- API routes:
apps/api/src/app/ - Dashboard components:
apps/dashboard/src/components/ - Shared types:
packages/shared/src/ - Database models:
libs/dal/src/repositories/ - Provider implementations:
packages/providers/src/
- Use Jarvis CLI (
pnpm start) for guided development - it handles service orchestration - Check diagnostics in IDE before running builds - saves time
- Focus on specific apps - the monorepo structure allows independent development
- Enterprise features are in
/enterprisefolder andapps/*/src/ee/directories - Database changes require updates to both DAL models and any migrations
- Provider development follows a consistent interface pattern in
packages/providers/
- CQRS-style command/query separation in business logic
- Event-driven architecture with message queues
- Microservices-ready - each app can be deployed independently
- Plugin system for extensible provider integrations
- Feature flags for enterprise functionality
- Multi-environment support (dev, staging, prod per organization)
- Node.js 20 required (
engines.node: ">=20 <21") - pnpm 10+ required as package manager
- MongoDB & Redis required for local development (available via Docker Compose)
- Environment files are set up automatically by setup scripts
- Dashboard is primary UI - web app is legacy but still maintained
- No need to run npm typecheck commands, as we will see it ourself