Skip to main content

UI Architecture

Internal architecture reference for contributors to the Michelangelo UI codebase.

Technology Stack

TechnologyVersionPurpose
React18.3.1UI component library
TypeScript5.7.xType-safe JavaScript
BaseUI15.0.0Component library
Styletron6.1.xCSS-in-JS styling engine
TanStack React Query5.39.0Server state management
TanStack React Table8.21.xTable components
React Final Form6.5.9Form state management
Vite6.2.0Build tooling and dev server
Vitest3.xTesting framework
Connect RPC2.0.xgRPC-Web communication

Package Structure

The JavaScript codebase is organized as a Yarn workspace with the following packages:

javascript/
├── app/ # Main application package
│ └── package.json # @michelangelo/app
├── packages/
│ ├── core/ # Core UI components and utilities
│ │ └── package.json # @uber/michelangelo-core
│ └── rpc/ # RPC client and error handling
│ └── package.json # @michelangelo/rpc
└── package.json # Workspace root

Package Responsibilities

@michelangelo/app: The main application that runs in the browser. Contains:

  • Application entry point and routing
  • Feature-specific views and pages
  • Application-level configuration

@uber/michelangelo-core: Shared UI components and utilities. Contains:

  • React components (table, cell, form, views)
  • React hooks (routing, queries, mutations)
  • Provider components (service, error, interpolation)
  • Type definitions
  • Test utilities

@michelangelo/rpc: RPC client and error handling. Contains:

  • Connect RPC client configuration
  • Error normalization for Connect errors

Build and Bundling

Development

Start the development server:

cd javascript
yarn dev

This runs Vite in development mode with hot module replacement.

Production Build

Build all packages:

cd javascript
yarn build

Build order:

  1. Generate gRPC client code (yarn generate)
  2. Build @uber/michelangelo-core
  3. Build @michelangelo/rpc
  4. Build @michelangelo/app

Scripts

ScriptDescription
yarn devStart development server
yarn buildBuild all packages
yarn testRun all tests
yarn test:coreRun core package tests
yarn test:rpcRun RPC package tests
yarn lintRun ESLint
yarn typecheckRun TypeScript type checking
yarn formatCheck code formatting with Prettier

Import Aliases

The codebase uses TypeScript path aliases:

// In @uber/michelangelo-core
import { useStudioQuery } from '#core/hooks/use-studio-query';
import { Phase } from '#core/types/common/studio-types';

// In @michelangelo/rpc
import { normalizeConnectError } from '#rpc/normalize-connect-error';