we are about to develop an ERP application e commerce so we structed b/w choosing mvc and web api
we have to build it in core now so give me some suggestion which is better and also in for future which can be sustain long time according latest tech trndz..
Loading
Tuhin PaulPosted Jan 16, 2025, 5:14 PM
For an e-commerce ERP application, the Web API approach is generally the better choice, particularly for long-term sustainability and scalability. You can combine it with modern front-end technologies (React, Angular, Vue.js) and easily expose your services to other systems or mobile applications.
Configuring CORS
Since your React front-end and Web API might run on different ports during development, you'll need to configure CORS (Cross-Origin Resource Sharing) in the Web API.
In
Startup.cs(ASP.NET Core 5 or 6):Tuhin PaulPosted Jan 16, 2025, 5:12 PM
API Controller for Products
React Component (ProductList.js):
If you decide to go with MVC, it would make more sense when your application needs to serve HTML views to users directly, where you control the UI layout using Razor views. If you're looking for flexibility, performance, and easier maintenance, Web API is preferred.
MVC would still be a viable choice if:
Sangeetha SPosted Jan 16, 2025, 5:15 AM
Choosing between MVC (Model-View-Controller) and Web API (Application Programming Interface) for building an e-commerce website depends on your specific needs:
MVC:- Best for: Traditional web applications where you need server-side rendering of HTML.
- Pros:
- Provides a complete framework for building web applications.
- Good for SEO since it generates HTML on the server.
- Easier for developers who want to work with a full-stack solution.
- Cons:
- Less flexibility for building single-page applications (SPAs).
- Can be heavier on server resources since it renders pages on the server.
Web API:Conclusion:
If your e-commerce site will mainly serve web users and you want to manage everything in one place, MVC might be the better choice.
Jignesh KumarPosted Jan 16, 2025, 5:12 AM
Hello Jaya prakas,
Based on my understanding of the latest trends, you can consider the following technologies: Web API combined with a Single Page Application (SPA).