Skip to content

saulotarsobc/electronjs-with-nextjs

Repository files navigation

Electron + Typescript + Next

Version License Contributors Last Commit Stars

Use

git clone https://github.com/saulotarsobc/electron-next-ts.git;
cd electron-next-ts;
npm install;
npm run dev;

Help

NPM Commands

  • dev: Builds the backend and then runs the application in development mode using Electron.

    "dev": "npm run build:backend && electron . --dev"
    • npm run build:backend: Compiles the backend code using TypeScript.
    • electron . --dev: Starts the Electron application in development mode.
  • prebuild: Cleans up the build and dist directories before building the project.

    "prebuild": "rimraf build && rimraf dist"
    • rimraf build: Removes the build directory.
    • rimraf dist: Removes the dist directory.
  • build: Builds both the frontend and the backend.

    "build": "npm run build:frontend && npm run build:backend"
    • npm run build:frontend: Builds the frontend using Next.js.
    • npm run build:backend: Compiles the backend code using TypeScript.
  • build:frontend: Compiles the frontend using Next.js.

    "build:frontend": "next build frontend"
  • build:backend: Compiles the backend using TypeScript.

    "build:backend": "tsc -p backend"
  • start: Builds the project and then starts the Electron application.

    "start": "npm run build && electron ."
  • start:electron: Builds the backend and then starts the Electron application.

    "start:electron": "npm run build:backend && electron ."
  • start:frontend: Runs the frontend in development mode on port 4000.

    "start:frontend": "next dev frontend -p 4000"
  • postinstall: Installs the application's dependencies using electron-builder.

    "postinstall": "electron-builder install-app-deps"
  • dist: Builds the project and then creates distribution artifacts using electron-builder.

    "dist": "npm run build && electron-builder"