Sitecore Hackathon 2019 entry by Team Cheese'n'Frog
Category: "Best enhancement to JSS to change a JSS component rendering behavior based on user's session data"
Youtube video: Dinocore highlights
What it solves
The solution shows a way to personalise JSS client behaviour based on data from/thru the sitecore server. Personalitation by user context showcased using a simple game and using the highscores as data.
This solution could be adapted to fit other needs but the general pattern remains the same and proves very affective.
What it does
This solution does 2 things:
- Client-side it polls a GraphQL endpoint for all relevant highscores based on the current user's highscore. The highscores become visible client-side in the leaderboard.
- Server-side it leverages JSS, GraphQL and the ContentSearch API to produce a list of relevant highscores for the leaderboard. A GraphQL mutation is used for adding a new highscores to the leaderboard.
How to install
How to use
Follow these setp after installing the module:
- Point you're browser to http://dinocore.sc
- Click in the game window, directly below the Dinocore logo, to start a new game.
- You can avoid obstacles by jumping. Use the left mouse button or pressing spacebar to jump.
While you are running your current highscore will be continously updated and stacked up against the highscores of other players. Keep you're eye on the leaderboard while you race!