Skip to content

Commit 503f112

Browse files
committed
feat: add .claude/settings.local.json to .gitignore and create CLAUDE.md
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
1 parent 1863be3 commit 503f112

2 files changed

Lines changed: 72 additions & 0 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ services/libs/tinybird/.diff_tmp
196196
# custom cursor rules
197197
.cursor/rules/*.local.mdc
198198

199+
# claude
200+
.claude/settings.local.json
201+
199202
# git integration test repositories & output
200203
services/apps/git_integration/src/test/repos/
201204
services/apps/git_integration/src/test/outputs/custom/

CLAUDE.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# CDP — Community Data Platform
2+
3+
CDP is a community data platform by the Linux Foundation. It ingests millions of
4+
activities and events daily from platforms like GitHub, GitLab, and many others
5+
(not just code hosting). Open-source projects get onboarded by connecting
6+
integrations, and data flows continuously at scale.
7+
8+
The ingested data is often messy. A big part of what CDP does is improve data quality: deduplicating member and organization profiles through merge and unmerge operations, enriching data via third-party providers, and resolving identities across sources. The cleaned data powers analytics and insights for LFX products.
9+
10+
The codebase started as crowd.dev, an open-source startup later acquired by the Linux Foundation. Speed was prioritized over standards, but the platform is now stable. The focus has shifted to maintainable patterns, scalability, and good developer experience. Performance matters at this scale, even small inefficiencies compound across millions of data points.
11+
12+
## Tech stack
13+
14+
TypeScript, Node.js, Express, PostgreSQL (pg-promise), Temporal, Kafka, Redis, OpenSearch, Zod, Bunyan, AWS S3.
15+
16+
Package manager is **pnpm**. Monorepo managed via pnpm workspaces.
17+
18+
## Codebase structure
19+
20+
```
21+
backend/ -> APIs (public endpoints for LFX products + internal for CDP UI)
22+
frontend/ -> CDP Platform UI
23+
services/apps/ -> Microservices — Temporal workers, Node.js workers, webhook APIs
24+
services/libs/ -> Shared libraries used across services
25+
```
26+
27+
`services/libs/common` holds shared utilities, error classes,
28+
and helpers. If a piece of logic is reusable (not business logic), it belongs there.
29+
30+
`services/libs/data-access-layer` holds all
31+
database query functions. Check here before writing new ones — duplicates are
32+
already a problem.
33+
34+
## Patterns in transition
35+
36+
Old and new patterns coexist. Always use the new pattern.
37+
38+
- **Sequelize -> pg-promise**: Sequelize is legacy (backend only). Use
39+
`queryExecutor` from `@crowd/data-access-layer` for all new database code.
40+
- **Classes -> functions**: Class-based services and repos are legacy. Write
41+
plain functions — composable, modular, easy to test.
42+
- **Multi-tenancy -> single tenant**: Multi-tenancy is being phased out. The
43+
tenant table still exists. Code uses `DEFAULT_TENANT_ID` from `@crowd/common`.
44+
Don't add new multi-tenant logic.
45+
- **Legacy auth -> Auth0**: Auth0 is the current auth system. Ignore old JWT
46+
patterns.
47+
- **Zod for validation**: Public API endpoints use Zod schemas with
48+
`validateOrThrow`. Follow this pattern for all new endpoints.
49+
50+
## Working with the database
51+
52+
Millions of rows. Every query matters.
53+
54+
- Look up the table schema and indexes before writing any query. Don't select
55+
or touch columns blindly.
56+
- Check existing functions in `data-access-layer` before writing new ones.
57+
Weigh the blast radius of modifying a shared function — sometimes a new
58+
function is safer.
59+
- Write queries with performance in mind. Think about what indexes exist, what
60+
the query plan looks like, and whether you're scanning more rows than needed.
61+
62+
## Code quality
63+
64+
- Functional and modular. Code should be easy to plug in, pull out, and test
65+
independently.
66+
- Think about performance at scale, even for small changes.
67+
- Define types properly — extend and reuse existing types. Don't sprinkle `any`.
68+
- Don't touch working code outside the scope of the current task.
69+
- Prefer doing less over introducing risk. Weigh trade-offs before acting.

0 commit comments

Comments
 (0)