dependabot[bot] c1a696e6f0 chore(deps-dev): bump js-yaml from 4.1.0 to 4.1.1 in /electron hace 1 mes
..
README.md 050e0221c7 README hace 3 meses
build.sh 723eefe9d8 electron hace 3 meses
create-tray-icon.js 0046282fb8 stash hace 3 meses
entitlements.mac.plist 0046282fb8 stash hace 3 meses
icon.png 7c7f9abd04 icon hace 3 meses
main.js 021892b17d feat: set data directory path in main process and update preload.js to use it hace 2 meses
package-lock.json c1a696e6f0 chore(deps-dev): bump js-yaml from 4.1.0 to 4.1.1 in /electron hace 1 mes
package.json 629a534798 chore(deps-dev): bump electron from 28.3.3 to 35.7.5 in /electron hace 2 meses
preload.js 021892b17d feat: set data directory path in main process and update preload.js to use it hace 2 meses
tray-icon-windows.png 15b21c075f windows tray icon hace 2 meses
tray-iconTemplate.png a57a36a739 tray hace 3 meses
[email protected] a57a36a739 tray hace 3 meses

README.md

New API Electron Desktop App

This directory contains the Electron wrapper for New API, providing a native desktop application with system tray support for Windows, macOS, and Linux.

Prerequisites

1. Go Binary (Required)

The Electron app requires the compiled Go binary to function. You have two options:

Option A: Use existing binary (without Go installed)

# If you have a pre-built binary (e.g., new-api-macos)
cp ../new-api-macos ../new-api

Option B: Build from source (requires Go) TODO

3. Electron Dependencies

cd electron
npm install

Development

Run the app in development mode:

npm start

This will:

  • Start the Go backend on port 3000
  • Open an Electron window with DevTools enabled
  • Create a system tray icon (menu bar on macOS)
  • Store database in ../data/new-api.db

Building for Production

Quick Build

# Ensure Go binary exists in parent directory
ls ../new-api  # Should exist

# Build for current platform
npm run build

# Platform-specific builds
npm run build:mac    # Creates .dmg and .zip
npm run build:win    # Creates .exe installer
npm run build:linux  # Creates .AppImage and .deb

Build Output

  • Built applications are in electron/dist/
  • macOS: .dmg (installer) and .zip (portable)
  • Windows: .exe (installer) and portable exe
  • Linux: .AppImage and .deb

Configuration

Port

Default port is 3000. To change, edit main.js:

const PORT = 3000; // Change to desired port

Database Location

  • Development: ../data/new-api.db (project directory)
  • Production:
    • macOS: ~/Library/Application Support/New API/data/
    • Windows: %APPDATA%/New API/data/
    • Linux: ~/.config/New API/data/