David C
David C

Reputation: 2796

Solution and folder structure for Angular and Net core API project

We have a solution which contains a Net Core 2.2 (API) + Angular 7 project, from the Visual Studio standard template, which combines both.

Due to performance issues when loading/debugging this, we are looking at splitting the API and Angular, which feels like it would be a good idea anyway in case of additional clients in the future? It's taking well over a minute to fire up with debug.

So assuming our VS Solution has an API project in it, and some other class libraries. Then do we look to just add a folder in the file system for the angular project, keeping it outside of Visual Studio. Or is there a way of keeping it in the world of Visual Studio also?
As a note, we've started to use VS Code more and more for the client side dev work, so aren't wedded to VS for everything.

Taking it further should we spin up separate repos and keep them not even in the same folders?

Looking back on this I'm not sure if there's an outright answer or whether it's subjective. If it needs to go to one of the other stack's then no problem.

Upvotes: 1

Views: 1568

Answers (1)

Chris Pratt
Chris Pratt

Reputation: 239250

You should be able to just create a folder manually in your source directory and put your Angular stuff there. Then, in Visual Studio, right-click your solution in the Solution Explorer and choose Add > Existing Web Site... Finally, choose that folder you created.

Now, getting everything to run is a bit trickier. Personally, I'd recommend running everything in containers with Docker. You just need to add Dockerfiles to all your startup projects (including this Angular website directory). Then, you can add a docker-compose project and add each of the apps as services in docker-compose.yml. With that, you can choose the docker-compose project to debug, and Visual Studio will hand this all off to Docker for Windows (which you'll obviously need to install) and it will all be spun up. Docker is absolutely brilliant for development, anyways, so even without this particular need, I'd encourage you to start using it.

Upvotes: 2

Related Questions