Project Structure
Vault is a monorepo managed with pnpm workspaces and Turborepo.
Directory Layout
vault/
├── packages/
│ ├── api/ # Cloudflare Workers API
│ ├── web/ # React frontend
│ ├── cli/ # Node.js CLI
│ ├── mobile/ # React Native app
│ ├── shared/ # Shared utilities
│ ├── cdn/ # Static assets
│ └── docs/ # Documentation
├── .cursor/ # IDE rules
├── turbo.json # Turborepo config
├── pnpm-workspace.yaml # Workspace definition
└── package.json # Root scriptsPackages
@pwm/api
Cloudflare Workers API server using Hono.
packages/api/
├── src/
│ ├── server.ts # Main app, route composition
│ ├── index.ts # Client export
│ ├── middleware/ # Auth middleware
│ ├── routes/ # Route modules
│ │ ├── auth.ts
│ │ ├── vault.ts
│ │ └── sharing.ts
│ ├── helpers/ # KV helpers
│ └── types/ # Type definitions
├── wrangler.toml # Cloudflare config
└── package.jsonserver.ts— Route composition and middlewareroutes/auth.ts— WebAuthn authenticationroutes/vault.ts— Vault CRUD operations
@pwm/web
React 18 frontend with Vite and PWA support.
packages/web/
├── src/
│ ├── components/
│ │ ├── ui/ # Reusable UI components
│ │ ├── auth/ # Auth components
│ │ ├── vault/ # Vault components
│ │ └── settings/ # Settings components
│ ├── hooks/ # Custom hooks
│ ├── lib/
│ │ ├── api.ts # API client
│ │ ├── utils.ts # Utilities
│ │ └── offline/ # PWA offline support
│ ├── stores/ # Zustand stores
│ ├── App.tsx # Root component
│ ├── main.tsx # Entry point
│ └── index.css # Global styles
├── public/ # Static assets
├── e2e/ # Playwright tests
├── vite.config.ts
└── wrangler.tomlApp.tsx— Routing and auth flowstores/— Zustand state managementlib/offline/— IndexedDB and sync
@pwm/cli
Node.js CLI using Commander.js.
packages/cli/
├── src/
│ ├── index.ts # Entry point
│ ├── commands/
│ │ ├── auth.ts # Login/logout
│ │ ├── vault.ts # Vault operations
│ │ ├── entry.ts # Entry CRUD
│ │ └── generate.ts # Password generator
│ ├── config.ts # Configuration
│ ├── api.ts # API client
│ ├── biometric.ts # Touch ID
│ └── demo.ts # Demo mode
├── bin/
│ └── pwm.ts # CLI executable
└── package.jsonbiometric.ts— macOS Touch ID integrationconfig.ts— File-based config (~/.pwm/)commands/— Command implementations
@pwm/mobile
React Native app with Expo.
packages/mobile/
├── app/ # Expo Router screens
│ ├── (tabs)/ # Tab navigation
│ │ ├── index.tsx # Vault list
│ │ ├── generator.tsx
│ │ └── settings.tsx
│ ├── entry/
│ │ ├── [id].tsx # View entry
│ │ ├── new.tsx # Create entry
│ │ └── edit/[id].tsx # Edit entry
│ └── _layout.tsx # Root layout
├── components/ # UI components
├── hooks/ # Custom hooks
├── stores/ # Zustand stores
├── metro.config.js # Metro bundler
└── app.json # Expo configmetro.config.js— Monorepo configurationstores/— Auth and vault state
@pwm/shared
Shared utilities used by all packages.
packages/shared/
├── src/
│ ├── crypto/
│ │ ├── encryption.ts # AES-GCM
│ │ ├── keys.ts # Key derivation
│ │ └── sharing.ts # ECDH
│ ├── generator/
│ │ ├── password.ts # Password generation
│ │ └── passphrase.ts # Passphrase generation
│ ├── schemas/ # Zod schemas
│ ├── types/ # TypeScript types
│ └── index.ts # Exports
└── package.jsongeneratePassword(),generatePassphrase()encrypt(),decrypt()Entry,Vaulttypes
@pwm/cdn
Static asset hosting.
packages/cdn/
├── public/
│ ├── screenshots/ # UI screenshots
│ ├── cli-demo.gif # CLI demo
│ └── cli-demo-quick.gif
├── wrangler.toml
└── package.json@pwm/docs
Documentation site (this site).
packages/docs/
├── docs/
│ ├── pages/ # MDX pages
│ └── public/ # Static assets
├── vocs.config.ts # Vocs config
├── wrangler.toml # Cloudflare config
└── package.jsonConfiguration Files
Root
| File | Purpose |
|---|---|
turbo.json | Turborepo task configuration |
pnpm-workspace.yaml | Workspace package paths |
package.json | Root scripts, pnpm overrides |
.npmrc | pnpm settings (hoisting) |
Package-Level
| File | Purpose |
|---|---|
wrangler.toml | Cloudflare Workers/Pages config |
vite.config.ts | Vite build configuration |
tsconfig.json | TypeScript configuration |
Dependencies
Inter-Package
@pwm/api ──▶ @pwm/shared
@pwm/web ──▶ @pwm/shared, @pwm/api (types)
@pwm/cli ──▶ @pwm/shared, @pwm/api (types)
@pwm/mobile ──▶ @pwm/shared, @pwm/api (types)React Versions
| Package | React |
|---|---|
@pwm/web | 18.3.1 |
@pwm/mobile | 19.1.0 |
@pwm/docs | 19.1.0 |
Root package.json uses pnpm overrides to force consistent @types/react.
Scripts
Root Level
pnpm dev # Start all dev servers
pnpm dev:mock # Start web with mock auth
pnpm build # Build all packages
pnpm typecheck # TypeScript check
pnpm lint # ESLint
pnpm test # Run unit testsPackage Filters
pnpm --filter @pwm/web dev
pnpm --filter @pwm/api test
pnpm --filter @pwm/cli buildRelated
- Contributing - Development workflow
- Testing - Testing guide
- Deployment - CI/CD