How lhx-space/infra-docs works
infra-docs is a collaborative wiki and document platform. The main workflow is a user browsing teams, wikis, and documents in a client, then using the shared application and API for workspace operations; web and desktop clients also connect to the collaboration service for live Yjs editing. The API handles persistent product operations and coordinates background media/export jobs, while AI and error-monitoring capabilities form distinct branches. The graph preserves README-documented client and service links; several unsampled feature internals are represented only at their documented subsystem boundary.
Main entry points: App.tsx Shared app · client.ts REST client · main.rs AI service · main.tsx Web client
Components 21
User clients
- Web client
apps/web/src/main.tsx - Desktop client
apps/desktop/src/renderer/src/main.tsx - Mobile browser
apps/mobile/src/app/(tabs)/index.tsx
Shared application
- Shared app
packages/app/src/App.tsx - Team and wiki UI
packages/app/src/pages/team/TeamList.tsx - Document editor
packages/app/src/pages/wiki/DocumentEditorPage.tsx - Tiptap editor
packages/tiptap-editor/src/components/DocumentEditor.tsx - Client state
packages/core/src/store/document.ts - REST client
packages/api-client/src/network/client.ts
Product backend
- REST API
apps/api/src/app.ts - Wiki and document services
apps/api/src/services/document.ts - PostgreSQL
- Media storage
apps/api/src/services/storage.ts - Export and video jobs
apps/api/src/worker.ts
Realtime and AI
- Yjs collaboration
apps/collab-server/src/handler/ws.rs - Internal gRPC
apps/api/src/grpc/server.ts - AI service
apps/ai-server/src/main.rs - Chat and audio
apps/ai-server/src/handler/chat.rs - Document indexing
apps/ai-server/src/service/indexer.rs
Monitoring
- Error monitoring
packages/error-monitor/src/core/dispatch.ts
Other components
- User
Connections 27
- User → Web client: uses
README.md - User → Desktop client: uses
README.md - User → Mobile browser: uses
README.md - Web client → Shared app: loads
apps/web/src/main.tsx - Desktop client → Shared app: loads
apps/desktop/src/renderer/src/main.tsx - Shared app → Error monitoring: uses
packages/app/src/App.tsx - Shared app → Team and wiki UI: routes to
- Shared app → Document editor: routes to
- Document editor → Tiptap editor: embeds
- Document editor → Client state: uses
- Client state → REST client: calls
- Web client → REST client: REST
README.md - Desktop client → REST client: REST
README.md - Mobile browser → REST client: REST
README.md - REST client → REST API: requests
README.md - REST API → Wiki and document services: routes requests
- Wiki and document services → PostgreSQL: reads and writes
- REST API → Media storage: uploads media
- REST API → Export and video jobs: queues jobs
- Web client → Yjs collaboration: Yjs WebSocket
README.md - Desktop client → Yjs collaboration: Yjs WebSocket
README.md - Yjs collaboration → Internal gRPC: gRPC
README.md - Internal gRPC → PostgreSQL: syncs content
- AI service → Chat and audio: serves
apps/ai-server/src/main.rs - AI service → Document indexing: spawns
apps/ai-server/src/main.rs - AI service → Internal gRPC: connects
apps/ai-server/src/main.rs - AI service → PostgreSQL: indexes documents