Backend rendering of a preview image

I have a working threejs-based viewer an now i like to generate preview image in the backend. I like t o load the website and than catch the first rendered scene. No move or rotation. I already have a working code in javascript implemented to catch the current scene to a image by click on a button on the webpage so this part should not be the problem.

The backend is written in java and i like to execute a task where i get a image or a path of a image to store them in a database for future use.

Im totally lost where to start. Do i need to setup a complete nodejs setup or are there some smaller opinions for my task?

three.js generates the thumbnails for its examples with a node.js script. The most important module of the script is Puppeteer: GitHub - puppeteer/puppeteer: Headless Chrome Node.js API


The actual script is:

I don’t know how to implement the same with Java though.