Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons

© 2026 BraveProgrammer. All rights reserved.

  1. Courses
  2. /
  3. Electron.js Desktop App Development

Lesson 24 of 28 · javascript

Project Structure & npm Scripts

Duration: 8 mins

Project Structure & npm Scripts

A common layout:

my-app/
├─ src/            # renderer source (HTML/JS/CSS or a framework)
│   ├─ index.html
│   └─ renderer.js
├─ main/           # main‑process code
│   └─ main.js
├─ preload/        # preload scripts (secure bridge)
│   └─ bridge.js
├─ package.json
└─ .gitignore

Add helpful scripts:

"scripts": {
  "start": "electron .",
  "dev": "concurrently \"npm:watch-main\" \"npm:watch-renderer\"",
  "watch-main": "nodemon --watch main --exec electron .",
  "watch-renderer": "vite --config vite.renderer.config.js",
  "build": "electron-builder"
}

concurrently and nodemon are optional helpers that restart the app on changes.

Previous: Your First Electron App – Hello WorldNext: Creating BrowserWindows – Options & Features