Open the command prompt. Create a directory for SPFx solution.
Solution Name: Hit Enter to have default name (single-part-app-page in this case) or type in any other name for your solution.
Selected choice: Hit Enter
Target for component: Here, we can select the target environment where we are planning to deploy the client web part, i.e., SharePoint Online or SharePoint OnPremise (SharePoint 2016 or 2019 onwards).
Selected choice: SharePoint Online only (latest)
Place of files: We may choose to use the same folder or create a subfolder for our solution.
Selected choice: Use the current folder
Deployment option: Selecting Y will allow the app to deployed instantly to all sites and will be accessible everywhere.
Selected choice: Y
Permissions to access web APIs: Choose if the components in the solution require permissions to access web APIs that are unique and not shared with other components in the tenant.
Selected choice: N (solution contains unique permissions)
Type of client-side component to create: We can choose to create a client-side web part or an extension.
Selected choice: WebPart, since single part app pages are web parts.
Web Part Name: Hit Enter to select the default name or type in any other name.
Selected choice: SinglePartPage
Web part description: Hit Enter to select the default description or type in any other value.
Selected choice: Hit Enter
Framework to use: Select any JavaScript framework to develop the component. Available choices are (No JavaScript Framework, React, and Knockout)
Selected choice: No JavaScript Framework
Yeoman generator will perform a scaffolding process to generate the solution. The scaffolding process will take a significant amount of time.
Once the scaffolding process is completed, lock down the version of project dependencies by running the below command.
In the command prompt, type the below command to open the solution in the code editor of your choice.
Our custom app page is now ready with our SPFx web part added to it.
Summary
We can extend out of the box page templates by creating our own templates, however, they are limited to only that site. To use the page templates all across the tenant, we will have to create custom app pages using SharePoint framework.