Clone the repo:
Change directory:
cd AspNetCoreSpa
Restore packages:
dotnet restore AspNetCoreSpa.sln
Install npm packages:
cd src/Presentation/Web/ClientApp:
npm install
Start Frontend:
Run Backend:
Using VSCode:
dotnet dev-certs https --trust
Web
profile to run api applicationSTS
profile to run Identity Server applicationUsing Visual Studio IDE:
Web
and STS
projects either individually or by setting multiple projects in solutions properties and hit F5Target either Sqlite or Microsoft SQL Server
This project supports both databases OOTB.
Run with Sqlite: (Already configured to quickly run the project)
Run with Microsoft SQL Server:
Migrations
folder from src/Infrastructure/Infrastructure/PersistenceuseSqLite
from true
to false
and change Web
connection string to your local Sql Server connection stringOnce the project is running use following test users to login:
2 Test users: Username: admin@admin.com Password: P@ssw0rd! OR Username: user@user.com Password: P@ssw0rd!
Note: For production use Identity server hosted with appropriate configuration.
dotnet tool install --global dotnet-ef
dotnet ef migrations add migrationname --startup-project ./src/Presentation/Web --project ./src/Infrastructure/Infrastructure --context ApplicationDbContext -o Persistence/Migrations
dotnet ef database update --startup-project ./src/Presentation/Web --project ./src/Infrastructure/Infrastructure --context ApplicationDbContext
dotnet ef database drop --startup-project ./src/Presentation/Web --project ./src/Infrastructure/Infrastructure --context ApplicationDbContext
dotnet ef migrations add migrationname --startup-project ./src/Presentation/Web --project ./src/Infrastructure/Infrastructure --context LocalizationDbContext -o Localization/Migrations
dotnet ef database update --startup-project ./src/Presentation/Web --project ./src/Infrastructure/Infrastructure --context LocalizationDbContext
dotnet ef database drop --startup-project ./src/Presentation/Web --project ./src/Infrastructure/Infrastructure --context LocalizationDbContext
dotnet ef migrations add migrationname --startup-project ./src/Presentation/STS --project ./src/Infrastructure/Infrastructure --context IdentityServerDbContext -o Identity/Migrations
dotnet ef database update --startup-project ./src/Presentation/STS --project ./src/Infrastructure/Infrastructure --context IdentityServerDbContext
dotnet ef database drop --startup-project ./src/Presentation/STS --project ./src/Infrastructure/Infrastructure --context IdentityServerDbContext
Note: You need to run commands from src/Presentation/Web/ClientApp
directory: More information here
cd src/Presentation/Web/ClientApp
npm test
Compodoc documentation:
### 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
From powershell:
./deploy-azure.ps1
aspnetcorespa
deploy.heroku.ps1
script included with this project which automates above steps.Set-Item -path env:AzureAppPass -value passwordhere
From powershell:
./deploy-azure.ps1