Not a long blog post, just straight to the point.
I have made a script that creates a team in Teams with a project structure as the use case. It creates predefined folders under each channels files tab.
The channels root document folder in SharePoint is not created until you click the file tab in that specific channel, therefore I create these in the script so I can go on to create subfolders.
Connecting to Graph API is done through an application and application secret from Azure. More on this in Lee Ford’s blog post here.
How to create a folder in SharePoint I got from this blog post here.