Visitar URL original
Rocket.Chat/CLAUDE.md at develop · RocketChat/Rocket.Chat · GitHub
Skip to content

Latest commit

 

History

History
80 lines (61 loc) · 6.89 KB

CLAUDE.md

File metadata and controls

80 lines (61 loc) · 6.89 KB

Rocket.Chat

Monorepo: the main Meteor app lives in apps/meteor/, shared libraries in packages/, other services in apps/ and ee/.

Writing code here

Comments state the intent of a function, never the mechanism, and never explain code that lives in another file — that belongs in docs/features/. Full rules: docs/code-comments.md.

Every database operation goes through a named model method in packages/models; code outside a model never passes a filter or update document to find, findOne, updateOne and the like. Models hold no business logic: they don't call other models or validate their arguments. Full rules: docs/database-access.md.

Each pull request carries one classification and one concern, and can be reverted alone. Fixes and enabling refactors are their own commits, ordered below the feature so they can be extracted, even in a POC. Full rules: docs/change-organization.md.

Documentation index

Read the doc that matches the task instead of scanning docs/ wholesale.

Cross-cutting

  • docs/code-comments.md — what a comment may say, and where reasoning goes when it is not a comment
  • docs/change-organization.md — one concern per pull request, fixes → refactors → feature as a stack (POCs included), rebasing stacks after squash merges
  • docs/i18n.md — translation keys: where they live, naming, namespaces, interpolation, plurals, server-side lng, what the i18n linter enforces

Frontend

  • docs/frontend/ — frontend guidelines, split by topic:
    • typescript-conventions.md — ES modules, import type, type vs interface, any vs unknown
    • migrating-from-javascript.md — gradual JS → TS migration
    • react.md — component structure, naming, exports, explicit and generic props types
    • layout.md — screens compose named layout containers, never raw Box or styling props on Fuselage components; where a new container lives and when it gets promoted
    • building-components.md — application vs Fuselage components, the props a component accepts, layout containers, adding a variation, Storybook-first
    • list-keyboard-navigation.md — the three keyboard models for lists (combobox, menu, composite list), the implementation of each, and how to test them
    • dom-hooks.md — hooks that attach listeners or observers return a callback ref instead of taking a RefObject
    • i18n.md — client side only: useTranslation, Trans, runtime keys, escaping (shared rules in docs/i18n.md)
    • adding-icons.md — adding an icon to @rocket.chat/icons: SVG cleanup, shape-based naming, directional icons, glyph mapping, changeset
  • docs/form-validation.md — standardized form validation patterns
  • docs/anchor-navigation.md — deep-linking to a field via URL hash fragments
  • docs/bundle-optimization-react-aria.md — barrel-import patches; Meteor's bundler does not tree-shake

Backend

  • docs/backend-folder-structure.md — how apps/meteor/ server code is organized and where new code goes
  • docs/features/http-server.md — the server's own HTTP server: base middlewares, routes on the root app, the Meteor fallback, where to add a route
  • docs/features/ddp-sessions.md — DDP over the WebSocket with @rocket.chat/ddp-server: endpoints, what runs through Meteor, login, who follows a session
  • docs/database-access.md — every query and write is a named model method; what callers may still pass, how to add a method, why models never call other models or validate input
  • docs/api-endpoint-migration.md — migrating API.v1.addRoute() to the validated API.v1.get()/.post()/… pattern
  • docs/ajv-instances.md — when to use ajv vs ajvQuery in @rocket.chat/rest-typings
  • docs/apps-engine-migration.md — phased extraction of apps execution into a microservice
  • docs/service-brokers.md — how services reach each other: the local and Moleculer brokers, how events and stream relays reach other instances in each deployment, and the calls that only work because both ends share a process

Build and tooling

Testing

Other

  • docs/adr/ — architecture decision records
  • ee/packages/xmpp-server/docs/ — the XMPP server is developed spec-first; its specs, ADRs, plans and compliance matrix live in the package, not here; /xmpp-intent, /xmpp-spec and /xmpp-plan drive its authoring stages from any directory
  • docs/features/ — per-feature notes
    • uikit/ — UiKit blocks, surfaces, rendering, interactions; field reference and per-surface support matrix
    • web-client-hosting.md — how the server serves the Vite-built client (manifest, entry injection, CDN, cache) and how to serve the client from another host
  • docs/proposals/ — design proposals, not yet implemented