This guide covers the development setup, workflow, and conventions for contributing to the project.
- Node.js 18+
- pnpm 10+
- Aidbox instance running locally (default
http://localhost:8765)
git clone --recursive git@github.com:HealthSamurai/aidbox-ui.git
cd aidbox-ui
pnpm install # preinstall auto-builds the react-components submodule
pnpm hooks # install pre-commit hooks
pnpm dev # start dev serverIf you make changes to @health-samurai/react-components, run pnpm rc:build and restart the dev server for the changes to take effect (Vite caches pre-bundled deps in memory).
Configure VITE_AIDBOX_BASE_URL if your Aidbox runs on a different address.
-
Create a branch from
master:git checkout -b my-feature master
-
Make your changes. Useful commands while developing:
pnpm dev # start Vite dev server pnpm typecheck # type-check the project pnpm lint:fix # auto-fix linting and formatting pnpm all # format + typecheck + lint (one shot) pnpm rc:build # rebuild react-components submodule + clear Vite cache
-
Commit. The pre-commit hook runs
pnpm lint:checkandpnpm typecheck. Fix any issues before pushing. -
Open a pull request against
master.
The @health-samurai/react-components package lives in the aidbox-ts-sdk git submodule (linked via file: protocol in package.json). Source code is at aidbox-ts-sdk/packages/react-components/src/.
After making changes in the submodule:
pnpm rc:build # builds react-components + reinstalls + clears Vite cache
# then restart dev server (Ctrl+C, pnpm dev)Restart is required because Vite caches pre-bundled deps in memory.
Committing submodule changes:
- Commit and push inside
aidbox-ts-sdk/(target thedevelopmentbranch) - Then commit the updated submodule ref in
aidbox-ui
All formatting and linting is handled by Biome. There is no ESLint or Prettier.
- Indentation: tabs
- Quotes: double quotes
- Imports: auto-organized alphabetically by Biome
Run pnpm lint:fix to auto-format.
The pre-commit hook enforces formatting automatically.
src/
routes/ # TanStack Router file-based routes
components/ # Feature-scoped UI components
layout/ # App shell (navbar, sidebar)
api/ # API layer and schemas
hooks/ # Shared React hooks
shared/ # Constants, types, shared utilities
utils/ # Pure utility functions
fhir-types/ # Generated FHIR type definitions
scripts/ # Code generation scripts
aidbox-ts-sdk/ # Git submodule (react-components, aidbox-client, fhirpath-lsp)
- React 19 with React Compiler
- TanStack Router — file-based routing with auto code splitting
- TanStack Query — server state management
- Tailwind CSS v4 — styling via design tokens from react-components
- Vite — bundler and dev server
- Biome — linting and formatting
- TypeScript in strict mode
- Use
@health-samurai/react-componentsfor all UI. Do not install third-party UI libraries (shadcn/ui, MUI, Ant Design, etc.). - Use design tokens (
text-text-primary,bg-bg-secondary,border-border-primary) instead of raw Tailwind color values. - Icons: use
lucide-reactfor standard icons. Use icons from@health-samurai/react-componentsonly for domain-specific FHIR icons. - TypeScript strict mode is enforced.
Do not use
any— preferunknown, generics, or proper types. - Do not edit
src/fhir-types/— these types are generated viapnpm generate-types. - Path alias: use
@aidbox-ui/*to import fromsrc/*(configured intsconfig.app.json). - Keep PRs focused. One feature or fix per PR. Avoid unrelated refactors.
Open an issue at github.com/HealthSamurai/aidbox-ui/issues with:
- A clear description of the problem
- Steps to reproduce
- Expected vs actual behavior
- Browser and Aidbox version
For any questions or clarifications, open a discussion or issue on the repository.