Create mini games to put inside a webpage, with rest communication

Hi, I want to create a webpage with user and different actions, and I want to put differents minigames that communicate with the webpage, i need to get a score after the user end the minigame and put this information in a database.

I have thought of two ideas, create a page with aframework and place the games inside so that they communicate. or also create the page and all the games with UE4 and communicate them with a database.

Is the first option possible? what do you recommend? Has someone done something similar?

thanks