TeamPlay can run in three different modes. Pick the one that matches your needs for persistence and synchronization:
By default, TeamPlay runs in in-memory mode. It keeps everything in memory, so your data is not persisted between page reloads. If you want a client-only setup with local persistence, use the Offline Mode.
Offline Mode persists data locally (browser or React Native) without a server. Use the offline connector:
See Offline Mode for details and React Native setup.
To enable synchronization with the server, follow these steps:
Enable the connection on the client somewhere early in your client app:
On the server, you need to create the TeamPlay backend and then create a connection handler for WebSockets:
By default no extra database setup is needed and the data is gonna be saved into an SQLite file local.db in the root of your project.
You can still use the MongoDB query syntax with aggregations which is emulated using mingo.
MONGO_URL.REDIS_URL (Redis).TeamPlay's createBackend() is a wrapper around creating a ShareDB's backend. You can instead manually create a ShareDB backend yourself and pass it to initConnection(). ShareDB is re-exported from teamplay/server, you can get it as import { ShareDB } from 'teamplay/server'.
Now that you have TeamPlay installed and configured, you're ready to start using it in your application!