• Stars
    star
    967
  • Rank 47,309 (Top 1.0 %)
  • Language
    JavaScript
  • Created over 8 years ago
  • Updated about 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Neuron - Electron, ES6, React, PouchDB, Sass, Webpack

Neuron - ES6 React Electron Starter Kit

Build Status

Note: This project is an active work in progress. Contributions, support and feedback is very much welcomed.

Neuron is an offline first starter kit for developers wanting to create cross platform desktop applications with Electron. It comes complete with a handful of useful tools to help you create killer applications that run on all platforms!

Features

  • PouchDB (inc. pouchdb-find) with CouchDB remote replication
  • ES6 support via Babel
  • React
  • Webpack
  • Sass

Install

git clone https://github.com/JamesTheHacker/Neuron
cd Neuron
npm install

Windows Users

If you're running Windows remove the following line from the package.json file and use browser adapters instead of Node's levelDB adapter (See here for more info):

"postinstall": "bash postinstall.sh"

... and set the browser adapter in app.js like so:

const localDB = new PouchDB('app', { adapter: 'websql' })

Usage

Running npm start will build the JS and CSS files and launch the Electron application.

By default devtools is disabled. To enable it uncomment the following line in app.js:

//win.webContents.openDevTools()

Electron

The Electron entry point is a file called app.js stored in the root directory.

PouchDB and CouchDB

PouchDB is a pure JavaScript NoSQL database that can be synced with a remote CouchDB database to create an offline first application.If you're not comfortable using PouchDB's map/reduce API you can use pouchdb-find. This is included by default.

In order to sync the local and remote databases when the application launches follow the instructions below:

Local PouchDB

If you do not require the use of CouchDB on a remote server simply leave the variables in .env blank. By default this will use a local PouchDB database.

Remote CouchDB

Syncing your application to a remote CouchDB database is easy. Ensure you have CouchDB installed on a remote server and that you've secured it (I suggest reading this guide). If you need a server to play around with you can get $10 free from Digital Ocean by following this link.

Once you have CouchDB installed and secured you can configure your application by entering the host, username and password in the .env file.

COUCH_PROTOCOL=http
COUCH_HOST=192.168.0.1
COUCH_PORT=5984
COUCH_DB=app
COUCH_USERNAME=username
COUCH_PASSWORD=secret_password

Add CORS Configuration

See here for more details on why this step is required.

Run the following command, replacing the host, username and password:

npm run add-cors http://127.0.0.0:5984 --username user --password secret_password

Finished

Neuron will now automatically sync the remote database to the local one when the application launches, and will keep in sync when data is changed in the database. By default the database sync is bidirectional.

For more information on replication see the docs.

Webpack

CSS

All CSS files are stored in the app/css/ directory. Sass is built in by default allowing you to easily build CSS componenets/modules with the added benefits of Sass.

JS

All JS files are stored in the app/js/ directory. ES6 and React is supported out of the box.

Build

Running npm start or npm run build will build both the JS and CSS into single bundles. We keep the JS and CSS bundles seperate which allows you to include your CSS at the top of a HTML file and the JS at the bottom to avoid having the CSS render after the page has loaded.

More Repositories

1

Facebook-Live-Reactions

The easiest way to create interactive Facebook live streams. Displays reaction count and live shoutouts :)
PHP
293
star
2

nodejs-server-ansible-playbook

NodeJS server provisioning and application deployment using Ansible: HAProxy, Let's Encrypt, HTTPS, Secure Firewall ...
40
star
3

passman

PassMan is a secure, and easy to use password manager that runs on the terminal! Written in bash.
Shell
38
star
4

meme-maker

NodeJS module for creating meme images
JavaScript
26
star
5

JakePHP

JakePHP is a boilerplate created for modern web application development on Linux platforms. Simply clone, and start developing!
PHP
11
star
6

80Probe

Brute force subdomains and probe domains for a webserver
Python
7
star
7

northumberland-planning-application-scraper

Harvest data from Northumberland's public planning application database and convert to CSV
JavaScript
6
star
8

Yarn-Downloader

A terminal script developed in PHP to download movie clips from Yarn.
PHP
4
star
9

speeed

Style CSS based on the users Internet speed
3
star
10

profanity-bash

Filter profanity from a string of text using standard linux tools
Shell
2
star
11

Simplex

A Simple NPM based PostCSS build tool
CSS
2
star
12

80Scan

Port 80/443 Scanner on Steroids
JavaScript
2
star
13

spacecake

React, Mobx, Styled-Components, Styled-Grid boilerplate. Deploy to S3 and Digital Ocean Spaces.
JavaScript
2
star
14

RageRacer

πŸš— 🏁 A simple and easy to use race condition testing tool for web applications
JavaScript
1
star
15

Hofstadter-Q-sequence

Hofstadter Q-sequence Code Golf Solution
JavaScript
1
star
16

cmake-c-tutorial

Just a test repo I created while learning CMake from https://cliutils.gitlab.io/modern-cmake/
C
1
star
17

Slack-Linkit

A slack bot that hooks up to Wordpress. Invite the bot into a channel and use the !linkit command to share a URL to a Wordpress page
PHP
1
star
18

nodebox-testapp

A simple test application for NodeBox. Feel free to completely ignore this repo.
JavaScript
1
star