├── .compilerc ├── .eslintrc ├── .gitignore ├── LICENSE ├── README.md ├── package.json └── src ├── index.html ├── index.js └── renderer.js /.compilerc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "development": { 4 | "application/javascript": { 5 | "presets": [ 6 | [ 7 | "env", 8 | { 9 | "targets": { 10 | "electron": "3.0" 11 | } 12 | } 13 | ], 14 | "react" 15 | ], 16 | "plugins": [ 17 | "transform-async-to-generator" 18 | ], 19 | "sourceMaps": "inline" 20 | } 21 | }, 22 | "production": { 23 | "application/javascript": { 24 | "presets": [ 25 | [ 26 | "env", 27 | { 28 | "targets": { 29 | "electron": "3.0" 30 | } 31 | } 32 | ], 33 | "react" 34 | ], 35 | "plugins": [ 36 | "transform-async-to-generator" 37 | ], 38 | "sourceMaps": "none" 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "eslint-config-airbnb", 3 | "rules": { 4 | "import/extensions": 0, 5 | "import/no-extraneous-dependencies": 0, 6 | "import/no-unresolved": [2, { "ignore": ["electron"] }], 7 | "linebreak-style": 0 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | out 3 | package-lock.json 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Aditya Sridhar 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Temperature Converter Desktop App 2 | 3 | This Code is part of a blog. Please refer to the blog to make the best use of this code. 4 | The link to the blog is [here](https://adityasridhar.com/posts/desktop-apps-with-html-css-javascript) 5 | 6 | ## Pre-requisites 7 | 8 | ### Install NodeJS 9 | 10 | Install NodeJS from [https://nodejs.org/en/](https://nodejs.org/en/) 11 | 12 | ### Install Electron Forge 13 | 14 | Install Electron forge using the following command 15 | 16 | ```bash 17 | npm install -g electron-forge 18 | ``` 19 | 20 | ## Cloning the Code 21 | 22 | Clone the Code using the following command 23 | 24 | ```bash 25 | git clone https://github.com/aditya-sridhar/simple-desktop-app-electronjs.git 26 | ``` 27 | 28 | ## Running the application 29 | 30 | Go into the project folder and run the application using the following commands 31 | 32 | ```bash 33 | cd simple-desktop-app-electronjs 34 | npm install 35 | npm start 36 | ``` 37 | 38 | ## Package the Application 39 | 40 | The application can be packaged using the command 41 | 42 | ```bash 43 | npm run package 44 | ``` 45 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simple-desktop-app-electronjs", 3 | "productName": "simple-desktop-app-electronjs", 4 | "version": "1.0.0", 5 | "description": "My Electron application description", 6 | "main": "src/index.js", 7 | "scripts": { 8 | "start": "electron-forge start", 9 | "package": "electron-forge package", 10 | "make": "electron-forge make", 11 | "publish": "electron-forge publish", 12 | "lint": "eslint src --color" 13 | }, 14 | "keywords": [], 15 | "author": "Aditya", 16 | "license": "MIT", 17 | "config": { 18 | "forge": { 19 | "make_targets": { 20 | "win32": [ 21 | "squirrel" 22 | ], 23 | "darwin": [ 24 | "zip" 25 | ], 26 | "linux": [ 27 | "deb", 28 | "rpm" 29 | ] 30 | }, 31 | "electronPackagerConfig": { 32 | "packageManager": "npm" 33 | }, 34 | "electronWinstallerConfig": { 35 | "name": "simple_desktop_app_electronjs" 36 | }, 37 | "electronInstallerDebian": {}, 38 | "electronInstallerRedhat": {}, 39 | "github_repository": { 40 | "owner": "", 41 | "name": "" 42 | }, 43 | "windowsStoreConfig": { 44 | "packageName": "", 45 | "name": "simpledesktopappelectronjs" 46 | } 47 | } 48 | }, 49 | "dependencies": { 50 | "bootstrap": "^4.1.3", 51 | "electron-compile": "^6.4.3", 52 | "electron-squirrel-startup": "^1.0.0" 53 | }, 54 | "devDependencies": { 55 | "babel-plugin-transform-async-to-generator": "^6.24.1", 56 | "babel-preset-env": "^1.7.0", 57 | "babel-preset-react": "^6.24.1", 58 | "electron-forge": "^5.2.3", 59 | "electron-prebuilt-compile": "3.0.10", 60 | "eslint": "^3.19.0", 61 | "eslint-config-airbnb": "^15.1.0", 62 | "eslint-plugin-import": "^2.14.0", 63 | "eslint-plugin-jsx-a11y": "^5.1.1", 64 | "eslint-plugin-react": "^7.11.1" 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |