From 50c347bbb9daf0958d82a19d340272f8d7c0d498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20=C3=85berg?= Date: Thu, 15 Jan 2026 14:02:13 +0100 Subject: [PATCH] Update CLAUDE.md --- .claude/CLAUDE.md | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index 53f096ea09e..cf8eeae63c0 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -22,35 +22,13 @@ All clients share core libraries in `/libs` for business logic, cryptography, an | **Organization** | Shared vault for team/enterprise password sharing | | **Collection** | Grouping mechanism for organizing Ciphers within Organizations | -# Tech stack +### Tech stack - Angular - RxJS - Tailwind (with `tw-` prefix) - The Bitwarden SDK (wasm rust crate) -### Typed IDs - -All IDs in the codebase use branded types for type safety. Most are located in `libs/common/src/types/guid.ts`. - -```typescript -export type CipherId = Opaque; -export type SendId = Opaque; -``` - -### Data Model - -Domains generally consists of multiple DTO layers: - -- ``: Encrypted representation of the object -- `View`: Decrypted representations -- `Data`: Serializeable representation for storage -- `Response`: Response from API -- `Export`: Export representation for exporting/importing -- `Request`: Requests to create/update the object - -Some examples of these are `Cipher`, `Folder`, `Send`. - ## Build and Development Commands **Install dependencies** (from repo root): @@ -153,6 +131,13 @@ The codebase uses a layered model pattern: Response (API) → Data (Storage) → Domain (Encrypted) → View (Decrypted) ``` +- ``: Encrypted representation of the object +- `View`: Decrypted representations +- `Data`: Serializeable representation for storage +- `Response`: Response from API +- `Export`: Export representation for exporting/importing +- `Request`: Requests to create/update the object + | Layer | Purpose | Example | | ------------ | ----------------------------- | -------------------------------------- | | **Response** | API response DTOs | `CipherResponse` | @@ -160,14 +145,16 @@ Response (API) → Data (Storage) → Domain (Encrypted) → View (Decrypted) | **Domain** | Encrypted business objects | `Cipher` (contains `EncString` fields) | | **View** | Decrypted for UI display | `CipherView` (contains plain strings) | -**Core Types** (from `libs/common/src/types/guid.ts`): +### Typed IDs + +All IDs in the codebase use branded types for type safety. Most are located in `libs/common/src/types/guid.ts`. ```typescript -// Branded types for type-safe IDs type UserId = Opaque; type CipherId = Opaque; type OrganizationId = Opaque; type CollectionId = Opaque; +... ``` ## Angular Patterns