The Semantic Workbench app is designed as a client-side, single-page application (SPA) using React and TypeScript. It runs entirely in the user's browser and interacts with the backend Semantic Workbench service for state and conversation management.
React/TypeScript: The app is built using the React library and TypeScript for static typing.
Vite: Build system and development server that provides fast HMR (Hot Module Replacement).
Fluent UI & Fluent Copilot: Microsoft design system components that provide a consistent look and feel.
Redux & Redux Toolkit: Centralized state management with middleware for side effects.
React Router: Handles navigation and URL management within the SPA.
Client-Server Interaction: The app communicates with the Workbench backend service via RESTful APIs and SSE (Server-Sent Events) for real-time updates.
Content Rendering: Support for rich content types including Markdown, code syntax highlighting, Mermaid diagrams, ABC notation for music, and more.
The application requires user authentication, typically via Microsoft AAD or MSA accounts. The app uses Microsoft Authentication Library (MSAL) for authentication flows. Instructions for setting up the development environment are in the repo readme. To deploy in your own environment see app registration documentation.
The Semantic Workbench app connects to the backend service using RESTful API calls. Here's how the interaction works:
- Initial Setup: On application startup, the app establishes a connection to the backend service located at a specified endpoint. This connection requires SSL certificates, which are automatically generated by vite-plugin-mkcert during development.
- User Authentication: Users must authenticate via Microsoft AAD or MSA accounts. This enables secure access and interaction between the app and the backend.
- Data Fetching & State Management: The app uses Redux Toolkit Query to manage API requests and caching of conversation data, messages, and participant information.
- Event Handling: User actions within the app (e.g., sending a message) trigger RESTful API calls to the backend, which processes the actions and returns the appropriate responses.
- Real-time Updates: The app uses Server-Sent Events (SSE) to receive real-time updates from the backend service, enabling live updates of conversation state.
The app includes error handling mechanisms that notify users of any issues with the backend connection, such as authentication failures or network issues.
The Semantic Workbench app is a React/TypeScript app integrated with the Semantic Workbench backend service.
- Node.js: Version 20.x is required (enforced by the run script)
- pnpm: Used for package management
- SSL certificates: Automatically generated during development for HTTPS
Follow the setup guide to install all required development tools.
In the workbench-app directory:
make
This command runs pnpm install
to install all required dependencies.
To run and/or debug in VS Code:
- Open the workspace file
semantic-workbench.code-workspace
- View -> Run
- Select "app: semantic-workbench-app"
In the workbench-app directory:
pnpm dev
or
pnpm start
Then open https://127.0.0.1:4000 in your browser.
Note: The first time you run the app, your browser may warn about the self-signed SSL certificate.
pnpm dev
/pnpm start
- Start development serverpnpm build
- Build for productionpnpm preview
- Locally preview production buildpnpm lint
- Run ESLint to check code qualitypnpm format
/pnpm prettify
- Format code with Prettierpnpm type-check
- Run TypeScript type checkingpnpm find-deadcode
- Identify unused codepnpm depcheck
- Check for dependency issues
- App Development Guide - Guide for developing the app
- Message Metadata - Details about message metadata structure
- Message Types - Different types of messages supported
- State Inspectors - Information about state inspection tools
- Workbench App Overview - Complete overview of the application
- Custom App Registration - Setting up authentication
Key directories in the project:
workbench-app/
├── src/
│ ├── components/ # Reusable UI components
│ ├── models/ # TypeScript interfaces and types
│ ├── redux/ # State management
│ ├── routes/ # Application routes
│ ├── services/ # API services
│ └── libs/ # Utility functions and hooks
├── public/ # Static assets
├── docs/ # Documentation
└── certs/ # SSL certificates for development