{"id":13402783,"url":"https://github.com/szwacz/electron-boilerplate","last_synced_at":"2025-03-14T08:31:08.638Z","repository":{"id":31004058,"uuid":"34562465","full_name":"szwacz/electron-boilerplate","owner":"szwacz","description":"Boilerplate application for Electron runtime","archived":true,"fork":false,"pushed_at":"2022-12-27T15:03:51.000Z","size":825,"stargazers_count":3125,"open_issues_count":3,"forks_count":491,"subscribers_count":108,"default_branch":"master","last_synced_at":"2024-07-31T19:38:35.951Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/szwacz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-25T09:16:40.000Z","updated_at":"2024-07-25T15:09:46.000Z","dependencies_parsed_at":"2023-01-14T18:08:49.221Z","dependency_job_id":null,"html_url":"https://github.com/szwacz/electron-boilerplate","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szwacz%2Felectron-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szwacz%2Felectron-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szwacz%2Felectron-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szwacz%2Felectron-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/szwacz","download_url":"https://codeload.github.com/szwacz/electron-boilerplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243547311,"owners_count":20308686,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T19:01:20.805Z","updated_at":"2025-03-14T08:31:08.294Z","avatar_url":"https://github.com/szwacz.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Boilerplates","Boilerplates and Starter Kits","Seed List","others","Javascript"],"sub_categories":["Tools","Samples","Desktop"],"readme":"# electron-boilerplate\n\n**This repository is no longer in active maintenance.**\n\n---\n\nMinimalistic, very easy to understand boilerplate for [Electron runtime](https://www.electronjs.org/). Tested on Windows, macOS and Linux.  \n\nThis project contains only bare minimum of tooling and dependencies to provide you with simple to understand and extensible base (but still, this is fully functional Electron environment). The boilerplate doesn't impose on you any frontend technologies, so feel free to pick your favourite.\n\n# Quick start\n\nMake sure you have [Node.js](https://nodejs.org) installed, then type...\n```\ngit clone https://github.com/szwacz/electron-boilerplate.git\ncd electron-boilerplate\nnpm install\nnpm start\n```\n...and you have a running desktop application on your screen.\n\n# Structure of the project\n\nThe application consists of two main folders...\n\n`src` - files within this folder get transpiled or compiled (because Electron can't use them directly).\n\n`app` - contains all static assets which don't need any pre-processing and can be used directly.\n\nThe build process compiles the content of the `src` folder and puts it into the `app` folder, so after the build has finished, your `app` folder contains the full, runnable application. Treat `src` and `app` folders like two halves of one bigger thing.\n\nThe drawback of this design is that `app` folder contains some files which should be git-ignored and some which shouldn't (see `.gitignore` file). But this two-folders split makes development builds much faster.\n\n# Development\n\n## Starting the app\n\n```\nnpm start\n```\n\n## The build pipeline\n\nBuild process uses [Webpack](https://webpack.js.org/). The entry-points are `src/main.js` and `src/app.js`. Webpack will follow all `import` statements starting from those files and compile code of the whole dependency tree into one `.js` file for each entry point.\n\n[Babel](http://babeljs.io/) is also utilised, but mainly for its great error messages. Electron under the hood runs latest Chromium, hence most of the new JavaScript features are already natively supported.\n\n## Environments\n\nEnvironmental variables are done in a bit different way (not via `process.env`). Env files are plain JSONs in `config` directory, and build process dynamically links one of them as an `env` module. You can import it wherever in code you need access to the environment.\n```js\nimport env from \"env\";\nconsole.log(env.name);\n```\n\n## Adding npm modules to your app\n\nRemember to respect the split between `dependencies` and `devDependencies` in `package.json` file. Your distributable app will contain only modules listed in `dependencies` after running the release script.\n\n*Side note:* If the module you want to use in your app is a native one (not pure JavaScript but compiled binary) you should first  run `npm install name_of_npm_module` and then `npm run postinstall` to rebuild the module for Electron. You need to do this once after you're first time installing the module. Later on, the postinstall script will fire automatically with every `npm install`.\n\n# Testing\n\nRun all tests:\n```\nnpm test\n```\n\n## Unit\n\n```\nnpm run unit\n```\nUsing [electron-mocha](https://github.com/jprichardson/electron-mocha) test runner with the [Chai](http://chaijs.com/api/assert/) assertion library. You can put your spec files wherever you want within the `src` directory, just name them with the `.spec.js` extension.\n\n## End to end\n\n```\nnpm run e2e\n```\nUsing [Mocha](https://mochajs.org/) and [Spectron](http://electron.atom.io/spectron/). This task will run all files in `e2e` directory with `.e2e.js` extension.\n\n# Making a release\n\nTo package your app into an installer use command:\n```\nnpm run release\n```\n\nOnce the packaging process finished, the `dist` directory will contain your distributable file.\n\n[Electron-builder](https://github.com/electron-userland/electron-builder) is handling the packaging process. Follow docs over there to customise your build.\n\nYou can package your app cross-platform from a single operating system, [electron-builder kind of supports this](https://www.electron.build/multi-platform-build), but there are limitations and asterisks. That's why this boilerplate doesn't do that by default.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszwacz%2Felectron-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fszwacz%2Felectron-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszwacz%2Felectron-boilerplate/lists"}