Search code examples
c#reactjsasp.net-mvcasp.net-web-apiminimal-apis

Is it possible to connect a backend MVC C# API with a separate frontend React project?


I am trying to create a conceptual diagram after researching for a while, it seems like you need to use minimal API if you want to mesh it with a React frontend. Is it possible to do this with the MVC architectural pattern?

I have read the docs and watched numerous tutorials but could not find the answer.


Solution

  • Is there a reason you want an "MVC architectural pattern"? I think the way to do this is with a ASP API backend. If you are not familiar with an ASP API it has the feel of a MVC app and might be what you're looking for?

    Take a look at this link:

    https://learn.microsoft.com/en-us/aspnet/core/client-side/spa/react?view=aspnetcore-6.0&tabs=visual-studio

    This link shows you how to easily get a template solution setup with a React SPA and a ASP.NET Core API project as the backend.