Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gundb/gun-starter-app
Framework agnostic starter code for gun apps
https://github.com/gundb/gun-starter-app
Last synced: about 2 months ago
JSON representation
Framework agnostic starter code for gun apps
- Host: GitHub
- URL: https://github.com/gundb/gun-starter-app
- Owner: gundb
- Created: 2016-11-10T22:49:37.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-12T20:52:34.000Z (over 6 years ago)
- Last Synced: 2024-08-03T20:12:13.270Z (5 months ago)
- Language: HTML
- Size: 6.84 KB
- Stars: 127
- Watchers: 7
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Gun starter app
*[Gun](https://github.com/amark/gun) application boilerplate*This boilerplate is a good starting point for gun applications, or just for understanding how all the pieces fit together.
> Important: Make sure you update the gun version to latest, as the package.json on this app becomes stale!
## Cloning
```sh
# 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:
```sh
$ 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.
```js
// 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...
- [React](https://github.com/PsychoLlama/connect-four)
- [jQuery](https://github.com/alvaro911/chat)
- [Polymer](https://github.com/Stefdv/Gun-Server-CMS-App)## Questions
Have more questions? Send 'em our way on the [gitter channel](http://gitter.im/amark/gun/).