While GitHub itself doesn't directly support creating subfolders with separate repository URLs, you can achieve a similar organization using a combination of GitHub repositories and submodules.
Disclaimer before you go further down: Using submodules adds some complexity so please make sure you understand how they work before making any major changes to your repo structures.
https://github.blog/2016-02-01-working-with-submodules/
Example repository that uses a submodules: https://github.com/githubtraining/example-dependency
I will try to go through the steps you want to take to achieve this:
Create separate repositories for each component (api, app, and one main one, ProjectA for example ). Each of these repositories will have its own URL.
Clone each repository to your local machine. Arrange them in the desired directory:
Project A
├── api
│ └── (contents of api repository)
└── app
└── (contents of app repository)
Add the submodules to the "main" repository. If your folder structure looks like the above possible steps might look like this:
cd ProjectA
Add the api repository as a submodule
git submodule add <api-repo-url> api
Add the app repository as a submodule
git submodule add <app-repo-url> app
Commit the changes to the main repository (ProjectA)
git commit -m "Added submodules for api and app"