Files
sarthi_lab/README.md

133 lines
3.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Sarthi Lab Desktop
AI learning desktop application for school computer labs.
## Quick Start
### 1. Clone & Install
```bash
git clone https://github.com/Eduspheria/sarthi_lab.git
cd sarthi_lab
npm install
```
### 2. Run Locally
```bash
npm run dev
```
Electron app will open at `http://localhost:5174`. Exercises load correctly in dev mode.
---
## Global Command Setup (Run from Anywhere)
Set up a global `sarthi-lab` command that works from any terminal directory.
### macOS / Linux
#### Symlink Setup
```bash
# Make script executable
chmod +x launch.sh
# Create global symlink (requires sudo)
sudo ln -s "$(pwd)/launch.sh" /usr/local/bin/sarthi-lab
```
If `/usr/local/bin` isn't in PATH, add it:
```bash
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bashrc # or ~/.zshrc
source ~/.bashrc
```
### Windows
#### Add to PATH
1. **Copy** `launch.bat` to a directory already in PATH:
- `C:\Windows\System32`
- `C:\Program Files\Git\usr\bin` (if Git installed)
2. **OR add repo to PATH:**
- Open **System Properties****Environment Variables**
- Edit **User variables****PATH**
- Add `C:\path\to\sarthi_lab`
- Restart terminal
---
## Usage
### Basic Launch
```bash
sarthi-lab
```
Starts the Electron dev app (`npm run dev`).
### Upgrade Command
```bash
sarthi-lab upgrade
```
Pulls latest git changes and updates npm dependencies.
### Command Reference
- `sarthi-lab` Start Sarthi Lab (default)
- `sarthi-lab upgrade` Pull latest changes and update dependencies
- `sarthi-lab --help` or `-h` Show help
- `sarthi-lab --version` or `-v` Show version
---
## Troubleshooting
| Issue | Solution |
|-------|----------|
| `sudo: command not found` (mac/Linux) | Use `~/bin`: `ln -s "$(pwd)/launch.sh" ~/bin/sarthi-lab` |
| Permission denied (symlink) | Ensure `/usr/local/bin` exists and is writable |
| Windows PATH not working | Use full path: `C:\path\to\sarthi_lab\launch.bat` |
| `npm run dev` fails | Check Node.js ≥18, run `npm install` |
| Exercises not loading | Ensure you're using dev mode (`npm run dev`); packaged DMG may have issues |
---
## Development
### Scripts
- `npm run dev` Start dev server + Electron
- `npm run build` Build for production
- `npm run build:mac` Build macOS DMG
- `npm run build:win` Build Windows installer
- `npm run build:linux` Build Linux AppImage
### Project Structure
```
sarthi_lab/
├── src/ # React frontend
├── electron/ # Electron main process
├── dist/ # Production build
└── dist-electron/ # Packaged apps
```
---
## Backend Connection
Sarthi Lab connects to a Django backend (cloud or local):
- Default: `https://sarthi.eduspheria.com`
- Change via Settings screen in app
---
## Notes
- **Packaged App Limitation**: Packaged DMG (`file://` origin) may have loading issues. Use `npm run dev` (this launcher) for school deployments.
- **Offline Features**: Desktop TTS/STT via Piper/whisper binaries (macOS only in current build).
- **Updates**: Use `sarthi-lab upgrade` to pull latest code.
---
**Eduspheria** · [eduspheria.com](https://eduspheria.com) · Contact: eduspheria@gmail.com