Coder Social home page Coder Social logo

keethburu / aspnet-core-react-redux-playground-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from based-ghost/aspnet-core-react-redux-playground-template

0.0 0.0 0.0 10.89 MB

SPA template built with ASP.NET Core 7.0 + React + Redux + TypeScript + Hot Module Replacement (HMR)

License: MIT License

C# 16.14% TypeScript 69.42% HTML 2.86% SCSS 11.58%

aspnet-core-react-redux-playground-template's Introduction

ASP.NET Core 7.0 + React + Redux + TypeScript + Hot Module Replacement (HMR)

This template is a SPA application built using ASP.NET Core 7.0 as the REST API server and React/Redux/TypeScript as the web client (Bulma + SASS + styled-components for UI styling). You can find a similar version using Vue + Vuex (and associated libraries) here: aspnet-core-vue-vuex-playground-template

demo

General Overview

This template is vaguley based on the original React + Redux .NET Core SPA template that was offered around the time of .NET Core 2.0 release (the existing template is a much more simplified version of what was offered in the past and the structure is quite different as well). Using that as a base, this template greatly extends the functionality provided and also uses the latest versions of all referenced libraries/packages. Keep in mind that I use this project (or others like it) as a testing ground for varying libraries/packages and it is not meant to act as a stand-alone final solution - it is more of POC. For example, the login & logout processes are stubbed to simulate the actual process (no real authentication is happening, however, it is something I plan to add to this project in the near future). I plan on keeping this up to date, and the listed technology stack may be subject to change.

Note: All components are written using FunctionComponents & React Hooks. Legacy class components are not used.

Technology Stack Overview

  • Server
    • ASP.NET Core 7.0
    • SignalR
    • HealthChecks + AspNetCore.HealthChecks.UI package - this provides a nicely formatted UI for viewing the results of the HealthCheck modules in use and is accessed on /health-ui (also, provide an option for viewing the raw JSON data that the UI package prettifies for you at /healthchecks-json). Access this view in the application via the floating settings cog on right screen by clicking the "Health Checks" link.
    • API Documentation using Swagger UI - using package NSwag.AspNetCore to prettify the specification output and display at /swagger/* & NSwag.MSBuild to handle automatic updates - so that when the project builds, the NSwag CLI will run and generate an updated API specification. Access this view in the application via the floating settings cog on right screen by clicking the "Swagger API" link.
    • Brotli/Gzip response compression (production build)
  • Client
    • React
    • Redux
    • TypeScript
    • Webpack for bundling of application assets and HMR (Hot Module Replacement)
    • Bulma CSS + SASS + Font Awesome 5 (using fontawesome-svg-core)
    • styled-components - CSS-in-JS via template literals - Examples in this project: Checkbox.tsx, Spinner.tsx, Authenticator.tsx, Settings.tsx, and Footer.tsx are written using styled-components.
    • react-functional-select - A micro-sized & micro-optimized select component for ReactJS. Inspired by react-select and built for ultimate performance - leverages react-window to virtualize long options data and styled-components to handle styling via CSS-in-JS. Note: I am the author of this package.
    • Axios for REST endpoint requests
    • react-toastify - a highly configurable toast notification library - comes hooked up to display login error & SignalR hub push notifications examples.
    • react-router/react-router-dom - route transitions handled using react-transition-group
    • Custom, reusable Dropdown & Checkbox components that provide full functionality w/ state management (without a JQuery dependency).
    • Two different loader components (spinner & authentication animation w/ callback for success/fail)

Setup

  • Node.js version >= 14
  • .NET 7.0 SDK
  • Clone the repository and run npm install from the root of the ClientApp directory to properly install all node packages/dependencies.
  • Opening the solution in VisualStudio should automatically trigger nuget package and other dependencies to be restored (assuming latest version of VisualStudio and installation of .NET Core version mentioned aboved). If issues are encountered, attempting to refresh the dependencies or executing a rebuild solution should resolve them.
  • A solution.sln file is added to act as an entry point to open the application in Visual Studio. Visual Studio 2022 and up.
  • GhostUI/GhostUI.csproj acts as the entry point to open the application in Visual Studio Code.

aspnet-core-react-redux-playground-template's People

Contributors

based-ghost avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.