Sample CRUD ASP NET MVC 5 + RazorPages + ReactJS

The solution is created via Visual Studio 2019.

Solution structure

  • Database project contains database scheme and seed script. MS SQL database.
  • Api is backend project based on dapper ORM. ASP NET MVC Framework 4.7.2.
  • There are two UI projects: MVC.UI and UI.ReactJS
  • XUnitTests contains integration tests for repository and unit tests for user controller. FakeItEasy and XUnit frameworks are used.

Solution structure

Figure 0 - Solution structure

Configuration

Api

Web.config contains DbConnection string. Don't forget to setup it properly. ASP.NET MVC Framework is chosen in accordance with technical requirements.

MVC.UI

Web.config contains ServiceUrl app setting. Don't forget to setup it properly. ASP.NET MVC Framework is chosen in accordance with technical requirements.

image

Figure 1 - Razor Pages UI

UI.ReactJS

  • Web.config contains ServiceUrl app setting. Don't forget to setup it properly.
  • ASP.NET MVC Framework as hosting of ReactJS UI is chosen in accordance with technical requirements.
  • Apply "npm install" for package.json file to download all dependencies.
  • React components are located here: WebUserManagement.UI.ReactJS/Scripts/Home/react/

image

Figure 2 - How to install dependencies using Visual Studio

image

Figure 3 - React UI