SeekingData is a desktop application built with Electron, React, and FastAPI.
┌─────────────────────────────────────────────────────────┐
│ Electron Desktop App │
│ ┌──────────────────┐ ┌────────────────────┐ │
│ │ Main Process │───────▶│ Python Backend │ │
│ │ (Node.js/TS) │ │ (FastAPI) │ │
│ └──────────────────┘ └────────────────────┘ │
│ │ │ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────────────┐ ┌────────────────────┐ │
│ │ Renderer Process │◀──────▶│ REST API │ │
│ │ (React + Vite) │ │ (/api/*) │ │
│ └──────────────────┘ └────────────────────┘ │
└─────────────────────────────────────────────────────────┘
- Framework: React 18
- Build Tool: Vite 5
- Language: TypeScript 5.4+
- Styling: TailwindCSS 3.4 + Material Design 3
- State Management: Zustand
- Routing: React Router DOM 7
- UI Components: Custom Material Design 3 components
- Framework: Electron 33
- Build: Electron Builder + vite-plugin-electron
- IPC: Context Bridge + Preload Scripts
- Language: Python 3.11+
- Framework: FastAPI 0.115+
- Package Manager: uv
- Agent Framework: Camel-AI 0.2.90+
- Task Framework: Harbor
The main process is responsible for:
- Creating and managing application windows
- Starting and managing the Python backend
- Handling system-level events
- Managing application lifecycle
Key Files:
index.ts: Main entry pointinit.ts: Python backend initializationutils/envUtil.ts: Environment utilities
The frontend is a single-page application built with React:
Structure:
components/: Reusable UI componentsui/: Material Design 3 components (Button, Card, Input)layout/: Layout components (Sidebar, Layout)sft/: SFT-related componentsharbor/: Harbor task components
lib/: Utilities and librariesapi.ts: API clientstores.ts: Zustand storestypes.ts: TypeScript types
pages/: Page components
The backend provides REST API endpoints:
Structure:
api/routes/: API endpointshealth.py: Health checksft.py: SFT data generation
models/: Pydantic modelsservices/: Business logicagents/: Camel AI agentsconfig.py: Configuration managementmain.py: FastAPI application entry point
User Input → React Component → API Client → FastAPI Route
↓
OpenAI API Call → Response Processing → Return to Frontend
↓
Display in UI → User Edit/Download
GitHub URL → React Component → API Client → FastAPI Route
↓
Camel GitHub Toolkit → Code Analysis → Task Generation
↓
Harbor Task Object → Export Files → Return to Frontend
↓
Display in UI → User Preview/Edit/Export
- Install uv: Package manager for Python
- Create Virtual Environment: Isolated Python environment
- Install Dependencies: Pre-install all Python packages
- Fix Paths: Replace absolute paths with placeholders
- Bundle Resources: Package into Electron app
npm run build:mac
↓
preinstall-deps.js (Install uv, venv, deps)
↓
fix-venv-paths.js (Replace paths with placeholders)
↓
fix-symlinks.js (Check symlinks)
↓
vite build (Build React app)
↓
electron-builder (Package Electron app)
↓
Generate DMG/ZIP (macOS) or EXE (Windows)
On first launch, the Electron main process:
- Detects the application installation path
- Finds
pyvenv.cfgwith placeholders - Replaces placeholders with actual paths
- Starts the Python backend with fixed environment
- Context Isolation: Enabled by default
- Node Integration: Disabled in renderer
- Preload Scripts: Minimal API exposure
- Content Security Policy: Strict CSP headers
- CORS: Configured for local development
- Input Validation: Pydantic models
- Error Handling: Sanitized error messages
- Code Splitting: Route-based splitting
- Lazy Loading: Component-level lazy loading
- Tree Shaking: Vite automatic optimization
- Caching: Zustand persist middleware
- Async I/O: All operations are async
- Connection Pooling: Database connections
- Caching: Response caching for API calls
- Pre-installed Dependencies: No runtime installation
- Optimized Bundle: Exclude dev files and caches
- Efficient IPC: Minimal main-renderer communication
- Create React component in
src/components/sft/ - Add route in
src/App.tsx - Create API endpoint in
backend/api/routes/ - Implement business logic in
backend/services/
- Create agent in
backend/agents/ - Create service in
backend/services/ - Add API endpoint in
backend/api/routes/ - Create frontend component in
src/components/harbor/
# Terminal 1: Start backend
cd backend
uv sync
uv run uvicorn main:app --reload --port 5001
# Terminal 2: Start frontend
npm install
npm run dev# Build for current platform
npm run build
# Build for specific platform
npm run build:mac
npm run build:win
npm run build:linux- Unit Tests: Jest + React Testing Library
- E2E Tests: Playwright
- Unit Tests: pytest
- API Tests: pytest + FastAPI TestClient
- Test Electron + Backend integration
- Test cross-platform compatibility