All Projects → bradymholt → Aspnet Core React Template

bradymholt / Aspnet Core React Template

Licence: mit
ASP.NET Core 3.1 / React SPA Template App

Projects that are alternatives of or similar to Aspnet Core React Template

aspnet-core-vuejs-template
ASP.NET Core / Vue.js SPA Template App
Stars: ✭ 75 (-86.09%)
Mutual labels:  spa, asp-net-core, postgresql-database
ajxnetcore
Its an innovative method to turn an ASP.NET Core Application Into Single Page Application, While enhancing the Software performance both on server and client side.
Stars: ✭ 31 (-94.25%)
Mutual labels:  spa, asp-net-core
Winton.extensions.configuration.consul
Enables Consul to be used as a configuration source in dotnet core applications
Stars: ✭ 239 (-55.66%)
Mutual labels:  asp-net-core, dotnet-core
SPA-With-Blazor
Creating a Single Page Application with Razor pages in Blazor using Entity Framework Core database first approach.
Stars: ✭ 27 (-94.99%)
Mutual labels:  spa, asp-net-core
Anclafs
ASP.NET Core Library and Framework Support
Stars: ✭ 192 (-64.38%)
Mutual labels:  asp-net-core, dotnet-core
Electron.net Api Demos
Explore the Electron.NET APIs
Stars: ✭ 231 (-57.14%)
Mutual labels:  asp-net-core, dotnet-core
Yoyocmsfree.template
一个免费版本的ABP框架,整合了ng-Zorro。
Stars: ✭ 254 (-52.88%)
Mutual labels:  asp-net-core, dotnet-core
Umbraco Cms
The simple, flexible and friendly ASP.NET CMS used by more than 730.000 websites
Stars: ✭ 3,484 (+546.38%)
Mutual labels:  dotnet-core, asp-net-core
Simplcommerce
A simple, cross platform, modularized ecommerce system built on .NET Core
Stars: ✭ 3,474 (+544.53%)
Mutual labels:  asp-net-core, dotnet-core
Mix.core
🚀 Mixcore CMS is an open source CMS that support both headless and decoupled to easily build any kinds of app/web app/customisable APIs built on top of ASP.NET Core / Dotnet Core. It is a completely open source ASP.NET Core (Dotnet Core) CMS solution. https://mixcore.org
Stars: ✭ 304 (-43.6%)
Mutual labels:  asp-net-core, dotnet-core
Hotchocolate
Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
Stars: ✭ 3,009 (+458.26%)
Mutual labels:  asp-net-core, dotnet-core
Framework
.NET Core Extensions and Helper NuGet packages.
Stars: ✭ 399 (-25.97%)
Mutual labels:  asp-net-core, dotnet-core
Angular 7 Project With Asp.net Core Apis
Angular 7 Project with ASP.NET CORE APIS | Angular Project
Stars: ✭ 174 (-67.72%)
Mutual labels:  asp-net-core, dotnet-core
Templates
.NET project templates with batteries included, providing the minimum amount of code required to get you going faster.
Stars: ✭ 2,864 (+431.35%)
Mutual labels:  asp-net-core, dotnet-core
Netcorecms
NetCoreCMS is a modular theme supported Content Management System developed using ASP.Net Core 2.0 MVC. Which is also usable as web application framework. This project is still under development. Please do not use before it's first release.
Stars: ✭ 165 (-69.39%)
Mutual labels:  asp-net-core, dotnet-core
Storedprocedureefcore
Entity Framework Core extension to execute stored procedures
Stars: ✭ 164 (-69.57%)
Mutual labels:  asp-net-core, dotnet-core
Sunengine
SunEngine – site engine with blog, forum and articles sections features support.
Stars: ✭ 130 (-75.88%)
Mutual labels:  asp-net-core, spa
Nlayerappv3
Domain Driven Design (DDD) N-LayeredArchitecture with .Net Core 2
Stars: ✭ 138 (-74.4%)
Mutual labels:  asp-net-core, dotnet-core
Unitynuget
Provides a service to install NuGet packages into a Unity project via the Unity Package Manager
Stars: ✭ 257 (-52.32%)
Mutual labels:  asp-net-core, dotnet-core
Comcms core
COMCMS_Core 版本
Stars: ✭ 377 (-30.06%)
Mutual labels:  asp-net-core, dotnet-core

ASP.NET Core / React SPA Template App

This app is a template application using ASP.NET Core 3.1 for a REST/JSON API server and React for a web client.

screen recording 2017-06-10 at 04 12 pm

Overview of Stack

  • Server
    • ASP.NET Core 3.1
    • PostgreSQL 10
    • Entity Framework Core w/ EF Migrations
    • JSON Web Token (JWT) authorization
    • Docker used for development PostgreSQL database and MailCatcher server
  • Client
    • React 16
    • Webpack for asset bundling and HMR (Hot Module Replacement)
    • CSS Modules
    • Fetch API for REST requests
  • Testing
    • xUnit for .NET Core
    • Enzyme for React
    • MailCatcher for development email delivery
  • DevOps
    • Ansible playbook for provisioning (Nginx reverse proxy, SSL via Let's Encrypt, PostgreSQL backups to S3)
    • Ansible playbook for deployment

Demo

Demo Video

Setup

  1. Install the following:
  2. Run npm install && npm start
  3. Open browser and navigate to http://localhost:5000.

This template was developed and tested on macOS Sierra but should run on Windows (for development) as well. If you experience any issues getting it to run on Windows and work through them, please submit a PR! The production provisioning and deployment scripts (provision:prod and deploy:prod) use Ansible and require a Linux/Ubuntu >= 16.04 target host.

Scripts

npm install

When first cloning the repo or adding new dependencies, run this command. This will:

  • Install Node dependencies from package.json
  • Install .NET Core dependencies from api/api.csproj and api.test/api.test.csproj (using dotnet restore)

npm start

To start the app for development, run this command. This will:

  • Run docker-compose up to ensure the PostgreSQL and MailCatcher Docker images are up and running
  • Run dotnet watch run which will build the app (if changed), watch for changes and start the web server on http://localhost:5000
  • Run Webpack dev middleware with HMR via ASP.NET JavaScriptServices

npm run migrate

After making changes to Entity Framework models in api/Models/, run this command to generate and run a migration on the database. A timestamp will be used for the migration name.

npm test

This will run the xUnit tests in api.test/ and the Mocha/Enzyme tests in client-react.test/.

npm run provision:prod

Before running this script, you need to create an ops/config.yml file first. See the ops README for instructions.

This will run the ops/provision.yml Ansible playbook and provision hosts in ops/hosts inventory file. Ubuntu 16.04 (Xenial) and Ubuntu 18.04 (Bionic) is supported and tested.

This prepares the hosts to recieve deployments by doing the following:

  • Install Nginx
  • Generate a SSL certificate from Let's Encrypt and configure Nginx to use it
  • Install .Net Core
  • Install Supervisor (will run/manage the ASP.NET app)
  • Install PostgreSQL
  • Setup a cron job to automatically backup the PostgreSQL database, compress it, and upload it to S3.
  • Setup UFW (firewall) to lock everything down except inbound SSH and web traffic
  • Create a deploy user, directory for deployments and configure Nginx to serve from this directory

npm run deploy:prod

Before running this script, you need to create a ops/config.yml file first. See the ops README for instructions.

This script will:

  • Build release Webpack bundles
  • Package the .NET Core application in Release mode (dotnet publish)
  • Run the ops/deploy.yml Ansible playbook to deploy this app to hosts in /ops/config.yml inventory file.

This does the following:

  • Copies the build assets to the remote host(s)
  • Updates the appsettings.json file with PostgreSQL credentials specified in ops/group_vars/all file and the app URL (needed for JWT tokens)
  • Restarts the app so that changes will be picked up

Entity Framework Migrations are automatically applied upon startup so they will run when the app restarts.

Development Email Delivery

This template includes a MailCatcher Docker image so that when email is sent during development (i.e. new user registration), it can be viewed in the MailCacher web interface at http://localhost:1080/.

Older Versions

This template was originally created on .NET Core 1.0 and has been upgraded with new versions of .NET Core. Older versions can be found on the Releases page.

Visual Studio Code config

This project has Visual Studio Code tasks and debugger launch config located in .vscode/.

Tasks

  • Command+Shift+B - Runs the "build" task which builds the api/ project
  • Command+Shift+T - Runs the "test" task which runs the xUnit tests in api.test/ and Mocha/Enzyme tests in client-react.test/.

Debug Launcher

With the following debugger launch configs, you can set breakpoints in api/ or the the Mocha tests in client-react.test/ and have full debugging support.

  • Debug api/ (server) - Runs the vscode debugger (breakpoints) on the api/ .NET Core app
  • Debug client-react.test/ (Mocha tests) - Runs the vscode debugger on the client-react.test/ Mocha tests

Credit

The following resources were helpful in setting up this template:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].