I’m working on a monitoring app. It receives data from an external source (via server side route) and displays it on the client with charts and other graphs.
Let’s say we are monitoring 1 data :
Temperature : it has its Collection, its Publication and its server side Route for receiving the data.
Now the user wants to add a new type of data : Humidity. It will also need the same thing as Temperature.
How those things are done ? The app changes its own code ?
I never knew how CMS (since it’s sort of a CMS) are done, here we create Collections, Publications and server side Routes (API) instead of adding pages and content.
Maybe you could switch your point of view. Make a collection called Measures (I can’t think of a better name) and add a ‘type’ field in it that says if it is Temperature, Humidity or whatever. Then filter on that field when you want to show data of one type.
That easy ? Wow
So I juste have to tell the client to add a ‘‘type’’ field to the data he receives and then filter the Collection by ‘‘type’’ when he wants to display it.