- ASP.NET Core 2.2
- Entity Framework Core 2.2
- Both Sql Server and Sql lite databases are supported (Check installation instrcutions for more details)
- Identity Server 4
- Angular 7
- Angular CLI 7
- Secure - with CSP and custom security headers
- SignalR
- SASS
- Best practices for Angular code organisation.
- Clean Architecture for ASP.Net Core code.
- PWA support
- SSR (Server side rendering) - Coming soon...
- Fast Unit Testing with Jest.
- E2E testing with Protractor.l
- Compodoc for Angular documentation
- Login and Registration functionality using Identity Server implicit flow
- Extensible User/Role identity implementation
- Social logins support with token based authentication, using Identity Server
- [Angular dynamic forms] for reusable and DRY code.
- Swagger as Api explorer (Visit url https://127.0.0.1:5050/swagger OR whatever port visual studio has launched the website.). More details
- .Net core 2.2 SDK
- Visual studio 2017 OR VSCode with C# extension
- NodeJs (Latest LTS)
- Microsoft SQL Server (Optional: If MS SQL server required instead of Sqlite during development)
- Docker (Optional: If application will run inside docker container)
1. Clone the repo:
git clone https://github.com/asadsahi/AspNetCoreSpa
2. Change directory:
cd AspNetCoreSpa
3. Restore packages:
dotnet restore AspNetCoreSpa.sln
4. Run client project
cd src/AspNetCoreSpa.Web/ClientApp:
4.1. npm install
4.2. npm start
5. Run .Net project:
F5 from either [Visual Studio IDE](https://www.visualstudio.com/) OR [VScode] (https://code.visualstudio.com/):
6. Target either Sqlite or Microsoft SQL Server
This project supports both databases OOTB.
* Run with Sqlite: (Already configured to quickly run the project)
* Project is already setup with Sqlite specific database migrations
* Run with Microsoft SQL Server:
* Delete `Migrations` folder from src/AspNetCoreSpa.Web
* Change setting in appsettings.json called `useSqLite` from `true` to `false`
* This will use `SqlServerConnectionString` connection string pointing to default instance of SQL server installed on local machine
7. Identity server for authentication:
This project by default uses a hosted version of Identity Server at this url: (https://aspnetcorests.azurewebsites.net/).
2 Test users:
Username: admin@admin.com
Password: P@ssw0rd!
OR
Username: user@user.com
Password: P@ssw0rd!
Alternatively, you can run local version of identity server:
a. Run `AspNetCoreSpa.STS` project from this solution
b. Change `StsAuthority` configuration in `appsettings.Development.json` or `appsettings.json` file inside `src/AspNetCoreSpa.Web` to the local running Identity Server URL.
Note: You need to run commands from src/AspNetCoreSpa.Web/ClientApp
directory: More information here
cd src/AspNetCoreSpa.Web/ClientApp
npm test
- Steps to generate:
- npm i compodoc -g
- cd src/AspNetCoreSpa.Web/ClientApp
- 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.2/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