14 |
15 | ## 🚀 Quickest start without downloading
16 |
17 | 1. Go to the document you want to edit on deepstream.io (click on the github icon on each page)
18 | 2. Edit the file
19 | 3. Commit
20 |
21 | ## 🚀 Quick start for downloading
22 |
23 | 1. git clone
24 | 2. npm i
25 | 3. npm run develop
26 | 4. Edit as you see fit
27 | 5. Commit
28 | 6. Raise PR
29 |
30 | A quick look at the top-level files and directories you should care about:
31 |
32 | .
33 | ├── content
34 | ├── code-examples
35 | ├── markdown-templates
36 | └──src
37 |
38 |
39 | 1. **`/content`**: This directory contains all the content markdown content on the website and is organized into
40 | the different routes on the application. Adding a document in most cases will automatically add it to the index pages and the navigation menus.
41 |
42 | 2. **`/code-examples`**: This directory contains all the example code in the application (mostly guides and plugins).
43 | It's useful to have them live here due to prettify and typescript validation.
44 |
45 | 4. **`/markdown-templates`**: This directory contains all the snippets reused across the website (to the horror of search engines). Use and add to these sparingly.
46 |
47 | 4. **`/src`**: This directory contains all the react components and styles to render the page. If you feel a component can be displayed better this is the place to be!
48 |
49 |
50 | ## 💫 Deploy
51 |
52 | Website automatically gets deployed from master to https://deepstream.io and from staging to https://staging.deepstream.io
53 |
--------------------------------------------------------------------------------
/code-examples/guides/live-progress-bar/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "live-progress-bar",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "server.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1",
8 | "start": "node server.js"
9 | },
10 | "author": "",
11 | "license": "ISC",
12 | "dependencies": {
13 | "@deepstream/client": "^4.1.3",
14 | "express": "^4.17.1"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/code-examples/guides/live-progress-bar/skeleton.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
19 |
20 |
21 |
22 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/code-examples/js/attach-error-listener.js:
--------------------------------------------------------------------------------
1 | // hide-next-line
2 | const dsClient = new Client()
3 | dsClient.on('error', (error,event,topic) => {
4 | console.error(error,event,topic)
5 | })
6 |
--------------------------------------------------------------------------------
/code-examples/js/create-client.js:
--------------------------------------------------------------------------------
1 | const dsClient = new DeepstreamClient('localhost:6020');
2 |
--------------------------------------------------------------------------------
/code-examples/js/include-script.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/code-examples/js/login-es5.js:
--------------------------------------------------------------------------------
1 | // ES5
2 | const { DeepstreamClient } = require('@deepstream/client')
3 | const client = new DeepstreamClient('localhost:6020');
4 |
5 | client.login({
6 | username: 'chris',
7 | password: 'password' // NEEDS TO BE REAL
8 | }, (success, clientData) => {
9 | if (success) {
10 | // Do stuff now your authenticated
11 | } else {
12 | // Unhappy path of an unsuccesful login
13 | }
14 | })
--------------------------------------------------------------------------------
/code-examples/js/login-es6.js:
--------------------------------------------------------------------------------
1 | import deepstream from '@deepstream/client'
2 | const client = new DeepstreamClient('localhost:6020')
3 |
4 | try {
5 | const clientData = await client.login({
6 | username: 'chris',
7 | password: 'password' // NEEDS TO BE REAL
8 | })
9 | // Do stuff now your authenticated
10 | } catch (error) {
11 | // Unhappy path of an unsuccesful login
12 | }
13 |
--------------------------------------------------------------------------------
/code-examples/js/server-customhttp.js:
--------------------------------------------------------------------------------
1 | const { Deepstream } = require('./dist/src/deepstream.io')
2 | const { Server } = require('http')
3 |
4 | const httpServer = new Server()
5 |
6 | const ds = new Deepstream({
7 | connectionEndpoints: [{
8 | type: 'ws-websocket',
9 | options: {
10 | httpServer
11 | }
12 | }]
13 | })
14 | ds.start()
15 |
16 | httpServer.listen(6020, function(){
17 | console.log( 'HTTP server listening on 6020' );
18 | })
--------------------------------------------------------------------------------
/code-examples/js/set-merge-strategies.js:
--------------------------------------------------------------------------------
1 | const customMergeStrategy = (localValue, localVersion, remoteValue, remoteVersion, callback) => {
2 | callback(error, mergedData)
3 | }
4 |
5 | // Set merge strategy globally when initialising the client
6 | const client = deepstream('localhost', { mergeStrategy: deepstream.MERGE_STRATEGIES.LOCAL_WINS })
7 |
8 | // Or set merge strategy on a pattern to match multiple records
9 | client.record.setMergeStrategyRegExp('albums/.*', customMergeStrategy)
10 |
11 | // Or set merge strategy on a name
12 | client.record.setMergeStrategyByName('name', customMergeStrategy)
13 |
14 | // Or set merge strategy on a per record basis (this just proxies to the above, as only one record per name is every created)
15 | rec = ds.record.getRecord('some-record')
16 | rec.setMergeStrategy(customMergeStrategy)
--------------------------------------------------------------------------------
/code-examples/js/simple-login.js:
--------------------------------------------------------------------------------
1 | // hide-next-line
2 | const dsClient = new Client()
3 | dsClient.login()
4 |
--------------------------------------------------------------------------------
/content/404.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deepstreamIO/deepstream.io-website/f449598a352617ecd29fded8fc8dbff853d15705/content/404.md
--------------------------------------------------------------------------------
/content/acknowledgements.yml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deepstreamIO/deepstream.io-website/f449598a352617ecd29fded8fc8dbff853d15705/content/acknowledgements.yml
--------------------------------------------------------------------------------
/content/blog/20170509-release-deepstream-2.3/2.3-deepstream.io.jpg:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:948d88c84524edc1ff16bb2e5540cef3e6ad6681dd04a56206a49d3fe06a1bf5
3 | size 133493
4 |
--------------------------------------------------------------------------------
/content/blog/20170702-release-deepstream-2.4/2.4-deepstream-elton.jpg:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:90feff65b41f10817e97ed7233a72a7162f95c76518c031ee4438d5461c8d81b
3 | size 149661
4 |
--------------------------------------------------------------------------------
/content/blog/20170702-release-deepstream-2.4/2.4-deepstream.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:0109e89d4240d656d9685e4bc864d394ec81386b71eea29515a76892be334518
3 | size 50127
4 |
--------------------------------------------------------------------------------
/content/blog/20170721-release-deepstream-3.0/3.0-deepstream.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:362003d616a36d569c1a2c83670bf95769fb0f7744f29404189aef3f98bc3f04
3 | size 104094
4 |
--------------------------------------------------------------------------------
/content/blog/20170721-release-deepstream-3.0/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Release: Deepstream 3.0"
3 | description: a foundation for a multi-protocol-server
4 | ---
5 |
6 | I’m terrible with secrets. I’ve always been. Back when I was still working in corporate land, I gave our receptionist a run for her money when it came to gossiping — and trust me, this is saying a lot.
7 |
8 | 
9 |
10 | Today, with deepstream 3.0 on the horizon I’m not much better:
11 |
12 | Over the last month we’ve been working hard to turn deepstreamHub into a global realtime platform — one that goes beyond the current generation of PubSub services or realtime DBs and makes cloud-based deepstream accessible at large scale.
13 |
14 | But deepstreamHub isn’t just hosted deepstream. It comes with its own set of features. Amongst the most popular ones: our HTTP API.
15 |
16 | The API makes it possible for any programming language to create, read, write and delete records, send events or make RPCs. This opened up a whole new range of usecases: sending events from AWS Lambda functions, bulk importing thousands of records at once, making AJAX calls without establishing a deepstream connection — to name just a few.
17 |
18 | With deepstream 3.0 this API will come back to open source. But we didn’t just take some code from the hub and put it into the open source server — we want to go further:
19 |
20 | deepstream 3.0 will come with a re-architected abstract connection endpoint, making it possible to add any number of communication mechanisms and protocols to exchange data and interact with deepstream’s records, events and RPCs:
21 |
22 | GraphQL, MQTT, STOMP, Binary transports…just a few of the things on the horizon…
23 |
--------------------------------------------------------------------------------
/content/blog/20190830-release-deepstream-4.1/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Release: Deepstream 4.1"
3 | description: Deepstream V3 and below compatibility support!
4 | redirectFrom: [/releases/server/v4-1-0/]
5 | ---
6 |
7 | ### Features:
8 |
9 | Backwards compatibility with V3 clients / text protocol using a ws-text connection endpoint!
10 |
11 | This has a couple of small differences, like `has` is no longer supported and `snapshot` errors
12 | are exposed using the global `error` callback instead of via the response. Otherwise all the e2e
13 | tests work, and best of all you can run both at the same time if you want to run JS 4.0
14 | and Java 3.0 simultaneously!
15 |
16 | It is worth keeping in mind there is a small CPU overhead between switching from V3 custom deepstream
17 | encoding to JSON (V4), so it is advised to monitor your CPU when possible!
18 |
19 | ```yaml
20 | - type: ws-text
21 | options:
22 | # port for the websocket server
23 | port: 6021
24 | # host for the websocket server
25 | host: 0.0.0.0
26 | ```
--------------------------------------------------------------------------------
/content/blog/20190905-release-clientjs-4.1/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Release: Javascript/Node 4.1"
3 | description: Default Timer Implementation
4 | redirectFrom: [/releases/server/v4-1-0/]
5 | ---
6 |
7 | Including a default implementation of timeouts using the native setTimeout API. The interval based one was created in order to mitigate the insane amount
8 | of ack registries we used to have get created, and also because setting timeouts
9 | isn't cheap (you can verify this by creating a couple thousand records and noticing the cost within the default noop storage registry). However as correctly stated by @Krishna [here](https://github.com/deepstreamIO/deepstream.io-client-js/issues/500) the interval implementation is naive in terms of mobile (looping every 20milliseconds for idle connections is overkill) and the benefits now is no longer as apparent as during the RC release (since bulk messaging now only makes one timeout for N amount amount of subscriptions).
10 |
11 | You can toggle them with the following:
12 |
13 | ```yaml
14 | # When true uses setTimeout
15 | nativeTimerRegistry: true,
16 | # When nativeTimerRegistry is false uses an interval with this timer resolution
17 | intervalTimerResolution: 50,
18 | ```
19 |
20 | Either ways both implementations are expensive in terms of garbage collection since it binds to the context and data as part of the API. This can probably be avoided by providing a null context going forward.
21 |
--------------------------------------------------------------------------------
/content/blog/20190920-release-clientjs-5.0/5.0-release.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:1b0194e688441d22aa888de7e200793973824de45afcc0972f7c9f81084e1a6f
3 | size 2157822
4 |
--------------------------------------------------------------------------------
/content/blog/20190920-release-clientjs-5.0/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Release: Javascript/Node 5.0"
3 | description: Better Typescript and MIT
4 | redirectFrom: [/releases/clientjs/v5-0-0/]
5 | blogImage: ./5.0-release.png
6 | ---
7 |
8 | This version bump is mainly to respect the major version of the deepstream server, and is (almost) fully compatible with V4.
9 |
10 | The one breaking change we figured we should sneak in is the following:
11 |
12 | ```javascript
13 | import { DeepstreamClient } from '@deepstream/client'
14 | const client = new DeepstreamClient('localhost:6020/deepstream')
15 | ```
16 |
17 | as opposed to how it was done before:
18 |
19 | ```javascript
20 | import * as deepstream from '@deepstream/client'
21 | const client = deepstream('localhost:6020/deepstream')
22 | ```
23 |
24 | This provides much better typescript support.
--------------------------------------------------------------------------------
/content/blog/20190920-release-deepstream-5.0/5.0-release.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:1b0194e688441d22aa888de7e200793973824de45afcc0972f7c9f81084e1a6f
3 | size 2157822
4 |
--------------------------------------------------------------------------------
/content/blog/20190920-release-deepstream-5.0/5.0-release.svg:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:64bdaa2802241137d4e9a8d6e6eea2a94f5a20b187707ce5853ddad250772858
3 | size 130530
4 |
--------------------------------------------------------------------------------
/content/docs/10-server/user-file/ds-hash-output.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:d3df2c047187b337eb183352608ad434edbf933faf9ac211a7d033991b6cdde0
3 | size 2011
4 |
--------------------------------------------------------------------------------
/content/docs/40-client-js/90-datasync-anonymous-record/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Anonymous Record
3 | description: Learn how to use anonymous records to switch context without having to renew bindings
4 | ---
5 |
6 | AnonymousRecord is a record without a predefined name. It functions as a wrapper around an actual record that can be swapped out for another while keeping all bindings intact.
7 |
8 | An anonymousRecord extends `Record` and contains all of its [API calls](/docs/client-js/datasync-record/).
9 |
10 | To learn more about how they are used, have a look at the [AnonymousRecord Tutorial](/tutorials/core/datasync/anonymous-records/).
11 |
12 | ## Creating an anonymousRecord
13 |
14 | AnonymousRecords are created and retrieved using `client.record.getAnonymousRecord('name')`
15 |
16 | ```javascript
17 | const anonymousRecord = client.record.getAnonymousRecord()
18 | ```
19 |
20 | ## Events
21 |
22 | ### nameChanged
23 | The new name of the underlying record which the anonymous record now represents.
24 |
25 | ## Methods
26 |
27 | ### setName(recordName)
28 |
29 | |Argument|Type|Optional|Description|
30 | |---|---|---|---|
31 | |recordName|String|false|he name of the actual record the anonymousRecord should use. This can be called multiple times.|
32 |
33 | Sets the underlying record the `anonymousRecord` wraps around. It takes care of cleaning up the previous record on your behalf.
34 |
35 | ```javascript
36 | const anonymousRecord = client.record.getAnonymousRecord()
37 | anonymousRecord.setName('user/john-snow')
38 | ```
39 |
--------------------------------------------------------------------------------
/content/docs/50-client-java-v2/AnonymousRecord/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Class AnonymousRecord
3 | description: An AnonymousRecord acts as a wrapper around an actual record, allowing it to be swapped whilst keeping all bindings intact
4 | ---
5 |
6 | An AnonymousRecord is a record without a predefined name. It acts as a wrapper around an actual record that can be swapped out for another one whilst keeping all bindings intact.
7 |
8 | This is useful to easily populate user-interface with data choosen from a list of entries.
9 |
10 | Learn more about AnonymousRecords in [this tutorial](/tutorials/guides/anonymous-records/)
11 |
12 | ## Methods
13 |
14 | ### String name()
15 |
16 | Returns the name of the underlying record the anonymous record is bound to.
17 |
18 | ```java
19 | String recordName = anonymousRecord.name()
20 | ```
21 |
22 | ### AnonymousRecord setName(String recordName)
23 |
24 | |Argument|Type|Description|
25 | |---|---|---|
26 | |recordName|String|The name of the underlying record to use|
27 |
28 | Sets the underlying record the anonymous record is bound to. Can be called multiple times.
29 |
30 | ```java
31 | anonymousRecord.setName('person/bob')
32 | ```
33 |
34 | ### AnonymousRecord addRecordNameChangedListener(AnonymousRecordNameChangedListener listener)
35 |
36 | |Argument|Type|Description|
37 | |---|---|---|
38 | |listener|AnonymousRecordNameChangedListener|Listener to add|
39 |
40 | Add a callback to be notified whenever setName(String) is called.
41 |
42 | ```java
43 | anonymousRecord.addRecordNameChangedListener(...)
44 | ```
45 |
46 | ### AnonymousRecord removeRecordNameChangedCallback(AnonymousRecordNameChangedListener listener)
47 |
48 | |Argument|Type|Description|
49 | |---|---|---|
50 | |listener|AnonymousRecordNameChangedListener|Listener to remove|
51 |
52 |
53 | Remove a previously registered AnonymousRecordNameChangedListener
54 |
55 | ```java
56 | anonymousRecord.removeRecordNameChangedCallback(...)
57 | ```
58 |
--------------------------------------------------------------------------------
/content/docs/50-client-java-v2/AnonymousRecordNameChangedListener/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Interface AnonymousRecordNameChangedListener
3 | description: A listener that's notified whenever an AnonymousRecord's name is changed
4 | category: interface
5 | navLabel: AnonymousRecordNameChangedListener
6 | body_class: dark
7 | ---
8 |
9 | A listener that notifies whenever AnonymousRecord.setName(name) is called.
10 |
11 | This is useful to easily populate user-interface with data choosen from a list of entries.
12 |
13 | Learn more about AnonymousRecords in [this tutorial](/tutorials/guides/anonymous-records/)
14 |
15 | ## Methods
16 |
17 | ### void recordNameChanged(String name, AnonymousRecord anonymousRecord)
18 |
19 |
20 | ```
21 | {{#table mode="java-api"}}
22 | -
23 | arg: name
24 | typ: String
25 | des: The new recordName
26 | -
27 | arg: anonymousRecord
28 | typ: AnonymousRecord
29 | des: The anonymousRecord which name changed
30 | {{/table}}
31 | ```
32 | Notified whenever the underlying record changes
33 |
--------------------------------------------------------------------------------
/content/docs/50-client-java-v2/ConnectionStateListener/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Interface ConnectionStateListener
3 | description: A listener that's notified whenever the client's connections tate changes
4 | category: interface
5 | navLabel: ConnectionStateListener
6 | body_class: dark
7 | ---
8 |
9 | A listener that will be notified whenever the ConnectionState changes. Can be added via
10 | DeepstreamClient.addConnectionChangeListener(listener) and removed via DeepstreamClient.removeConnectionChangeListener(listener).
11 |
12 | Learn more about [connections states and connectivity issues](/docs/general/connectivity/)
13 |
14 | ## Methods
15 |
16 | ### void connectionStateChanged(ConnectionState connectionState)
17 |
18 |
19 | ```
20 | {{#table mode="java-api"}}
21 | -
22 | arg: state
23 | typ: ConnectionState
24 | des: The current connection state
25 | {{/table}}
26 | ```
27 |
28 | Called with the new updated connection state. Useful for enabling applications to respond to different scenarios, like [ConnectionState.ERROR](/docs/general/connectivity/) if an error occurs, or [ConnectionState.RECONNECTING](/docs/general/connectivity/) if the connection drops.
--------------------------------------------------------------------------------
/content/docs/50-client-java-v2/DeepstreamRuntimeErrorHandler/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Class DeepstreamRuntimeErrorHandler
3 | description: Allows for all runtime errors to be caught in a single place
4 | category: interface
5 | navLabel: DeepstreamRuntimeErrorHandler
6 | body_class: dark
7 | ---
8 |
9 | This interface allows to handle common errors centrally rather than in numerous try/catch clauses.
10 |
11 | Please note: Errors that are specific to a request, e.g. a RPC timing out or a record not being permissioned are either passed directly to the method that requested them or will be caught by a more specific listener.
12 |
13 | ## Methods
14 |
15 | ### void onException(Topic topic, Event event, String errorMessage)
16 |
17 | ```
18 | {{#table mode="java-api"}}
19 | -
20 | arg: topic
21 | typ: Topic
22 | des: The Topic the error occured on
23 | -
24 | arg: event
25 | typ: Event
26 | des: The Error Event
27 | -
28 | arg: errorMessage
29 | typ: String
30 | des: The error message
31 | {{/table}}
32 | ```
33 |
34 | Triggered whenever a runtime error occurs ( mostly async such as TimeOuts or MergeConflicts ). Recieves a topic to indicate if it was e.g. RPC, event and a english error message to simplify debugging.
35 |
36 |
--------------------------------------------------------------------------------
/content/docs/50-client-java-v2/EventListener/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Interface EventListener
3 | description: A listener that's notified whenever an event is received via deepstream's pub-sub mechanism
4 | category: interface
5 | navLabel: EventListener
6 | body_class: dark
7 | ---
8 |
9 | This listener is notified whenever a given event is triggered, whether by this client or by another. It can be added via EventHandler.subscribe(eventName,listener)
10 |
11 | ## Methods
12 |
13 | ### void onEvent(String eventName, Object data)
14 |
15 | ```
16 | {{#table mode="java-api"}}
17 | -
18 | arg: eventName
19 | typ: String
20 | des: The event name
21 | -
22 | arg: data
23 | typ: Object
24 | des: The arguments that the event has been called with
25 | {{/table}}
26 | ```
27 |
--------------------------------------------------------------------------------
/content/docs/50-client-java-v2/HasResult/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Class HasResult
3 | description: A class representing the outcome of a record Has
4 | category: class
5 | navLabel: HasResult
6 | body_class: dark
7 | ---
8 |
9 | HasResult provides the ability for clients to determine whether or not a record exists via client.record.has(name) .
10 |
11 | ## Methods
12 |
13 | ### boolean getResult()
14 |
15 | Returns a boolean reflecting whether or not the record exists.
16 |
17 | ### DeepstreamError getData()
18 |
19 | Returns an error if there was one while checking for existence of the record..
20 |
21 | ### boolean hasError()
22 |
23 | Returns a boolean indicating if there was an error checking the record exists.
24 |
--------------------------------------------------------------------------------
/content/docs/50-client-java-v2/ListChangedListener/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Interface ListChangedListener
3 | description: A listener that's notified whenever any change to a list occurs
4 | category: interface
5 | navLabel: ListChangedListener
6 | body_class: dark
7 | ---
8 |
9 | List change callback, invoked for every change to the list
10 |
11 | ## Methods
12 |
13 | ### void onListChanged(String listName, java.util.List entries)
14 |
15 |
16 | ```
17 | {{#table mode="java-api"}}
18 | -
19 | arg: listName
20 | typ: String
21 | des: The name of the list that changed
22 | -
23 | arg: entries
24 | typ: List
25 | des: A list containing all the record names
26 | {{/table}}
27 | ```
28 |
29 | Notified whenever the entries in the list change
--------------------------------------------------------------------------------
/content/docs/50-client-java-v2/ListEntryChangedListener/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Interface ListEntryChangedListener
3 | description: A listener that's notified whenever entries are added, removed or moved within a List
4 | category: interface
5 | navLabel: ListEntryChangedListener
6 | body_class: dark
7 | ---
8 |
9 | List entry callbacks, called whenever an entry is added, removed or moved within the list
10 |
11 | ## Methods
12 |
13 | ### void onEntryAdded(String name, String entry, int position)
14 |
15 |
16 | ```
17 | {{#table mode="java-api"}}
18 | -
19 | arg: name
20 | typ: String
21 | des: The name of the list that changed
22 | -
23 | arg: entry
24 | typ: String
25 | des: The entry that has been added
26 | -
27 | arg: position
28 | typ: int
29 | des: The index of the item added
30 | {{/table}}
31 | ```
32 |
33 | Notified whenever an entry is added
34 |
35 | ### void onEntryRemoved(String name, String entry, int position)
36 |
37 |
38 | ```
39 | {{#table mode="java-api"}}
40 | -
41 | arg: name
42 | typ: String
43 | des: The name of the list that changed
44 | -
45 | arg: entry
46 | typ: String
47 | des: The entry that has been removed
48 | -
49 | arg: position
50 | typ: int
51 | des: The index of the item removed
52 | {{/table}}
53 | ```
54 | Notified whenever an entry is removed
55 |
56 | ### void onEntryMoved(String name, String entry, int position)
57 |
58 |
59 | ```
60 | {{#table mode="java-api"}}
61 | -
62 | arg: name
63 | typ: String
64 | des: The name of the list that changed
65 | -
66 | arg: entry
67 | typ: String
68 | des: The entry that was moved within the list
69 | -
70 | arg: position
71 | typ: int
72 | des: The index of the item was moved to
73 | {{/table}}
74 | ```
75 |
76 | Notified whenever an entry is moved
--------------------------------------------------------------------------------
/content/docs/50-client-java-v2/ListenListener/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Interface ListenListener
3 | description: An interface that notifies whenever a pattern match has been found or removed
4 | category: interface
5 | navLabel: ListenListener
6 | body_class: dark
7 | ---
8 |
9 | An interface that notifies whenever a pattern match has been found or removed when added via event.listen(istener) or record.listen(istener)
10 |
11 | ## Methods
12 |
13 | ### boolean onSubscriptionForPatternAdded(String subscription)
14 |
15 | ```
16 | {{#table mode="java-api"}}
17 | -
18 | arg: subscription
19 | typ: String
20 | des: The name of the subscription that can be provided
21 | {{/table}}
22 | ```
23 |
24 | Called whenever a subscription has been found a on pattern you previously added. This method must return a true if it is willing to provide the subscription, and false otherwise. This also has to be done in a timely fashion since the server will assume the provider is unresponsive if it takes too long.
25 |
26 | ### void onSubscriptionForPatternRemoved(String subscription)
27 |
28 | ```
29 | {{#table mode="java-api"}}
30 | -
31 | arg: subscription
32 | typ: String
33 | des: The name of the subscription to stop providing
34 | {{/table}}
35 | ```
36 |
37 | If a provider has accepted a request, they will then be notified when the subscription is no longer needed so that they can stop providing
38 |
--------------------------------------------------------------------------------
/content/docs/50-client-java-v2/LoginResult/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Class LoginResult
3 | description: An object containing information about the last login attempt
4 | category: class
5 | navLabel: LoginResult
6 | body_class: dark
7 | ---
8 |
9 | The result of a login, indicating if it was successful and providing clientData
10 |
11 | ## Methods
12 |
13 | ### boolean loggedIn()
14 |
15 | Whether or not the login completed successfully
16 |
17 | ### Object getData()
18 |
19 | Return the data associated with login. If login was successful, this would be the user associated clientData. Otherwise data explaining the reason why it wasn't.
20 |
21 | ### Object getErrorEvent()
22 |
23 | The error message the server sent to explain why the client couldn't log in.
24 |
--------------------------------------------------------------------------------
/content/docs/50-client-java-v2/PresenceEventListener/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Interface PresenceEventListener
3 | description: A listener that's notified whenever an authenticated client logs into or out of deepstream
4 | category: interface
5 | navLabel: PresenceEventListener
6 | body_class: dark
7 | ---
8 |
9 | This listener is notified whenever an authenticated client (ie. one that logged in with credentials) logs in or out.
10 |
11 | ## Methods
12 |
13 | ### void onClientLogin(String name)
14 |
15 | ```
16 | {{#table mode="java-api"}}
17 | -
18 | arg: name
19 | typ: String
20 | des: The users name or ID
21 | {{/table}}
22 | ```
23 |
24 | ### void onClientLogout(String name)
25 |
26 | ```
27 | {{#table mode="java-api"}}
28 | -
29 | arg: name
30 | typ: String
31 | des: The users name or ID
32 | {{/table}}
33 | ```
34 |
--------------------------------------------------------------------------------
/content/docs/50-client-java-v2/RecordChangedCallback/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Interface RecordChangedCallback
3 | description: A listener that's notified whenever the data within a record changes
4 | category: interface
5 | navLabel: RecordChangedCallback
6 | body_class: dark
7 | ---
8 |
9 | Record data changed listener, used to be notified whenever the record data has been modified either locally or remotely.
10 |
11 | ## Methods
12 |
13 | ### void onRecordChanged(String name, JsonElement data)
14 |
15 | ```
16 | {{#table mode="java-api"}}
17 | -
18 | arg: name
19 | typ: String
20 | des: The name of the record that changed
21 | -
22 | arg: data
23 | typ: JsonElement
24 | des: The updated data
25 | {{/table}}
26 | ```
27 |
28 | Called when the listener is added via Record.subscribe(callback,triggerNow)
29 |
30 | Will contain the entire record data, regardless of whether triggered by a Patch or Update
--------------------------------------------------------------------------------
/content/docs/50-client-java-v2/RecordEventsListener/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Interface RecordEventsListener
3 | description: A listener that's notified whenever a record is deleted, or discarded
4 | category: interface
5 | navLabel: RecordEventsListener
6 | body_class: dark
7 | ---
8 |
9 | Record state changed listener, used to be notified whenever the record state has occurred
10 |
11 | ## Methods
12 |
13 | ### void onError(String recordName, Event errorType, String errorMessage)
14 |
15 | ```
16 | {{#table mode="java-api"}}
17 | -
18 | arg: recordName
19 | typ: String
20 | des: The name of the record an error occured to
21 | -
22 | arg: errorType
23 | typ: Event
24 | des: The error type, such as Event.ACK_TIMEOUT or Event.MESSAGE_DENIED
25 | -
26 | arg: errorMessage
27 | typ: String
28 | des: An error message in english, describing the issue. Do not use this message other than for logging! All checks should be against errorType
29 | {{/table}}
30 | ```
31 | Notified whenever an error has occurred on the record, usually due to an async operation such as a timeout or VersionConflict that can't be caught sync.
32 |
33 | ### void onRecordDeleted(String recordName)
34 |
35 |
36 | ```
37 | {{#table mode="java-api"}}
38 | -
39 | arg: recordName
40 | typ: String
41 | des: The name of the record that got deleted
42 | {{/table}}
43 | ```
44 | Notified when the record was deleted, whether by this client or by another.
45 |
46 | Once this is called the record object must be cleaned up and a new one created if you wish to continue setting data.
47 |
48 | ### void onRecordDiscarded(String recordName)
49 |
50 |
51 | ```
52 | {{#table mode="java-api"}}
53 | -
54 | arg: recordName
55 | typ: String
56 | des: The name of the record that got discarded
57 | {{/table}}
58 | ```
59 |
60 | Notified once the record was discarded.
61 | Once this is called the record object must be cleaned up and a new one created if you wish to continue setting data.
--------------------------------------------------------------------------------
/content/docs/50-client-java-v2/RecordMergeStrategy/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Class RecordMergeStategy
3 | description: A collection of strategies that will be applied to resolve data-conflicts
4 | category: class
5 | navLabel: RecordMergeStategy
6 | body_class: dark
7 | ---
8 |
9 | Allows users to reconcile record versions in case of data-conflict ( out of sync record versions )
10 |
11 | ## Methods
12 |
13 | ### JsonElement merge(Record record, JsonElement remoteValue, int remoteVersion) throws RecordMergeStrategyException
14 |
15 |
16 | ```
17 | {{#table mode="java-api"}}
18 | -
19 | arg: record
20 | typ: Record
21 | des: Used to retrieve the local version via record.version() and data via record.get()
22 | -
23 | arg: remoteValue
24 | typ: int
25 | des: The remote value on the platform
26 | -
27 | arg: remoteVersion
28 | typ: int
29 | des: The remote version on the platform, used to find out if the remote is ahead of the local
30 | {{/table}}
31 | ```
32 |
33 | Whenever a version conflict occurs the MergeStrategy set via Record.setMergeStrategy(strategy) will be called to merge the data and send the data back to the platform.
34 |
35 | This is mainly used for scenarios such as when working on very collaborative records where messages cross on the wire, or for connection drops where the client still updates records in an offline mode.
36 |
37 | Throw an error if the merge fails, but keep in mind that this only means it will postpone the merge conflict until the next remote/local update.
--------------------------------------------------------------------------------
/content/docs/50-client-java-v2/RecordPathChangedCallback/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Interface RecordPathChangedCallback
3 | description: A listener that's notified whenever the value of a path within a record changes
4 | category: interface
5 | navLabel: RecordPathChangedCallback
6 | body_class: dark
7 | ---
8 |
9 | Record data changed listener, used to be notified whenever the record data under a path has been modified either locally or remotely.
10 |
11 | ## Methods
12 |
13 | ### void onRecordPathChanged(String recordName, String path, JsonElement data)
14 |
15 |
16 | ```
17 | {{#table mode="java-api"}}
18 | -
19 | arg: recordName
20 | typ: String
21 | des: The name of the record that changed
22 | -
23 | arg: path
24 | typ: String
25 | des: The path that data changed within
26 | -
27 | arg: data
28 | typ: JsonElement
29 | des: The data under the path as an Object
30 | {{/table}}
31 | ```
32 |
33 | Called when the listener is added via Record.subscribe(path,callback,triggerNow)
34 |
35 | Will contain the data under the path, regardless of whether triggered by a Patch or Update
--------------------------------------------------------------------------------
/content/docs/50-client-java-v2/RecordSetResult/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Class RecordSetResult
3 | description: A class representing the outcome of a Record write
4 | category: class
5 | navLabel: RecordSetResult
6 | body_class: dark
7 | ---
8 |
9 | RecordSetResult provides access to the success or failure of a record write called via record.setWithAck(data) or record.setWithAck(path,data).
10 |
11 | ## Methods
12 |
13 | ### String getResult()
14 |
15 | An error string if there were any problems writing to the record or null.
16 |
--------------------------------------------------------------------------------
/content/docs/50-client-java-v2/RpcRequestedListener/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Interface RpcRequestedListener
3 | description: A listener that's notified with the response to a Remote Procedure Call
4 | category: interface
5 | navLabel: RpcRequestedListener
6 | body_class: dark
7 | ---
8 |
9 | Listener for any rpc requests recieved from the server
10 |
11 | ## Methods
12 |
13 | ### void onRPCRequested(String rpcName, Object data, RpcResponse response)
14 |
15 | ```
16 | {{#table mode="java-api"}}
17 | -
18 | arg: rpcName
19 | typ: String
20 | des: The name of the rpc being requested
21 | -
22 | arg: data
23 | typ: Object
24 | des: The data the request was made with-
25 | -
26 | arg: response
27 | typ: RpcResponse
28 | des: The RpcResponse to respond to the request with
29 | {{/table}}
30 | ```
31 |
32 | This listener will be invoked whenever the client recieves an rpc request from the server, and will be able to respond via RpcResponse.send(data) or RpcResponse.reject()
--------------------------------------------------------------------------------
/content/docs/50-client-java-v2/RpcResponse/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Class RpcResponse
3 | description: A class representing the response to a Remote Procedure Call
4 | category: class
5 | navLabel: RpcResponse
6 | body_class: dark
7 | ---
8 |
9 | This object provides a number of methods that allow a RPC-provider to respond to a request
10 |
11 | ## Methods
12 |
13 | ### void ack()
14 |
15 | Acknowledges the receipt of the request. This will happen implicitly unless the request callback explicitly sets autoAck to false
16 |
17 | ### void reject()
18 |
19 | Reject the request. This might be necessary if the client is already processing a large number of requests. If deepstream receives a rejection message it will try to route the request to another provider - or return a NO_RPC_PROVIDER error if there are no providers left
20 |
21 | ### void send(Object data)
22 |
23 |
24 | ```
25 | {{#table mode="java-api"}}
26 | -
27 | arg: data
28 | typ: Objet
29 | des: The response data. Has to be JsonSerializable
30 | {{/table}}
31 | ```
32 | Completes the request by sending the response data to the server. If data is an array or object it will automatically be serialised.
33 | If autoAck is disabled and the response is sent before the ack message the request will still be completed and the ack message ignored
34 |
35 |
36 | ### void error(String errorMessage)
37 |
38 |
39 | ```
40 | {{#table mode="java-api"}}
41 | -
42 | arg: errorMsg
43 | typ: String
44 | des: The message used to describe the error that occured
45 | {{/table}}
46 | ```
47 |
48 | Notifies deepstream that an error has occured while trying to process the request. This will complete the rpc.
--------------------------------------------------------------------------------
/content/docs/50-client-java-v2/RpcResult/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Class RpcResult
3 | description: A class representing the outcome of an Remote Procedure Call
4 | category: class
5 | navLabel: RpcResult
6 | body_class: dark
7 | ---
8 |
9 | RpcResult provides access to the response state of a rpc request called via RpcHandler.make(name,data)
10 |
11 | ## Methods
12 |
13 | ### boolean success()
14 |
15 | Whether or not the RPC completed successfully
16 |
17 | ### Object getData()
18 |
19 | The data returned by the RPC. If success() is true the resulting data from your rpc, if false data associated with why it failed.
20 |
--------------------------------------------------------------------------------
/content/docs/50-client-java-v2/SnapshotResult/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Class SnapshotResult
3 | description: A class representing the outcome of a Snapshot
4 | ---
5 |
6 | SnapshotResult provides access to the data of a record or any errors while retrieving it via client.record.snapshot(name) .
7 |
8 | ## Methods
9 |
10 | ### JsonElement getData()
11 |
12 | Returns the record data.
13 |
14 | ### DeepstreamError getData()
15 |
16 | Returns any errors while retrieving the record data.
17 |
18 | ### boolean hasError()
19 |
20 | Returns a boolean indicating whether or not there was an error retrieving the record data.
21 |
--------------------------------------------------------------------------------
/content/guides/live-progress-bar/00-intro/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Live Progress Bar
3 | description: Learn how to create a Live Progress Bar using deepstream
4 | tags: [realtime]
5 | redirectFrom: [/guides/live-progress-bar/]
6 | ---
7 |
8 | Users are impatient. Therefore, if you are going to keep them waiting, they deserve to know why and how long they will wait. It's not just in browsers; a lady in a waiting room would have some sense of feedback if she is given a tag and time slot, instead of leaving her there and just asking her to WAIT.
9 |
10 | Spinners provide poor feedback for very long request-response activity. Indefinite progress bars are even worse. What you can do is provide a live progress bar that shows the current status. A situation where you:
11 |
12 | - Receive a file
13 | - Process the file
14 | - Upload the file
15 | - Save the file name to a database
16 | - Respond with the file information saved
17 |
18 | You will definitely need to let the user know what is happening behind the scenes so as to give them a good reason to wait. We will not do all that in our example, rather, we will simulate the time it takes to do each of them using `setTimeout`.
19 |
20 | In each of the async functions, you can send realtime updates to the client informing her about what's ongoing on the server and why she is yet to receive a response.
21 |
--------------------------------------------------------------------------------
/content/guides/live-progress-bar/10-prerequistes/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Prerequisite
3 | description: "Step one: What you need to know before starting this guide"
4 | ---
5 |
6 | We will provide two simple files, one server side for the progress bar and another
7 | for the front-end visualization
8 |
9 | ## Server
10 |
11 | Create an `index.js` in the root of an empty project folder with:
12 |
13 | ```javascript
14 | // ./index.js
15 | const Express = require('express');
16 | const bodyParser = require('body-parser');
17 | const app = Express();
18 |
19 | app.use(bodyParser.urlencoded({ extended: false }))
20 | app.use(bodyParser.json())
21 |
22 | app.get('/', (req, res) => {
23 | res.json({text: 'hi'})
24 | })
25 |
26 | app.listen(9090)
27 | ```
28 |
29 | Visit the URL localhost:9090 and expect the following response body:
30 |
31 | ```javascript
32 | {text: 'hi'}
33 | ```
34 |
35 | ## Visual Progress Bar
36 |
37 | In the spirit of vanilla JS, we will be putting everything in the same (tiny) HTML file
38 |
39 | `embed:guides/live-progress-bar/skeleton.html`
--------------------------------------------------------------------------------
/content/guides/live-progress-bar/20-setting-up-the-backend/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Setting up the backend
3 | description: "Step two: Starting the backend service"
4 | ---
5 |
6 | `markdown:deepstream-backend-guide.md`
7 |
--------------------------------------------------------------------------------
/content/guides/live-progress-bar/40-visualizing-in-the-frontend/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Visualizing in the frontend
3 | description: "Step three: Visualizing in the frontend"
4 | ---
5 |
6 | All that's left is for us to subscribe to the event and update the progress bar state whenever an event comes through.
7 |
8 | In the skeleton app we have a function called `updateProgressBar` which takes a the percentage and associated message and sets it on the progress bar.
9 |
10 | All we need to do to hook up events is subscribe to the unique event when making the request
11 |
12 | ```javascript
13 | try {
14 | // subscribe to changes
15 | client.event.subscribe(`progress:${id}`, updateProgressBar)
16 | // make the actual post request
17 | const data = await postData('http://localhost:9090/post', { id })
18 | } catch (e) {
19 | // error happened getting data
20 | } finally {
21 | // unsubscribe to changes, whether it failed or succeeded
22 | client.event.unsubscribe(`progress:${id}`, updateProgressBar)
23 | }
24 | ```
25 |
26 | And that's it, you should now have progress events working!
--------------------------------------------------------------------------------
/content/guides/live-progress-bar/50-permissions/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Permissions
3 | description: "Step three: Restricting who can emit events"
4 | ---
5 |
6 | Since the application logic is quite tiny, all we need to do here is limit only the backend servers to emit events.
7 |
8 | ```yaml
9 | event:
10 | '*':
11 | subscribe: "true"
12 | emit: "server.data.role === 'admin'"
13 | ```
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/content/guides/live-progress-bar/90-conclusion/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Summary and extra tasks
3 | description: "Step seven: Conclusion"
4 | ---
5 |
6 | So what we learnt in this tutorial was:
7 |
8 | - Setting up deepstream with [HTTP authentication](/tutorials/core/auth/http-webhook/)
9 | - Subscribing and emitting [events](/tutorials/core/pubsub/) to display the progress status
10 | - Applying some really [basic permissions](/tutorials/core/permission/valve-simple/) to stop front endusers from posting events
11 |
12 | ### Full application code
13 |
14 | #### FrontEnd
15 |
16 | `embed:guides/live-progress-bar/app.html`
17 |
18 | #### Backend
19 |
20 | `embed:guides/live-progress-bar/server.js`
--------------------------------------------------------------------------------
/content/guides/live-progress-bar/progress-bar.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:dc7ad91e29185b07f78532dbdcef48a98ab170470673f62f3d836fce09f5df6b
3 | size 13737
4 |
--------------------------------------------------------------------------------
/content/guides/post-it-board/00-intro/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Collaborative Post-It Board
3 | description: Creating a Retrospective Board with deepstream
4 | tags: [Javascript, lists, records]
5 | redirectFrom: [/guides/post-it-board/]
6 | ---
7 |
8 | With more and more teams working remotely, tools have sprung up everywhere, shifting online processes. The fun part behind retrospective planning poker and other methods was always the interactivity, seeing cards move around and identifying barely readable scribbles.
9 | As such, let’s take a look at how we can use data-sync to create a real-time retrospective board. It will look something like this:
10 |
11 | 
12 |
13 | In the spirit of agile approaches, let’s start by breaking down our requirements. Our retrospective board needs to allow us to:
14 |
15 | - Add, edit and move cards
16 |
17 | - Allow everyone with access to the board to see live updates
18 |
19 | In case you decide to make the application public, let’s throw in a few security requirements:
20 |
21 | - Only let people access the board with a username and password
22 |
23 | - Only let cards be edited by their creator
--------------------------------------------------------------------------------
/content/guides/post-it-board/10-prerequisites/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Prerequisite
3 | description: "Step one: What you need to know before starting this guide"
4 | ---
5 |
6 | In order to build this application we are going to go as bare bone minimum as possible. What this means is we just be be using deepstream and a small library called interactjs for dragging things around.
7 |
8 | To achieve this we need a really basic HTML page that:
9 |
10 | - includes both interactjs and deepstream from CDNs
11 | - has a login-form
12 | - has a board
13 | - has three post-its (sad, happy, mad)
14 |
15 | `embed:guides/post-it-board/skeleton.html`
--------------------------------------------------------------------------------
/content/guides/post-it-board/15-setting-up-the-backend/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Setting up the postit backend
3 | description: "Step two: Starting the postit services"
4 | ---
5 |
6 | `markdown:deepstream-backend-guide.md`
7 |
8 | `markdown:guide-install-mongo.md`
--------------------------------------------------------------------------------
/content/guides/post-it-board/50-permissions/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Permissioning it all
3 | description: "Step six: Adding some permissions"
4 | ---
5 |
6 | So our app is now up and running, but before you can go and deploy this for the world you probably want to first add some permissions to stop people directly manipulating your data in an invalid way.
7 |
8 | The permissions we want to add are:
9 |
10 | - Only allow users to edit their own postits
11 | - Only allow users to add postits
12 | - Only allow an admin user to delete postits
13 |
14 | In order to this we will be using a powerful permission language called Valve. This allows us to create rules that can validate every message that comes from a client before it effects any state at all on the server.
15 |
16 | In order to permission the data we'll need to have access to the users id and role. The will be required in order to solve our applications requirements. In order to do
17 |
18 | ### Only allow users to edit their own postits
19 |
20 | Comparing the users id with an id in the payload or the actual record name is the perfect way to guarantee only the specific user can edit their own postit
21 |
22 | You can access the id on a user simply by referencing the `user.id` property. The userid here is the one that is returned by the storage adaptor we setup earlier
23 |
24 | ```yaml
25 | record:
26 | "postits/.*":
27 | write: "data.owner === user.id"
28 | ```
29 |
30 | Or if you you want to be a bit more specific, you could instead allow any user to move cards around but just not
31 | edit the content. This can be done by loading up the previous content up and doing a comparison.
32 |
33 | ```yaml
34 | record:
35 | "postits/.*":
36 | write: "data.owner === user.id || (_(name).content === data.content && _(name).owner === data.owner)"
37 | ```
38 |
39 | And that’s it. The users who can edit cards have to be the same as the cards’ creators.
40 |
--------------------------------------------------------------------------------
/content/guides/post-it-board/90-conclusion/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Summary and extra tasks
3 | description: "Step seven: Conclusion"
4 | ---
5 |
6 | So what we learnt in this tutorial was:
7 |
8 | - Setting up deepstream with [mongo storage adaptor](/tutorials/plugins/database/mongodb/)
9 | - Enabling auth using the [storage adaptor](/tutorials/core/auth/storage/)
10 | - Creating a [record](/tutorials/core/datasync/records/) to represent each postit, subscribing and updating its content
11 | - Creating a [list](/tutorials/core/datasync/lists/) to represent the board
12 | - Applying some really [basic permissions](/tutorials/core/permission/valve-simple/) to stop users for editing postits that isn't theirs
13 |
14 | ### Full application code
15 |
16 | `embed:guides/post-it-board/app.html`
--------------------------------------------------------------------------------
/content/guides/post-it-board/board.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:42f08fa229da2937179708f986e1c9b7747b5251a15ce8cb3c0a6914cf81c78b
3 | size 272724
4 |
--------------------------------------------------------------------------------
/content/guides/realtime-search/00-intro/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Announcing new Realtime Search!
3 | description: Learn how to use realtime-search with deepstream
4 | tags: [realtime]
5 | redirectFrom: [/guides/realtime-search/]
6 | ---
7 |
--------------------------------------------------------------------------------
/content/guides/realtime-search/10-prerequisites/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Prerequisite
3 | description: What you need to know before starting this guide
4 | ---
5 |
6 | In order to go through this guide you'll need:
7 |
8 | - docker-compose [installed](https://docs.docker.com/compose/install/)
9 |
10 | - the following script to run in a browser
11 |
12 | `embed:server/realtime-search/example/realtime-search-skeleton.html`
13 |
--------------------------------------------------------------------------------
/content/guides/realtime-search/25-logging-in/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Logging in
3 | description: Logging into deepstream
4 | ---
5 |
6 | To keep this guide as lightweight as possible, we will be logging in using [anonymous authentication](/tutorials/core/auth/none/) for the front-end users, and [file auth](/tutorials/core/auth/file/) for the backend.
7 |
8 | By just settings a DEEPSTREAM_PASSWORD environment variable on the realtime_search provider it will automatically try and login using the `{ username: 'realtime_search', password: process.env.DEEPSTREAM_PASSWORD }`. The least hassle way of getting deepstream to acknowledge the user and provide it some meta data for permissions in the future is to add file auth as one of our authentication types, followed by open auth for all
9 | anonymous users
10 |
11 | ```yaml
12 | # Authentication
13 | auth:
14 | - type: file
15 | options:
16 | # Path to the user file. Can be json, js or yml
17 | users: fileLoad(users.yml)
18 |
19 | - type: none
20 | ```
21 |
22 | Configuring the details on the server is also pretty easy, we just need a `users.yml` file with username, password and isRealtimeSearch meta data. The environment variable automatically gets substituted one file load.
23 |
24 | `embed:server/realtime-search/example/conf/users.yml`
25 |
26 | So in order to login to deepstream all we need to add is the following after the deepstream constructor:
27 |
28 | ```javascript
29 | const client = new DeepstreamClient('localhost:6020')
30 | await client.login()
31 | ```
32 |
33 | That was quick wasn't it! You can checkout the other guides and tutorials on authentication if you want more challenging.
--------------------------------------------------------------------------------
/content/guides/realtime-search/50-permissions/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Permissions
3 | description: "Step three: Restricting who can emit events"
4 | ---
5 |
6 | When using realtime-search we have two different aspects to permission. As a general rule of thumb, lock down your permissions by default and only open up topics instead of vice versa.
7 |
8 | - the rpc
9 |
10 | This is the most important part, which gives the you the ability to stop the RPC from ever
11 | making it to to the realtime-provider. You also want to make sure only the realtime_search
12 | can provide the actual rpc hook so another client doesn't register it!
13 |
14 | - the record
15 |
16 | You want to make sure only the backend can update the list and meta objects, as again a front-end
17 | client should not be able to do so.
18 |
19 | ### The permissions
20 |
21 | `embed:server/realtime-search/example/conf/permissions.yml`
22 |
23 |
24 |
--------------------------------------------------------------------------------
/content/guides/realtime-search/60-conclusion/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Summary and extra tasks
3 | description: "Step seven: Conclusion"
4 | ---
5 |
6 | So what we learnt in this tutorial was:
7 |
8 | - Running the "MDR" stack (Mongo, Deepstream and Realtime-Search)
9 | - Authentication your realtime_search
10 | - Using realtime_search
11 | - Permission everything correctly
12 |
13 | ### Full application code
14 |
15 | #### FrontEnd
16 |
17 | `embed:server/realtime-search/example/realtime-search-browser.html`
18 |
19 | #### Backend
20 |
21 | There is none! 😅
--------------------------------------------------------------------------------
/content/info/community/cla/cla.html:
--------------------------------------------------------------------------------
1 | ---
2 | title: Contributor License Agreement
3 | description: The Contributor License Agreement
4 | ---
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/content/info/community/get-in-touch/community.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:c4b3ae343de46cc2e3b17eb5b1bbc0d559947b7d68a7d79c93141db7a042f55e
3 | size 275072
4 |
--------------------------------------------------------------------------------
/content/info/community/get-in-touch/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Getting in touch
3 | description: Find out how to get in touch with other deepstream aficionados
4 | ---
5 |
6 | Need help with a deepstream.io problem, found an issue or want to become a contributer? Join our lovely and helpful community:
7 |
8 | 
9 |
10 | ## Join us on Slack
11 | There should always be someone around on the [deepstream.io slack channel](https://deepstreamio-slack.herokuapp.com/)
12 |
13 | ## Drop by our Github
14 | We use [Github](https://github.com/deepstreamIO) as the home for all of our open source code, issues and discussions. You should come by some time.
15 |
16 | ## Raise a question via Stack Overflow
17 | * Ask a question tagged with `deepstream.io` on [stack overflow](http://stackoverflow.com/questions/tagged/deepstream.io)
18 |
--------------------------------------------------------------------------------
/content/info/performance/four-billion-messages-per-hour/cluster.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:34356a165773b2d248a1c8d9941a4aa71b6745441b20169714a08f0436ed709e
3 | size 76518
4 |
--------------------------------------------------------------------------------
/content/info/performance/four-billion-messages-per-hour/consoles.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:f42ab23712486c19af40899772adccc7597d8625065a4793bea2cbfa938c7f3f
3 | size 365339
4 |
--------------------------------------------------------------------------------
/content/info/performance/four-billion-messages-per-hour/cpu-cluster.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:f6c97ee2162a4bc1d5651d510f0d36e20813e351743ac29a40a152f19ef3ce2e
3 | size 133460
4 |
--------------------------------------------------------------------------------
/content/info/performance/four-billion-messages-per-hour/cpu-single-node.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:7883bcb4dc1a87c52791f8c08220b0903fc696d7bfa04992a6daaba031966295
3 | size 34494
4 |
--------------------------------------------------------------------------------
/content/info/performance/four-billion-messages-per-hour/dashboard.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:63c8f46e0aeb76307e9d5a4be256323de67fbee018801ff73d2320b494d41016
3 | size 121364
4 |
--------------------------------------------------------------------------------
/content/info/performance/four-billion-messages-per-hour/memory-cluster.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:5a77a631cfadfd21bacb01e4c4b79f0b26afedb98f43e23c523af9991153c4b8
3 | size 37282
4 |
--------------------------------------------------------------------------------
/content/info/performance/four-billion-messages-per-hour/memory-single-node.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:7d1a63747cba1d1d1011ce6e117a6334da0f1b8ad016ebc46714e544ad77a4e7
3 | size 18139
4 |
--------------------------------------------------------------------------------
/content/info/performance/four-billion-messages-per-hour/single-node.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:24ad30d6f0ff31273912ab5a66272760eacd64787338a7dca653e86aaaec8e20
3 | size 22104
4 |
--------------------------------------------------------------------------------
/content/info/performance/single-node-vs-cluster/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Latency tests
3 | description: A suite of tests to determine message latency under load
4 | ---
5 |
6 | ### Test Setup
7 | All tests were run on Amazon Web Services EC2 instances within the same region, running AWS Linux. For the cluster tests, Redis was used as a message bus.
8 |
9 | ||Single Node|Cluster||
10 | |---|---|---|---|
11 | |machine for deepstream servers|1 EC2 c4.large|1 EC2 c4.2xlarge|
12 | |deepstream servers|1|3|
13 | |client pairs|250|750|
14 | |ec2 t2.micro instances clients were distributed across|2|6|
15 | |message frequency per client|~25ms|~25ms|
16 | |duration of full load|~3 min|~12 min|
17 | |messages per second|~10,000|~30,000|
18 |
19 | ## Single deepstream Node
20 |
21 | #### Latency Distribution
22 | Average latency was 2.065ms ( machines being within same data centre )
23 |
24 | 
25 |
26 | Average latency was 0.999ms ( machines being within same data centre )
27 |
28 | 
29 |
--------------------------------------------------------------------------------
/content/info/performance/single-node-vs-cluster/one-ds-cpu.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:bca9667b13c569e689f6c3a767b9ca5d664f1e67edcefd00e07ec9c4aee32dfe
3 | size 19616
4 |
--------------------------------------------------------------------------------
/content/info/performance/single-node-vs-cluster/one-ds-latency.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:515765642ea281a6e1842ce5839a90ea3894a6555a3eef6a514a56e6f55ee091
3 | size 10659
4 |
--------------------------------------------------------------------------------
/content/info/performance/single-node-vs-cluster/three-ds-cpu.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:a87c3f7b12e18b2493275c7c311bc8e2f8fa4207802f51ff9cd4f8197952522a
3 | size 21495
4 |
--------------------------------------------------------------------------------
/content/info/performance/single-node-vs-cluster/three-ds-latency.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:d802a5e107769f40ae91c1c92eb59e1c282e4fed6cdd8973cc4bb603d0bf49fc
3 | size 10681
4 |
--------------------------------------------------------------------------------
/content/tutorials/00-concepts/10-what-is-deepstream/what-is-deepstream-header.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:d90b0e8bf8be0a5576c00bfb0f619bca436ffcd652ed286c9f98d933ba0b2b82
3 | size 60451
4 |
--------------------------------------------------------------------------------
/content/tutorials/00-concepts/50-active-data-providers/active-data-providers.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:d08fb77006f2cb78ffd87be04e856028c59aab75deb6018d69a3ba69298397f2
3 | size 92889
4 |
--------------------------------------------------------------------------------
/content/tutorials/00-concepts/50-active-data-providers/data-providers.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:d099aca6e32151634cbf83d5ec585e8f9f707de42501a0f3bff3a83af92edb7c
3 | size 18085
4 |
--------------------------------------------------------------------------------
/content/tutorials/00-concepts/50-active-data-providers/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Active Data Providers
3 | description: How to boost your application performance by supplying data on demand
4 | ---
5 |
6 | What are Data Providers?
7 |
8 | Data Providers are processes that feed data into deepstream. Technically, they are just regular deepstream clients that usually run on the backend and write to records, send events or provide RPCs.
9 |
10 | #### Example
11 | Imagine you're building an application that shows stock prices from various exchanges from around the world. For each exchange, you'd build a process that receives data and forwards it to deepstream.
12 |
13 | 
14 |
15 | #### The Problem
16 | Nasdaq alone can send out tens of millions of price updates every day, and it's not much different for other stock exchanges. This can put an unsustainable load on your infrastructure and can lead to high bandwidth costs.
17 |
18 | Even worse: Most updates might be for stocks that no client is subscribed to and won't be forwarded at all.
19 |
20 | #### The Solution: Active Data Providers
21 | Only write to records / send events that clients are interested in. deepstream supports a feature called `listening` that lets clients listen for event or record subscriptions made by other clients. First, the listener registers for a pattern, e.g. `nasdaq/.*`. Then it will be notified once the subscription is removed via the `onStop` callback.
22 |
23 | ```javascript
24 | client.record.listen('nasdaq/.*', (match, response) => {
25 | // Start providing data
26 | response.accept()
27 |
28 | response.onStop(() => {
29 | // stop providing data
30 | })
31 | })
32 | ```
33 |
34 | This allows you to create efficient providers that only send out the data that's currently needed.
35 |
36 | 
--------------------------------------------------------------------------------
/content/tutorials/01-install/10-linux/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Installing on Linux
3 | description: Learn how to install deepstream on Linux
4 | redirectFrom: [/install/,/install/linux/,/tutorials/core/server/getting-started-config/]
5 | logoImage: linux.png
6 | ---
7 |
8 | Download the latest server artifact [deepstream.io-linux-VERSION.tar.gz](https://github.com/deepstreamIO/deepstream.io/releases) and unzip it.
9 |
10 | ## Starting deepstream
11 | You can start the server by simply running it on the command line
12 |
13 | ```bash
14 | ./deepstream
15 | ```
16 |
17 | Learn more about deepstream's [command line interface](/docs/server/command-line-interface/) and its [configuration file](/docs/server/configuration/).
18 |
19 | `markdown:starting-deepstream-hints.md`
20 |
21 | ## Install as a service
22 |
23 | As of 2.4, deepstream comes with ability to automatically setup and run as a service on machines supporting init.d or systemd.
24 |
25 | Installing the service is as simple as
26 |
27 | ```bash
28 | sudo deepstream service add
29 | ```
30 |
31 | Which then allows you to start it using the normal service command
32 |
33 | ```bash
34 | sudo service deepstream start
35 | ```
36 |
37 | or through an alias directly via deepstream
38 |
39 | ```bash
40 | sudo deepstream service start
41 | ```
42 |
43 | For those looking to register multiple services (to run multiple deepstreams on one machine) you can do so by specifying the name and providing unique config files
44 |
45 | ```bash
46 | sudo deepstream service add --service-name deepstream-6020 -c ~/path1/to/config
47 | sudo deepstream service add --service-name deepstream-6030 -c ~/path2/to/config
48 | ```
49 |
50 |
51 | ## Avoiding Sudo
52 |
53 | If you want to make sure the service configuration is set correctly, or if you feel uncomfortable running something under sudo, you can run `add` with the `--dry-run` option to print the service script out for inspection and manual installation.
54 |
55 | ```bash
56 | deepstream service add --dry-run
57 | ```
58 |
--------------------------------------------------------------------------------
/content/tutorials/01-install/20-osx/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Installing on OSX
3 | description: Find out how to get deepstream running on OSX
4 | logoImage: osx.png
5 | redirectFrom: [/install/osx/]
6 | ---
7 |
8 | Download the latest server artifact [deepstream.io-mac-VERSION.zip](https://github.com/deepstreamIO/deepstream.io/releases) and unzip it.
9 |
10 | ## Starting deepstream
11 | You can start the server via command line
12 |
13 | ```bash
14 | ./deepstream start
15 | ```
16 |
17 | Learn more about deepstream's [command line interface](/docs/server/command-line-interface/) and its [configuration file](/docs/server/configuration/).
18 |
19 | `markdown:starting-deepstream-hints.md`
20 |
21 | ## Homebrew
22 |
23 | [[info]]
24 | | Homebrew is not yet up to date with the V5 version. If you are able to help update it please reach out!
25 |
26 | 
27 |
--------------------------------------------------------------------------------
/content/tutorials/01-install/30-windows/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Installing on Windows
3 | description: Find out how to get deepstream running on Windows
4 | redirectFrom: [/install/windows/]
5 | logoImage: windows.png
6 | ---
7 |
8 | Download the latest server artifact [deepstream.io-windows-VERSION.zip](https://github.com/deepstreamIO/deepstream.io/releases) and unzip it.
9 |
10 | ## Starting deepstream
11 | You can start the server by _double clicking_ the executable file or via `CMD`
12 |
13 | ```bash
14 | deepstream.exe start
15 | ```
16 |
17 | 
18 |
19 | Learn more about deepstream's [command line interface](/docs/server/command-line-interface/) and its [configuration file](/docs/server/configuration/).
20 |
21 | `markdown:starting-deepstream-hints.md`
22 |
--------------------------------------------------------------------------------
/content/tutorials/01-install/40-nodejs/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Node / NPM / Yarn
3 | description: Installing deepstream via NPM and and Node.js
4 | redirectFrom: [/install/nodejs/]
5 | logoImage: nodejs.png
6 | ---
7 |
8 | 
9 |
10 | deepstream can also be installed as an [NPM package](https://www.npmjs.com/package/deepstream.io) and offers a Node.js API to interact with it programmatically.
11 |
12 | This can be useful to build custom authentication or permissioning logic. You can view the full Node.js API [here](/docs/server/node-api/).
13 |
14 | Install the server via npm
15 |
16 | ``` bash
17 | npm install @deepstream/server
18 | ```
19 |
20 | Create a js file, e.g. start.js with the following content
21 |
22 | ```javascript
23 | const { Deepstream } = require('@deepstream/server')
24 |
25 | /*
26 | The server can take
27 | 1) a configuration file path
28 | 2) null to explicitly use defaults to be overriden by server.set()
29 | 3) left empty to load the base configuration from the config file located within the conf directory.
30 | 4) pass some options, missing options will be merged from the base configuration.
31 | */
32 | const server = new Deepstream()
33 |
34 | // start the server
35 | server.start()
36 | ```
37 |
38 | run the file with node
39 | ```bash
40 | node start.js
41 | ```
42 |
43 | 
44 |
45 | #### Using the deepstream client in Node.js
46 | The deepstream javascript client can be installed via [NPM](https://www.npmjs.com/package/@deepstream/client) and used in Node.js.
47 |
48 | ```bash
49 | npm install @deepstream/client
50 | ```
51 |
52 | ```javascript
53 | const { DeepstreamClient } = require('@deepstream/client')
54 | const client = new DeepstreamClient('localhost:6020')
55 | client.login()
56 | ```
57 |
--------------------------------------------------------------------------------
/content/tutorials/01-install/40-nodejs/nodejs.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:ac89ed5b9aa0c415ca12c4f815a8b01a80397d46176c07a4c607b4cf5af99174
3 | size 9620
4 |
--------------------------------------------------------------------------------
/content/tutorials/01-install/50-docker/docker.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:1205ededea1817df87ef997df6c6e689db8baebb1bb126b5fcd21a79d0fbe9a2
3 | size 6607
4 |
--------------------------------------------------------------------------------
/content/tutorials/01-install/deepstream-v4.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:8d35e74adb71ce82d11f65c262b179dfa17e25f61b92f57c3dac58bfd47d8b26
3 | size 192695
4 |
--------------------------------------------------------------------------------
/content/tutorials/10-getting-started/20-javascript/getting-started.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deepstreamIO/deepstream.io-website/f449598a352617ecd29fded8fc8dbff853d15705/content/tutorials/10-getting-started/20-javascript/getting-started.gif
--------------------------------------------------------------------------------
/content/tutorials/20-core/20-auth/00-auth-introduction/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Auth Introduction
3 | description: Deepstream authentication mechanisms
4 | ---
5 |
6 | Deepstream comes with different authentication mechanisms that can integrate with different providers.
7 |
8 | The available authentication strategies are:
9 |
10 | - [Auth None](/tutorials/core/auth/none/)
11 | - [file-based authentication](/tutorials/core/auth/file/)
12 | - [storage-based authentication](/tutorials/core/auth/storage/)
13 | - [HTTP authentication](/tutorials/core/auth/http-webhook/)
14 | - [JWT authentication](/tutorials/core/auth/jwt-auth/)
15 |
16 |
17 | You can set one or multiple authentication types simultaneously and the incoming connection will be validated against each of them until one succeeds or all fail. You just need to make them available on the deepstream server config. Authentication strategies will be queried in the same order they are declared on the configuration file.
18 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/20-auth/10-none/ds-start-auth-none.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:2755cc175518177b80b462c7e3ab6ad0db55e066162edeb380ac477dfec3cf28
3 | size 84992
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/20-auth/10-none/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Auth None
3 | description: How to disable user authentication for simple applications and development
4 | ---
5 |
6 | To disable authentication against a deepstream server altogether, either set the `auth` type to `none` in the server's [configuration file](../../../docs/server/configuration/).
7 |
8 | ```yaml
9 | #Authentication
10 | auth:
11 | type: none
12 | ```
13 |
14 | Or use the `--disable-auth` command line argument.
15 |
16 | ```bash
17 | ./deepstream start --disable-auth
18 | ```
19 |
20 | The deepstream startup log should confirm that authentication is disabled.
21 |
22 | 
23 |
24 | **Please note** Even with authentication type `none`, users can still provide an (unverified) username by sending `{username: 'johndoe'}` at login.
25 |
26 | ```javascript
27 | client = new DeepstreamClient('localhost:6020')
28 | client.login({ username: 'johndoe' })
29 | ```
30 |
31 | If no username is provided, deepstream will default to `OPEN`.
32 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/20-auth/20-file/ds-auth-file-failure.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:38f5924f50aa9c8bc9a7c9b814039efe609b914d7069831127bd916991949cf4
3 | size 25012
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/20-auth/20-file/ds-auth-file-start.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:50752bd40dc54bb3c5d18160e84f26d8ddefe9a74e0bd38cf1502fca0b48478b
3 | size 40765
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/20-auth/20-file/ds-auth-file-success.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:2fb1d8fdc6d1f61e1345741053139931555ff4b3bca810fc22d9ed73f53ce5b7
3 | size 20608
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/20-auth/30-http-webhook/ds-auth-http-fail.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:29587255ea78c8cf863cbfa20b517dff63a7cf522f46057a92528cd80300789d
3 | size 157164
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/20-auth/30-http-webhook/ds-auth-http-start.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:7932f4cd78ffa2fec50608e74357ba920a997e77848fd4ff9c272f18bd5194af
3 | size 119079
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/20-auth/30-http-webhook/ds-auth-http-success.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:9395f9e568e0231fe711ace20506e664e61d23f41865cef02172e6aa85c4d7b5
3 | size 140571
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/20-auth/30-http-webhook/webhook-flow.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:5756e3ed7f63ae96708abb062b9d9b4fbbd272c10a2d1e679a989672ed6a3339
3 | size 13848
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/20-auth/40-jwt-auth/browser-cookie.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:372e30095169ffeab8a41514eb025eebd449640c4c04cd586e61377e3d62b316
3 | size 35517
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/20-auth/40-jwt-auth/deepstream-jwt-auth-flow-simple.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:5b81f60f43e27904146be16de1daf2af3123642cea5f8ada65e2626c2e1b77bc
3 | size 9169
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/20-auth/40-jwt-auth/deepstream-jwt-auth-flow.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:3ea162a3d037d0814de064cfc4033a39a0900accd1185ed0e6303a8be8bac3e8
3 | size 13357
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/20-auth/40-jwt-auth/login-log.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:ecc2776158d5791f07f2851eae4cf84587140244d05c856e870c1bf5f9b12928
3 | size 442146
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/30-permission/40-valve-dynamic/admin.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:e6c43499d325ab40cb49387b96b86da2d39ea082f26ba75c01c7736ba8e0c3bf
3 | size 34792
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/30-permission/40-valve-dynamic/deepstream-dynamic-permissions.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deepstreamIO/deepstream.io-website/f449598a352617ecd29fded8fc8dbff853d15705/content/tutorials/20-core/30-permission/40-valve-dynamic/deepstream-dynamic-permissions.gif
--------------------------------------------------------------------------------
/content/tutorials/20-core/30-permission/40-valve-dynamic/login.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:d19643442b44d5a9837b7042eeb9ced0e739da7567679c5796146b876c70957f
3 | size 14504
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/30-permission/40-valve-dynamic/user.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:4c10bcd3d5ec9336eb1842035487756e36e21ab6806c9275eb4d61a3449f29ac
3 | size 16420
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/30-permission/50-user-specific-data/login-form.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:69bc0c169567b2e3ff49221d07a2e78f63fbeeafe0e003b79041e865238037ce
3 | size 2926
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/30-permission/50-user-specific-data/rpc-diagram.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:bf31226fc03704cd46c3061d7cb7a2e58db19d9dc7ed7dd6d647d940f7508793
3 | size 7353
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/40-pubsub/pubsub-diagram.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:47ff2f84e84b1ce8398d6656ee61e2189a77707194d105f225c706fbd75d36b3
3 | size 13493
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/50-request-response/rpc-rerouting.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:fd16ed7e5ff177def255e657ce42e00bdb6624c61143f20ac3a72af7b4468ef9
3 | size 19598
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/70-datasync/20-anonymous-records/laptop-dock.jpg:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:4a115a845810995c5dc04d04db49e801a8af780e1219e9a2eaf971ce0f50e945
3 | size 34415
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/70-datasync/20-anonymous-records/simple-app-anim.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deepstreamIO/deepstream.io-website/f449598a352617ecd29fded8fc8dbff853d15705/content/tutorials/20-core/70-datasync/20-anonymous-records/simple-app-anim.gif
--------------------------------------------------------------------------------
/content/tutorials/20-core/70-datasync/20-anonymous-records/simple-app-structure.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:82bd1e7748f6980728c20b70f6d85dcd427390779cddaef59a04215a83c96d34
3 | size 31988
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/70-datasync/30-lists/simple-app-structure.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:82bd1e7748f6980728c20b70f6d85dcd427390779cddaef59a04215a83c96d34
3 | size 31988
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/70-datasync/30-lists/todolist-list.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:844e97cad0d70b345b111a5b36438398628905a531ff3d616c295d5a954511ea
3 | size 78585
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/70-datasync/30-lists/todolist-record.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:90022b70624e7ac1fec791b1196dd91241d4a5c0a35b77f2f8a804c152b71b28
3 | size 82583
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/70-datasync/30-lists/tree-structure.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:57b9050fd261aa1f8047a8e67db87740a3c8a51df97c7b6d11d11bd7e90bbf87
3 | size 23888
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/70-datasync/60-storing-data/console-output-elasticsearch-install.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:2844894d2bd02cf9d541be2a0148c587f719f84f2d40d5c0595d3021b31cc575
3 | size 9275
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/80-listening/listening-for-load-balancing.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:0f4bc199858694ef743926ca4da7a39ffb7bdbb313d9393263b99d4874ea47d3
3 | size 60641
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/80-listening/listening.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:b9225c707bab5d5ac012d0d9076c6bb1d352d8135de5c5e69e6236d172eb670d
3 | size 178031
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/80-listening/pubsub-with-listening-workflow.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:5f02cd66e1572d4ce229d707785abae002d02b65fd159700b7732785d1bbe7f4
3 | size 73388
4 |
--------------------------------------------------------------------------------
/content/tutorials/20-core/80-listening/usual-pubsub-workflow.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:9f0dd8e8ea9cb84dcbf7271861b09c1ae7c0e42f772e76b7a3b892a117582ae8
3 | size 78502
4 |
--------------------------------------------------------------------------------
/content/tutorials/50-integrations/10-frontend/10-react/basic-react-input.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deepstreamIO/deepstream.io-website/f449598a352617ecd29fded8fc8dbff853d15705/content/tutorials/50-integrations/10-frontend/10-react/basic-react-input.gif
--------------------------------------------------------------------------------
/content/tutorials/50-integrations/10-frontend/10-react/complex-react-example.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deepstreamIO/deepstream.io-website/f449598a352617ecd29fded8fc8dbff853d15705/content/tutorials/50-integrations/10-frontend/10-react/complex-react-example.gif
--------------------------------------------------------------------------------
/content/tutorials/50-integrations/10-frontend/10-react/deepstream-react.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:b775d87636c1e0ed91e024957bbda0f87976a71ef3895978a527acd10159f0f3
3 | size 23580
4 |
--------------------------------------------------------------------------------
/content/tutorials/50-integrations/10-frontend/10-react/simple-app.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:f9e462d1596893f1f685ce3e6fab705c8794240e8e4f515d8154ef4198a79c14
3 | size 19943
4 |
--------------------------------------------------------------------------------
/content/tutorials/50-integrations/10-frontend/30-angular/final-app.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deepstreamIO/deepstream.io-website/f449598a352617ecd29fded8fc8dbff853d15705/content/tutorials/50-integrations/10-frontend/30-angular/final-app.gif
--------------------------------------------------------------------------------
/content/tutorials/50-integrations/10-frontend/30-angular/first-run.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:ba2acfb9d4a2014114e44f58e0e3942282b32705c5f4de3ade13f7f437a71a5e
3 | size 131918
4 |
--------------------------------------------------------------------------------
/content/tutorials/50-integrations/10-frontend/40-knockout/simple-app.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:f9e462d1596893f1f685ce3e6fab705c8794240e8e4f515d8154ef4198a79c14
3 | size 19943
4 |
--------------------------------------------------------------------------------
/content/tutorials/50-integrations/20-mobile/10-reactnative/deepstream-react-native.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deepstreamIO/deepstream.io-website/f449598a352617ecd29fded8fc8dbff853d15705/content/tutorials/50-integrations/20-mobile/10-reactnative/deepstream-react-native.gif
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/10-logger/winston/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Winston Logger
3 | description: Learn how to use Winston with deepstream
4 | logoImage: winston.png
5 | draft: true
6 | ---
7 |
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/20-cache/aerospike/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Aerospike Cache Connector
3 | description: Learn how to use Hazelcast with deepstream
4 | logoImage: aerospike.png
5 | draft: true
6 | ---
7 |
8 | Aerospike
9 |
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/20-cache/hazelcast/console-output.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:8c203a49b63b69c19abc695c104b91dd6c80b9364457050689c44233f1970029
3 | size 7518
4 |
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/20-cache/hazelcast/hazelcast-diagram.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:44a4f820697a5414e0c98789acf4b2ea86481bc8aaef2328355194cfc75f6284
3 | size 9159
4 |
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/20-cache/hazelcast/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Hazelcast Cache Connector
3 | description: Learn how to use Hazelcast with deepstream
4 | logoImage: hazelcast.png
5 | ---
6 |
7 | *** Hazelcast not upgraded to V4/V5. Please refer to [this github issue](https://github.com/deepstreamIO/deepstream.io/issues/972) if you require this ***
8 |
9 | #### What is Hazelcast?
10 | Hazelcast is a distributed caching layer, organized as a grid of independent nodes that sync their state. On top of that, Hazelcast allows to perform computations based on the stored data and even supports basic server side messaging.
11 |
12 | #### Why use Hazelcast with deepstream?
13 | Hazelcast can be a good choice as a fast and scalable caching layer for deepstream. It can outperform other caches like Redis in cluster-mode, but is a bit trickier to set up.
14 | Where Hazelcast really comes into its own is the additional Map-Reduce functionality built on top of its caching capabilities. This makes it possible to perform simple, distributed computations based on record data and feed the results back to deepstream.
15 |
16 | 
17 |
18 | #### Using Hazelcast with deepstream
19 | deepstream comes with a cache connector for Hazelcast preinstalled
20 |
21 | 
22 |
23 | or, if you're using deepstream in Node, [get it from NPM](https://www.npmjs.com/package/@deepstream/cache-hazelcast)
24 |
25 | #### Configuring the Hazelcast connector
26 |
27 | You can configure the Hazelcast cache connector in the plugins section of deepstream's config.yml file. Please find a full list of configuration options [here](http://hazelcast.github.io/hazelcast-nodejs-client/api/0.3/docs/modules/_config_.html)
28 | ```yaml
29 | plugins:
30 | cache:
31 | name: hazelcast
32 | options:
33 | networkConfig:
34 | addresses:
35 | - host: hostname
36 | port: 1234
37 |
38 | ```
39 |
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/20-cache/memcached/console-output.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:b6e3fb89c0d5f132f4fd19751d1d077147f950183fa13901d2541ca84be9bf13
3 | size 6297
4 |
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/20-cache/memcached/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Memcached Cache Connector
3 | description: Learn how to use Memcached with deepstream
4 | logoImage: memcached.png
5 | ---
6 |
7 | *** Memcached not upgraded to V4/V5. Please [refer to this github issue](https://github.com/deepstreamIO/deepstream.io/issues/973) if you require this ***
8 |
9 | #### What is Memcached?
10 | [Memcached](https://memcached.org/) is a distributed caching system. All its data is purely kept in memory which means two things:
11 |
12 | - its very fast
13 | - everything is gone if you pull the plug.That's not necessarily a bad thing, but it means you need some sort of persistent database layer as well if you choose to go with Memcached.
14 |
15 | #### Why use Memcached with deepstream?
16 | For two reasons: Speed and scale. Memcached can power large clusters and writes and reads data very quickly. The memcached protocol has also seen some wider adoption, e.g. by [Hazelcast](../hazelcast/), so if you do decide to change caches at some point, migration might be quite easy.
17 |
18 | #### I want to use AWS Elasticache with deepstream. Should I choose Memcached or Redis as a caching-engine?
19 | Redis! Memcached is a great cache, but Redis also saves data to disk and can act as a message-bus for smaller deepstream clusters, giving you all the functionality you need.
20 |
21 | #### How to use Memcached with deepstream?
22 | deepstream comes preinstalled with an official connector for Memcached.
23 |
24 | If you are using deepstream from Node, you can also install it via [NPM](https://www.npmjs.com/package/@deepstream/cache-memcached)
25 |
26 | #### Configuring the Memcached connector
27 | You can configure memcached in the plugin section of deepstream's config.yml file
28 |
29 | ```yaml
30 | plugins:
31 | cache:
32 | name: memcached
33 | options:
34 | serverLocation: [ 'localhost:11211' ] # One or more endpoint URLs
35 | ```
36 |
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/20-cache/redis/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Redis Cache Connector
3 | description: Learn how to use Redis with deepstream for cache
4 | logoImage: redis.png
5 | ---
6 |
7 | `markdown:redis-description.md`
8 |
9 | #### How to use Redis as a cache with deepstream?
10 |
11 | It comes preinstalled with the binary or if you're using deepstream in Node.js via [NPM](https://www.npmjs.com/package/@deepstream/cache-redis)
12 |
13 | And can be enabled in your config file as follows:
14 |
15 | ```yaml
16 | cache:
17 | name: redis
18 | options:
19 | host: localhost
20 | port: 6379
21 | ```
22 |
23 | Both connectors work with Redis clusters as well. Just adjust your options as follows:
24 |
25 | ```yaml
26 | cache:
27 | name: redis
28 | options:
29 | nodes:
30 | - host:
31 | port:
32 | password:
33 | - host:
34 | port:
35 | maxRedirections: 16
36 | redisOptions:
37 | password: 'fallback-password'
38 | ```
39 |
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/20-cache/redis/redis.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:cbd4a610175fdfe003318e6839c35a767c2245d9c318ea2743ee5a8c0b0d0263
3 | size 16744
4 |
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/30-database/couchdb/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Memcached DataBase Connector
3 | description: Learn how to use Memcached with deepstream
4 | logoImage: couchdb.png
5 | draft: true
6 | ---
7 |
8 | CouchDB
9 |
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/30-database/dynamodb/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: DynamoDB DataBase Connector
3 | description: Learn how to use DynamoDB with deepstream
4 | logoImage: dynamodb.png
5 | draft: true
6 | ---
7 |
8 | AWS DynamoDB
9 |
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/30-database/elasticsearch/deepstream-elasticsearch-provider-diagram.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:ab8426d4fb9e414ec03de738af47798d2fc1302cb05c50acc7632ad42aa42bfa
3 | size 9255
4 |
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/30-database/elasticsearch/elasticsearch-install-console-output.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:2844894d2bd02cf9d541be2a0148c587f719f84f2d40d5c0595d3021b31cc575
3 | size 9275
4 |
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/30-database/mongodb/mongodb-initial-config.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:32978a029027bf4fcd301934834189f185dbb54deecd3cb5e4e0b2c6c66b4702
3 | size 21205
4 |
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/30-database/mysql/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: MySQL DataBase Connector
3 | description: Learn how to use MySQL with deepstream
4 | logoImage: mysql.png
5 | draft: true
6 | ---
7 |
8 | MySQL
9 |
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/30-database/postgres/postgres-deepstream.svg:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:06dab74faf245cc52dace64a2aaf5b7940de99e0b8cd9b8f169adc2a36aa62b5
3 | size 55139
4 |
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/30-database/rethinkdb/deepstream-rethinkdb-search-provider.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:6b27a84d27c1a6bcd32bcf827a4d4f119027b95c4803d22b3da209d17fe800c3
3 | size 9283
4 |
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/30-database/rethinkdb/deepstream-rethinkdb.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:74bc7c2e823f839f79f4842c9a4747d26da804ea7d2bff00c931ec385abeace0
3 | size 32225
4 |
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/30-database/rethinkdb/rethinkdb-deepstream-install-console-output.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:2c68f5877f13e96456d955203b049bc6e651d2f835d47fa8a5ce122fa57cec72
3 | size 8807
4 |
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/39-http-service/20-node-and-ws/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Node HTTP
3 | description: Learn how to configure the node HTTP Service
4 | logoImage: websocket.png
5 | ---
6 |
7 | Node is the default HTTP server as it supports all platforms and is much easier to debug.
8 |
9 | To enable SSL, all you need to do is pass in the the loaded file and cert.
10 |
11 | You can either do this using an explicit path:
12 |
13 | ```yaml
14 | ssl:
15 | key: fileLoad(/location/to/ssl/key.pem)
16 | cert: fileLoad(/location/to/ssl/key.pem)
17 | ```
18 |
19 | or relative to the config file (less likely on a production install):
20 |
21 | ```yaml
22 | ssl:
23 | key: fileLoad(ssl/key.pem)
24 | cert: fileLoad(ssl/key.pem)
25 | ```
26 |
27 | ### How to configure:
28 |
29 | ```yaml
30 | httpServer:
31 | type: default
32 | options:
33 | # url path for http health-checks, GET requests to this path will return 200 if deepstream is alive
34 | healthCheckPath: /health-check
35 | # -- CORS --
36 | # if disabled, only requests with an 'Origin' header matching one specified under 'origins'
37 | # below will be permitted and the 'Access-Control-Allow-Credentials' response header will be
38 | # enabled
39 | allowAllOrigins: true
40 | # a list of allowed origins
41 | origins:
42 | - 'https://example.com'
43 | # Headers to copy over from websocket
44 | headers:
45 | - user-agent
46 | # Options required to create an ssl app
47 | # ssl:
48 | # key: fileLoad(ssl/key.pem)
49 | # cert: fileLoad(ssl/cert.pem)
50 | # ca: ...
51 | ```
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/39-http-service/60-uws/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: UWS HTTP
3 | description: Learn how to configure the UWS HTTP Service
4 | logoImage: uws.svg
5 | ---
6 |
7 | UWS is enabled throughout all endpoints by setting the httpServer type to uws.
8 |
9 | Important:
10 |
11 | UWS does not work on alpine images and returns C++ error traces on failure. If you run into
12 | a bug please try it out with the default http server to see if it can be reproduced on both
13 | types.
14 |
15 | Currently uws doesn't have as many configurations options as the node server, but this
16 | will be expanded in the future, please raise an issue for anything you thing is missing.
17 |
18 | To enable SSL on uws, all you need to do is pass in the location to a key and cert.
19 |
20 | You can either do this using an explicit path:
21 |
22 | ```yaml
23 | key: /location/to/ssl/key.pem
24 | ```
25 |
26 | or relative to the config file (less likely on a production install):
27 |
28 | ```yaml
29 | key: file(relative/to/config/ssl/key.pem)
30 | ```
31 |
32 | ### How to configure:
33 |
34 | ```yaml
35 | httpServer:
36 | type: uws
37 | options:
38 | # url path for http health-checks, GET requests to this path will return 200 if deepstream is alive
39 | healthCheckPath: /health-check
40 | # Headers to copy over from websocket
41 | headers:
42 | - user-agent
43 | # Options required to create an ssl app
44 | # ssl:
45 | # key: file(ssl/key.pem)
46 | # cert: file(ssl/cert.pem)
47 | ## dhParams: ...
48 | ## passphrase: ...
49 | ```
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/40-connection-endpoint/00-http/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: HTTP Endpoint
3 | description: Learn how to configure a HTTP Endpoint
4 | wip: true
5 | logoImage: http.png
6 | ---
7 |
8 | ### How to configure:
9 |
10 | ```yaml
11 | connectionEndpoints:
12 | - type: http
13 | options:
14 | # allow 'authData' parameter in POST requests, if disabled only token and OPEN auth is
15 | # possible
16 | allowAuthData: true
17 | # enable the authentication endpoint for requesting tokens/userData.
18 | # note: a custom authentication handler is required for token generation
19 | enableAuthEndpoint: false
20 | # path for authentication requests
21 | authPath: /auth
22 | # path for POST requests
23 | postPath: /
24 | # path for GET requests
25 | getPath: /
26 | # maximum allowed size of an individual message in bytes
27 | maxMessageSize: 1024
28 | ```
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/40-connection-endpoint/01-websocket-binary/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Binary WebSocket Endpoint
3 | description: Learn how to configure the default binary WS Websocket Endpoint
4 | wip: true
5 | logoImage: binary.png
6 | ---
7 |
8 | ### How to configure:
9 |
10 | ```yaml
11 | connectionEndpoints:
12 | - type: ws-binary
13 | options:
14 | # url path websocket connections connect to
15 | urlPath: /deepstream
16 | # the amount of milliseconds between each ping/heartbeat message
17 | heartbeatInterval: 30000
18 | # the amount of milliseconds that writes to sockets are buffered
19 | outgoingBufferTimeout: 10
20 | # the maximum amount of bytes to buffer before flushing, stops the client from large enough packages
21 | # to block its responsiveness
22 | maxBufferByteSize: 100000
23 |
24 | # Security
25 | # amount of time a connection can remain open while not being logged in
26 | unauthenticatedClientTimeout: 180000
27 | # invalid login attempts before the connection is cut
28 | maxAuthAttempts: 3
29 | # maximum allowed size of an individual message in bytes
30 | maxMessageSize: 1048576
31 | ```
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/40-connection-endpoint/02-websocket-json/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: JSON Endpoint
3 | description: Learn how to configure a JSON based Websocket Endpoint
4 | wip: true
5 | logoImage: json.png
6 | ---
7 |
8 | The JSON endpoint is available to help people to debug writing new SDKs and should not be used in production.
9 |
10 | ### How to configure:
11 |
12 | #### server
13 |
14 | ```yaml
15 | connectionEndpoints:
16 | - type: ws-json
17 | options:
18 | # url path websocket connections connect to
19 | urlPath: /deepstream-json
20 | # the amount of milliseconds between each ping/heartbeat message
21 | heartbeatInterval: 30000
22 | # the amount of milliseconds that writes to sockets are buffered
23 | outgoingBufferTimeout: 10
24 | # the maximum amount of bytes to buffer before flushing, stops the client from large enough packages
25 | # to block its responsiveness
26 | maxBufferByteSize: 100000
27 |
28 | # Security
29 | # amount of time a connection can remain open while not being logged in
30 | unauthenticatedClientTimeout: 180000
31 | # invalid login attempts before the connection is cut
32 | maxAuthAttempts: 3
33 | # maximum allowed size of an individual message in bytes
34 | maxMessageSize: 1048576
35 | ```
36 |
37 | #### client
38 |
39 | In the client options include:
40 |
41 | ```
42 | socketOptions: {
43 | jsonTransportMode: true
44 | }
45 | ```
46 |
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/40-connection-endpoint/03-websocket-v3/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: V3 Text Protocol
3 | description: Learn how to configure a V3 compatible endpoint
4 | wip: true
5 | logoImage: deepstream-v3.png
6 | ---
7 |
8 | ### How to configure:
9 |
10 | ```yaml
11 | connectionEndpoints:
12 | - type: ws-text
13 | options:
14 | # url path websocket connections connect to
15 | urlPath: /deepstream-v3
16 | # the amount of milliseconds between each ping/heartbeat message
17 | heartbeatInterval: 30000
18 | # the amount of milliseconds that writes to sockets are buffered
19 | outgoingBufferTimeout: 10
20 | # the maximum amount of bytes to buffer before flushing, stops the client from large enough packages
21 | # to block its responsiveness
22 | maxBufferByteSize: 100000
23 |
24 | # Security
25 | # amount of time a connection can remain open while not being logged in
26 | unauthenticatedClientTimeout: 180000
27 | # invalid login attempts before the connection is cut
28 | maxAuthAttempts: 3
29 | # maximum allowed size of an individual message in bytes
30 | maxMessageSize: 1048576
31 | ```
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/40-connection-endpoint/80-mqtt/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: MQTT
3 | description: Learn how to configure a MQTT Endpoint
4 | wip: true
5 | logoImage: mqtt.png
6 | ---
7 |
8 | ### How to configure:
9 |
10 | ```yaml
11 | connectionEndpoints:
12 | - type: mqtt
13 | options:
14 | # port for the mqtt server
15 | port: 1883
16 | # host for the mqtt server
17 | host: 0.0.0.0
18 | # timeout for idle devices
19 | idleTimeout: 60000
20 | ```
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/50-clusternode/redis/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Redis Cluster Connector
3 | description: Learn how to use Redis with deepstream for clustering
4 | logoImage: redis.png
5 | ---
6 |
7 | `markdown:redis-description.md`
8 |
9 | #### How to use Redis for clustering with deepstream?
10 |
11 | The nodejs cluster comes preinstalled in the node binary, and can also be installed via [NPM](https://www.npmjs.com/package/@deepstream/clusternode-redis) if your using as node.
12 |
13 | And can be enabled in your config file as follows:
14 |
15 | ```yaml
16 | clusterNode:
17 | name: redis
18 | options:
19 | host: localhost
20 | port: 6379
21 | ```
22 |
23 | Or to connect it to a redis cluster:
24 |
25 | ```yaml
26 | clusterNode:
27 | name: redis
28 | options:
29 | nodes:
30 | - host:
31 | port:
32 | password:
33 | - host:
34 | port:
35 | maxRedirections: 16
36 | redisOptions:
37 | password: 'fallback-password'
38 | ```
39 |
--------------------------------------------------------------------------------
/content/tutorials/60-plugins/50-clusternode/redis/redis.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:cbd4a610175fdfe003318e6839c35a767c2245d9c318ea2743ee5a8c0b0d0263
3 | size 16744
4 |
--------------------------------------------------------------------------------
/content/tutorials/70-custom-plugins/20-custom-plugin/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Custom Plugin
3 | description: Building your own custom plugin
4 | ---
5 |
6 | Learn how to create a custom plugin, used to hook into services and provide random functionality!
7 |
8 | You can see the code for this [here](https://github.com/deepstreamIO/deepstream.io-example-plugins)
9 |
10 | ### Configuring the plugin
11 |
12 | 1) Via config.yml:
13 | `embed: server/example-plugins/src/custom-plugin/config.yml`
14 |
15 | 2) Via deepstream constructor:
16 | `embed: server/example-plugins/src/custom-plugin/deepstream-constructor.ts`
17 |
18 | 3) Via deepstream setter:
19 | `embed: server/example-plugins/src/custom-plugin/deepstream-setter.ts`
20 |
21 | ### Example Documented Plugin
22 |
23 | `embed: server/example-plugins/src/custom-plugin/custom-plugin.ts`
--------------------------------------------------------------------------------
/content/tutorials/70-custom-plugins/30-authentication/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Authentication Plugin
3 | description: Building your own authentication plugin
4 | ---
5 |
6 | Learn how to create an authentication plugin to verify a users ability to connect, as well as
7 | provide data that can be used for permissioning further on.
8 |
9 | You can see the code for this [here](https://github.com/deepstreamIO/deepstream.io-example-plugins)
10 |
11 | ### Configuring the plugin
12 |
13 | 1) Via config.yml:
14 | `embed: server/example-plugins/src/auth/config.yml`
15 |
16 | 2) Via deepstream constructor:
17 | `embed: server/example-plugins/src/auth/deepstream-constructor.ts`
18 |
19 | 3) Via deepstream setter:
20 | `embed: server/example-plugins/src/auth/deepstream-setter.ts`
21 |
22 | ### Example Documented Plugin
23 |
24 | `embed: server/example-plugins/src/auth/token-authentication.ts`
--------------------------------------------------------------------------------
/content/tutorials/70-custom-plugins/40-permission/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Permission Plugin
3 | description: Building your own permission plugin
4 | ---
5 |
6 | Learn the basics of creating a permission plugin, allowing you to allow or deny actions down to a per
7 | message basis.
8 |
9 | You can see the code for this [here](https://github.com/deepstreamIO/deepstream.io-example-plugins)
10 |
11 | ### Configuring the plugin
12 |
13 | 1) Via config.yml:
14 | `embed: server/example-plugins/src/permission/config.yml`
15 |
16 | 2) Via deepstream constructor:
17 | `embed: server/example-plugins/src/permission/deepstream-constructor.ts`
18 |
19 | 3) Via deepstream setter:
20 | `embed: server/example-plugins/src/permission/deepstream-setter.ts`
21 |
22 | ### Example Documented Plugin
23 |
24 | `embed: server/example-plugins/src/permission/username-permission.ts`
--------------------------------------------------------------------------------
/content/tutorials/70-custom-plugins/50-logger/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Logger Plugin
3 | description: Building your own logger plugin
4 | ---
5 |
6 | Create your own logger to interact with your favorite logging platform or filter logs to what you
7 | want exactly.
8 |
9 | You can see the code for this [here](https://github.com/deepstreamIO/deepstream.io-example-plugins)
10 |
11 | ### Configuring the plugin
12 |
13 | 1) Via config.yml:
14 | `embed: server/example-plugins/src/logger/config.yml`
15 |
16 | 2) Via deepstream constructor:
17 | `embed: server/example-plugins/src/logger/deepstream-constructor.ts`
18 |
19 | 3) Via deepstream setter:
20 | `embed: server/example-plugins/src/logger/deepstream-setter.ts`
21 |
22 | ### Example Documented Plugin
23 |
24 |
25 | `embed: server/example-plugins/src/logger/pino-logger.ts`
--------------------------------------------------------------------------------
/content/tutorials/70-custom-plugins/60-storage/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Storage Plugin
3 | description: Building your own storage plugin
4 | ---
5 |
6 | Create a plugin to connect to any type of storage system out there, be it file, memory, disk, a url
7 | or anything else.
8 |
9 | You can see the code for this [here](https://github.com/deepstreamIO/deepstream.io-example-plugins)
10 |
11 | ### Configuring the plugin
12 |
13 | 1) Via config.yml:
14 | `embed: server/example-plugins/src/storage/config.yml`
15 |
16 | 2) Via deepstream constructor:
17 | `embed: server/example-plugins/src/storage/deepstream-constructor.ts`
18 |
19 | 3) Via deepstream setter:
20 | `embed: server/example-plugins/src/storage/deepstream-setter.ts`
21 |
22 | ### Example Documented Plugin
23 |
24 | `embed: server/example-plugins/src/storage/file-storage.ts`
--------------------------------------------------------------------------------
/content/tutorials/70-custom-plugins/70-cache/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cache Plugin
3 | description: Building your own cache plugin
4 | ---
5 |
6 | Create a plugin to connect to any type of cache system out there, just remember to keep it fast!
7 |
8 | You can see the code for this [here](https://github.com/deepstreamIO/deepstream.io-example-plugins)
9 |
10 | ### Configuring the plugin
11 |
12 | 1) Via config.yml:
13 | `embed: server/example-plugins/src/cache/config.yml`
14 |
15 | 2) Via deepstream constructor:
16 | `embed: server/example-plugins/src/cache/deepstream-constructor.ts`
17 |
18 | 3) Via deepstream setter:
19 | `embed: server/example-plugins/src/cache/deepstream-setter.ts`
20 |
21 | ### Example Documented Plugin
22 |
23 |
24 | `embed: server/example-plugins/src/cache/node-cache.ts`
--------------------------------------------------------------------------------
/content/tutorials/70-custom-plugins/80-connection-endpoint/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Connection Endpoint Plugin
3 | description: Building your own connection endpoint plugin
4 | draft: true
5 | ---
--------------------------------------------------------------------------------
/content/tutorials/70-custom-plugins/90-cluster-node/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cluster Node Plugin
3 | description: Building your own cluster node plugin
4 | ---
5 |
6 | Create a plugin that allows deepstream nodes to connect to each other and scale
7 |
8 | You can see the code for this [here](https://github.com/deepstreamIO/deepstream.io-example-plugins)
9 |
10 | ### Configuring the plugin
11 |
12 | 1) Via config.yml:
13 | `embed: server/example-plugins/src/cluster-node/config.yml`
14 |
15 | 2) Via deepstream constructor:
16 | `embed: server/example-plugins/src/cluster-node/deepstream-constructor.ts`
17 |
18 | 3) Via deepstream setter:
19 | `embed: server/example-plugins/src/cluster-node/deepstream-setter.ts`
20 |
21 | ### Example Documented Plugin
22 |
23 | `embed: server/example-plugins/src/cluster-node/vertical-cluster-node.ts`
--------------------------------------------------------------------------------
/content/tutorials/70-custom-plugins/92-monitoring/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Monitoring Plugin
3 | description: Building your own monitoring plugin
4 | ---
5 |
6 | Create a plugin that monitors deepstream nodes
7 |
8 | You can see the code for this [here](https://github.com/deepstreamIO/deepstream.io-example-plugins)
9 |
10 | ### Configuring the plugin
11 |
12 | 1) Via config.yml:
13 | `embed: server/example-plugins/src/monitoring/config.yml`
14 |
15 | 2) Via deepstream constructor:
16 | `embed: server/example-plugins/src/monitoring/deepstream-constructor.ts`
17 |
18 | 3) Via deepstream setter:
19 | `embed: server/example-plugins/src/monitoring/deepstream-setter.ts`
20 |
21 | ### Example Documented Plugin
22 |
23 | `embed: server/example-plugins/src/monitoring/http-monitoring.ts`
24 |
--------------------------------------------------------------------------------
/content/tutorials/75-example-apps/http-iot-stock-monitor/circuit.jpg:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:7272dc020635f8553b75ddf3a64b4ec6158b64463c80579944b55f5d550ec8fa
3 | size 1251036
4 |
--------------------------------------------------------------------------------
/content/tutorials/75-example-apps/http-iot-stock-monitor/schematic.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:61ad1c19ccfd50f5dfa05dac7e89300914371712cdc3d36f0bc5e2d16401900f
3 | size 37028
4 |
--------------------------------------------------------------------------------
/content/tutorials/75-example-apps/http-iot/circuit.jpg:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:8c648549115437dc64bb345db5defcf200faeb9e7270a2302740e95ae76749c8
3 | size 1258439
4 |
--------------------------------------------------------------------------------
/content/tutorials/75-example-apps/http-iot/schematic.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:523a0512a805d0ff3745968e4fda6d8c027a00d008dd42baf187457de9e7e024
3 | size 29725
4 |
--------------------------------------------------------------------------------
/content/tutorials/75-example-apps/realtime-flight-tracker/flights.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deepstreamIO/deepstream.io-website/f449598a352617ecd29fded8fc8dbff853d15705/content/tutorials/75-example-apps/realtime-flight-tracker/flights.gif
--------------------------------------------------------------------------------
/content/tutorials/75-example-apps/realtime-friend-locator/locator.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deepstreamIO/deepstream.io-website/f449598a352617ecd29fded8fc8dbff853d15705/content/tutorials/75-example-apps/realtime-friend-locator/locator.gif
--------------------------------------------------------------------------------
/content/tutorials/75-example-apps/realtime-todo-list/todoMVC.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deepstreamIO/deepstream.io-website/f449598a352617ecd29fded8fc8dbff853d15705/content/tutorials/75-example-apps/realtime-todo-list/todoMVC.gif
--------------------------------------------------------------------------------
/content/tutorials/80-devops/00-nginx/deepstream-nginx-deployment-diagram.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:624674794f56f26f000fc9d97929d8a5072f30cac8bf50026f38ab00aad5382d
3 | size 15251
4 |
--------------------------------------------------------------------------------
/content/tutorials/98-webrtc/00-webrtc-intro/webrtc-logo.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:abd637da2b4bf1349cabc9a0524391e028b791e68985fe472ab214aed5498352
3 | size 15319
4 |
--------------------------------------------------------------------------------
/content/tutorials/98-webrtc/20-webrtc-full-mesh/full-mesh.svg:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:fa0742bbc5ec67232ab9935eb044852c1feeb1fb1a6776f592f1a070c0b78278
3 | size 11386
4 |
--------------------------------------------------------------------------------
/content/tutorials/98-webrtc/40-webrtc-video-manipulation/steps.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:620f8e4b7175db11781b1e35aa2ae600f0b2f56af0ae2a22957395082b9d6c81
3 | size 10530
4 |
--------------------------------------------------------------------------------
/content/tutorials/98-webrtc/50-webrtc-screen-sharing/screen-sharing-dialog.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:f840a113a4a0eb0b467932ea4ec5b886e140bb1ff2781d45a3bba89a250a4560
3 | size 32674
4 |
--------------------------------------------------------------------------------
/content/tutorials/99-upgrade-guides/v4/20-client/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Upgrading the js client
3 | description: Upgrading the deepstream js/node client to V4
4 | ---
5 |
6 | We tried to keep APIs as consistent as possible on the client, with only two main changes:
7 |
8 | ### Promise APIs breaks chaining
9 |
10 | ```JavaScript
11 | const client = deepstream()
12 | try {
13 | await client.login()
14 |
15 | const record = client.record.getRecord(name)
16 | await record.whenReady()
17 |
18 | const data = await client.record.snapshot(name)
19 | const version = await client.record.head(name)
20 | const exists = await client.record.has(name)
21 | const result = await client.rpc.make(name, data)
22 | const users = await client.presence.getAll()
23 | } catch (e) {
24 | console.log('Error occurred', e)
25 | }
26 | ```
27 |
28 | ### New listening callback
29 |
30 | The listening API has been ever so slightly tweaked in order to simplify removing an active subscription.
31 |
32 | Before when an active provider was started you would usually need to store it in a higher scope, for example:
33 |
34 | ```typescript
35 | const listeners = new Map()
36 |
37 | client.record.listen('users/.*', (name, isSubscribed, ({ accept, reject }) => {
38 | if (isSubscribed) {
39 | const updateInterval = setInterval(updateRecord.bind(this, name), 1000)
40 | listeners.set(name, updateInterval)
41 | accept()
42 | } else {
43 | clearTimeout(listeners.get(name))
44 | listeners.delete(name)
45 | }
46 | })
47 | ```
48 |
49 | Where now we instead do:
50 |
51 | ```typescript
52 | const listeners = new Map()
53 |
54 | client.record.listen('users/.*', (name, ({ accept, reject, onStop }) => {
55 | const updateInterval = setInterval(updateRecord.bind(this, name), 1000)
56 | accept()
57 |
58 | onStop(() => clearTimeout(updateInterval))
59 | })
60 | ```
61 |
--------------------------------------------------------------------------------
/content/tutorials/99-upgrade-guides/v5/20-client/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Upgrading the js client
3 | description: Upgrading the deepstream js/node client to V5
4 | ---
5 |
6 | The one breaking change in the V5 client library is the following:
7 |
8 | ```javascript
9 | import { DeepstreamClient } from '@deepstream/client'
10 | const client = new DeepstreamClient('localhost:6020/deepstream')
11 | ```
12 |
13 | as opposed to how it was done before:
14 |
15 | ```javascript
16 | import * as deepstream from '@deepstream/client'
17 | const client = deepstream('localhost:6020/deepstream')
18 | ```
19 |
20 | This provides much better typescript support and stops us from trying to do high level wizardry
21 | when creating the bundle
--------------------------------------------------------------------------------
/content/versions.yml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deepstreamIO/deepstream.io-website/f449598a352617ecd29fded8fc8dbff853d15705/content/versions.yml
--------------------------------------------------------------------------------
/gatsby-browser.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Implement Gatsby's Browser APIs in this file.
3 | *
4 | * See: https://www.gatsbyjs.org/docs/browser-apis/
5 | */
6 |
7 | // Import global styles
8 | require('./src/css/screen.css');
9 | require('./src/css/global.css');
10 | require('./src/css/section-overview.scss');
11 | require('prismjs/themes/prism-coy.css');
12 |
13 | // require('./src/css/reset.css');
14 | // require('./src/css/algolia.css');
15 |
16 | // A stub function is needed because gatsby won't load this file otherwise
17 | // (https://github.com/gatsbyjs/gatsby/issues/6759)
18 | exports.onClientEntry = () => {};
19 |
--------------------------------------------------------------------------------
/gatsby-node.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Implement Gatsby's Node APIs in this file.
3 | *
4 | * See: https://www.gatsbyjs.org/docs/node-apis/
5 | */
6 |
7 | exports.createPages = require('./gatsby/createPages');
8 | exports.onCreatePage = require('./gatsby/onCreatePage');
9 | exports.onCreateNode = require('./gatsby/onCreateNode');
10 |
--------------------------------------------------------------------------------
/gatsby-ssr.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Implement Gatsby's SSR (Server Side Rendering) APIs in this file.
3 | *
4 | * See: https://www.gatsbyjs.org/docs/ssr-apis/
5 | */
6 |
7 | // You can delete this file if you're not using it
8 |
--------------------------------------------------------------------------------
/gatsby/onCreateNode.js:
--------------------------------------------------------------------------------
1 | module.exports = exports.onCreateNode = ({ node, actions, getNode }) => {
2 | const {createNodeField} = actions;
3 |
4 |
5 | switch (node.internal.type) {
6 | case 'MarkdownRemark':
7 | const { permalink } = node.frontmatter;
8 | const { relativePath } = getNode(node.parent);
9 |
10 | let slug = permalink;
11 |
12 | // Github edit link
13 | createNodeField({
14 | node,
15 | name: 'githubLink',
16 | value: `https://github.com/deepstreamIO/deepstream.io-website/blob/master/content/${relativePath}`
17 | });
18 |
19 | if (!slug) {
20 | // This will likely only happen for the partials in /content/home.
21 | slug = `/${relativePath.replace('.md', '.html')}`;
22 | }
23 |
24 | slug = slug.replace('index.html', '');
25 |
26 | // Used to generate URL to view this content.
27 | createNodeField({
28 | node,
29 | name: 'weightedSlug',
30 | value: slug,
31 | });
32 |
33 | // Used to generate URL to view this content.
34 | createNodeField({
35 | node,
36 | name: 'slug',
37 | value: slug.includes('blog') ? slug : slug.replace(/(\d\d)-/g, ''),
38 | });
39 | return;
40 | }
41 | };
42 |
--------------------------------------------------------------------------------
/gatsby/onCreatePage.js:
--------------------------------------------------------------------------------
1 | module.exports = exports.onCreatePage = ({ page, actions }) => {
2 | return page
3 | }
4 |
--------------------------------------------------------------------------------
/markdown-templates/glossary-clientData.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
clientData is data that will be sent to clients upon successful login.
4 |
5 |
6 |
--------------------------------------------------------------------------------
/markdown-templates/glossary-event.md:
--------------------------------------------------------------------------------
1 | [[glossary]]
2 |
3 | | *Events* are deepstream's publish-subscribe mechanism. Clients and backend processes can subscribe to event-names (sometimes also called “topics” or “channels”) and receive messages published by other endpoints.
4 |
5 | | Events are non-persistent, one-off messages. For persistent data, please use [records](/docs/client-js/datasync-record/).
6 |
7 | | Events, aka Pub/Sub, allows communication using a Publish-Subscribe pattern. A client/server emits an event, which is known as publishing and all connected (subscribed) clients/servers are triggered with the event's payload if any. This is a common pattern, not just in realtime systems, but software engineering generally.
--------------------------------------------------------------------------------
/markdown-templates/glossary-record.md:
--------------------------------------------------------------------------------
1 | [[glossary]]
2 | | *Records* are the documents in deepstream’s realtime datastore. A record is identified by a [unique id](/docs/client-js/client/#getuid-) and can contain any kind of JSON data. Clients and backend processes can create, read, write, update and observe the entire record as well as paths within it. Any change is immediately synchronized amongst all connected subscribers.
3 | | Records can be arranged in [lists](/docs/client-js/datasync-list/) and collections and can contain references to other records to allow for the modelling of relational data structures.
4 | | You can learn more about records in the [records tutorial](/docs/client-js/datasync-record/).
5 |
6 |
--------------------------------------------------------------------------------
/markdown-templates/glossary-rpc.md:
--------------------------------------------------------------------------------
1 | [[glossary]]
2 | | *Remote Procedure Calls* are deepstream's request-response mechanism. Clients and backend processes can register as “providers” for a given RPC, identified by a unique name. Other endpoints can request said RPC.
3 | | deepstream will route requests to the right provider, load-balance between multiple providers for the same RPC, and handle data-serialisation and transport.
4 |
--------------------------------------------------------------------------------
/markdown-templates/guide-install-mongo.md:
--------------------------------------------------------------------------------
1 | ### Install MongoDB
2 |
3 | Using mongodb with deepstream is a breeze, since mongo is a schemaless database there isn't much at all we need to configure.
4 |
5 | First things first, you need to run mongodb. You can do this by either:
6 |
7 | - Running it via docker (as always, the easiest way):
8 |
9 | ```
10 | docker run -p 27017:27017 mvertes/alpine-mongo
11 | ```
12 |
13 | - Follow the [install docs](https://docs.mongodb.com/manual/installation/)
14 |
15 | One you have it up and running you would need to add it to deepstream, the easiest way of doing this is adding the following to your `config.yml` file:
16 |
17 | ```
18 | storage:
19 | name: mongodb
20 | options:
21 | connectionString: mongodb://localhost:27017/deepstream
22 | database: deepstream
23 | ```
24 |
25 | And start deepstream! You should see this in your startup logs:
26 |
27 | ```
28 | INFO | storage ready: @deepstream/storage-mongodb
29 | ```
30 |
31 | If you see the error
32 |
33 | ```
34 | Error: Cannot load module @deepstream/storage-mongodb or deepstream.io-storage-mongodb
35 | ```
36 |
37 | It means you are running it via node directly which means you just need to run
38 |
39 | ```
40 | npm install --save @deepstream/storage-mongodb
41 | ```
42 |
--------------------------------------------------------------------------------
/markdown-templates/redis-description.md:
--------------------------------------------------------------------------------
1 | #### What is Redis?
2 | A lot of things. In fact, so many that its often referred to as the "Swiss Army Knife of the web". Redis is first and foremost a cache. It's fast, simple, single threaded with non-blocking I/O and scales well in distributed deployments (should sound familiar to deepstream fans).
3 |
4 | But it also persists its data to disk, making it a good alternative to full-size databases for simpler usecases and can act as a publish/subscribe server for message distribution.
5 |
6 | 
7 |
8 | You can easily install Redis yourself or use it as a service from your cloud hosting provider, e.g. via [AWS ElastiCache](https://aws.amazon.com/elasticache/), [Microsoft Azure](https://azure.microsoft.com/en-us/services/cache/) or [RackSpace's Object Rocket](http://objectrocket.com/). Due to its popularity there are also a number of specialized Redis hosting companies, e.g. [RedisLabs](https://redislabs.com/), [RedisGreen](http://www.redisgreen.net/), [Compose](https://www.compose.io/) or [ScaleGrid](https://scalegrid.io/), but be careful: deepstream constantly interacts with its cache, so every millisecond network latency between its server and your RedisHoster makes deepstream notably slower. We strongly recommend choosing a cache that runs in close network proximity to your deepstream servers, e.g. within the same data-center.
9 |
10 | #### Why use Redis with deepstream?
11 | Redis is a great fit for use with deepstream. It can be used as a cache, persists data and re-distributes messages for smaller to medium sized deepstream clusters. It won't be much help when it comes to executing complex queries, but if you can live without, Redis might be all you need for your production deployment.
--------------------------------------------------------------------------------
/markdown-templates/setting-up-deepstream.md:
--------------------------------------------------------------------------------
1 |
15 | Get started with deepstream by reading more about the high level concepts
16 | it provides, or jump straight into building your first application!
17 |