One service is already developed by collection. It provides useful data to create, read, update and delete (if applicable) documents, plus custom fetch functions.
In addition, these services contains right management details for every action the user can do.
Other services are developed and answer specific problematics:
ColorServiceUsed to filter colors and to extract main colors from an image
DataServiceUsed to pre compute data linked to the user (active role, active role company, user details).
This data permits to ask the database once and to keep data available every time we need it.
Using a singleton pattern, the call of computed data fetch data only the first time, then it keeps it.
Utility funcitons are available to invalidate data (for example when the current active role is changed).
DateServiceSeveral functions to format and process date operations
ErrorServiceUsed to manage errors and warnings and responsible of printing user-friendly errors.
Automatic error reporting is being designed.
FileServiceUsed to store documents in the user-space. Firebase Storage provides an efficiant way to restrict user access.
Each user, when signing up, is gived a user storage folder (named by his id). He has the right to read every user space, but can write only to his own space.
This service provides a way to upload files to his user space.
FirebaseServiceThis service is used to initialize global Firebase objects, as well as providing user authentication functions.
GeoServiceUsed to store third-party tile layers configurations (from Bing, CartoDB...)
as well as giving access to utility functions (data coordinates transformation, bounding boxes computes...)
LocalStorageServiceProvides functionalities to put and retrieve data stored in the local storage.
ModalServiceLaunching modals and listening from user events in modals are never been so simple with this service.
PermissionServiceUsed to ask specific permissions from the browser, like location.
Using the observer pattern, every location listener is called at the same time when the user's position is changed.
PlacesServiceProvides places search anf geocoding from the Nominatim package.
ResizeServiceService that uses the observer pattern to call every listener that needs to know when the window has been moved or resized.
Useful for components that cannot be developed with CSS responsiveness in mind (Map for example).
RightServiceProvides a utility functions that check if a user has a specific right.
It stores right dependency tree as well.
SettingsServiceUsed to store, retrieve and print settings.
UtilsServiceMore utility functions to manage arrays, JS events and strings.
WeatherServiceUsed to interact with OpenWeather API endpoints to get the weather at user's location.