I'm trying to get into ASP.NET Core. A lot of the examples out there have the front end and the back end using the same project. What I'd like to do is to have one API project, and one front end project. I prefer this separate solution because it'll be easier for me to add on a mobile component in future if needed.
My question is this: Assuming I have projects, one Web API (core) and an MVC (core) would I be having duplicate controllers?
E.g., in the API project, I would have the following controllers
- LoginController
- MembersController
- ShopController
Would that mean in my MVC project, I'll have the same controllers, and within the controllers I'll be making REST calls to the corresponding controllers in my API project? Would it seem redundant and inefficient to have each request go through the MVC controller, and then to the API controller?
How should the calls be secured? Would I be issuing a JWT upon a successful login against the API project to protect subsequent calls to the API layer?