Skip to content

Latest commit

 

History

History
45 lines (32 loc) · 2.23 KB

README.md

File metadata and controls

45 lines (32 loc) · 2.23 KB

Tutorial and sample codes for ASP.NET 5 SPA with React

Overview

This follows the following to create the default template codes.

You can check the following for more detailed explanations.

The folder structure is the following

  • my-new-app \ ClientApp folder: This is the React app. The build output in build folder will be served.
  • my-new-app \ Controllers folder: This has a dummy Web API that the React app can send requests to.
    • To pass any data from the backend to the frontend, one shoud use the Web API. If the data is needed before the authentication, then one can create an API path without the need for authentication to pass the data that do not need to be protected.
  • my-new-app \ Pages folder: This has some standard ASP.NET Razor pages.
  • my-new-app \ Program.cs: This is the standard ASP.NET file.
  • my-new-app \ Startup.cs: This specifies that this is serving the SPA static files from CilentApp \ build folder. This also sets up the Web API.
  • my-new-app \ WeatherForcast.cs: This has the model used by the dummy Web API.

After the app is running, open https://localhost:5001 to see the web site.

GitHub Actions included

  • DOTNET build and test
  • CodeQL

Useful Visual Studio Code extensions

Useful Visual Studio Code references

Useful .NET CLI commands

  • (Create the default template for backend and frontend) dotnet new react -o my-new-app
  • (Powershell) SET ASPNETCORE_ENVIRONMENT=Development
  • (in my-new-app folder) dotnet build
  • (in my-new-app folder) dotnet run