mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-27 21:08:00 +00:00
3.6 KiB
3.6 KiB
description, icon
| description | icon |
|---|---|
| Index for the React + Vite frontend (app/src/) — architecture, state, services, components, hooks. | browsers |
Source code documentation (app/src/)
This section describes the OpenHuman desktop app frontend: the Vite + React tree under app/src/ in the monorepo (Yarn workspace openhuman-app).
Quick reference
| Document | Description |
|---|---|
| Architecture overview | Entry points, provider chain, module relationships |
| State management | Redux Toolkit, persistence, selectors |
| Services layer | API client, Socket.io, core RPC client |
| MCP utilities | Transport and types (no bundled Telegram tool pack) |
| Pages & routing | HashRouter, guards, main routes |
| Components | UI and settings patterns |
| Providers | User, Socket, AI, Skill providers |
| Hooks & utils | Shared hooks and helpers |
Scale (approximate)
| Metric | Value |
|---|---|
TypeScript / TSX files under app/src/ |
~285 (run find app/src -name '*.ts' -o -name '*.tsx' | wc -l to refresh) |
| Test runner | Vitest (app/test/vitest.config.ts) |
Directory layout (high level)
app/src/
├── App.tsx # Provider chain + HashRouter shell
├── AppRoutes.tsx # Route table + guards
├── main.tsx # Entry (Sentry, store, styles)
├── store/ # Redux slices and selectors
├── providers/ # UserProvider, SocketProvider, AIProvider, SkillProvider
├── services/ # apiClient, socketService, coreRpcClient, api/*
├── lib/ # AI loaders, MCP helpers, skills sync, etc.
├── pages/ # Route-level screens
├── components/ # Shared UI
├── hooks/ # App hooks
├── utils/ # Config, Tauri helpers, routing utilities
└── assets/ # Icons and static assets
Architectural decisions
- HashRouter — Fits Tauri and deep-link flows better than browser history in many desktop setups.
- Redux Toolkit + persist — Centralized state; selective persistence for auth and related slices.
- Core RPC client — Business logic and skills run in the
openhumanRust sidecar; the UI calls it via HTTP (core_rpc_relay/coreRpcClient), not only REST. - No MTProto provider — The current tree does not ship a
TelegramProviderormtprotoService; any Telegram mentions may be legacy UI or future channels work.
Getting started
- Read Architecture overview.
- Skim State management and Services.
- Use Pages & routing when changing navigation.
Documentation for the app/src/ tree; paths are relative to the repository root.