{"id":15093290,"url":"https://github.com/fullstackproltd/aspnetcorespa","last_synced_at":"2025-05-15T14:08:36.295Z","repository":{"id":8956797,"uuid":"60366923","full_name":"fullstackproltd/AspNetCoreSpa","owner":"fullstackproltd","description":"Asp.Net 7.0 \u0026 Angular 15 SPA Fullstack application with plenty of examples. Live demo: ","archived":false,"fork":false,"pushed_at":"2023-11-24T09:50:52.000Z","size":18339,"stargazers_count":1508,"open_issues_count":12,"forks_count":470,"subscribers_count":137,"default_branch":"master","last_synced_at":"2025-05-15T14:08:27.483Z","etag":null,"topics":["angular","angular-cli","aspnetcore","aspnetcorespa","best-practices","compodoc","efcore","globalization","identityserver4","security","spa","typescript","unit-testing"],"latest_commit_sha":null,"homepage":"https://aspnetcorespa.fullstackpro.co.uk","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fullstackproltd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-06-03T17:49:56.000Z","updated_at":"2025-04-29T22:02:57.000Z","dependencies_parsed_at":"2023-11-24T10:47:25.208Z","dependency_job_id":null,"html_url":"https://github.com/fullstackproltd/AspNetCoreSpa","commit_stats":null,"previous_names":["fullstackproltd/aspnetcorespa","asadsahi/aspnetcorespa"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fullstackproltd%2FAspNetCoreSpa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fullstackproltd%2FAspNetCoreSpa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fullstackproltd%2FAspNetCoreSpa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fullstackproltd%2FAspNetCoreSpa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fullstackproltd","download_url":"https://codeload.github.com/fullstackproltd/AspNetCoreSpa/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254355335,"owners_count":22057354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","angular-cli","aspnetcore","aspnetcorespa","best-practices","compodoc","efcore","globalization","identityserver4","security","spa","typescript","unit-testing"],"created_at":"2024-09-25T11:20:47.550Z","updated_at":"2025-05-15T14:08:31.275Z","avatar_url":"https://github.com/fullstackproltd.png","language":"C#","readme":"[![Actions Status Web](https://github.com/asadsahi/aspnetcorespa/workflows/Web/badge.svg)](https://github.com/asadsahi/aspnetcorespa/actions?query=workflow%3AWEB)\n[![Actions Status STS](https://github.com/asadsahi/aspnetcorespa/workflows/STS/badge.svg)](https://github.com/asadsahi/aspnetcorespa/actions?query=workflow%3ASTS)\n[![Build Status](https://asadsahi.visualstudio.com/playground/_apis/build/status/asadsahi.AspNetCoreSpa?branchName=master)](https://asadsahi.visualstudio.com/playground/_build/latest?definitionId=20\u0026branchName=master)\n[![Build status](https://ci.appveyor.com/api/projects/status/35j3sxdi22rhg70c?svg=true)](https://ci.appveyor.com/project/asadsahi/aspnetcorespa)\n[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)\n\n## Features\n\n- [ASP.NET Core 7.0](http://www.dot.net/)\n- [Entity Framework Core 7.0](https://docs.efproject.net/en/latest/)\n  - Both Sql Server and Sql lite databases are supported (Check installation instrcutions for more details)\n- [Identity Server 4](http://identityserver.io/)\n- [Angular 15](https://angular.io/)\n- [Angular CLI 15](https://cli.angular.io/)\n- Secure - with CSP and custom security headers\n- [SignalR](https://github.com/aspnet/SignalR/)\n- [SASS](http://sass-lang.com/)\n- Best [practices](https://angular.io/docs/ts/latest/guide/style-guide.html) for Angular code organisation.\n- [Clean Architecture](https://github.com/jasontaylordev/CleanArchitecture) inspired from Jason Taylor.\n- [PWA support](https://developers.google.com/web/progressive-web-apps/)\n- Fast Unit Testing with [Jest](https://facebook.github.io/jest/).\n- E2E testing with [Protractor](http://www.protractortest.org).l\n- [Compodoc](https://compodoc.github.io/compodoc/) for Angular documentation\n- Login and Registration functionality using [Identity Server implicit flow](http://identityserver.io/)\n- Extensible User/Role identity implementation\n- Social logins support with token based authentication, using [Identity Server](http://identityserver.io/)\n- Angular dynamic forms for reusable and DRY code.\n- [Swagger](http://swagger.io/) as Api explorer (Visit url **https://127.0.0.1:5005/swagger** OR whatever port visual studio has launched the website.). More [details](https://github.com/domaindrivendev/Swashbuckle.AspNetCore)\n\n## Pre-requisites\n\n1. [.Net 7.0 SDK](https://www.microsoft.com/net/core#windows)\n2. [Visual studio 2019](https://www.visualstudio.com/) OR [VSCode](https://code.visualstudio.com/) with [C#](https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp) extension\n3. [NodeJs](https://nodejs.org/en/) (Latest LTS)\n4. [Microsoft SQL Server](https://www.microsoft.com/en-us/sql-server) (Optional: If MS SQL server required instead of Sqlite during development)\n5. [Docker](https://www.docker.com/) (Optional: If application will run inside docker container)\n\n## Installation\n\n1. Clone the repo:\n\n   git clone https://github.com/asadsahi/AspNetCoreSpa\n\n2. Change directory:\n\n   cd AspNetCoreSpa\n\n3. Restore packages:\n\n   dotnet restore AspNetCoreSpa.sln\n\n4. Install npm packages:\n\n   - cd src/Presentation/Web/ClientApp:\n\n   - npm install\n\n5. Start Frontend:\n\n   - npm start\n\n6. Run Backend:\n\n   - Using [VSCode](https://code.visualstudio.com/):\n\n     - If you are running for the first time, install dev certificates using command:\n\n     ```\n     dotnet dev-certs https --trust\n     ```\n\n     - From debug menu select `Web` profile to run api application\n     - From debug menu select `STS` profile to run Identity Server application\n\n   - Using [Visual Studio IDE](https://www.visualstudio.com/):\n     - Run `Web` and `STS` projects either individually or by setting multiple projects in solutions properties and hit F5\n\n7. Target either Sqlite or Microsoft SQL Server\n\nThis project supports both databases OOTB.\n\n- Run with Sqlite: (Already configured to quickly run the project)\n\n  - Project is already setup with Sqlite specific database migrations\n\n- Run with Microsoft SQL Server:\n  - Delete `Migrations` folder from src/Infrastructure/Infrastructure/Persistence\n  - Change setting in appsettings.json called `useSqLite` from `true` to `false` and change `Web` connection string to your local Sql Server connection string\n\n7. Once the project is running use following test users to login:\n\n   2 Test users:\n   Username: admin@admin.com\n   Password: P@ssw0rd!\n   OR\n   Username: user@user.com\n   Password: P@ssw0rd!\n\n   Note: For production use Identity server hosted with appropriate configuration.\n\n# Managing Migrations\n\n## Make sure you have ef core global tools installed\n\n`dotnet tool install --global dotnet-ef`\n\n# Web Migrations\n\n## Using command line (from root of the project)\n\n### Create Migration\n\n`dotnet ef migrations add migrationname --startup-project ./src/Presentation/Web --project ./src/Infrastructure/Infrastructure --context ApplicationDbContext -o Persistence/Migrations`\n\n### Update database\n\n`dotnet ef database update --startup-project ./src/Presentation/Web --project ./src/Infrastructure/Infrastructure --context ApplicationDbContext`\n\n### Drop database\n\n`dotnet ef database drop --startup-project ./src/Presentation/Web --project ./src/Infrastructure/Infrastructure --context ApplicationDbContext`\n\n# Localization Migrations\n\n## Using command line (from root of the project)\n\n### Create Migration\n\n`dotnet ef migrations add migrationname --startup-project ./src/Presentation/Web --project ./src/Infrastructure/Infrastructure --context LocalizationDbContext -o Localization/Migrations`\n\n### Update database\n\n`dotnet ef database update --startup-project ./src/Presentation/Web --project ./src/Infrastructure/Infrastructure --context LocalizationDbContext`\n\n### Drop database\n\n`dotnet ef database drop --startup-project ./src/Presentation/Web --project ./src/Infrastructure/Infrastructure --context LocalizationDbContext`\n\n# Identity Migrations\n\n## Using command line (from root of the project)\n\n### Create Migration\n\n`dotnet ef migrations add migrationname --startup-project ./src/Presentation/STS --project ./src/Infrastructure/Infrastructure --context IdentityServerDbContext -o Identity/Migrations`\n\n### Update database\n\n`dotnet ef database update --startup-project ./src/Presentation/STS --project ./src/Infrastructure/Infrastructure --context IdentityServerDbContext`\n\n### Drop database\n\n`dotnet ef database drop --startup-project ./src/Presentation/STS --project ./src/Infrastructure/Infrastructure --context IdentityServerDbContext`\n\n# Other commands\n\n### Angular component scaffolding\n\nNote: You need to run commands from `src/Presentation/Web/ClientApp` directory: More information [here](https://angular.io/cli)\n\n### Angular tests - Using [Jest](https://jestjs.io/en/) and Angular jest [preset](https://github.com/thymikee/jest-preset-angular)\n\n```bash\ncd src/Presentation/Web/ClientApp\n\nnpm test\n```\n\n### Compodoc Angular documentation\n\n- Steps to generate:\n  - npm i compodoc -g\n  - cd src/Presentation/Web/ClientApp\n  - npm run compodoc\n  - cd documentation\n  - http-server\n\nCompodoc documentation: ![alt text](compodoc.jpg \"compodoc documentation\")\n\n````\n### run end-to-end tests\n```bash\n# make sure you have your server running in another terminal (i.e run \"dotnet run\" command)\nnpm run e2e\n````\n\n### run Protractor's elementExplorer (for end-to-end)\n\n```bash\nnpm run webdriver:start\n# in another terminal\nnpm run e2e:live\n```\n\n# Azure Deploy\n\n- You can set an environment variable for azure app deployment password\n  Set-Item -path env:AzureAppPass -value passwordhere\n\n```\nFrom powershell:\n./deploy-azure.ps1\n```\n\n# Deploy to heroku using its container service\n\n### Replace your app name where it is `aspnetcorespa`\n\n- dotnet publish -c release\n- docker build -t aspnetcorespa ./bin/release/net7.0/publish\n- heroku login\n- heroku container:login\n- docker tag aspnetcorespa registry.heroku.com/aspnetcorespa/web\n- docker push registry.heroku.com/aspnetcorespa/web\n  Note: There is a `deploy.heroku.ps1` script included with this project which automates above steps.\n\n# Deploy to Azure as App Service\n\nSet-Item -path env:AzureAppPass -value passwordhere\n\n```\nFrom powershell:\n./deploy-azure.ps1\n```\n\n---\n\n[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=RB7XESV8CP7GW)\n","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=RB7XESV8CP7GW"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffullstackproltd%2Faspnetcorespa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffullstackproltd%2Faspnetcorespa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffullstackproltd%2Faspnetcorespa/lists"}