Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

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 scripts

Packages

@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.json
Key files:
  • server.ts — Route composition and middleware
  • routes/auth.ts — WebAuthn authentication
  • routes/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.toml
Key files:
  • App.tsx — Routing and auth flow
  • stores/ — Zustand state management
  • lib/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.json
Key files:
  • biometric.ts — macOS Touch ID integration
  • config.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 config
Key files:
  • metro.config.js — Monorepo configuration
  • stores/ — 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.json
Key exports:
  • generatePassword(), generatePassphrase()
  • encrypt(), decrypt()
  • Entry, Vault types

@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.json

Configuration Files

Root

FilePurpose
turbo.jsonTurborepo task configuration
pnpm-workspace.yamlWorkspace package paths
package.jsonRoot scripts, pnpm overrides
.npmrcpnpm settings (hoisting)

Package-Level

FilePurpose
wrangler.tomlCloudflare Workers/Pages config
vite.config.tsVite build configuration
tsconfig.jsonTypeScript 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

PackageReact
@pwm/web18.3.1
@pwm/mobile19.1.0
@pwm/docs19.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 tests

Package Filters

pnpm --filter @pwm/web dev
pnpm --filter @pwm/api test
pnpm --filter @pwm/cli build

Related