Sefism is free for learners. We are here to help you grow, one step at a time.Join for free
Sefism.

Project structure · More

Electron desktop app project structure

Opens with credits

A desktop notes app for Windows, macOS and Linux, built from the Electron Forge 8 Vite and TypeScript template. The tree starts with the scaffold's three entry files (main, preload, renderer) and grows into separate folders for each process, a typed IPC contract, signed installers, auto-update and end-to-end tests on the packaged app. For students who know web development and want to ship a real desktop app; if a small download matters more than a large JavaScript ecosystem, Tauri is the alternative worth comparing first.

Curated by Tauseef FayyazIntermediate138 files and foldersElectron 44, Electron Forge 8.0, Vite 8Checked October 2026
Explore the filesPick any file to see what it is, why it exists and when you add it.

How it grows

Each stage opens the explorer there

  1. 1Day 1What the scaffold and your first hour give you22 files and folders
  2. 2GrowingWhat a real app with features and tests adds+58 files and folders
  3. ProductionWhat running it for real users adds+29 files and foldersOpens with credits
  4. ExpertWhat a team needs to keep it healthy for years+29 files and foldersOpens with credits

How it is organised

  • Three kinds of code, three places. The main process (Node.js, full OS access) goes in `src/main`, the UI (a web page, no Node) in `src/renderer`, and the preload bridge in `src/preload.ts`. Code that every process needs, and that imports nothing from any of them, goes in `src/shared`.
  • Keep the secure defaults: contextIsolation and sandbox on, nodeIntegration off, and the Forge fuses that block `RunAsNode` and only load the app from its asar archive. If something only works with a protection turned off, the design is wrong.
  • The renderer talks to main only through a small typed API that preload exposes with `contextBridge`. One function per action, never a raw `ipcRenderer`. Every main handler validates its input and checks who sent it.
  • Treat every IPC channel like a public API endpoint: the page can run untrusted content (a pasted link, a Markdown file), so a handler that reads any path it is given is a hole in the user's whole machine.
  • User data lives in `app.getPath('userData')`, written atomically and versioned. The install folder is replaced on every update.
  • Ship signed builds with auto-update from the first public release. Unsigned apps are blocked on macOS and flagged on Windows, and without an updater you cannot fix what you shipped.
  • Test most code without Electron (Vitest for storage, validation and components) and only a few journeys against the packaged app with Playwright, on all three operating systems.
  • Electron or Tauri: Electron bundles Chromium and Node.js, so every user gets the same engine and you write the backend in TypeScript, at the cost of a larger download and more memory. Tauri uses the system web view and a Rust backend, so apps are much smaller but render slightly differently per OS. Pick one and write down why.

At the top of the project

Open one in the explorer for the full story

Learn more on Sefism

Roadmaps, cheat sheets and projects that go with Electron desktop app.

See 7 more
Checked against 16 official sources, October 2026. If something has changed, the docs win.Show sources

Picked from the other libraries by shared topics.

Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.

  • 1:1 Mentorship
  • Fresh Graduate Mentorship
  • Career Guidance

Brand deals, promos and partnerships: tauseeffayyaz@gmail.com