mirror of
https://github.com/bitwarden/browser
synced 2026-02-16 00:24:52 +00:00
2.9 KiB
2.9 KiB
Project Structure
Root Organization
This is an Nx monorepo with a clear separation between applications and shared libraries.
├── apps/ # Client applications
├── libs/ # Shared libraries and components
├── bitwarden_license/ # Enterprise/licensed features
├── scripts/ # Build and utility scripts
└── coverage/ # Test coverage reports
Applications (apps/ & bitwarden_license/)
browser/: Browser extension (Chrome, Firefox, Edge, Opera, Safari)web/: Web vault applicationbit-web/: Bitwarden licensed portions of the web vaultdesktop/: Electron-based desktop applicationcli/: Command-line interface tool
Each app has its own:
src/- Source codepackage.json- App-specific dependenciestsconfig.json- TypeScript configurationjest.config.js- Test configurationwebpack.config.js- Build configuration (where applicable)
Shared Libraries (libs/)
Core Libraries
common/: Core business logic and modelsplatform/: Platform abstractions and servicescomponents/: Reusable UI componentsangular/: Angular-specific utilities and services
Domain Libraries
auth/: Authentication and identity managementvault/: Password vault functionalityadmin-console/: Organization and admin featuresbilling/: Payment and subscription managementkey-management/: Cryptographic key handlingtools/: Generator, import/export, and other tools
Infrastructure Libraries
node/: Node.js specific implementationsimporter/: Data import functionalityeslint/: Custom ESLint rules and configurations
Licensed Features (bitwarden_license/)
Enterprise and business features with separate licensing:
bit-common/: Licensed common functionalitybit-web/: Licensed web featuresbit-cli/: Licensed CLI features
Import Restrictions
The project enforces strict import boundaries:
- Apps cannot import from other apps
libs/common/is the base layer - minimal external dependencies- Domain libraries have controlled dependencies on each other
- Licensed code is isolated from open-source code
Path Aliases
TypeScript path mapping is configured in tsconfig.base.json:
@bitwarden/common/*→libs/common/src/*@bitwarden/auth/common→libs/auth/src/common@bitwarden/components→libs/components/src- And many more for clean imports across the monorepo
Configuration Files
nx.json: Nx workspace configurationangular.json: Angular CLI project definitionstsconfig.base.json: Base TypeScript configurationjest.config.js: Root Jest configuration with project referenceseslint.config.mjs: ESLint configuration with import restrictions