dependabot[bot] 0015763021 chore(deps-dev): bump minimatch from 3.1.2 to 3.1.5 in /electron 1 mēnesi atpakaļ
..
README.md 2af0bf9d91 README 6 mēneši atpakaļ
build.sh be02a73df2 electron 6 mēneši atpakaļ
create-tray-icon.js 834ab29a46 stash 6 mēneši atpakaļ
entitlements.mac.plist 834ab29a46 stash 6 mēneši atpakaļ
icon.png fe6dbbcffe icon 6 mēneši atpakaļ
main.js d76ee92f7d feat: set data directory path in main process and update preload.js to use it 6 mēneši atpakaļ
package-lock.json 0015763021 chore(deps-dev): bump minimatch from 3.1.2 to 3.1.5 in /electron 1 mēnesi atpakaļ
package.json be0cb08da1 chore(deps): bump tar and electron-builder in /electron 1 mēnesi atpakaļ
preload.js d76ee92f7d feat: set data directory path in main process and update preload.js to use it 6 mēneši atpakaļ
tray-icon-windows.png f50ca4fd21 windows tray icon 6 mēneši atpakaļ
tray-iconTemplate.png 11f50478a7 tray 6 mēneši atpakaļ
[email protected] 11f50478a7 tray 6 mēneši atpakaļ

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/