GithubHelp home page GithubHelp logo

edwardwbli / gun-starter-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gundb/gun-starter-app

0.0 1.0 0.0 4 KB

Framework agnostic starter code for gun apps

HTML 60.50% JavaScript 39.50%

gun-starter-app's Introduction

Gun starter app

Gun application boilerplate

This boilerplate is a good starting point for gun applications, or just for understanding how all the pieces fit together.

Cloning

# Download the code
$ git clone https://github.com/gundb/gun-starter-app.git

# Install the dependencies
$ cd gun-starter-app
$ npm install

Once the code has been downloaded, you can easily start the server:

$ npm start

Under the hood, this is just running node server.js

Trying it

In two browser windows, open localhost:8080/index.html.

Make sure your server is running!

There's a global gun reference you can access in the developer console called data. Change the value on message and it'll update in real-time on the other browser.

// Updates on the other browser window.
data.put({
	message: 'updated value',
})

Applying it

The code provided here is just the bare basics. It's intentionally framework agnostic to keep the example simple and reusable.

Now that you've got real-time data sync and a way to listen for changes, you can plug those change events into a UI tool/framework (like jQuery, React, Angular, etc.)

For reference, here are gun apps written with...

Questions

Have more questions? Send 'em our way on the gitter channel.

gun-starter-app's People

Contributors

amark avatar psychollama avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.