| Dimension | Shared | Only in A | Only in B | Overlap |
|---|---|---|---|---|
| Sections | 0 | 1 | 1 | 0% |
| Commands | 0 | 0 | 0 | — |
| Section tags | 1 | 0 | 3 | 25% |
What each file covers
Sections
0 shared · 1 only in A · 1 only in B- − ClickHouse Conventions
- + Shared Packages Conventions
Commands
neither file has anySection tags
1 shared · 0 only in A · 3 only in B- + architecture
- + dependencies
- + docs
- code-style
Line diff
novuhq/novu · .cursor/rules/clickhouse.mdc
@@ −1 @@
1---
2description: Rules for working with ClickHouse analytics and trace logging
3globs:
4 - "**/analytic-logs/**"
5 - "**/clickhouse-migrations/**"
6alwaysApply: false
7---
8
9### ClickHouse Conventions
10
11**Service layer**
12- Use `ClickHouseService` for single queries/inserts and `ClickHouseBatchService` for high-throughput writes.
13- Both are registered as custom providers (`clickHouseService`, `clickHouseBatchService`) in each app's `shared.module.ts`.
14- Never instantiate ClickHouse clients directly — always inject the providers.
15
16**Repositories**
17- All ClickHouse repositories extend `LogRepository` in `libs/application-generic/src/services/analytic-logs/`.
18- Each repository has a corresponding schema file defining the table columns and types.
19- Always include `_environmentId` and `_organizationId` in queries for tenant isolation (same pattern as MongoDB DAL).
20
21**Migrations**
22- ClickHouse migrations are numbered `.sql` files in `apps/api/migrations/clickhouse-migrations/`.
23- Run locally with `cd apps/api && pnpm run clickhouse:migrate:local`.
24- New migrations must be additive — never alter or drop columns that existing queries depend on. Use temp tables and exchange patterns for schema refactors (see migration 4/5 for the established pattern).
25
26**Feature flags**
27- Gate new ClickHouse-dependent behavior behind a feature flag (see `packages/shared/src/types/feature-flags.ts` for existing flags like `IS_CLICKHOUSE_BATCHING_ENABLED`).
28
novuhq/novu · .cursor/rules/packages.mdc
@@ +1 @@
1---
2description: Rules for working in the shared NPM packages
3globs: packages/**/*
4alwaysApply: false
5---
6
7### Shared Packages Conventions
8
9**Public API / semver**
10- Packages are published to NPM — treat all exported symbols as public API.
11- Follow semver: breaking changes require a major bump, new exports are minor, fixes are patch.
12- Deprecate symbols with `@deprecated` JSDoc before removing them.
13
14**`packages/shared`**
15- Contains types, DTOs, enums, and utility functions used across both frontend and backend.
16- Keep this package free of runtime side-effects; it is imported by both Node.js services and browser bundles.
17
18**`packages/framework`**
19- Defines the code-first workflow SDK — the interface between user-defined workflows and Novu's engine.
20- Changes here affect the developer-facing API; write clear, minimal abstractions.
21
22**`packages/providers`**
23- Each provider implements a standard channel interface (e.g., `IEmailProvider`, `ISmsProvider`).
24- New providers must be registered in the provider index and follow the existing file structure.
25
@@ −1 +1 @@
11 ---
2−description: Rules for working with ClickHouse analytics and trace logging
3−globs:
4− - "**/analytic-logs/**"
5− - "**/clickhouse-migrations/**"
2+description: Rules for working in the shared NPM packages
3+globs: packages/**/*
64 alwaysApply: false
75 ---
86
9−### ClickHouse Conventions
7+### Shared Packages Conventions
108
11−**Service layer**
12−- Use `ClickHouseService` for single queries/inserts and `ClickHouseBatchService` for high-throughput writes.
13−- Both are registered as custom providers (`clickHouseService`, `clickHouseBatchService`) in each app's `shared.module.ts`.
14−- Never instantiate ClickHouse clients directly — always inject the providers.
9+**Public API / semver**
10+- Packages are published to NPM — treat all exported symbols as public API.
11+- Follow semver: breaking changes require a major bump, new exports are minor, fixes are patch.
12+- Deprecate symbols with `@deprecated` JSDoc before removing them.
1513
16−**Repositories**
17−- All ClickHouse repositories extend `LogRepository` in `libs/application-generic/src/services/analytic-logs/`.
18−- Each repository has a corresponding schema file defining the table columns and types.
19−- Always include `_environmentId` and `_organizationId` in queries for tenant isolation (same pattern as MongoDB DAL).
14+**`packages/shared`**
15+- Contains types, DTOs, enums, and utility functions used across both frontend and backend.
16+- Keep this package free of runtime side-effects; it is imported by both Node.js services and browser bundles.
2017
21−**Migrations**
22−- ClickHouse migrations are numbered `.sql` files in `apps/api/migrations/clickhouse-migrations/`.
23−- Run locally with `cd apps/api && pnpm run clickhouse:migrate:local`.
24−- New migrations must be additive — never alter or drop columns that existing queries depend on. Use temp tables and exchange patterns for schema refactors (see migration 4/5 for the established pattern).
18+**`packages/framework`**
19+- Defines the code-first workflow SDK — the interface between user-defined workflows and Novu's engine.
20+- Changes here affect the developer-facing API; write clear, minimal abstractions.
2521
26−**Feature flags**
27−- Gate new ClickHouse-dependent behavior behind a feature flag (see `packages/shared/src/types/feature-flags.ts` for existing flags like `IS_CLICKHOUSE_BATCHING_ENABLED`).
22+**`packages/providers`**
23+- Each provider implements a standard channel interface (e.g., `IEmailProvider`, `ISmsProvider`).
24+- New providers must be registered in the provider index and follow the existing file structure.
2825
