This project can be run as a desktop application using Electron. The entire Next.js app (UI + API routes) is bundled into a cross-platform desktop executable.
Architecture
Frontend: Next.js React app (App Router)
Backend: Next.js API routes running in Electron's main process
Packaging: electron-builder for cross-platform builds
Server: Embedded Next.js standalone server started on app launch
Development
Prerequisites
Bun installed
Node.js 20+ (bundled with Electron in production)
Running in Development Mode
# Start Next.js dev server + Electron window
bun run electron:dev
This command:
Starts Next.js dev server on port 3000
Waits for the server to be ready
Opens Electron window pointing to localhost:3000
Includes hot reload for frontend changes
Building for Production
# Build Next.js and package Electron app for your current platform
bun run electron:build
This will:
Build Next.js in standalone mode
Copy static files and public assets
Package the app using electron-builder
Output to dist/ directory
Platform-Specific Builds
# macOS (creates .dmg)
bunx electron-builder --mac
# Windows (creates .exe installer)
bunx electron-builder --win
# Linux (creates .AppImage and .deb)
bunx electron-builder --linux
GitHub Actions CI/CD
The project includes automated builds via GitHub Actions:
Triggers
Push to release branch
Push tags matching v* (e.g., v1.0.0)
Manual workflow dispatch
Build Matrix
Builds are created for:
macOS: DMG installer (Intel + Apple Silicon)
Windows: NSIS installer (.exe)
Linux: AppImage and deb packages
Releases
When you push a version tag (e.g., v1.0.0):
GitHub Actions builds for all platforms
Creates a draft release
Uploads installers as release assets
Generates release notes automatically
To create a release:
git tag v1.0.0
git push origin v1.0.0
Configuration
electron-builder
Configuration is in package.json under the build key: