Skip to content

Commit

Permalink
update readme and remove not needed files
Browse files Browse the repository at this point in the history
  • Loading branch information
cjerrington committed Apr 6, 2020
1 parent c85e62d commit b7365c2
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 318 deletions.
54 changes: 32 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,44 @@
# Network Status Check application written with Electron, Bootstrap, jQuery

This is a tool to add URLs and ports to check to see if they are open or not. You can add as many items to the list, and edit the list as well if needed. You can save your list and eventually reimport the list as well on launch or by using the Load URLs button.

A Demonstration of How to Use Bootstrap and jQuery to Build an Electron Application
------------------------------------------------------------------------
Main Window

What is Electron?
![main](screenshots/main.png)

> If you can build a website, you can build a desktop app. Electron is a framework for creating native applications with web technologies like JavaScript, HTML, and CSS. It takes care of the hard parts so you can focus on the core of your application.
Run Check

I built this demonstration application for those of you who have experience building web applications and are just getting started with Electron. I chose to implement Bootstrap 4.0.0-beta3 because:
![runcheck](screenshots/runcheck.png)

> Bootstrap is the most popular HTML, CSS, and JS framework in the world for building responsive, mobile-first projects on the web
## Quick Code Tour

It happens to require jQuery which also comes in handy for web development. I borrowed the [Dashboard example markup](https://getbootstrap.com/docs/4.0/examples/dashboard/) from the Bootstrap project. As example markup its purpose is merely to demonstrate a responsive layout. The menu buttons demonstrate roll-over behavior but do not link to anything. The search box doesn't work. To the example for it's intended purpose grab the window frame and resize it. Watch the interface fold and unfold as it redesigns itself making the best use of the available space as the window goes from phone size to table size to desktop size.
- The code entry point is in **package.json** under the key "main". The value is "main.js"
- **main.js** creates a BrowserWindow and loads **index.html**. It also has event handlers that enable keyboard shortcuts for Developer Tools on various platforms. Note that loadURL uses a [template literal](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) to give the source file's location.`` `file://${__dirname}/app/index.html` ``
- **index.html** loads Bootstrap's CSS in the <head> tag and **renderer.js** after the closing <body> tag. On the web Bootstrap's JavaScript would also load in this location but the Electron way is to load it in **renderer.js** with a require(). Note that these src and href attributes use normal relative paths. An HTTP server is not necessary.
- **renderer.js** loads jQuery, Bootstrap and it's dependency; Tether. Each is assigned to the window object because this is the web application custom. It's not the Node.js or Electron custom because window is a global. For now we must do it this way or it won't work.
- **setup.js** setups up some overall settings for the application
- **app.js** is the real worker of functions.

Desktop
-------
![desktop](screenshots/desktop.png)
## Releases

Tablet
-------
![tablet](screenshots/tablet.png)
At this time the releases are for Windows as that is my main developing platform and where I use this tool mostly; on Windows environments.

Phone
-------
![phone](screenshots/phone.png)
## Running Application

Quick Code Tour
---------------
first download and install dependencies, then start the app.

- The code entry point is in **package.json** under the key "main". The value is "main.js"
- **main.js** creates a BrowserWindow and loads **index.html**. It also has event handlers that enable keyboard shortcuts for Developer Tools on various platforms. Note that loadURL uses a [template literal](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) to give the source file's location.`` `file://${__dirname}/app/index.html` ``
- **index.html** loads Bootstrap's CSS in the <head> tag and **renderer.js** after the closing <body> tag. On the web Bootstrap's JavaScript would also load in this location but the Electron way is to load it in **renderer.js** with a require(). Note that these src and href attributes use normal relative paths. An HTTP server is not necessary.
- **renderer.js** loads jQuery, Bootstrap and it's dependency; Tether. Each is assigned to the window object because this is the web application custom. It's not the Node.js or Electron custom because window is a global. For now we must do it this way or it won't work.
```
git clone https://github.com/cjerrington/net-check.git
cd net-check
npm install
npm start
```

## Creating Releases

We will need to package first, then we can create the installer if needed.

```
npm run package-win
npm run release
```
240 changes: 0 additions & 240 deletions app/help.html

This file was deleted.

55 changes: 0 additions & 55 deletions app/pills.html

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "net-check",
"productName": "Network Status Check",
"version": "1.0.2",
"version": "1.0.3",
"description": "A desktop app to check the status of a hostname or URL and port. ",
"main": "main.js",
"repository": "https://github.com/cjerrington/net-check",
Expand Down

0 comments on commit b7365c2

Please sign in to comment.