# Help Scout Docs Exporter - Desktop App

A standalone desktop application to export Help Scout documentation articles locally without needing any web hosting.

## Features

- **100% Local** - Runs entirely on your computer, no hosting required
- **Direct API Access** - Connects directly to Help Scout's API
- **Multiple Export Formats**:
  - JSON (complete raw data)
  - CSV with HTML content
  - CSV with Markdown content
- **Cross-Platform** - Works on Windows, macOS, and Linux

## Installation

### Prerequisites

You need Node.js installed on your computer. Download it from [nodejs.org](https://nodejs.org/)

### Setup Steps

1. **Create a new folder** for the app (e.g., `helpscout-exporter`)

2. **Add all the files** to this folder:
   - `package.json`
   - `main.js`
   - `preload.js`
   - `index.html`
   - `renderer.js`

3. **Open Terminal/Command Prompt** in the folder and run:
   ```bash
   npm install
   ```

4. **Run the app**:
   ```bash
   npm start
   ```

## Building Standalone Executables

To create a standalone app you can distribute:

### For macOS:
```bash
npm run package-mac
```

### For Windows:
```bash
npm run package-win
```

### For Linux:
```bash
npm run package-linux
```

The built app will be in the `dist` folder.

## Usage

1. Launch the application
2. Enter your Help Scout credentials:
   - Site ID
   - API Key (username)
   - API Password
3. Click "Fetch Articles" (may take a few minutes)
4. Once complete, choose your export format:
   - **JSON** - Full data structure
   - **CSV (HTML)** - Spreadsheet with HTML content
   - **CSV (Markdown)** - Spreadsheet with Markdown content
5. Choose where to save the file

## How It Works

The app runs locally on your machine and:
1. Makes direct HTTPS calls to Help Scout's API using Basic Authentication
2. Fetches all collections, then all articles in each collection
3. Retrieves full article content including the HTML body
4. Processes and exports the data in your chosen format
5. Saves files directly to your computer

**No data is sent to any third-party servers** - everything happens on your local machine.

## Security

- Credentials are only stored in memory during the fetch operation
- No credentials are saved to disk
- All API communication is over HTTPS
- The app runs completely offline after fetching data

## Troubleshooting

**"App can't be opened" on macOS:**
- Right-click the app and select "Open"
- Or go to System Preferences > Security & Privacy and allow it

**"Windows protected your PC" on Windows:**
- Click "More info" then "Run anyway"

**Connection errors:**
- Verify your Site ID, API Key, and Password are correct
- Check your internet connection
- Ensure Help Scout's API is accessible from your network

## File Structure

```
helpscout-exporter/
├── package.json          # App configuration
├── main.js              # Electron main process (API calls)
├── preload.js           # Security bridge
├── index.html           # User interface
├── renderer.js          # UI logic and export functions
└── icon.png             # App icon (optional)
```

## License

MIT