See @README.md for project overview and @CONTRIBUTING.md for development setup.
Use bun to run any command.
Always run bun run check after making changes. This runs linting (Biome), type checking, and tests.
KeyWrit is signing-method agnostic. It uses public key infrastructure (PKI) for license validation but does not depend on any specific signing algorithm. The current implementation uses Ed25519 for key generation, but this is an implementation detail, not a library requirement. Do not document or describe KeyWrit as being tied to Ed25519 or any specific algorithm.
KeyWrit Hub is also token-format agnostic. The License interface uses generic field names (e.g., id, expiresAt, notBefore, issuedAt) rather than JWT-specific claim names (e.g., jti, exp, nbf, iat). The current implementation generates JWT tokens, but the License type should not expose JWT terminology. Keep the internal token generation separate from the License interface.
React web application for generating JWT license tokens.
- src/App.tsx - Main application with layout
- src/lib/ - Utility functions
types.ts- TypeScript interfaces (Realm, Client, License, KeyPair, Storage)crypto/keys.ts- Key pair generation using josestorage/storage.ts- localStorage operationsstorage/migrations.ts- Schema versioningjwt.ts- JWT generation using jose librarylicense.ts- License utilitiesutils.ts- Helper functions (cn for Tailwind class merging)
- src/context/ - React Context providers
RealmContext.tsx- Realm state managementThemeContext.tsx- Theme state management
- src/hooks/ - Custom React hooks
useRealms.ts- Hook for realm contextuseTheme.ts- Hook for theme context
- src/components/ - UI components
layout/- Header, Sidebar, ThemeTogglerealm/- RealmList, RealmCard, RealmForm, ExportDialog, ImportDialogclient/- ClientList, ClientCard, ClientForm, ClientSelector, ManageClientDialoglicense/- LicenseList, LicenseCard, LicenseForm, LicenseSectionui/- shadcn/ui components
Uses Vitest. Run with bun run test (watch mode) or bun run test:run (single run).
Test files are in tests/ directory.
Uses Vite for bundling and development server. Run with bun run build.
Outputs to dist/ and deploys to GitHub Pages at /KeyWrit-Hub/.
@maps to./src