- ASP.NET Core
- Entity Framework Core
- Both Sql Server and Sql lite databases are supported (Check installation instrcutions for more details)
- Angular
- Angular CLI
- Secure - with CSP and custom security headers
- SignalR (Chat example)
- SASS support
- Best practices in file and application organization for Angular.
- Clean Architecture for Asp.Net Core application.
- PWA support
- SSR (Server side rendering) - Coming soon...
- Fast Unit Testing with Jest.
- E2E testing with Protractor.
- Compodoc for Angular documentation
- Login and Registration functionality using Asp.Net Identity & JWT
- Token based authentication using Openiddict
- Get public key access using: http://127.0.0.1:5000/.well-known/jwks
- Extensible User/Role identity implementation
- Social logins support with token based authentication, Follow this wiki page to see how it will work.
- Angular dynamic forms for reusability and to keep html code DRY.
- Swagger as Api explorer (Visit url http://127.0.0.1:5000/swagger OR whatever port visual studio has launched the website.). More details
- .Net core sdk
- Either VSCode with C# extension OR Visual studio 2017
- Nodejs
**Make sure you have Node version >= latest LTS and NPM >= latest LTS
1. Clone the repo
git clone https://github.com/asadsahi/AspNetCoreSpa
2. Change directory
cd AspNetCoreSpa
3. Run Server
F5 from either [VScode] (https://code.visualstudio.com/) or [Visual Studio IDE](https://www.visualstudio.com/):
4. Point to Sqllite or SqlServer
This project supports both sql server and sql lite databases
* Run with Sqlite:
* Project is configured to run with sqlite by default and there is an 'Initial' migration already added (see Migrations folder)
* After changing you models, you can add additional migrations
[see docs](https://docs.microsoft.com/en-us/ef/core/miscellaneous/cli/dotnet)
* Run with SqlServer:
* To run under sql server:
* npm run clean
* Delete `Migrations` folder
* Flip the switch in appsettings.json called `useSqLite` to `false`, this should point to use local sql server setup as default instance. (See appsettings.json file for connection string)
* Run `dotnet ef migrations add "InitialMigrationName"`
Scaffold | Usage |
---|---|
Component | ng g component my-new-component |
Directive | ng g directive my-new-directive |
Pipe | ng g pipe my-new-pipe |
Service | ng g service my-new-service |
Class | ng g class my-new-class |
Guard | ng g guard my-new-guard |
Interface | ng g interface my-new-interface |
Enum | ng g enum my-new-enum |
Module | ng g module my-module |
cd ClientApp
npm test
- Steps to generate:
- npm i compodoc -g
- npm run compodoc
- cd documentation
- http-server
### run end-to-end tests
```bash
# make sure you have your server running in another terminal (i.e run "dotnet run" command)
npm run e2e
npm run webdriver:start
# in another terminal
npm run e2e:live
- You can set an environment variable for azure app deployment password Set-Item -path env:AzureAppPass -value passwordhere
From powershell:
./deploy-azure.ps1
- dotnet publish -c release
- docker build -t aspnetcorespa ./bin/release/netcoreapp2.1/publish
- heroku login
- heroku container:login
- docker tag aspnetcorespa registry.heroku.com/aspnetcorespa/web
- docker push registry.heroku.com/aspnetcorespa/web
Note: There is a
deploy.heroku.ps1
script included with this project which automates above steps.
Set-Item -path env:AzureAppPass -value passwordhere
From powershell:
./deploy-azure.ps1