Server Overview
The Informfully back end uses Meteor. Meteor connects to clients using the WebSocket protocol, a full-duplex communication protocol that closes only when the connection is terminated. That is, WebSocket connections are bidirectional and remain open even after the client receives the response to a request. The benefit of this is that, after successfully connecting to a client, the server can “push” data to the client, whereas with traditional protocols (such as HTTP), a connection to a client is closed once the response from the server is received. A traditional client receives data updates by re-requesting the same resources.
For time-sensitive applications, this translates to requesting the same resources from a server in very short time intervals (polling), which unnecessarily increases the server's load. It is recommended to consult the Meteor documentation referenced below for further information.
Database Collections
The project utilizes MongoDB for its database. You can download MongoDB Compass to view and manipulate the data in the database. If you are running Meteor locally, you can connect MongoDB Compass to the database by following the instructions in Local Development. If Meteor has been deployed to production, take a look at Website Deployment to connect to a remote database.
Meteor Publications
The Meteor server shares its data with the client through publications. The client can subscribe to a publication to get the necessary data and copy it into its own local Minimongo database. The local database is updated automatically, always reflecting the most current changes.
The files for the Meteor Publications are located in the folder backend/imports/api/server/publications and are organized into separate files corresponding to the related collections in MongoDB. These functions define what data will be synchronized to the client when it subscribes to one of the publications.
Meteor Methods
Meteor methods are functions to call when modifying data. It is similar to POST requests with REST APIs. These methods are also available to the client as stub functions. This means that the client will simulate the outcome and update its UI with its local Minimongo database before a confirmation from the server (visit the official website for more information).
The methods can be found in the folder imports/api/. In this folder, all Meteor methods are split into JavaScript files and are named after the collections in MongoDB to which they are related.