In classic SharePoint, we had a custom coded button which would bring up a pop-up (below), take inputs, automatically create a SitePage with the required folders by copying a projects template sitepage, and use that newly created Projects page URL to create a new item within a list of projects.

This would be the result:
In the process of making a modern SP Homepage, I can add a button and link it to the default New Project button within the List which brings up the following options:

The previous button automatically did the steps of creating a new site page and filling in the Projects URL section of this. My question is:
How can I create a button to automate a task such as creating a new SitePage from a template, and use that URL to create a new List item in Modern SharePoint?
Previously this was done in a very complicated and convoluted way using SharePoint designer and I don't want to replicate that.
- Can I use some REST API Calls or PowerShell scripts?
- If so, or any other such method, how would those be linked to a button on the Sharepoint Homepage itself?