s3-kennisbank

View the Project on GitHub HU-SD-S3/s3-kennisbank

Challenges

Objective

To create a set of custom web components using Lit that demonstrate data exchange between them using different patterns (mediator pattern, events, and observables). The components should also use a service layer to demonstrate communication with a REST API for data persistence.

Specifications

The specifications for this challenge are given by the documentation you should normally provide for your frontend. The documentation can be found here.

Challenge 1 - Data Exchange using Events and Mediator Pattern

In this challenge, you will create a set of custom web components using Lit that demonstrate data exchange between them using the mediator pattern and events. The components will also use a service layer to communicate with a simulated REST API for data persistence.

[!NOTE]

Note that if you change the data in the json-server from another browser (tab) the data in your application will not update automatically, because we are using REST where the "S" stands for stateless. Meaning that the server does not keep track of any clients and their state. So when the data changes on the server, the clients are not notified about this change. To see the updated data you will have to refresh the application to fetch the data again from the server.

Challenge 2 - Data Exchange using Observables

Challenge 2.1 Code refactoring

Refactor the code to use observables for data exchange between the service layer and the view layer.

Challenge 2.2 (optional) Server Sent Events

Use the forked version of JSON-Server (see Pull Request 1614) that supports Server Sent Events (SSE) to implement real-time updates in the application. This means that when the data in the JSON-Server changes (for example, when you add, update or delete a user from another browser tab), the changes should be automatically reflected in your application without needing to refresh the page.


:house: Home | :arrow_backward: Observables | :arrow_up: Data Exchange