It’s not possible. Git has its advantages, but one of the drawbacks is just that. Git works with the repository as a whole. It’s actually more common when you need better organization and access control to have a separation of projects into parts and each to have its own repository.
Of course you can, even if not recommended, put both in the same repository, but it will be one thing from Git’s point of view. You can do this, but any attempt to manage as if they were separate things will bring more confusion.
Separate into two repositories and be happy. There’s no reason not to do this.
If you want to insist, has an OS solution. Don’t think it’s simple to handle it properly. I don’t know if you’ll have everything you want and especially if it makes up for the effort, especially when something goes wrong.
In your case, it seems to me that the projects are so distinct that it wouldn’t be worth even trying to put everything in one repository.
And of course if you want to treat it as one thing, it’s no secret.
you can separate projects into folders... but I don’t know if it’s the right way
– David Schrammel