What Programming Languages Does OpenHuman Use? Rust + TypeScript Architecture Explained
OpenHuman combines a high-performance Rust core with a modern TypeScript/React desktop UI to deliver secure, concurrent backend operations through a cross-platform user interface.
OpenHuman is a mixed-language project developed by tinyhumansai/openhuman that leverages systems-level programming for performance-critical tasks while utilizing web technologies for the frontend. Understanding what programming languages OpenHuman uses reveals a deliberate architecture where Rust handles the heavy lifting—networking, cryptography, and agent orchestration—while TypeScript powers the responsive desktop experience.
The Rust Core: Backend Infrastructure
The foundation of OpenHuman is written in Rust, providing memory safety and concurrency for critical operations. In the top-level Cargo.toml, the project defines the openhuman crate and its binaries, establishing the package structure for the core application.
The entry point in src/main.rs initializes the JSON-RPC server and core services:
// src/main.rs (excerpt)
fn main() -> anyhow::Result<()> {
// Initialise logging, config, and the JSON‑RPC server
openhuman::startup::run().await?;
Ok(())
}
This Rust layer manages business logic, agent orchestration, networking, cryptography, and storage mechanisms.
TypeScript and React: The Desktop UI
The desktop client runs inside a Tauri-wrapped Chromium engine, built with a pnpm workspace containing a Vite + React frontend. The UI source lives under app/src/ and is authored in TypeScript (*.ts) and JSX/TSX (*.tsx).
The app/src/App.tsx file serves as the root React component rendered in the desktop UI. Communication with the Rust core occurs through Tauri's invoke API. In app/src/lib/coreRpcClient.ts, the frontend calls backend methods:
// app/src/lib/coreRpcClient.ts (excerpt)
export async function listAgents(): Promise<Agent[]> {
// `invoke` forwards the request to the embedded Rust core
return await window.__TAURI__.invoke('core_rpc_relay', {
method: "openhuman.agent_list",
params: {}
});
}
The Tauri Bridge: Connecting Both Languages
The Tauri shell glues the Rust core to the frontend. Defined in app/src-tauri/Cargo.toml, this Rust-based layer exposes native capabilities to the TypeScript code while maintaining security boundaries between the web view and system resources.
When the TypeScript layer calls window.__TAURI__.invoke('core_rpc_relay', ...), the Tauri runtime forwards the request to the embedded Rust core. This architecture enables seamless communication between the UI and backend logic without sacrificing performance or safety.
Summary
- Rust powers the core business logic, RPC server, and agent management in
src/main.rsand the top-levelCargo.toml - TypeScript/React drives the desktop interface through
app/src/App.tsxand related frontend files underapp/src/ - Tauri (configured in
app/src-tauri/Cargo.toml) bridges both languages, allowing secure invocation of core methods from the UI - The architecture deliberately separates performance-critical backend operations from the responsive frontend using language-specific strengths
Frequently Asked Questions
Is OpenHuman written entirely in Rust?
No, OpenHuman is a mixed-language project according to the tinyhumansai/openhuman source code. While the core backend—including the RPC server, agents, and cryptographic functions—is written in Rust, the desktop user interface is built with TypeScript and React. The Tauri framework facilitates this combination by wrapping a Rust backend around a web-based frontend.
Why does OpenHuman use TypeScript for the desktop UI instead of native Rust UI libraries?
OpenHuman uses TypeScript and React to leverage the modern web ecosystem's rapid development capabilities and rich component libraries. Running inside a Tauri-wrapped Chromium engine allows the project to deliver a cross-platform desktop experience while keeping the performance-critical backend in Rust as defined in the architectural structure.
How does the Rust core communicate with the TypeScript frontend?
Communication occurs through Tauri's command system. The TypeScript code in app/src/lib/coreRpcClient.ts uses window.__TAURI__.invoke() to send requests to the Rust core. The Tauri shell defined in app/src-tauri/Cargo.toml routes these invocations to the appropriate Rust functions, such as core_rpc_relay, which then interact with the main openhuman crate.
What build tools does OpenHuman use for its TypeScript components?
OpenHuman uses a pnpm workspace to manage frontend dependencies, with Vite serving as the build tool and development server for the React-based desktop interface. This configuration is housed within the app/ directory alongside the Tauri-specific Rust code.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →