├── .dockerignore ├── .env ├── .gitignore ├── LICENSE ├── NetCoreMicroservices.sln ├── NetCoreMicroservices.sln.DotSettings.user ├── README.md ├── azure └── images │ └── azure-eks.PNG ├── deployment ├── aks │ ├── commands.txt │ ├── examples │ │ ├── dbs │ │ │ ├── mssql │ │ │ │ ├── mssql-db-deployment.yaml │ │ │ │ ├── mssql-db-pv.yaml │ │ │ │ └── mssql-db-service.yaml │ │ │ ├── postgres │ │ │ │ ├── postgres-db-pv.yaml │ │ │ │ ├── postgres-deployment.yaml │ │ │ │ └── postgres-service.yaml │ │ │ └── redis │ │ │ │ └── redis-db.yaml │ │ ├── ingress-controller │ │ │ ├── test-ingress.yaml │ │ │ ├── test.yaml │ │ │ ├── with-cors │ │ │ │ └── Test-ingress.yaml │ │ │ └── without-cors │ │ │ │ ├── Test-Ingress.yaml │ │ │ │ ├── Test.yaml │ │ │ │ └── Test1.yaml │ │ └── services │ │ │ ├── cors │ │ │ └── cors-ingres.yaml │ │ │ └── ingress-controller │ │ │ └── without-cors │ │ │ └── Test.yaml │ ├── extensions │ │ └── ingress-setup.yaml │ ├── helm │ │ ├── extensions │ │ │ └── ingress │ │ │ │ └── install.bat │ │ └── services │ │ │ └── examples │ │ │ └── webfrontend │ │ │ ├── .vscode │ │ │ └── launch.json │ │ │ ├── Dockerfile │ │ │ ├── package.json │ │ │ ├── public │ │ │ ├── app.css │ │ │ ├── app.js │ │ │ └── index.html │ │ │ ├── server.js │ │ │ └── webfrontend │ │ │ ├── .helmignore │ │ │ ├── Chart.yaml │ │ │ ├── templates │ │ │ ├── NOTES.txt │ │ │ ├── _helpers.tpl │ │ │ ├── deployment.yaml │ │ │ ├── hpa.yaml │ │ │ ├── ingress.yaml │ │ │ ├── service.yaml │ │ │ ├── serviceaccount.yaml │ │ │ └── tests │ │ │ │ └── test-connection.yaml │ │ │ └── values.yaml │ ├── letsencrypt │ │ └── letsencrypt-issuer.yaml │ ├── message-brokers │ │ └── kafka │ │ │ └── kafka-values.yaml │ ├── services │ │ ├── api-gateways │ │ │ └── web-gw │ │ │ │ ├── web-gw-deployment.yaml │ │ │ │ └── web-gw-service.yaml │ │ ├── basket │ │ │ ├── basket-api │ │ │ │ └── basket-api.yaml │ │ │ └── basket-db │ │ │ │ └── basket-db.yaml │ │ ├── catalog │ │ │ ├── catalog-api │ │ │ │ └── catalog-api.yaml │ │ │ └── catalog-db │ │ │ │ └── catalog-db.yaml │ │ ├── customer │ │ │ ├── customer-api │ │ │ │ └── customer-api.yaml │ │ │ └── customer-db │ │ │ │ ├── customer-db-pv.yaml │ │ │ │ ├── customer-db-service.yaml │ │ │ │ └── customer-db.yaml │ │ ├── discount │ │ │ ├── discount-api │ │ │ │ ├── discount-api-configmap.yaml │ │ │ │ └── discount-api.yaml │ │ │ ├── discount-db │ │ │ │ ├── discount-db-deployment.yaml │ │ │ │ ├── discount-db-pv.yaml │ │ │ │ └── discount-db-service.yaml │ │ │ └── discount-grpc │ │ │ │ └── discount-grpc.yaml │ │ ├── game-catalog │ │ │ ├── game-catalog-api │ │ │ │ └── game-catalog-api.yaml │ │ │ └── game-catalog-db │ │ │ │ └── game-catalog-db.yaml │ │ ├── identity-auth │ │ │ ├── identity-auth-deployment.yaml │ │ │ └── identity-auth-service.yaml │ │ ├── ingress │ │ │ └── ingress-deployment.yaml │ │ ├── inventory │ │ │ ├── inventory-api │ │ │ │ └── inventory-api.yaml │ │ │ └── inventory-db │ │ │ │ └── inventory-db.yaml │ │ ├── ordering │ │ │ ├── ordering-api │ │ │ │ └── ordering-api.yaml │ │ │ └── ordering-db │ │ │ │ ├── ordering-db-deployment.yaml │ │ │ │ ├── ordering-db-pv.yaml │ │ │ │ └── ordering-db-service.yaml │ │ ├── product │ │ │ ├── product-api │ │ │ │ ├── product-api-deployment.yaml │ │ │ │ └── product-api-service.yaml │ │ │ └── product-db │ │ │ │ ├── product-db-deployment.yaml │ │ │ │ ├── product-db-pv.yaml │ │ │ │ └── product-db-service.yaml │ │ ├── project-detail │ │ │ ├── project-detail-api │ │ │ │ ├── project-detail-api-deployment.yaml │ │ │ │ └── project-detail-api-service.yaml │ │ │ └── project-detail-db │ │ │ │ ├── project-detail-db-pv.yaml │ │ │ │ ├── project-detail-db-service.yaml │ │ │ │ └── project-detail-db.yaml │ │ ├── realtime-transmission │ │ │ ├── realtime-transmission-api │ │ │ │ └── realtime-transmission-api.yaml │ │ │ └── realtime-transmission-db │ │ │ │ └── realtime-transmission-db.yaml │ │ └── user │ │ │ ├── user-api │ │ │ ├── user-api-deployment.yaml │ │ │ └── user-api-service.yaml │ │ │ └── user-db │ │ │ ├── user-db-deployment.yaml │ │ │ ├── user-db-pv.yaml │ │ │ └── user-db-service.yaml │ └── webapps │ │ ├── web-blazor │ │ ├── web-blazor-deplopyment.yaml │ │ └── web-blazor-service.yaml │ │ ├── web-mvc.yaml │ │ └── web-spa.yaml ├── docker │ └── commands.txt ├── k8s │ ├── commands │ │ ├── arbitrary-commands.txt │ │ ├── deployment.txt │ │ ├── k8s-dashboard.txt │ │ └── troubleshooting.txt │ ├── mongo-configmap.yaml │ ├── mongo-secret.yaml │ ├── mongo.yaml │ ├── netcoremicroservices-api-configmap.yaml │ ├── netcoremicroservices-api.yaml │ ├── netcoremicroservices-client.yaml │ ├── nginx-depl.yaml │ └── nginx-service.yaml └── pipelines │ ├── examples │ └── trivy-pipeline-example.yaml │ ├── nugets │ ├── netmicroservices-mediator-wrapper-pipeline.yaml │ ├── netmicroservices.configuration.nuget-pipeline.yaml │ ├── netmicroservices.messagecontracts.nuget-pipeline.yaml │ ├── netmicroservices.mongodb-wrapper-pipeline.yaml │ ├── netmicroservices.rabbitmq-wrapper.nuget-pipeline.yaml │ └── netmicroservices.sql-wrapper-pipeline.yaml │ ├── services │ ├── api-gateways │ │ └── web-gw │ │ │ └── web-gw-pipeline.yaml │ ├── basket │ │ └── basket-api-pipeline.yml │ ├── catalog │ │ └── catalog-api-pipeline.yml │ ├── customer │ │ └── customer-api-pipeline.yml │ ├── discount │ │ └── discount-grpc-pipeline.yml │ ├── game-catalog │ │ └── game-catalog-pipeline.yml │ ├── identity-auth │ │ └── identity-auth-pipeline.yaml │ ├── inventory │ │ └── inventory-pipeline.yaml │ ├── ordering │ │ └── ordering-api-pipeline.yaml │ ├── product │ │ └── product-api-pipeline.yaml │ ├── project-detail │ │ └── project-detail-pipeline.yaml │ ├── realtime-transmission │ │ └── realtime-transmission-api-pipeline.yaml │ └── user │ │ └── user-api-pipeline.yaml │ └── webapps │ ├── web-blazor-pipeline.yaml │ ├── web-mvc-pipeline.yaml │ └── web-spa-pipeline.yaml ├── docker-compose.dcproj ├── docker-compose.override.yml ├── docker-compose.yml ├── get_helm.sh └── src ├── nugets ├── NetMicroservices.Configuration │ └── NetMicroservices.ServiceConfig │ │ └── NetMicroservices.ServiceConfig.Nuget │ │ ├── NetMicroservices.ServiceConfig.Nuget.csproj │ │ ├── Result.cs │ │ ├── ServiceBase.cs │ │ ├── ServiceResponse.cs │ │ └── ServiceSettings.cs ├── NetMicroservices.Dbs │ ├── NetMicroservices.MongoDbWrapper │ │ ├── NetMicroservices.MongoDbWrapper.Nuget │ │ │ ├── Contexts │ │ │ │ ├── IMongoContext.cs │ │ │ │ ├── IMongoContextSeed.cs │ │ │ │ ├── MongoContext.cs │ │ │ │ └── MongoContextSeed.cs │ │ │ ├── Entities │ │ │ │ └── IMongoEntity.cs │ │ │ ├── NetMicroservices.MongoDbWrapper.Nuget.csproj │ │ │ ├── Repositories │ │ │ │ ├── IMongoRepository.cs │ │ │ │ └── MongoRepository.cs │ │ │ └── Settings │ │ │ │ └── MongoDbSettings.cs │ │ └── NetMicroservices.MongoDbWrapper.Tests │ │ │ └── NetMicroservices.MongoDbWrapper.Tests.csproj │ └── NetMicroservices.SqlWrapper │ │ └── NetMicroservices.SqlWrapper.Nuget │ │ ├── Contracts │ │ └── IAsyncRepository.cs │ │ ├── Entities │ │ └── EntityBase.cs │ │ ├── Extensions │ │ └── EFCoreExtensions.cs │ │ ├── MigrationExtensions.cs │ │ ├── NetMicroservices.SqlWrapper.Nuget.csproj │ │ └── Repositories │ │ └── RepositoryBase.cs ├── NetMicroservices.Messaging │ ├── MediatorWrapper │ │ └── NetMicroservices.MediatorWrapper.Nuget │ │ │ ├── Behaviors │ │ │ ├── UnhandledExceptionBehavior.cs │ │ │ └── ValidationBehavior.cs │ │ │ ├── Exceptions │ │ │ ├── NotFoundException.cs │ │ │ └── ValidationException.cs │ │ │ └── NetMicroservices.MediatorWrapper.Nuget.csproj │ ├── MessageContracts │ │ └── NetMicroservices.MessageContracts.Nuget │ │ │ ├── Contracts.cs │ │ │ └── NetMicroservices.MessageContracts.Nuget.csproj │ └── RabbitMqWrapper │ │ └── NetMicroservices.RabbitMqWrapper.Nuget │ │ ├── Extensions.cs │ │ ├── NetMicroservices.RabbitMqWrapper.Nuget.csproj │ │ └── RabbitMqSettings.cs └── NetMicroservices.Shared │ └── NetMicroservices.Shared.Nuget │ └── NetMicroservices.Shared.Nuget.csproj ├── services ├── API-Gws │ └── Web.Gw │ │ ├── Constants │ │ ├── CorsConstants.cs │ │ ├── DomainConstants.cs │ │ └── EnvConstants.cs │ │ ├── Dockerfile │ │ ├── Extensions │ │ └── KubernetesExtensions.cs │ │ ├── Program.cs │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── Web.Gw.csproj │ │ ├── Web.Gw.csproj.user │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── ocelot.Development.IdentityAuth.json │ │ ├── ocelot.Development.Product.json │ │ ├── ocelot.Development.ProjectDetail.json │ │ ├── ocelot.Development.User.json │ │ ├── ocelot.Development.json │ │ ├── ocelot.Release.IdentityAuth.json │ │ ├── ocelot.Release.Product.json │ │ ├── ocelot.Release.ProjectDetail.json │ │ ├── ocelot.Release.User.json │ │ ├── ocelot.Release.json │ │ ├── ocelot.json │ │ └── stylecop.json ├── Basket │ └── Basket.API │ │ ├── Basket.API.csproj │ │ ├── Basket.API.csproj.user │ │ ├── Controllers │ │ └── BasketController.cs │ │ ├── Dockerfile │ │ ├── Dockerfile.original │ │ ├── Entities │ │ ├── ShoppingCart.cs │ │ └── ShoppingCartItem.cs │ │ ├── GrpcServices │ │ ├── DiscountGrpcService.cs │ │ └── StatusManager.cs │ │ ├── Program.cs │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── Repositories │ │ ├── BasketRepository.cs │ │ └── IBasketRepository.cs │ │ ├── Startup.cs │ │ ├── appsettings.Development.json │ │ └── appsettings.json ├── Coupon │ ├── Coupon.API │ │ ├── Coupon.API.csproj │ │ ├── Coupon.API.csproj.user │ │ ├── Dockerfile │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── Coupon.Application │ │ └── Coupon.Application.csproj │ ├── Coupon.Domain │ │ └── Coupon.Domain.csproj │ ├── Coupon.Infrastructure │ │ └── Coupon.Infrastructure.csproj │ └── Coupon.Persistence │ │ └── Coupon.Persistence.csproj ├── Discount │ ├── Discount.API │ │ ├── Configurations │ │ │ └── DatabaseSettings.cs │ │ ├── Controllers │ │ │ └── DiscountController.cs │ │ ├── Discount.API.csproj │ │ ├── Discount.API.csproj.user │ │ ├── Dockerfile │ │ ├── Dockerfile.original │ │ ├── Entities │ │ │ └── Coupon.cs │ │ ├── Extensions │ │ │ └── HostExtensions.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Repositories │ │ │ ├── DiscountRepository.cs │ │ │ └── IDiscountRepository.cs │ │ ├── Startup.cs │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ └── Discount.Grpc │ │ ├── Configurations │ │ └── DatabaseSettings.cs │ │ ├── Discount.Grpc.csproj │ │ ├── Discount.Grpc.csproj.user │ │ ├── Dockerfile │ │ ├── Dockerfile.original │ │ ├── Entities │ │ └── Coupon.cs │ │ ├── Extensions │ │ └── HostExtensions.cs │ │ ├── Mapper │ │ └── CouponProfile.cs │ │ ├── Program.cs │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── Protos │ │ └── discount.proto │ │ ├── Repositories │ │ ├── DiscountRepository.cs │ │ └── IDiscountRepository.cs │ │ ├── Services │ │ └── DiscountService.cs │ │ ├── Startup.cs │ │ ├── appsettings.Development.json │ │ └── appsettings.json ├── Examples │ ├── Catalog │ │ ├── Catalog.API │ │ │ ├── Catalog.API.csproj │ │ │ ├── Catalog.API.csproj.user │ │ │ ├── Controllers │ │ │ │ └── CatalogController.cs │ │ │ ├── Dockerfile │ │ │ ├── Program.cs │ │ │ ├── Properties │ │ │ │ └── launchSettings.json │ │ │ ├── Startup.cs │ │ │ ├── appsettings.Development.json │ │ │ └── appsettings.json │ │ ├── Catalog.Application │ │ │ ├── ApplicationServicesRegistrator.cs │ │ │ ├── Catalog.Application.csproj │ │ │ ├── Contracts │ │ │ │ └── IProductRepository.cs │ │ │ ├── Features │ │ │ │ └── Queries │ │ │ │ │ └── Products │ │ │ │ │ ├── GetProducts │ │ │ │ │ ├── GetProductsQuery.cs │ │ │ │ │ ├── GetProductsQueryHandler.cs │ │ │ │ │ └── ProductsVm.cs │ │ │ │ │ └── GetSingleProduct │ │ │ │ │ ├── GetProductQuery.cs │ │ │ │ │ ├── GetProductQueryHandler.cs │ │ │ │ │ └── ProductVm.cs │ │ │ └── MappingProfile.cs │ │ ├── Catalog.Domain │ │ │ ├── Catalog.Domain.csproj │ │ │ └── Entities │ │ │ │ └── Product.cs │ │ ├── Catalog.Infrastructure │ │ │ ├── Catalog.Infrastructure.csproj │ │ │ └── InfrastructureServicesRegistrator.cs │ │ └── Catalog.Persistence │ │ │ ├── Catalog.Persistence.csproj │ │ │ ├── PersistenceServicesRegistrator.cs │ │ │ └── Repositories │ │ │ └── ProductRepository.cs │ ├── Customer │ │ ├── Customer.API │ │ │ ├── Configurations │ │ │ │ └── DatabaseSettings.cs │ │ │ ├── Controllers │ │ │ │ └── CustomerController.cs │ │ │ ├── Customer.API.csproj │ │ │ ├── Customer.API.csproj.user │ │ │ ├── Dockerfile │ │ │ ├── Program.cs │ │ │ ├── Properties │ │ │ │ └── launchSettings.json │ │ │ ├── Startup.cs │ │ │ ├── appsettings.Development.json │ │ │ └── appsettings.json │ │ ├── Customer.Application │ │ │ ├── ApplicationServicesRegistrator.cs │ │ │ ├── Contracts │ │ │ │ └── IPersonRepository.cs │ │ │ ├── Customer.Application.csproj │ │ │ ├── Features │ │ │ │ └── Queries │ │ │ │ │ └── GetPersonsList │ │ │ │ │ ├── GetPersonsListQuery.cs │ │ │ │ │ ├── GetPersonsListQueryHandler.cs │ │ │ │ │ └── PersonVm.cs │ │ │ └── MappingProfile.cs │ │ ├── Customer.Domain │ │ │ ├── Customer.Domain.csproj │ │ │ └── Person.cs │ │ ├── Customer.Infrastructure │ │ │ └── Customer.Infrastructure.csproj │ │ ├── Customer.Persistence │ │ │ ├── Contexts │ │ │ │ ├── PersonContext.cs │ │ │ │ └── PersonContextSeed.cs │ │ │ ├── Customer.Persistence.csproj │ │ │ ├── Migrations │ │ │ │ ├── 20210618201512_InitialCreate.Designer.cs │ │ │ │ ├── 20210618201512_InitialCreate.cs │ │ │ │ └── PersonContextModelSnapshot.cs │ │ │ ├── PersistenceServicesRegistrator.cs │ │ │ └── Repositories │ │ │ │ └── PersonRepository.cs │ │ └── Customer.Tests │ │ │ ├── Customer.Tests.csproj │ │ │ └── UnitTest1.cs │ ├── GameCatalog │ │ └── GameCatalog.API │ │ │ ├── Constants │ │ │ └── QueueConstants.cs │ │ │ ├── Controllers │ │ │ └── ItemsController.cs │ │ │ ├── Dockerfile │ │ │ ├── Dtos.cs │ │ │ ├── Entities │ │ │ └── GameItem.cs │ │ │ ├── Extensions │ │ │ └── ItemExtensions.cs │ │ │ ├── GameCatalog.API.csproj │ │ │ ├── GameCatalog.API.csproj.user │ │ │ ├── Program.cs │ │ │ ├── Properties │ │ │ └── launchSettings.json │ │ │ ├── Settings │ │ │ └── ServiceSettings.cs │ │ │ ├── Startup.cs │ │ │ ├── appsettings.Development.json │ │ │ └── appsettings.json │ ├── Inventory │ │ └── Inventory.API │ │ │ ├── Automapper │ │ │ └── Profiles │ │ │ │ └── GameCatalogProfile.cs │ │ │ ├── Clients │ │ │ ├── GameCatalogClient.cs │ │ │ └── IGameCatalogClient.cs │ │ │ ├── Controllers │ │ │ └── ItemsController.cs │ │ │ ├── Dockerfile │ │ │ ├── Dtos.cs │ │ │ ├── Entities │ │ │ └── InventoryItem.cs │ │ │ ├── Extensions │ │ │ └── InventoryExtensions.cs │ │ │ ├── Inventory.API.csproj │ │ │ ├── Inventory.API.csproj.user │ │ │ ├── Program.cs │ │ │ ├── Properties │ │ │ └── launchSettings.json │ │ │ ├── Settings │ │ │ └── ServiceSettings.cs │ │ │ ├── Startup.cs │ │ │ ├── appsettings.Development.json │ │ │ └── appsettings.json │ ├── RealTimeTransmission │ │ └── RealTimeTransmission.API │ │ │ ├── Controllers │ │ │ └── AppSettingsController.cs │ │ │ ├── Dockerfile │ │ │ ├── Hubs │ │ │ ├── IViewHub.cs │ │ │ └── ViewHub.cs │ │ │ ├── Program.cs │ │ │ ├── Properties │ │ │ └── launchSettings.json │ │ │ ├── RealTimeTransmission.API.csproj │ │ │ ├── RealTimeTransmission.API.csproj.user │ │ │ ├── Startup.cs │ │ │ ├── appsettings.Development.json │ │ │ └── appsettings.json │ └── SignalR.API │ │ ├── Dockerfile │ │ ├── Hubs │ │ └── CourierHub.cs │ │ ├── Program.cs │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── SignalR.API.csproj │ │ ├── SignalR.API.csproj.user │ │ ├── SignalR │ │ ├── Contracts │ │ │ └── CourierMessage.cs │ │ ├── Handlers │ │ │ └── CourierTrackingHandler.cs │ │ └── Hubs │ │ │ └── CourierTrackingHub.cs │ │ ├── Startup.cs │ │ ├── appsettings.Development.json │ │ └── appsettings.json ├── IdentityAuth │ ├── Config.cs │ ├── Dockerfile │ ├── IdentityAuth.csproj │ ├── IdentityAuth.csproj.user │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Quickstart │ │ ├── Account │ │ │ ├── AccountController.cs │ │ │ ├── AccountOptions.cs │ │ │ ├── ExternalController.cs │ │ │ ├── ExternalProvider.cs │ │ │ ├── LoggedOutViewModel.cs │ │ │ ├── LoginInputModel.cs │ │ │ ├── LoginViewModel.cs │ │ │ ├── LogoutInputModel.cs │ │ │ ├── LogoutViewModel.cs │ │ │ └── RedirectViewModel.cs │ │ ├── Consent │ │ │ ├── ConsentController.cs │ │ │ ├── ConsentInputModel.cs │ │ │ ├── ConsentOptions.cs │ │ │ ├── ConsentViewModel.cs │ │ │ ├── ProcessConsentResult.cs │ │ │ └── ScopeViewModel.cs │ │ ├── Device │ │ │ ├── DeviceAuthorizationInputModel.cs │ │ │ ├── DeviceAuthorizationViewModel.cs │ │ │ └── DeviceController.cs │ │ ├── Diagnostics │ │ │ ├── DiagnosticsController.cs │ │ │ └── DiagnosticsViewModel.cs │ │ ├── Extensions.cs │ │ ├── Grants │ │ │ ├── GrantsController.cs │ │ │ └── GrantsViewModel.cs │ │ ├── Home │ │ │ ├── ErrorViewModel.cs │ │ │ └── HomeController.cs │ │ ├── SecurityHeadersAttribute.cs │ │ └── TestUsers.cs │ ├── Views │ │ ├── Account │ │ │ ├── AccessDenied.cshtml │ │ │ ├── LoggedOut.cshtml │ │ │ ├── Login.cshtml │ │ │ └── Logout.cshtml │ │ ├── Consent │ │ │ └── Index.cshtml │ │ ├── Device │ │ │ ├── Success.cshtml │ │ │ ├── UserCodeCapture.cshtml │ │ │ └── UserCodeConfirmation.cshtml │ │ ├── Diagnostics │ │ │ └── Index.cshtml │ │ ├── Grants │ │ │ └── Index.cshtml │ │ ├── Home │ │ │ └── Index.cshtml │ │ ├── Shared │ │ │ ├── Error.cshtml │ │ │ ├── Redirect.cshtml │ │ │ ├── _Layout.cshtml │ │ │ ├── _Nav.cshtml │ │ │ ├── _ScopeListItem.cshtml │ │ │ └── _ValidationSummary.cshtml │ │ ├── _ViewImports.cshtml │ │ └── _ViewStart.cshtml │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── tempkey.jwk │ └── wwwroot │ │ ├── css │ │ ├── site.css │ │ ├── site.min.css │ │ └── site.scss │ │ ├── favicon.ico │ │ ├── icon.jpg │ │ ├── icon.png │ │ ├── js │ │ ├── signin-redirect.js │ │ └── signout-redirect.js │ │ └── lib │ │ ├── bootstrap │ │ ├── LICENSE │ │ ├── README.md │ │ ├── dist │ │ │ ├── css │ │ │ │ ├── bootstrap-grid.css │ │ │ │ ├── bootstrap-grid.css.map │ │ │ │ ├── bootstrap-grid.min.css │ │ │ │ ├── bootstrap-grid.min.css.map │ │ │ │ ├── bootstrap-reboot.css │ │ │ │ ├── bootstrap-reboot.css.map │ │ │ │ ├── bootstrap-reboot.min.css │ │ │ │ ├── bootstrap-reboot.min.css.map │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ ├── bootstrap.min.css │ │ │ │ └── bootstrap.min.css.map │ │ │ └── js │ │ │ │ ├── bootstrap.bundle.js │ │ │ │ ├── bootstrap.bundle.js.map │ │ │ │ ├── bootstrap.bundle.min.js │ │ │ │ ├── bootstrap.bundle.min.js.map │ │ │ │ ├── bootstrap.js │ │ │ │ ├── bootstrap.js.map │ │ │ │ ├── bootstrap.min.js │ │ │ │ └── bootstrap.min.js.map │ │ └── scss │ │ │ ├── _alert.scss │ │ │ ├── _badge.scss │ │ │ ├── _breadcrumb.scss │ │ │ ├── _button-group.scss │ │ │ ├── _buttons.scss │ │ │ ├── _card.scss │ │ │ ├── _carousel.scss │ │ │ ├── _close.scss │ │ │ ├── _code.scss │ │ │ ├── _custom-forms.scss │ │ │ ├── _dropdown.scss │ │ │ ├── _forms.scss │ │ │ ├── _functions.scss │ │ │ ├── _grid.scss │ │ │ ├── _images.scss │ │ │ ├── _input-group.scss │ │ │ ├── _jumbotron.scss │ │ │ ├── _list-group.scss │ │ │ ├── _media.scss │ │ │ ├── _mixins.scss │ │ │ ├── _modal.scss │ │ │ ├── _nav.scss │ │ │ ├── _navbar.scss │ │ │ ├── _pagination.scss │ │ │ ├── _popover.scss │ │ │ ├── _print.scss │ │ │ ├── _progress.scss │ │ │ ├── _reboot.scss │ │ │ ├── _root.scss │ │ │ ├── _spinners.scss │ │ │ ├── _tables.scss │ │ │ ├── _toasts.scss │ │ │ ├── _tooltip.scss │ │ │ ├── _transitions.scss │ │ │ ├── _type.scss │ │ │ ├── _utilities.scss │ │ │ ├── _variables.scss │ │ │ ├── bootstrap-grid.scss │ │ │ ├── bootstrap-reboot.scss │ │ │ ├── bootstrap.scss │ │ │ ├── mixins │ │ │ ├── _alert.scss │ │ │ ├── _background-variant.scss │ │ │ ├── _badge.scss │ │ │ ├── _border-radius.scss │ │ │ ├── _box-shadow.scss │ │ │ ├── _breakpoints.scss │ │ │ ├── _buttons.scss │ │ │ ├── _caret.scss │ │ │ ├── _clearfix.scss │ │ │ ├── _deprecate.scss │ │ │ ├── _float.scss │ │ │ ├── _forms.scss │ │ │ ├── _gradients.scss │ │ │ ├── _grid-framework.scss │ │ │ ├── _grid.scss │ │ │ ├── _hover.scss │ │ │ ├── _image.scss │ │ │ ├── _list-group.scss │ │ │ ├── _lists.scss │ │ │ ├── _nav-divider.scss │ │ │ ├── _pagination.scss │ │ │ ├── _reset-text.scss │ │ │ ├── _resize.scss │ │ │ ├── _screen-reader.scss │ │ │ ├── _size.scss │ │ │ ├── _table-row.scss │ │ │ ├── _text-emphasis.scss │ │ │ ├── _text-hide.scss │ │ │ ├── _text-truncate.scss │ │ │ ├── _transition.scss │ │ │ └── _visibility.scss │ │ │ ├── utilities │ │ │ ├── _align.scss │ │ │ ├── _background.scss │ │ │ ├── _borders.scss │ │ │ ├── _clearfix.scss │ │ │ ├── _display.scss │ │ │ ├── _embed.scss │ │ │ ├── _flex.scss │ │ │ ├── _float.scss │ │ │ ├── _overflow.scss │ │ │ ├── _position.scss │ │ │ ├── _screenreaders.scss │ │ │ ├── _shadows.scss │ │ │ ├── _sizing.scss │ │ │ ├── _spacing.scss │ │ │ ├── _stretched-link.scss │ │ │ ├── _text.scss │ │ │ └── _visibility.scss │ │ │ └── vendor │ │ │ └── _rfs.scss │ │ └── jquery │ │ ├── LICENSE.txt │ │ ├── README.md │ │ └── dist │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ ├── jquery.min.map │ │ ├── jquery.slim.js │ │ ├── jquery.slim.min.js │ │ └── jquery.slim.min.map ├── Ordering │ ├── Ordering.API │ │ ├── Configurations │ │ │ └── DatabaseSettings.cs │ │ ├── Controllers │ │ │ └── OrderController.cs │ │ ├── Dockerfile │ │ ├── Ordering.API.csproj │ │ ├── Ordering.API.csproj.user │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Startup.cs │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── Ordering.Application │ │ ├── ApplicationServicesRegistrator.cs │ │ ├── Contracts │ │ │ ├── Infrastructure │ │ │ │ └── IEmailService.cs │ │ │ └── Persistence │ │ │ │ └── IOrderRepository.cs │ │ ├── Features │ │ │ └── Orders │ │ │ │ ├── Commands │ │ │ │ ├── CheckoutOrder │ │ │ │ │ ├── CheckoutOrderCommand.cs │ │ │ │ │ ├── CheckoutOrderCommandHandler.cs │ │ │ │ │ └── CheckoutOrderCommandValidator.cs │ │ │ │ ├── DeleteOrder │ │ │ │ │ ├── DeleteOrderCommand.cs │ │ │ │ │ ├── DeleteOrderCommandHandler.cs │ │ │ │ │ └── DeleteOrderCommandValidator.cs │ │ │ │ └── UpdateOrder │ │ │ │ │ ├── UpdateOrderCommand.cs │ │ │ │ │ ├── UpdateOrderCommandHandler.cs │ │ │ │ │ └── UpdateOrderCommandValidator.cs │ │ │ │ └── Queries │ │ │ │ └── GetOrdersList │ │ │ │ ├── GetOrdersListQuery.cs │ │ │ │ ├── GetOrdersListQueryHandler.cs │ │ │ │ └── OrdersVm.cs │ │ ├── Mappings │ │ │ └── MappingProfile.cs │ │ ├── Models │ │ │ ├── Email.cs │ │ │ └── EmailSettings.cs │ │ └── Ordering.Application.csproj │ ├── Ordering.Domain │ │ ├── Common │ │ │ └── ValueObject.cs │ │ ├── Entities │ │ │ └── Order.cs │ │ └── Ordering.Domain.csproj │ ├── Ordering.Infrastructure │ │ ├── EmailService.cs │ │ ├── InfrastructureServicesRegistrator.cs │ │ └── Ordering.Infrastructure.csproj │ └── Ordering.Persistence │ │ ├── Contexts │ │ ├── OrderContext.cs │ │ └── OrderContextSeed.cs │ │ ├── Migrations │ │ ├── 20210617074348_InitialCreate.Designer.cs │ │ ├── 20210617074348_InitialCreate.cs │ │ └── OrderContextModelSnapshot.cs │ │ ├── Ordering.Persistence.csproj │ │ ├── PersistenceServicesRegistrator.cs │ │ └── Repositories │ │ └── OrderRepository.cs ├── Product │ ├── Product.API │ │ ├── Controllers │ │ │ ├── CategoryController.cs │ │ │ ├── IdentityController.cs │ │ │ └── ProductController.cs │ │ ├── Dockerfile │ │ ├── Product.API.csproj │ │ ├── Product.API.csproj.user │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── Product.Application │ │ ├── ApplicationServicesRegistrator.cs │ │ ├── Categories │ │ │ ├── Dtos │ │ │ │ └── CategoryDto.cs │ │ │ ├── Handlers │ │ │ │ └── GetCategoryListUseCaseHandler.cs │ │ │ ├── Interfaces │ │ │ │ ├── ICategoryReader.cs │ │ │ │ └── ICategoryReaderEf.cs │ │ │ ├── Readers │ │ │ │ └── CategoryReader.cs │ │ │ └── UseCases │ │ │ │ └── GetCategoryListUseCase.cs │ │ ├── MappingProfile.cs │ │ ├── Product.Application.csproj │ │ └── Products │ │ │ ├── Dtos │ │ │ ├── ProductDetailDto.cs │ │ │ ├── ProductDetailVariantDto.cs │ │ │ ├── ProductDto.cs │ │ │ ├── ProductTypeItemDto.cs │ │ │ └── ProductVariantDto.cs │ │ │ ├── Handlers │ │ │ ├── GetProductListUseCaseHandler.cs │ │ │ ├── GetProductUseCaseHandler.cs │ │ │ ├── GetProductsByCategoryUseCaseHandler.cs │ │ │ ├── GetProductsSuggestionsUseCaseHandler.cs │ │ │ └── SearchProductsUseCaseHandler.cs │ │ │ ├── Interfaces │ │ │ ├── Readers │ │ │ │ ├── IProductReader.cs │ │ │ │ └── IProductReaderEf.cs │ │ │ ├── Repositories │ │ │ │ ├── ICategoryRepository.cs │ │ │ │ └── IProductRepository.cs │ │ │ └── Services │ │ │ │ ├── ICategoryService.cs │ │ │ │ └── IProductService.cs │ │ │ ├── Readers │ │ │ └── ProductReader.cs │ │ │ └── UseCases │ │ │ ├── GetProductListUseCase.cs │ │ │ ├── GetProductUseCase.cs │ │ │ ├── GetProductsByCategoryUseCase.cs │ │ │ ├── GetProductsSuggestionsUseCase.cs │ │ │ └── SearchProductsUseCase.cs │ ├── Product.Domain │ │ ├── Entities │ │ │ ├── CategoryEntity.cs │ │ │ ├── ProductEntity.cs │ │ │ ├── ProductTypeEntity.cs │ │ │ └── ProductVariantEntity.cs │ │ └── Product.Domain.csproj │ ├── Product.Infrastructure │ │ ├── InfrastructureServicesRegistrator.cs │ │ └── Product.Infrastructure.csproj │ ├── Product.Persistence │ │ ├── Contexts │ │ │ └── ProductContext.cs │ │ ├── EntityConfigurations │ │ │ ├── CategoryConfiguration.cs │ │ │ ├── ProductConfiguration.cs │ │ │ ├── ProductTypeConfiguration.cs │ │ │ └── ProductVariantConfiguration.cs │ │ ├── Migrations │ │ │ ├── 20221016075926_Initial.Designer.cs │ │ │ ├── 20221016075926_Initial.cs │ │ │ ├── 20221021061346_CategoryModel.Designer.cs │ │ │ ├── 20221021061346_CategoryModel.cs │ │ │ ├── 20221021070957_CategoryModel_Restructuralization.Designer.cs │ │ │ ├── 20221021070957_CategoryModel_Restructuralization.cs │ │ │ ├── 20221023100331_ProductCategoryRelationship.Designer.cs │ │ │ ├── 20221023100331_ProductCategoryRelationship.cs │ │ │ ├── 20221216091712_ProductPriceRemoval.Designer.cs │ │ │ ├── 20221216091712_ProductPriceRemoval.cs │ │ │ ├── 20221216094617_ProductEntityReset.Designer.cs │ │ │ ├── 20221216094617_ProductEntityReset.cs │ │ │ ├── 20221216220156_CleanProductCategories.Designer.cs │ │ │ ├── 20221216220156_CleanProductCategories.cs │ │ │ ├── 20221216222520_CategoryDataSeed.Designer.cs │ │ │ ├── 20221216222520_CategoryDataSeed.cs │ │ │ ├── 20221216230003_ProductDataSeed.Designer.cs │ │ │ ├── 20221216230003_ProductDataSeed.cs │ │ │ ├── 20221217090552_CleanProductCategoriesData.Designer.cs │ │ │ ├── 20221217090552_CleanProductCategoriesData.cs │ │ │ ├── 20221217092242_ClearProductCategoriesData.Designer.cs │ │ │ ├── 20221217092242_ClearProductCategoriesData.cs │ │ │ ├── 20221217093655_BookCategorySeed.Designer.cs │ │ │ ├── 20221217093655_BookCategorySeed.cs │ │ │ ├── 20221217094856_MovieCategorySeed.Designer.cs │ │ │ ├── 20221217094856_MovieCategorySeed.cs │ │ │ ├── 20221217134253_VideoGameCategorySeed.Designer.cs │ │ │ ├── 20221217134253_VideoGameCategorySeed.cs │ │ │ ├── 20221217142215_ProductNewDataSeed.Designer.cs │ │ │ ├── 20221217142215_ProductNewDataSeed.cs │ │ │ ├── 20221218094028_ProductsCleanup.Designer.cs │ │ │ ├── 20221218094028_ProductsCleanup.cs │ │ │ ├── 20221218094546_ProductFirstTestData.Designer.cs │ │ │ ├── 20221218094546_ProductFirstTestData.cs │ │ │ ├── 20221218203117_ProductsTestData.Designer.cs │ │ │ ├── 20221218203117_ProductsTestData.cs │ │ │ ├── 20221218205254_ProductTypeEntity.Designer.cs │ │ │ ├── 20221218205254_ProductTypeEntity.cs │ │ │ ├── 20221220005858_ProductTestDataFix.Designer.cs │ │ │ ├── 20221220005858_ProductTestDataFix.cs │ │ │ ├── 20221220085335_ProductTypeTestData.Designer.cs │ │ │ ├── 20221220085335_ProductTypeTestData.cs │ │ │ ├── 20221220233626_ProductVariantEntity.Designer.cs │ │ │ ├── 20221220233626_ProductVariantEntity.cs │ │ │ ├── 20221221192423_ProductVariantFirstProductData.Designer.cs │ │ │ ├── 20221221192423_ProductVariantFirstProductData.cs │ │ │ ├── 20221222151750_ProductVariantTestProductData.Designer.cs │ │ │ ├── 20221222151750_ProductVariantTestProductData.cs │ │ │ └── ProductContextModelSnapshot.cs │ │ ├── PersistenceServicesRegistrator.cs │ │ ├── Product.Persistence.csproj │ │ ├── Readers │ │ │ ├── CategoryReaderEf.cs │ │ │ └── ProductReaderEf.cs │ │ ├── Repositories │ │ │ ├── CategoryRepository.cs │ │ │ └── ProductRepository.cs │ │ └── Services │ │ │ ├── CategoryService.cs │ │ │ └── ProductService.cs │ └── Product.Tests │ │ ├── IntegrationTests │ │ └── Persistence │ │ │ └── CategoryDataRepositoryTests.cs │ │ ├── Product.Tests.csproj │ │ ├── UnitTests │ │ └── Persistence │ │ │ └── Services │ │ │ ├── CategoryServiceTests.cs │ │ │ └── ProductServiceTests.cs │ │ ├── Usings.cs │ │ └── nuget.config ├── ProjectDetail │ ├── ProjectDetail.API │ │ ├── Controllers │ │ │ └── ProjectDetailController.cs │ │ ├── Dockerfile │ │ ├── Program.cs │ │ ├── ProjectDetail.API.csproj │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── ProjectDetail.Application │ │ ├── ApplicationServicesRegistrator.cs │ │ ├── MappingProfile.cs │ │ ├── ProjectDetail.Application.csproj │ │ └── ProjectName │ │ │ ├── Dtos │ │ │ └── ProjectDetailDto.cs │ │ │ ├── Handlers │ │ │ └── GetProjectNameUseCaseHandler.cs │ │ │ ├── Interfaces │ │ │ └── Persistence │ │ │ │ └── Repositories │ │ │ │ └── IProjectRepository.cs │ │ │ └── UseCases │ │ │ └── GetProjectNameUseCase.cs │ ├── ProjectDetail.Domain │ │ ├── Entities │ │ │ └── ProjectDetailEntity.cs │ │ └── ProjectDetail.Domain.csproj │ ├── ProjectDetail.Infrastructure │ │ ├── InfrastructureServicesRegistrator.cs │ │ └── ProjectDetail.Infrastructure.csproj │ └── ProjectDetail.Persistence │ │ ├── Contexts │ │ ├── ProjectDetailContext.cs │ │ └── ProjectDetailContextSeed.cs │ │ ├── EntityConfigurations │ │ └── ProjectDetailConfiguration.cs │ │ ├── Migrations │ │ ├── 20221022103120_Initial.Designer.cs │ │ ├── 20221022103120_Initial.cs │ │ └── ProjectContextModelSnapshot.cs │ │ ├── PersistenceServicesRegistrator.cs │ │ ├── ProjectDetail.Persistence.csproj │ │ └── Repositories │ │ └── ProjectDetailRepository.cs └── User │ ├── User.API │ ├── Controllers │ │ ├── AuthController.cs │ │ └── IdentityController.cs │ ├── Dockerfile │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── User.API.csproj │ ├── User.API.csproj.user │ ├── appsettings.Development.json │ └── appsettings.json │ ├── User.Application │ ├── ApplicationServicesRegistrator.cs │ ├── Contracts │ │ └── IAuthService.cs │ ├── Dtos │ │ ├── AuthorizedUserDto.cs │ │ ├── Requests │ │ │ ├── UserLoginRequestDto.cs │ │ │ └── UserRegistrationRequestDto.cs │ │ ├── SignInUserDto.cs │ │ └── UserRegistrationDto.cs │ ├── Features │ │ └── Auth │ │ │ └── Commands │ │ │ ├── UserLogin │ │ │ ├── UserLoginCommand.cs │ │ │ └── UserLoginCommandHandler.cs │ │ │ └── UserRegistration │ │ │ ├── UserRegistrationCommand.cs │ │ │ └── UserRegistrationCommandHandler.cs │ ├── MappingProfile.cs │ └── User.Application.csproj │ ├── User.Domain │ ├── Entities │ │ └── UserEntity.cs │ └── User.Domain.csproj │ ├── User.Infrastructure │ ├── PasswordUtil.cs │ ├── User.Infrastructure.csproj │ └── UserUtil.cs │ └── User.Persistence │ ├── Contexts │ └── UserContext.cs │ ├── EntityConfigurations │ └── UserConfiguration.cs │ ├── Migrations │ ├── 20221104102050_Initial.Designer.cs │ ├── 20221104102050_Initial.cs │ └── UserContextModelSnapshot.cs │ ├── PersistenceServicesRegistrator.cs │ ├── Services │ └── AuthService.cs │ └── User.Persistence.csproj └── webapps ├── Web.Blazor ├── Client │ ├── App.razor │ ├── Auth │ │ └── BlazorAuthStateProvider.cs │ ├── Pages │ │ └── public-side │ │ │ ├── BooksPage.razor │ │ │ ├── Customers.razor │ │ │ ├── Index.razor │ │ │ ├── LoginPage.razor │ │ │ ├── MoviesPage.razor │ │ │ ├── ProductDetail.razor │ │ │ ├── ProfilePage.razor │ │ │ ├── SearchProductPage.razor │ │ │ ├── UserRegisterPage.razor │ │ │ └── VideoGamesPage.razor │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Services │ │ ├── Auth │ │ │ ├── AuthService.cs │ │ │ └── IAuthService.cs │ │ ├── Category │ │ │ ├── CategoryService.cs │ │ │ └── ICategoryService.cs │ │ ├── Products │ │ │ ├── IProductService.cs │ │ │ └── ProductService.cs │ │ └── ProjectDetail │ │ │ ├── IProjectDetailService.cs │ │ │ └── ProjectDetailService.cs │ ├── Shared │ │ ├── App │ │ │ ├── Cart │ │ │ │ └── Common │ │ │ │ │ └── CartBuyCTA.razor │ │ │ ├── Coupon │ │ │ │ └── Common │ │ │ │ │ └── ApplyCouponCTA.razor │ │ │ └── Products │ │ │ │ ├── Common │ │ │ │ ├── ProductDescription │ │ │ │ │ ├── ProductDescription.razor │ │ │ │ │ └── ProductDescription.razor.css │ │ │ │ ├── ProductImage │ │ │ │ │ ├── ProductImage.razor │ │ │ │ │ └── ProductImage.razor.css │ │ │ │ ├── ProductItemContainer │ │ │ │ │ ├── ProductItemContainer.razor │ │ │ │ │ └── ProductItemContainer.razor.css │ │ │ │ ├── ProductName │ │ │ │ │ ├── ProductName.razor │ │ │ │ │ └── ProductName.razor.css │ │ │ │ ├── ProductPrice │ │ │ │ │ ├── ProductPrice.razor │ │ │ │ │ └── ProductPrice.razor.css │ │ │ │ └── ProductVariant │ │ │ │ │ └── ProductVariantPrice │ │ │ │ │ ├── ProductVariantPrice.razor │ │ │ │ │ └── ProductVariantPrice.razor.css │ │ │ │ ├── ProductItem │ │ │ │ └── ProductItemDetail │ │ │ │ │ ├── ProductItemDetail.razor │ │ │ │ │ └── ProductItemDetail.razor.css │ │ │ │ └── ProductList │ │ │ │ ├── ProductList.razor │ │ │ │ └── ProductList.razor.css │ │ ├── Common │ │ │ ├── Auth │ │ │ │ └── NotAuthorizedContent.razor │ │ │ ├── PageHeading.razor │ │ │ └── Search │ │ │ │ └── Searchbar │ │ │ │ └── Searchbar.razor │ │ ├── MainLayout.razor │ │ ├── MainLayout.razor.css │ │ ├── NavMenu.razor │ │ ├── NavMenu.razor.css │ │ ├── Skeleton │ │ │ └── Header │ │ │ │ ├── Nav │ │ │ │ ├── NavTitle.razor │ │ │ │ └── NavTitle.razor.css │ │ │ │ └── UserButton │ │ │ │ └── UserButton.razor │ │ └── SurveyPrompt.razor │ ├── Web.Blazor.Client.csproj │ ├── _Imports.razor │ └── wwwroot │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── css │ │ ├── app.css │ │ ├── bootstrap │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ └── open-iconic │ │ │ ├── FONT-LICENSE │ │ │ ├── ICON-LICENSE │ │ │ ├── README.md │ │ │ └── font │ │ │ ├── css │ │ │ └── open-iconic-bootstrap.min.css │ │ │ └── fonts │ │ │ ├── open-iconic.eot │ │ │ ├── open-iconic.otf │ │ │ ├── open-iconic.svg │ │ │ ├── open-iconic.ttf │ │ │ └── open-iconic.woff │ │ ├── favicon.ico │ │ ├── icon-192.png │ │ ├── icon-512.png │ │ ├── index.html │ │ ├── manifest.json │ │ ├── service-worker.js │ │ └── service-worker.published.js ├── Dockerfile ├── Server │ ├── Pages │ │ ├── Error.cshtml │ │ └── Error.cshtml.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Web.Blazor.Server.csproj │ ├── Web.Blazor.Server.csproj.user │ ├── appsettings.Development.json │ └── appsettings.json ├── Shared │ ├── CategoryDto.cs │ ├── Product.cs │ ├── ProductType.cs │ ├── ProductVariant.cs │ ├── ProjectDetail.cs │ ├── UserLogin.cs │ ├── UserRegister.cs │ └── Web.Blazor.Shared.csproj └── nginx.conf └── Web.Mvc ├── ApiServices ├── IIdentityService.cs ├── IProductService.cs ├── IdentityService.cs └── ProductService.cs ├── Auth └── HttpHandlers │ └── AuthenticationDelegatingHandler.cs ├── Config └── ApiSettings.cs ├── Constants └── HttpClientConstants.cs ├── Controllers ├── HomeController.cs ├── ProductController.cs └── UserController.cs ├── Dockerfile ├── Models ├── ErrorViewModel.cs ├── Identity │ └── IdentityProfileModel.cs ├── Product.cs └── ProductVariant.cs ├── Program.cs ├── Properties └── launchSettings.json ├── Views ├── Home │ ├── Index.cshtml │ └── Privacy.cshtml ├── Product │ └── Index.cshtml ├── Shared │ ├── Error.cshtml │ ├── _Layout.cshtml │ ├── _Layout.cshtml.css │ └── _ValidationScriptsPartial.cshtml ├── User │ └── Profile.cshtml ├── _ViewImports.cshtml └── _ViewStart.cshtml ├── Web.Mvc.csproj ├── Web.Mvc.csproj.user ├── appsettings.Development.json ├── appsettings.json └── wwwroot ├── css └── site.css ├── favicon.ico ├── js └── site.js └── lib ├── bootstrap ├── LICENSE └── dist │ ├── css │ ├── bootstrap-grid.css │ ├── bootstrap-grid.css.map │ ├── bootstrap-grid.min.css │ ├── bootstrap-grid.min.css.map │ ├── bootstrap-grid.rtl.css │ ├── bootstrap-grid.rtl.css.map │ ├── bootstrap-grid.rtl.min.css │ ├── bootstrap-grid.rtl.min.css.map │ ├── bootstrap-reboot.css │ ├── bootstrap-reboot.css.map │ ├── bootstrap-reboot.min.css │ ├── bootstrap-reboot.min.css.map │ ├── bootstrap-reboot.rtl.css │ ├── bootstrap-reboot.rtl.css.map │ ├── bootstrap-reboot.rtl.min.css │ ├── bootstrap-reboot.rtl.min.css.map │ ├── bootstrap-utilities.css │ ├── bootstrap-utilities.css.map │ ├── bootstrap-utilities.min.css │ ├── bootstrap-utilities.min.css.map │ ├── bootstrap-utilities.rtl.css │ ├── bootstrap-utilities.rtl.css.map │ ├── bootstrap-utilities.rtl.min.css │ ├── bootstrap-utilities.rtl.min.css.map │ ├── bootstrap.css │ ├── bootstrap.css.map │ ├── bootstrap.min.css │ ├── bootstrap.min.css.map │ ├── bootstrap.rtl.css │ ├── bootstrap.rtl.css.map │ ├── bootstrap.rtl.min.css │ └── bootstrap.rtl.min.css.map │ └── js │ ├── bootstrap.bundle.js │ ├── bootstrap.bundle.js.map │ ├── bootstrap.bundle.min.js │ ├── bootstrap.bundle.min.js.map │ ├── bootstrap.esm.js │ ├── bootstrap.esm.js.map │ ├── bootstrap.esm.min.js │ ├── bootstrap.esm.min.js.map │ ├── bootstrap.js │ ├── bootstrap.js.map │ ├── bootstrap.min.js │ └── bootstrap.min.js.map ├── jquery-validation-unobtrusive ├── LICENSE.txt ├── jquery.validate.unobtrusive.js └── jquery.validate.unobtrusive.min.js ├── jquery-validation ├── LICENSE.md └── dist │ ├── additional-methods.js │ ├── additional-methods.min.js │ ├── jquery.validate.js │ └── jquery.validate.min.js └── jquery ├── LICENSE.txt └── dist ├── jquery.js ├── jquery.min.js └── jquery.min.map /.dockerignore: -------------------------------------------------------------------------------- 1 | **/.classpath 2 | **/.dockerignore 3 | **/.env 4 | **/.git 5 | **/.gitignore 6 | **/.project 7 | **/.settings 8 | **/.toolstarget 9 | **/.vs 10 | **/.vscode 11 | **/*.*proj.user 12 | **/*.dbmdl 13 | **/*.jfm 14 | **/azds.yaml 15 | **/bin 16 | **/charts 17 | **/docker-compose* 18 | **/Dockerfile* 19 | **/node_modules 20 | **/npm-debug.log 21 | **/obj 22 | **/secrets.dev.yaml 23 | **/values.dev.yaml 24 | LICENSE 25 | README.md -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | NUGET_PAT=secret 2 | IDENTITY_SERVER_URL=https://identity.shopwinner.org -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | src/services/API-Gws/WebAPI-GW/bin 2 | src/services/API-Gws/WebAPI-GW/obj 3 | src/services/Basket/Basket.API/bin 4 | src/services/Basket/Basket.API/obj 5 | src/services/Catalog/Catalog.API/bin 6 | src/services/Catalog/Catalog.API/obj 7 | src/services/Discount/Discount.API/bin 8 | src/services/Discount/Discount.API/obj 9 | .vs/ 10 | bin/ 11 | obj/ 12 | .env/ 13 | .idea/ -------------------------------------------------------------------------------- /NetCoreMicroservices.sln.DotSettings.user: -------------------------------------------------------------------------------- 1 |  2 | <SessionState ContinuousTestingMode="0" IsActive="True" Name="TestThis" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"> 3 | <TestAncestor> 4 | <TestId>xUnit::CD9D8527-72A4-4E6A-9CF0-AC86196CF62E::net6.0::Product.Tests.FirstTests.TestThis</TestId> 5 | </TestAncestor> 6 | </SessionState> -------------------------------------------------------------------------------- /azure/images/azure-eks.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrikduch/netcore-microservices/5684a1e63b8ea158ea9343d7b7e2e6a02db5f7a5/azure/images/azure-eks.PNG -------------------------------------------------------------------------------- /deployment/aks/examples/dbs/mssql/mssql-db-pv.yaml: -------------------------------------------------------------------------------- 1 | kind: StorageClass 2 | apiVersion: storage.k8s.io/v1 3 | metadata: 4 | name: azure-disk 5 | provisioner: kubernetes.io/azure-disk 6 | parameters: 7 | storageaccounttype: Standard_LRS 8 | kind: Managed 9 | --- 10 | kind: PersistentVolumeClaim 11 | apiVersion: v1 12 | metadata: 13 | name: mssql-data 14 | annotations: 15 | volume.beta.kubernetes.io/storage-class: azure-disk 16 | spec: 17 | accessModes: 18 | - ReadWriteOnce 19 | resources: 20 | requests: 21 | storage: 1Gi -------------------------------------------------------------------------------- /deployment/aks/examples/dbs/mssql/mssql-db-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mssql-deployment 5 | spec: 6 | selector: 7 | app: mssql 8 | ports: 9 | - protocol: TCP 10 | port: 1433 11 | targetPort: 1433 12 | type: LoadBalancer -------------------------------------------------------------------------------- /deployment/aks/examples/dbs/postgres/postgres-db-pv.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: postgres-pv-claim 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | resources: 9 | requests: 10 | storage: 2Gi -------------------------------------------------------------------------------- /deployment/aks/examples/dbs/postgres/postgres-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: postgres-example-db-service # Reference name that can be used for intercommunication 5 | spec: 6 | type: LoadBalancer 7 | selector: 8 | component: postgres 9 | ports: 10 | - port: 5432 11 | targetPort: 5432 -------------------------------------------------------------------------------- /deployment/aks/examples/services/cors/cors-ingres.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Ingress 3 | metadata: 4 | name: api 5 | namespace: fuse 6 | labels: 7 | app: api 8 | annotations: 9 | nginx.ingress.kubernetes.io/enable-cors: "true" 10 | nginx.ingress.kubernetes.io/cors-allow-methods: "PUT, GET, POST, OPTIONS" 11 | nginx.ingress.kubernetes.io/cors-allow-origin: "http://localhost" 12 | nginx.ingress.kubernetes.io/cors-allow-credentials: "true" 13 | spec: 14 | rules: 15 | - host: api.example.com 16 | http: 17 | paths: 18 | - backend: 19 | serviceName: api-example 20 | servicePort: 80 21 | path: /api 22 | tls: 23 | - hosts: 24 | - api.example.com 25 | secretName: example-tls -------------------------------------------------------------------------------- /deployment/aks/examples/services/ingress-controller/without-cors/Test.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: aks-helloworld-one 5 | namespace: ingress-basic 6 | spec: 7 | replicas: 1 8 | selector: 9 | matchLabels: 10 | app: aks-helloworld-one 11 | template: 12 | metadata: 13 | labels: 14 | app: aks-helloworld-one 15 | spec: 16 | containers: 17 | - name: aks-helloworld-one 18 | image: netcoremicroservicesacr.azurecr.io/catalogapi:486 19 | ports: 20 | - containerPort: 80 21 | --- 22 | apiVersion: v1 23 | kind: Service 24 | metadata: 25 | name: aks-helloworld-one 26 | namespace: ingress-basic 27 | spec: 28 | type: ClusterIP 29 | ports: 30 | - port: 80 31 | selector: 32 | app: aks-helloworld-one -------------------------------------------------------------------------------- /deployment/aks/helm/extensions/ingress/install.bat: -------------------------------------------------------------------------------- 1 | kubectl create namespace ingress-basic 2 | 3 | helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx 4 | 5 | helm install nginx-ingress ingress-nginx/ingress-nginx ^ 6 | --namespace ingress-basic ^ 7 | --set controller.replicaCount=2 ^ 8 | --set controller.nodeSelector."beta\.kubernetes\.io/os"=linux ^ 9 | --set defaultBackend.nodeSelector."beta\.kubernetes\.io/os"=linux ^ 10 | --set controller.admissionWebhooks.patch.nodeSelector."beta\.kubernetes\.io/os"=linux -------------------------------------------------------------------------------- /deployment/aks/helm/services/examples/webfrontend/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "node", 9 | "request": "launch", 10 | "name": "Launch via NPM", 11 | "runtimeExecutable": "npm", 12 | "runtimeArgs": [ 13 | "run-script", 14 | "debug" 15 | ], 16 | "port": 9229, 17 | "skipFiles": [ 18 | "/**" 19 | ] 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /deployment/aks/helm/services/examples/webfrontend/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:latest 2 | 3 | WORKDIR /webfrontend 4 | 5 | COPY package.json ./ 6 | 7 | RUN npm install 8 | 9 | COPY . . 10 | 11 | EXPOSE 80 12 | CMD ["node","server.js"] -------------------------------------------------------------------------------- /deployment/aks/helm/services/examples/webfrontend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webfrontend", 3 | "version": "0.1.0", 4 | "devDependencies": { 5 | "nodemon": "^1.18.10" 6 | }, 7 | "dependencies": { 8 | "express": "^4.16.2", 9 | "request": "2.83.0" 10 | }, 11 | "main": "server.js", 12 | "scripts": { 13 | "start": "node server.js", 14 | "debug": "node --nolazy --inspect-brk=9229 server.js" 15 | } 16 | } -------------------------------------------------------------------------------- /deployment/aks/helm/services/examples/webfrontend/public/app.css: -------------------------------------------------------------------------------- 1 | /* Copyright (c) Microsoft Corporation. All rights reserved. 2 | Licensed under the MIT License. */ 3 | 4 | .message { 5 | font-family: Courier New, Courier, monospace; 6 | font-weight: bold; 7 | } -------------------------------------------------------------------------------- /deployment/aks/helm/services/examples/webfrontend/public/app.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | var app = angular.module('myApp', ['ngRoute']); 5 | 6 | app.controller('MainController', function($scope, $http) { 7 | 8 | $scope.messages = []; 9 | $scope.sayHelloToServer = function() { 10 | $http.get("/api?_=" + Date.now()).then(function(response) { 11 | $scope.messages.push(response.data); 12 | }); 13 | }; 14 | 15 | $scope.sayHelloToServer(); 16 | }); -------------------------------------------------------------------------------- /deployment/aks/helm/services/examples/webfrontend/server.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | var express = require('express'); 5 | var app = express(); 6 | app.use(express.static(__dirname + '/public')); 7 | 8 | app.get('/', function (req, res) { 9 | res.sendFile(__dirname + '/public/index.html'); 10 | }); 11 | 12 | app.get('/api', function (req, res) { 13 | res.send('Tomáš Silber čumí jak puk...'); 14 | }); 15 | 16 | var port = process.env.PORT || 80; 17 | var server = app.listen(port, function () { 18 | console.log('Listening on port ' + port); 19 | }); 20 | 21 | process.on("SIGINT", () => { 22 | process.exit(130 /* 128 + SIGINT */); 23 | }); 24 | 25 | process.on("SIGTERM", () => { 26 | console.log("Terminating..."); 27 | server.close(); 28 | }); 29 | -------------------------------------------------------------------------------- /deployment/aks/helm/services/examples/webfrontend/webfrontend/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /deployment/aks/helm/services/examples/webfrontend/webfrontend/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ include "webfrontend.fullname" . }} 5 | labels: 6 | {{- include "webfrontend.labels" . | nindent 4 }} 7 | spec: 8 | type: {{ .Values.service.type }} 9 | ports: 10 | - port: {{ .Values.service.port }} 11 | targetPort: http 12 | protocol: TCP 13 | name: http 14 | selector: 15 | {{- include "webfrontend.selectorLabels" . | nindent 4 }} 16 | -------------------------------------------------------------------------------- /deployment/aks/helm/services/examples/webfrontend/webfrontend/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.serviceAccount.create -}} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ include "webfrontend.serviceAccountName" . }} 6 | labels: 7 | {{- include "webfrontend.labels" . | nindent 4 }} 8 | {{- with .Values.serviceAccount.annotations }} 9 | annotations: 10 | {{- toYaml . | nindent 4 }} 11 | {{- end }} 12 | {{- end }} 13 | -------------------------------------------------------------------------------- /deployment/aks/helm/services/examples/webfrontend/webfrontend/templates/tests/test-connection.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: "{{ include "webfrontend.fullname" . }}-test-connection" 5 | labels: 6 | {{- include "webfrontend.labels" . | nindent 4 }} 7 | annotations: 8 | "helm.sh/hook": test 9 | spec: 10 | containers: 11 | - name: wget 12 | image: busybox 13 | command: ['wget'] 14 | args: ['{{ include "webfrontend.fullname" . }}:{{ .Values.service.port }}'] 15 | restartPolicy: Never 16 | -------------------------------------------------------------------------------- /deployment/aks/letsencrypt/letsencrypt-issuer.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: cert-manager.io/v1 2 | kind: ClusterIssuer 3 | metadata: 4 | name: letsencrypt 5 | spec: 6 | acme: 7 | # You must replace this email address with your own. 8 | # Let's Encrypt will use this to contact you about expiring 9 | # certificates, and issues related to your account. 10 | email: patrickduch93@gmail.com 11 | server: https://acme-v02.api.letsencrypt.org/directory 12 | privateKeySecretRef: 13 | # Secret resource that will be used to store the account's private key. 14 | name: letsencrypt-account-private-key 15 | # Add a single challenge solver, HTTP01 using nginx 16 | solvers: 17 | - http01: 18 | ingress: 19 | class: nginx -------------------------------------------------------------------------------- /deployment/aks/message-brokers/kafka/kafka-values.yaml: -------------------------------------------------------------------------------- 1 | cp-kafka: 2 | replicas: 1 3 | resources: 4 | limits: 5 | cpu: 1000m 6 | memory: 2Gi 7 | requests: 8 | cpu: 500m 9 | memory: 1Gi 10 | persistence: 11 | enabled: true 12 | size: 10Gi 13 | 14 | cp-zookeeper: 15 | servers: 1 16 | resources: 17 | limits: 18 | cpu: 1000m 19 | memory: 2Gi 20 | requests: 21 | cpu: 500m 22 | memory: 1Gi 23 | persistence: 24 | enabled: true 25 | size: 10Gi -------------------------------------------------------------------------------- /deployment/aks/services/api-gateways/web-gw/web-gw-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: web-gw-deployment 5 | labels: 6 | app: web-gw 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: web-gw 12 | template: 13 | metadata: 14 | labels: 15 | app: web-gw 16 | spec: 17 | containers: 18 | - name: webgw 19 | image: netcoremicroservicesacr.azurecr.io/webgw:v1 20 | imagePullPolicy: IfNotPresent 21 | ports: 22 | - containerPort: 80 23 | env: 24 | - name: ASPNETCORE_ENVIRONMENT 25 | value: Release 26 | 27 | imagePullSecrets: 28 | - name: acr-secret -------------------------------------------------------------------------------- /deployment/aks/services/api-gateways/web-gw/web-gw-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: web-gw-service 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: web-gw 9 | ports: 10 | - protocol: TCP 11 | port: 80 -------------------------------------------------------------------------------- /deployment/aks/services/customer/customer-db/customer-db-pv.yaml: -------------------------------------------------------------------------------- 1 | kind: StorageClass 2 | apiVersion: storage.k8s.io/v1 3 | metadata: 4 | name: azure-disk 5 | provisioner: kubernetes.io/azure-disk 6 | parameters: 7 | storageaccounttype: Standard_LRS 8 | kind: Managed 9 | --- 10 | kind: PersistentVolumeClaim 11 | apiVersion: v1 12 | metadata: 13 | name: customer-db-data 14 | annotations: 15 | volume.beta.kubernetes.io/storage-class: azure-disk 16 | spec: 17 | accessModes: 18 | - ReadWriteOnce 19 | resources: 20 | requests: 21 | storage: 1Gi -------------------------------------------------------------------------------- /deployment/aks/services/customer/customer-db/customer-db.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: customer-db-service 5 | spec: 6 | selector: 7 | app: customer-db 8 | ports: 9 | - protocol: TCP 10 | port: 1433 11 | targetPort: 1433 12 | type: LoadBalancer -------------------------------------------------------------------------------- /deployment/aks/services/discount/discount-api/discount-api-configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: discount-api-configmap 5 | labels: 6 | app: discount-db 7 | data: 8 | connection_string: Server=postgres-cluster-ip-service;Port=5432;Database=postgres;User Id=postgres;Password=patrikduch; 9 | -------------------------------------------------------------------------------- /deployment/aks/services/discount/discount-db/discount-db-pv.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: discount-postgres-db-pv-claim 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | resources: 9 | requests: 10 | storage: 2Gi -------------------------------------------------------------------------------- /deployment/aks/services/discount/discount-db/discount-db-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: discount-postgresdb-service # Reference name that can be used for intercommunication 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | component: discount-postgresdb 9 | ports: 10 | - port: 5432 11 | targetPort: 5432 -------------------------------------------------------------------------------- /deployment/aks/services/identity-auth/identity-auth-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: identity-auth-api-service 5 | spec: 6 | type: LoadBalancer 7 | selector: 8 | app: identity-auth-api 9 | ports: 10 | - protocol: TCP 11 | port: 80 -------------------------------------------------------------------------------- /deployment/aks/services/ordering/ordering-db/ordering-db-pv.yaml: -------------------------------------------------------------------------------- 1 | kind: StorageClass 2 | apiVersion: storage.k8s.io/v1 3 | metadata: 4 | name: azure-disk 5 | provisioner: kubernetes.io/azure-disk 6 | parameters: 7 | storageaccounttype: Standard_LRS 8 | kind: Managed 9 | --- 10 | kind: PersistentVolumeClaim 11 | apiVersion: v1 12 | metadata: 13 | name: orderingdbdata 14 | annotations: 15 | volume.beta.kubernetes.io/storage-class: azure-disk 16 | spec: 17 | accessModes: 18 | - ReadWriteOnce 19 | resources: 20 | requests: 21 | storage: 1Gi -------------------------------------------------------------------------------- /deployment/aks/services/ordering/ordering-db/ordering-db-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: ordering-db-service 5 | spec: 6 | selector: 7 | app: ordering-db 8 | ports: 9 | - protocol: TCP 10 | port: 1433 11 | targetPort: 1433 12 | type: LoadBalancer -------------------------------------------------------------------------------- /deployment/aks/services/product/product-api/product-api-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: product-api-service 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: product-api 9 | ports: 10 | - protocol: TCP 11 | port: 80 -------------------------------------------------------------------------------- /deployment/aks/services/product/product-db/product-db-pv.yaml: -------------------------------------------------------------------------------- 1 | kind: StorageClass 2 | apiVersion: storage.k8s.io/v1 3 | metadata: 4 | name: productdb-storage 5 | provisioner: kubernetes.io/azure-disk 6 | reclaimPolicy: Delete 7 | volumeBindingMode: WaitForFirstConsumer 8 | parameters: 9 | skuName: Standard_LRS 10 | kind: Managed 11 | cachingmode: None 12 | --- 13 | apiVersion: v1 14 | kind: PersistentVolumeClaim 15 | metadata: 16 | name: product-db-pv-claim 17 | spec: 18 | accessModes: 19 | - ReadWriteOnce 20 | storageClassName: "productdb-storage" 21 | resources: 22 | requests: 23 | storage: 5Gi 24 | memory: 2Gi 25 | -------------------------------------------------------------------------------- /deployment/aks/services/product/product-db/product-db-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: product-db-service # Reference name that can be used for intercommunication 5 | spec: 6 | type: LoadBalancer 7 | selector: 8 | component: product-db 9 | ports: 10 | - port: 5432 11 | targetPort: 5432 -------------------------------------------------------------------------------- /deployment/aks/services/project-detail/project-detail-api/project-detail-api-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: project-detail-api-service 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: project-detail-api 9 | ports: 10 | - protocol: TCP 11 | port: 80 -------------------------------------------------------------------------------- /deployment/aks/services/project-detail/project-detail-db/project-detail-db-pv.yaml: -------------------------------------------------------------------------------- 1 | kind: StorageClass 2 | apiVersion: storage.k8s.io/v1 3 | metadata: 4 | name: azure-disk 5 | provisioner: kubernetes.io/azure-disk 6 | parameters: 7 | storageaccounttype: Standard_LRS 8 | kind: Managed 9 | --- 10 | kind: PersistentVolumeClaim 11 | apiVersion: v1 12 | metadata: 13 | name: projectdetaildbdata 14 | annotations: 15 | volume.beta.kubernetes.io/storage-class: azure-disk 16 | spec: 17 | accessModes: 18 | - ReadWriteOnce 19 | resources: 20 | requests: 21 | memory: 1Gi 22 | storage: 1Gi -------------------------------------------------------------------------------- /deployment/aks/services/project-detail/project-detail-db/project-detail-db.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: project-detail-db-service 5 | spec: 6 | selector: 7 | app: project-detail-db 8 | ports: 9 | - protocol: TCP 10 | port: 1433 11 | targetPort: 1433 12 | type: LoadBalancer -------------------------------------------------------------------------------- /deployment/aks/services/user/user-api/user-api-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: user-api-service 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: user-api 9 | ports: 10 | - protocol: TCP 11 | port: 80 -------------------------------------------------------------------------------- /deployment/aks/services/user/user-db/user-db-pv.yaml: -------------------------------------------------------------------------------- 1 | kind: StorageClass 2 | apiVersion: storage.k8s.io/v1 3 | metadata: 4 | name: userdb-storage 5 | provisioner: kubernetes.io/azure-disk 6 | reclaimPolicy: Delete 7 | volumeBindingMode: WaitForFirstConsumer 8 | parameters: 9 | skuName: Standard_LRS 10 | kind: Managed 11 | cachingmode: None 12 | --- 13 | apiVersion: v1 14 | kind: PersistentVolumeClaim 15 | metadata: 16 | name: user-db-pv-claim 17 | spec: 18 | accessModes: 19 | - ReadWriteOnce 20 | storageClassName: "userdb-storage" 21 | resources: 22 | requests: 23 | storage: 5Gi 24 | -------------------------------------------------------------------------------- /deployment/aks/services/user/user-db/user-db-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: user-db-service # Reference name that can be used for intercommunication 5 | spec: 6 | type: LoadBalancer 7 | selector: 8 | component: user-db 9 | ports: 10 | - port: 5432 11 | targetPort: 5432 -------------------------------------------------------------------------------- /deployment/aks/webapps/web-blazor/web-blazor-deplopyment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: web-blazor-deployment 5 | labels: 6 | app: web-blazor 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: web-blazor 12 | template: 13 | metadata: 14 | labels: 15 | app: web-blazor 16 | spec: 17 | containers: 18 | - name: web-blazor 19 | image: netcoremicroservicesacr.azurecr.io/webblazor:1747 20 | imagePullPolicy: IfNotPresent 21 | ports: 22 | - containerPort: 80 23 | 24 | imagePullSecrets: 25 | - name: acr-secret -------------------------------------------------------------------------------- /deployment/aks/webapps/web-blazor/web-blazor-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: web-blazor-service 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: web-blazor 9 | ports: 10 | - protocol: TCP 11 | port: 80 12 | 13 | -------------------------------------------------------------------------------- /deployment/docker/commands.txt: -------------------------------------------------------------------------------- 1 | docker rmi "nazev obrazu" -f -------------------------------------------------------------------------------- /deployment/k8s/commands/arbitrary-commands.txt: -------------------------------------------------------------------------------- 1 | Version 2 | kubectl version 3 | 4 | Get all nodes for current Kubernetes cluster 5 | kubectl get nodes 6 | 7 | 8 | Go to the linux docker container 9 | kubectl exec --stdin --tty containername -- /bin/bash -------------------------------------------------------------------------------- /deployment/k8s/commands/troubleshooting.txt: -------------------------------------------------------------------------------- 1 | kubectl get pod netcoremicroservices-client-deployment-5bbffdcb45-598gg -o wide 2 | kubectl describe pod netcoremicroservices-client-deployment-5bbffdcb45-598gg 3 | -------------------------------------------------------------------------------- /deployment/k8s/mongo-configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: mongo-configmap 5 | data: 6 | connection_string: mongodb://username:password@mongo-service:27017 -------------------------------------------------------------------------------- /deployment/k8s/mongo-secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mongo-secret 5 | type: Opaque 6 | data: 7 | mongo-root-username: dXNlcm5hbWU= 8 | mongo-root-password: cGFzc3dvcmQ= -------------------------------------------------------------------------------- /deployment/k8s/netcoremicroservices-api-configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: netcoremicroservicesapi-configmap 5 | data: 6 | necoremicroserviceapi_url: http://netcoremicroservicesapi:8000 -------------------------------------------------------------------------------- /deployment/k8s/nginx-depl.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: nginx-depl 5 | labels: 6 | app: nginx 7 | spec: 8 | replicas: 2 9 | selector: 10 | matchLabels: 11 | app: nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: nginx 16 | spec: 17 | containers: 18 | - name: nginx 19 | image: nginx:1.16 20 | ports: 21 | - containerPort: 80 -------------------------------------------------------------------------------- /deployment/k8s/nginx-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: nginx-service 5 | spec: 6 | selector: 7 | app: nginx 8 | ports: 9 | - protocol: TCP 10 | port: 80 11 | targetPort: 80 -------------------------------------------------------------------------------- /deployment/pipelines/examples/trivy-pipeline-example.yaml: -------------------------------------------------------------------------------- 1 | trigger: 2 | - master 3 | 4 | pool: 5 | vmImage: 'ubuntu-latest' 6 | 7 | variables: 8 | trivyVersion: 0.9.1 9 | 10 | steps: 11 | - script: | 12 | sudo apt-get install rpm 13 | wget https://github.com/aquasecurity/trivy/releases/download/v$(trivyVersion)/trivy_$(trivyVersion)_Linux-64bit.deb 14 | sudo dpkg -i trivy_$(trivyVersion)_Linux-64bit.deb 15 | trivy -v 16 | displayName: 'Download and install Trivy' 17 | 18 | - task: CmdLine@2 19 | displayName: "Run trivy scan" 20 | inputs: 21 | script: | 22 | trivy image --exit-code 0 --severity LOW,MEDIUM patrikduch/go-app-dockerization:v1.0.1 23 | trivy image --exit-code 1 --severity HIGH,CRITICAL patrikduch/go-app-dockerization:v1.0.1 -------------------------------------------------------------------------------- /docker-compose.dcproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2.1 5 | Linux 6 | 63f0ac7c-6516-463d-b542-2e9052839e48 7 | LaunchBrowser 8 | {Scheme}://localhost:{ServicePort}/swagger 9 | netcoremicroservices.api 10 | 11 | 12 | 13 | 14 | docker-compose.yml 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/nugets/NetMicroservices.Configuration/NetMicroservices.ServiceConfig/NetMicroservices.ServiceConfig.Nuget/NetMicroservices.ServiceConfig.Nuget.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | Patrik Duch 5 | NetMicroservices.ServiceConfig 6 | Common classes for implementing .NET microservices. 7 | 1.1.3 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/nugets/NetMicroservices.Configuration/NetMicroservices.ServiceConfig/NetMicroservices.ServiceConfig.Nuget/ServiceResponse.cs: -------------------------------------------------------------------------------- 1 | namespace NetMicroservices.ServiceConfig.Nuget; 2 | 3 | public class ServiceResponse 4 | { 5 | public T Data { get; set; } 6 | 7 | public bool Success { get; set; } = true; 8 | 9 | public string Message { get; set; } = string.Empty; 10 | } 11 | -------------------------------------------------------------------------------- /src/nugets/NetMicroservices.Configuration/NetMicroservices.ServiceConfig/NetMicroservices.ServiceConfig.Nuget/ServiceSettings.cs: -------------------------------------------------------------------------------- 1 | namespace NetMicroservices.Configuration.Nuget 2 | { 3 | /// 4 | /// Typed configuration class for accessing Service settings. 5 | /// 6 | public class ServiceSettings 7 | { 8 | /// 9 | /// Gets name of the microservice. 10 | /// 11 | public string ServiceName { get; init; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/nugets/NetMicroservices.Dbs/NetMicroservices.MongoDbWrapper/NetMicroservices.MongoDbWrapper.Nuget/Contexts/IMongoContext.cs: -------------------------------------------------------------------------------- 1 | using MongoDB.Driver; 2 | 3 | namespace NetMicroservices.MongoDbWrapper 4 | { 5 | public interface IMongoContext 6 | { 7 | IMongoCollection Collection { get; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/nugets/NetMicroservices.Dbs/NetMicroservices.MongoDbWrapper/NetMicroservices.MongoDbWrapper.Nuget/Contexts/IMongoContextSeed.cs: -------------------------------------------------------------------------------- 1 | namespace NetMicroservices.MongoDbWrapper 2 | { 3 | public interface IMongoContextSeed 4 | { 5 | 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/nugets/NetMicroservices.Dbs/NetMicroservices.MongoDbWrapper/NetMicroservices.MongoDbWrapper.Nuget/Contexts/MongoContext.cs: -------------------------------------------------------------------------------- 1 | using MongoDB.Driver; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace NetMicroservices.MongoDbWrapper 6 | { 7 | public class MongoContext : IMongoContext 8 | { 9 | public MongoContext(string collectionName, IMongoDatabase mongoDb, List dataset) 10 | { 11 | Collection = mongoDb.GetCollection(collectionName); 12 | MongoContextSeed.SeedData(Collection, dataset); 13 | } 14 | 15 | public IMongoCollection Collection { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/nugets/NetMicroservices.Dbs/NetMicroservices.MongoDbWrapper/NetMicroservices.MongoDbWrapper.Nuget/Entities/IMongoEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NetMicroservices.MongoDbWrapper 4 | { 5 | /// 6 | /// Contract for all Mongodb entities. 7 | /// 8 | public interface IMongoEntity 9 | { 10 | /// 11 | /// Get or set mongo entity identifier. 12 | /// 13 | public Guid Id { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/nugets/NetMicroservices.Dbs/NetMicroservices.MongoDbWrapper/NetMicroservices.MongoDbWrapper.Nuget/NetMicroservices.MongoDbWrapper.Nuget.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | MongoDb wrapper that provides easy setup of Mongo data layer and generic entity repositories. 6 | Patrik Duch 7 | 1.3.0 8 | NetMicroservices.MongoDbWrapper 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/nugets/NetMicroservices.Dbs/NetMicroservices.MongoDbWrapper/NetMicroservices.MongoDbWrapper.Nuget/Repositories/IMongoRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | 5 | namespace NetMicroservices.MongoDbWrapper 6 | { 7 | /// 8 | /// Interface for all mongodb repositories. 9 | /// 10 | /// Type of mongodb entity. 11 | public interface IMongoRepository where T : IMongoEntity 12 | { 13 | Task CreateAsync(T entity); 14 | Task RemoveAsync(Guid id); 15 | Task GetAsync(Guid id); 16 | Task> GetAllAsync(); 17 | Task UpdateAsync(T entity); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/nugets/NetMicroservices.Messaging/MediatorWrapper/NetMicroservices.MediatorWrapper.Nuget/NetMicroservices.MediatorWrapper.Nuget.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | Patrik Duch 6 | MediatorWrapper encapsulates exception handlers, needed extension methods etc. 7 | NetMicroservices.MediatorWrapper 8 | 1.3.0 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/nugets/NetMicroservices.Messaging/MessageContracts/NetMicroservices.MessageContracts.Nuget/Contracts.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NetMicroservices.MessageContracts.Nuget 4 | { 5 | public record GameCatalogItemUCreated(Guid ItemId, string Name, string Description); 6 | public record GameCatalogItemUpdated(Guid ItemId, string Name, string Description); 7 | public record GameCatalogItemDeleted(Guid ItemId); 8 | } 9 | -------------------------------------------------------------------------------- /src/nugets/NetMicroservices.Messaging/MessageContracts/NetMicroservices.MessageContracts.Nuget/NetMicroservices.MessageContracts.Nuget.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | Patrik Duch 6 | NetMicroservices.MessageContracts 7 | RabbitMQ message contracts to support asynchronous communication among Microservice Architecture. 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/nugets/NetMicroservices.Messaging/RabbitMqWrapper/NetMicroservices.RabbitMqWrapper.Nuget/RabbitMqSettings.cs: -------------------------------------------------------------------------------- 1 | namespace NetMicroservices.RabbitMqWrapper.Nuget 2 | { 3 | /// 4 | /// Connection setting for RabbitMQ service bus. 5 | /// 6 | public class RabbitMqSettings 7 | { 8 | /// 9 | /// Host name of RabbitMQ service bus. 10 | /// 11 | public string Host { get; init; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/nugets/NetMicroservices.Shared/NetMicroservices.Shared.Nuget/NetMicroservices.Shared.Nuget.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/services/API-Gws/Web.Gw/Constants/CorsConstants.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Patrik Duch, IČ: 09225471 3 | // 4 | namespace Web.Gw.Constants; 5 | 6 | /// 7 | /// Arbitrary constants for CORS determination. 8 | /// 9 | public class CorsConstants 10 | { 11 | public const string Corspolicydev = "CorsPolicyDev"; 12 | public const string Corspolicyrelease = "CorsPolicyRelease"; 13 | } -------------------------------------------------------------------------------- /src/services/API-Gws/Web.Gw/Constants/DomainConstants.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Patrik Duch, IČ: 09225471 3 | // 4 | namespace Web.Gw.Constants; 5 | 6 | /// 7 | /// Arbitrary constants for domain specification. 8 | /// 9 | public static class DomainConstants 10 | { 11 | public const string ProductionHttpsHost = "https://shopwinner.org"; 12 | public const string ProductionHttpHost = "http://shopwinner.org"; 13 | } 14 | -------------------------------------------------------------------------------- /src/services/API-Gws/Web.Gw/Constants/EnvConstants.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Patrik Duch, IČ: 09225471 3 | // 4 | namespace Web.Gw.Constants; 5 | 6 | /// 7 | /// Arbitrary constants for environment selection. 8 | /// 9 | public static class EnvConstants 10 | { 11 | public const string AspnetcoreEnvironment = "ASPNETCORE_ENVIRONMENT"; 12 | public const string DevEnvironment = "Development"; 13 | } 14 | -------------------------------------------------------------------------------- /src/services/API-Gws/Web.Gw/Dockerfile: -------------------------------------------------------------------------------- 1 | #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. 2 | 3 | FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base 4 | WORKDIR /app 5 | EXPOSE 80 6 | 7 | FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build 8 | WORKDIR /src 9 | COPY ["src/services/API-Gws/Web.Gw/Web.Gw.csproj", "src/services/API-Gws/Web.Gw/"] 10 | RUN dotnet restore "src/services/API-Gws/Web.Gw/Web.Gw.csproj" 11 | COPY . . 12 | WORKDIR "/src/src/services/API-Gws/Web.Gw" 13 | RUN dotnet build "Web.Gw.csproj" -c Release -o /app/build 14 | 15 | FROM build AS publish 16 | RUN dotnet publish "Web.Gw.csproj" -c Release -o /app/publish /p:UseAppHost=false 17 | 18 | FROM base AS final 19 | WORKDIR /app 20 | COPY --from=publish /app/publish . 21 | ENTRYPOINT ["dotnet", "Web.Gw.dll"] -------------------------------------------------------------------------------- /src/services/API-Gws/Web.Gw/Program.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrikduch/netcore-microservices/5684a1e63b8ea158ea9343d7b7e2e6a02db5f7a5/src/services/API-Gws/Web.Gw/Program.cs -------------------------------------------------------------------------------- /src/services/API-Gws/Web.Gw/Web.Gw.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Docker 5 | 6 | -------------------------------------------------------------------------------- /src/services/API-Gws/Web.Gw/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/services/API-Gws/Web.Gw/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /src/services/API-Gws/Web.Gw/ocelot.Development.IdentityAuth.json: -------------------------------------------------------------------------------- 1 | { 2 | "Routes": [ 3 | { 4 | "DownstreamPathTemplate": "/.well-known/openid-configuration", 5 | "DownstreamScheme": "http", 6 | "DownstreamHostAndPorts": [ 7 | { 8 | "Host": "identityauth", 9 | "Port": "80" 10 | } 11 | ], 12 | "UpstreamPathTemplate": "/auth/meta-data", 13 | "UpstreamHttpMethod": [ "GET" ] 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /src/services/API-Gws/Web.Gw/ocelot.Development.ProjectDetail.json: -------------------------------------------------------------------------------- 1 | { 2 | "Routes": [ 3 | { 4 | "DownstreamPathTemplate": "/api/v1/projectDetail", 5 | "DownstreamScheme": "http", 6 | "DownstreamHostAndPorts": [ 7 | { 8 | "Host": "projectdetail.api", 9 | "Port": 80 10 | } 11 | ], 12 | "UpstreamPathTemplate": "/projectDetail", 13 | "UpstreamHttpMethod": [ "GET" ] 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /src/services/API-Gws/Web.Gw/ocelot.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Routes": [ 3 | ], 4 | 5 | "GlobalConfiguration": { 6 | "BaseUrl": "http://webgwservice:9000" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/services/API-Gws/Web.Gw/ocelot.Release.ProjectDetail.json: -------------------------------------------------------------------------------- 1 | { 2 | "Routes": [ 3 | { 4 | "DownstreamPathTemplate": "/api/v1/projectDetail", 5 | "DownstreamScheme": "http", 6 | "DownstreamHostAndPorts": [ 7 | { 8 | "Host": "project-detail-api-service", 9 | "Port": 80 10 | } 11 | ], 12 | "UpstreamPathTemplate": "/projectDetail", 13 | "UpstreamHttpMethod": [ "GET" ] 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /src/services/API-Gws/Web.Gw/ocelot.Release.json: -------------------------------------------------------------------------------- 1 | { 2 | "Routes": [ 3 | 4 | ], 5 | 6 | "GlobalConfiguration": { 7 | "ServiceDiscoveryProvider": { 8 | "Host": "127.0.0.1", 9 | "Port": 80, 10 | "Token": "", 11 | "Namespace": "default", 12 | "Type": "kube" 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /src/services/API-Gws/Web.Gw/ocelot.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /src/services/Basket/Basket.API/Basket.API.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Docker 5 | ApiControllerEmptyScaffolder 6 | root/Common/Api 7 | 8 | -------------------------------------------------------------------------------- /src/services/Basket/Basket.API/Dockerfile: -------------------------------------------------------------------------------- 1 | #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. 2 | 3 | FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base 4 | WORKDIR /app 5 | EXPOSE 80 6 | 7 | FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build 8 | WORKDIR /src 9 | COPY ["src/services/Basket/Basket.API/Basket.API.csproj", "src/services/Basket/Basket.API/"] 10 | RUN dotnet restore "src/services/Basket/Basket.API/Basket.API.csproj" 11 | COPY . . 12 | WORKDIR "/src/src/services/Basket/Basket.API" 13 | RUN dotnet build "Basket.API.csproj" -c Release -o /app/build 14 | 15 | FROM build AS publish 16 | RUN dotnet publish "Basket.API.csproj" -c Release -o /app/publish 17 | 18 | FROM base AS final 19 | WORKDIR /app 20 | COPY --from=publish /app/publish . 21 | ENTRYPOINT ["dotnet", "Basket.API.dll"] 22 | -------------------------------------------------------------------------------- /src/services/Basket/Basket.API/Dockerfile.original: -------------------------------------------------------------------------------- 1 | #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. 2 | 3 | FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base 4 | WORKDIR /app 5 | EXPOSE 80 6 | 7 | FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build 8 | WORKDIR /src 9 | COPY ["Basket.API/Basket.API.csproj", "Basket.API/"] 10 | RUN dotnet restore "Basket.API/Basket.API.csproj" 11 | COPY . . 12 | WORKDIR "/src/Basket.API" 13 | RUN dotnet build "Basket.API.csproj" -c Release -o /app/build 14 | 15 | FROM build AS publish 16 | RUN dotnet publish "Basket.API.csproj" -c Release -o /app/publish 17 | 18 | FROM base AS final 19 | WORKDIR /app 20 | COPY --from=publish /app/publish . 21 | ENTRYPOINT ["dotnet", "Basket.API.dll"] -------------------------------------------------------------------------------- /src/services/Basket/Basket.API/GrpcServices/StatusManager.cs: -------------------------------------------------------------------------------- 1 | using Grpc.Core; 2 | using System.Linq; 3 | using System.Net; 4 | using System.Net.Http; 5 | 6 | namespace Basket.API.GrpcServices 7 | { 8 | public static class StatusManager 9 | { 10 | public static StatusCode? GetStatusCode(HttpResponseMessage response) 11 | { 12 | var headers = response.Headers; 13 | 14 | if (!headers.Contains("grpc-status") && response.StatusCode == HttpStatusCode.OK) 15 | return StatusCode.OK; 16 | 17 | if (headers.Contains("grpc-status")) 18 | return (StatusCode)int.Parse(headers.GetValues("grpc-status").First()); 19 | 20 | return null; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/services/Basket/Basket.API/Repositories/IBasketRepository.cs: -------------------------------------------------------------------------------- 1 | using Basket.API.Entities; 2 | using System.Threading.Tasks; 3 | 4 | namespace Basket.API.Repositories 5 | { 6 | /// 7 | /// Contract for data repository . 8 | /// 9 | public interface IBasketRepository 10 | { 11 | Task GetBasket(string username); 12 | 13 | Task UpdateBasket(ShoppingCart basket); 14 | 15 | Task DeleteBasket(string username); 16 | } 17 | } -------------------------------------------------------------------------------- /src/services/Basket/Basket.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/services/Basket/Basket.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "GrpcSettings": { 4 | "DiscountUrl": "http://localhost:5003" 5 | }, 6 | 7 | "Logging": { 8 | "LogLevel": { 9 | "Default": "Information", 10 | "Microsoft": "Warning", 11 | "Microsoft.Hosting.Lifetime": "Information" 12 | } 13 | }, 14 | "AllowedHosts": "*" 15 | } 16 | -------------------------------------------------------------------------------- /src/services/Coupon/Coupon.API/Coupon.API.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | Linux 8 | ..\..\..\.. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/services/Coupon/Coupon.API/Coupon.API.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Docker 5 | 6 | -------------------------------------------------------------------------------- /src/services/Coupon/Coupon.API/Program.cs: -------------------------------------------------------------------------------- 1 | var builder = WebApplication.CreateBuilder(args); 2 | 3 | // Add services to the container. 4 | 5 | builder.Services.AddControllers(); 6 | // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle 7 | builder.Services.AddEndpointsApiExplorer(); 8 | builder.Services.AddSwaggerGen(); 9 | 10 | var app = builder.Build(); 11 | 12 | // Configure the HTTP request pipeline. 13 | if (app.Environment.IsDevelopment()) 14 | { 15 | app.UseSwagger(); 16 | app.UseSwaggerUI(); 17 | } 18 | 19 | app.UseAuthorization(); 20 | 21 | app.MapControllers(); 22 | 23 | app.Run(); 24 | -------------------------------------------------------------------------------- /src/services/Coupon/Coupon.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/services/Coupon/Coupon.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /src/services/Coupon/Coupon.Application/Coupon.Application.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/services/Coupon/Coupon.Domain/Coupon.Domain.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/services/Coupon/Coupon.Infrastructure/Coupon.Infrastructure.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/services/Coupon/Coupon.Persistence/Coupon.Persistence.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/services/Discount/Discount.API/Configurations/DatabaseSettings.cs: -------------------------------------------------------------------------------- 1 | namespace Discount.API.Configurations 2 | { 3 | /// 4 | /// Arbitrary class that supports accessing to the database setting from appsettings.json file. 5 | /// 6 | public class DatabaseSettings 7 | { 8 | /// 9 | /// Gets or sets db connectionstring. 10 | /// 11 | public string ConnectionString { get; set; } 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/services/Discount/Discount.API/Discount.API.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | Linux 6 | ..\docker-compose.dcproj 7 | ..\..\..\.. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/services/Discount/Discount.API/Discount.API.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Docker 5 | ApiControllerEmptyScaffolder 6 | root/Common/Api 7 | 8 | -------------------------------------------------------------------------------- /src/services/Discount/Discount.API/Dockerfile.original: -------------------------------------------------------------------------------- 1 | #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. 2 | 3 | FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base 4 | WORKDIR /app 5 | EXPOSE 80 6 | 7 | FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build 8 | WORKDIR /src 9 | COPY ["Discount.API/Discount.API.csproj", "Discount.API/"] 10 | RUN dotnet restore "Discount.API/Discount.API.csproj" 11 | COPY . . 12 | WORKDIR "/src/Discount.API" 13 | RUN dotnet build "Discount.API.csproj" -c Release -o /app/build 14 | 15 | FROM build AS publish 16 | RUN dotnet publish "Discount.API.csproj" -c Release -o /app/publish 17 | 18 | FROM base AS final 19 | WORKDIR /app 20 | COPY --from=publish /app/publish . 21 | ENTRYPOINT ["dotnet", "Discount.API.dll"] -------------------------------------------------------------------------------- /src/services/Discount/Discount.API/Entities/Coupon.cs: -------------------------------------------------------------------------------- 1 | namespace Discount.API.Entities 2 | { 3 | public class Coupon 4 | { 5 | public int Id { get; set; } 6 | 7 | public string ProductName { get; set; } 8 | 9 | public string Description { get; set; } 10 | 11 | public int Amount { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/services/Discount/Discount.API/Program.cs: -------------------------------------------------------------------------------- 1 | using Discount.API.Extensions; 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.Extensions.Hosting; 4 | 5 | namespace Discount.API 6 | { 7 | public class Program 8 | { 9 | public static void Main(string[] args) 10 | { 11 | 12 | var host = CreateHostBuilder(args).Build(); 13 | host.MigrateDatabase(); 14 | host.Run(); 15 | 16 | // CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/services/Discount/Discount.API/Repositories/IDiscountRepository.cs: -------------------------------------------------------------------------------- 1 | using Discount.API.Entities; 2 | using System.Threading.Tasks; 3 | 4 | namespace Discount.API.Repositories 5 | { 6 | /// 7 | /// Contract for data repository . 8 | /// 9 | public interface IDiscountRepository 10 | { 11 | Task GetDiscount(string productName); 12 | 13 | Task CreateDiscount(Coupon coupon); 14 | 15 | Task UpdateDiscount(Coupon coupon); 16 | 17 | Task DeleteDiscount(string productName); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/services/Discount/Discount.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/services/Discount/Discount.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /src/services/Discount/Discount.Grpc/Configurations/DatabaseSettings.cs: -------------------------------------------------------------------------------- 1 | namespace Discount.Grpc.Configurations 2 | { 3 | /// 4 | /// Arbitrary class that supports accessing to the database setting from appsettings.json file. 5 | /// 6 | public class DatabaseSettings 7 | { 8 | /// 9 | /// Gets or sets db connectionstring. 10 | /// 11 | public string ConnectionString { get; set; } 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/services/Discount/Discount.Grpc/Discount.Grpc.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Docker 5 | true 6 | 7 | -------------------------------------------------------------------------------- /src/services/Discount/Discount.Grpc/Entities/Coupon.cs: -------------------------------------------------------------------------------- 1 | namespace Discount.Grpc.Entities 2 | { 3 | public class Coupon 4 | { 5 | /// 6 | /// Gets or sets coupon's identifier. 7 | /// 8 | public int Id { get; set; } 9 | 10 | /// 11 | /// Gets or sets product's name for particular coupon. 12 | /// 13 | public string ProductName { get; set; } 14 | 15 | /// 16 | /// Gets or sets product's description for particular coupon. 17 | /// 18 | public string Description { get; set; } 19 | 20 | /// 21 | /// Gets or sets amounth for particular coupon. 22 | /// 23 | public int Amount { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/services/Discount/Discount.Grpc/Mapper/CouponProfile.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using Discount.Grpc.Entities; 3 | using Discount.Grpc.Protos; 4 | 5 | namespace Discount.Grpc.Mapper 6 | { 7 | /// 8 | /// Automapper profile for discount coupon object. 9 | /// 10 | public class CouponProfile : Profile 11 | { 12 | /// 13 | /// Initializes a new instance of the class. 14 | /// 15 | public CouponProfile() 16 | { 17 | CreateMap().ReverseMap(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/services/Discount/Discount.Grpc/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Discount.Grpc": { 4 | "commandName": "Project", 5 | "environmentVariables": { 6 | "ASPNETCORE_ENVIRONMENT": "Development" 7 | }, 8 | "dotnetRunMessages": "true", 9 | "applicationUrl": "http://localhost:5004" 10 | }, 11 | "Docker": { 12 | "commandName": "Docker", 13 | "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", 14 | "publishAllPorts": true, 15 | "useSSL": true 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/services/Discount/Discount.Grpc/Repositories/IDiscountRepository.cs: -------------------------------------------------------------------------------- 1 | using Discount.Grpc.Entities; 2 | using System.Threading.Tasks; 3 | 4 | namespace Discount.Grpc.Repositories 5 | { 6 | /// 7 | /// Contract for data repository . 8 | /// 9 | public interface IDiscountRepository 10 | { 11 | Task GetDiscount(string productName); 12 | Task CreateDiscount(Coupon coupon); 13 | Task UpdateDiscount(Coupon coupon); 14 | Task DeleteDiscount(string productName); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/services/Discount/Discount.Grpc/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/services/Discount/Discount.Grpc/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*", 10 | "Kestrel": { 11 | "EndpointDefaults": { 12 | "Protocols": "Http2" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/services/Examples/Catalog/Catalog.API/Catalog.API.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Catalog.API 5 | ApiControllerEmptyScaffolder 6 | root/Common/Api 7 | 8 | 9 | ProjectDebugger 10 | 11 | -------------------------------------------------------------------------------- /src/services/Examples/Catalog/Catalog.API/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Hosting; 3 | 4 | namespace Catalog.API 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IHostBuilder CreateHostBuilder(string[] args) => 14 | Host.CreateDefaultBuilder(args) 15 | .ConfigureWebHostDefaults(webBuilder => 16 | { 17 | webBuilder.UseStartup(); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/services/Examples/Catalog/Catalog.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/services/Examples/Catalog/Catalog.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /src/services/Examples/Catalog/Catalog.Application/Contracts/IProductRepository.cs: -------------------------------------------------------------------------------- 1 | using Catalog.Domain.Entities; 2 | using NetMicroservices.MongoDbWrapper; 3 | 4 | namespace Catalog.Application.Contracts 5 | { 6 | /// 7 | /// Contract for product's data repository. 8 | /// 9 | public interface IProductRepository : IMongoRepository 10 | { 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/services/Examples/Catalog/Catalog.Application/Features/Queries/Products/GetProducts/GetProductsQuery.cs: -------------------------------------------------------------------------------- 1 | using MediatR; 2 | using NetMicroservices.ServiceConfig.Nuget; 3 | using System.Collections.Generic; 4 | 5 | namespace Catalog.Application.Features.Queries.Products.GetProducts 6 | { 7 | /// 8 | /// CQRS query object for fetching list of products. 9 | /// 10 | public class GetProductsQuery : IRequest>> 11 | { 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/services/Examples/Catalog/Catalog.Application/Features/Queries/Products/GetSingleProduct/GetProductQuery.cs: -------------------------------------------------------------------------------- 1 | using MediatR; 2 | using NetMicroservices.ServiceConfig.Nuget; 3 | using System; 4 | 5 | namespace Catalog.Application.Features.Queries.Products.GetSingleProduct 6 | { 7 | /// 8 | /// CQRS query object for fetching single product item. 9 | /// 10 | public class GetProductQuery : IRequest> 11 | { 12 | /// 13 | /// Gets or sets string identifier of particular product. 14 | /// 15 | public Guid ProductId { get; set; } 16 | 17 | public GetProductQuery(Guid productId) 18 | { 19 | ProductId = productId; 20 | } 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/services/Examples/Catalog/Catalog.Application/MappingProfile.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using Catalog.Application.Features.Queries.Products.GetProducts; 3 | using Catalog.Application.Features.Queries.Products.GetSingleProduct; 4 | using Catalog.Domain.Entities; 5 | 6 | namespace Catalog.Application 7 | { 8 | /// 9 | /// Mapping profiles of domain object to the application objects. 10 | /// 11 | public class MappingProfile : Profile 12 | { 13 | /// 14 | /// Initializes a new instance of the configuration. 15 | /// 16 | public MappingProfile() 17 | { 18 | CreateMap().ReverseMap(); 19 | CreateMap().ReverseMap(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/services/Examples/Catalog/Catalog.Domain/Catalog.Domain.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/services/Examples/Catalog/Catalog.Infrastructure/Catalog.Infrastructure.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/services/Examples/Catalog/Catalog.Persistence/Repositories/ProductRepository.cs: -------------------------------------------------------------------------------- 1 | using Catalog.Application.Contracts; 2 | using Catalog.Domain.Entities; 3 | using NetMicroservices.MongoDbWrapper; 4 | 5 | namespace Catalog.Persistence.Repositories 6 | { 7 | /// 8 | /// Data repository implementation for products data access. 9 | /// 10 | public class ProductRepository : MongoRepository, IProductRepository 11 | { 12 | /// 13 | /// Initializes a new instance of the class. 14 | /// 15 | /// 16 | public ProductRepository(IMongoContext mongoCtx) : base(mongoCtx) 17 | { 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/services/Examples/Customer/Customer.API/Configurations/DatabaseSettings.cs: -------------------------------------------------------------------------------- 1 | namespace Customer.API.Configurations 2 | { 3 | /// 4 | /// Arbitrary class that supports accessing to the database setting from appsettings.json file. 5 | /// 6 | public class DatabaseSettings 7 | { 8 | /// 9 | /// Gets or sets db connectionstring. 10 | /// 11 | public string ConnectionString { get; set; } 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/services/Examples/Customer/Customer.API/Customer.API.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Customer.API 5 | ApiControllerEmptyScaffolder 6 | root/Common/Api 7 | 8 | 9 | ProjectDebugger 10 | 11 | -------------------------------------------------------------------------------- /src/services/Examples/Customer/Customer.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | 10 | "DatabaseSettings": { 11 | "ConnectionString": "Server=localhost;Database=CustomerDb;User Id=sa;Password=SwN12345678;" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/services/Examples/Customer/Customer.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*", 10 | } 11 | -------------------------------------------------------------------------------- /src/services/Examples/Customer/Customer.Application/Contracts/IPersonRepository.cs: -------------------------------------------------------------------------------- 1 | using Customer.Domain; 2 | using NetMicroservices.SqlWrapper.Nuget; 3 | 4 | namespace Customer.Application.Contracts 5 | { 6 | /// 7 | /// Data repository contract of entity. 8 | /// 9 | public interface IPersonRepository : IAsyncRepository 10 | { } 11 | } 12 | -------------------------------------------------------------------------------- /src/services/Examples/Customer/Customer.Application/Features/Queries/GetPersonsList/GetPersonsListQuery.cs: -------------------------------------------------------------------------------- 1 | using Customer.Application.Features.Queries.GetOrderList; 2 | using MediatR; 3 | using NetMicroservices.ServiceConfig.Nuget; 4 | using System.Collections.Generic; 5 | 6 | namespace Customer.Application.Features.Queries.GetAllCustomers 7 | { 8 | /// 9 | /// CQRS query object for fetching list of customers. 10 | /// 11 | public class GetPersonsListQuery : IRequest>> 12 | { 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/services/Examples/Customer/Customer.Application/Features/Queries/GetPersonsList/PersonVm.cs: -------------------------------------------------------------------------------- 1 | namespace Customer.Application.Features.Queries.GetOrderList 2 | { 3 | public class PersonVm 4 | { 5 | /// 6 | /// Gets or sets order numeric identifier. 7 | /// 8 | public int Id { get; set; } 9 | 10 | /// 11 | /// Gets or sets firstname of a customer. 12 | /// 13 | public string FirstName { get; set; } 14 | 15 | /// 16 | /// Gets or sets lastname of a customer. 17 | /// 18 | public string LastName { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/services/Examples/Customer/Customer.Application/MappingProfile.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using Customer.Application.Features.Queries.GetOrderList; 3 | using Customer.Domain; 4 | 5 | namespace Customer.Application 6 | { 7 | /// 8 | /// Mapping profiles of domain object to the application objects. 9 | /// 10 | public class MappingProfile : Profile 11 | { 12 | /// 13 | /// Initializes a new instance of the configuration. 14 | /// 15 | public MappingProfile() 16 | { 17 | CreateMap().ReverseMap(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/services/Examples/Customer/Customer.Domain/Customer.Domain.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/services/Examples/Customer/Customer.Domain/Person.cs: -------------------------------------------------------------------------------- 1 | using NetMicroservices.SqlWrapper.Nuget; 2 | 3 | namespace Customer.Domain 4 | { 5 | /// 6 | /// Domain customer entity. 7 | /// 8 | public class Person : EntityBase 9 | { 10 | /// 11 | /// Gets or sets firstname of a customer. 12 | /// 13 | public string FirstName { get; set; } 14 | 15 | /// 16 | /// Gets or sets lastname of a customer. 17 | /// 18 | public string LastName { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/services/Examples/Customer/Customer.Infrastructure/Customer.Infrastructure.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/services/Examples/Customer/Customer.Persistence/Repositories/PersonRepository.cs: -------------------------------------------------------------------------------- 1 | using Customer.Application.Contracts; 2 | using Customer.Domain; 3 | using Customer.Persistence.Contexts; 4 | using NetMicroservices.SqlWrapper.Nuget.Repositories; 5 | 6 | namespace Customer.Persistence.Repositories 7 | { 8 | public class PersonRepository : RepositoryBase, IPersonRepository 9 | { 10 | /// 11 | /// Initializes a new instance of the . 12 | /// 13 | /// DbContext dependency object. 14 | public PersonRepository(PersonContext personContext) : base(personContext) 15 | { 16 | 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/services/Examples/Customer/Customer.Tests/UnitTest1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Xunit; 3 | 4 | namespace Customer.Tests 5 | { 6 | public class UnitTest1 7 | { 8 | [Fact] 9 | public void Test1() 10 | { 11 | 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/services/Examples/GameCatalog/GameCatalog.API/Constants/QueueConstants.cs: -------------------------------------------------------------------------------- 1 | namespace GameCatalog.API.Constants 2 | { 3 | public static class QueueConstants 4 | { 5 | public const string GameCatalogQueue = "gamecatalog-queue"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/services/Examples/GameCatalog/GameCatalog.API/Dtos.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace GameCatalog.API 5 | { 6 | /// 7 | /// Dto structure for listing a gamecatalog objects. 8 | /// 9 | public record GameItemDto(Guid Id, string Name, string Description, decimal Price, DateTimeOffset CreatedDate); 10 | 11 | /// 12 | /// Dto structure for creating a brand new gamecatalog objects. 13 | /// 14 | public record CreateGameItemDto([Required] string Name, string Description, [Range(0, 1000)] decimal Price); 15 | /// 16 | /// Dto structure for updating an existing gamecatalog objects. 17 | /// 18 | public record UpdateGameItemDto([Required] string Name, string Description, [Range(0, 1000)] decimal Price); 19 | } 20 | -------------------------------------------------------------------------------- /src/services/Examples/GameCatalog/GameCatalog.API/GameCatalog.API.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Docker 5 | ApiControllerEmptyScaffolder 6 | root/Common/Api 7 | 8 | -------------------------------------------------------------------------------- /src/services/Examples/GameCatalog/GameCatalog.API/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Hosting; 3 | 4 | namespace GameCatalog.API 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IHostBuilder CreateHostBuilder(string[] args) => 14 | Host.CreateDefaultBuilder(args) 15 | .ConfigureWebHostDefaults(webBuilder => 16 | { 17 | webBuilder.UseStartup(); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/services/Examples/GameCatalog/GameCatalog.API/Settings/ServiceSettings.cs: -------------------------------------------------------------------------------- 1 | namespace GameCatalog.API.Settings 2 | { 3 | /// 4 | /// Typed configuration class for accessing Service settings. 5 | /// 6 | public class ServiceSettings 7 | { 8 | /// 9 | /// Gets name of the microservice. 10 | /// 11 | public string ServiceName { get; init; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/services/Examples/GameCatalog/GameCatalog.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/services/Examples/GameCatalog/GameCatalog.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /src/services/Examples/Inventory/Inventory.API/Automapper/Profiles/GameCatalogProfile.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using Inventory.API.Dtos; 3 | 4 | namespace Inventory.API.Automapper.Profiles 5 | { 6 | /// 7 | /// Mapping scanner configuration for Inventory objects. 8 | /// 9 | public class InventoryItem : Profile 10 | { 11 | /// 12 | /// Initializes a new instance of the class 13 | /// and setup mapping configuration for . 14 | /// 15 | public InventoryItem() 16 | { 17 | CreateMap(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/services/Examples/Inventory/Inventory.API/Clients/IGameCatalogClient.cs: -------------------------------------------------------------------------------- 1 | using Inventory.API.Dtos; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | 5 | namespace Inventory.API.Clients 6 | { 7 | /// 8 | /// Contract for synchronous via HTTP client with GameCatalog microservice. 9 | /// 10 | public interface IGameCatalogClient 11 | { 12 | Task> GetCatalogItemsAsync(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/services/Examples/Inventory/Inventory.API/Dtos.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Inventory.API.Dtos 4 | { 5 | public record GrantItemsDto(Guid UserId, Guid CatalogItemId, int Quantity); 6 | 7 | public record InventoryItemDto(Guid id, Guid CatalogItemId, Guid UserId, int Quantity, DateTimeOffset AcquiredDate); 8 | 9 | /// 10 | /// Dto structure for listing a gamecatalog objects. 11 | /// 12 | public record GameCatalogItemDto(Guid Id, string Name, string Description); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/services/Examples/Inventory/Inventory.API/Extensions/InventoryExtensions.cs: -------------------------------------------------------------------------------- 1 | using Inventory.API.Dtos; 2 | using Inventory.API.Entities; 3 | 4 | namespace Inventory.API.Extensions 5 | { 6 | /// 7 | /// Inventory arbitrary extensions. 8 | /// 9 | public static class InventoryExtensions 10 | { 11 | /// 12 | /// Convert entity InventoryItem to datatransfer object GameCatalogItemDto. 13 | /// 14 | /// Entity data that will be converted into data-transfer-object. 15 | /// 16 | public static GameCatalogItemDto AsDto(this InventoryItem item, string name, string description) 17 | { 18 | return new GameCatalogItemDto(item.Id, name, description); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/services/Examples/Inventory/Inventory.API/Inventory.API.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Docker 5 | ApiControllerEmptyScaffolder 6 | root/Common/Api 7 | 8 | -------------------------------------------------------------------------------- /src/services/Examples/Inventory/Inventory.API/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Hosting; 3 | 4 | namespace Inventory.API 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IHostBuilder CreateHostBuilder(string[] args) => 14 | Host.CreateDefaultBuilder(args) 15 | .ConfigureWebHostDefaults(webBuilder => 16 | { 17 | webBuilder.UseStartup(); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/services/Examples/Inventory/Inventory.API/Settings/ServiceSettings.cs: -------------------------------------------------------------------------------- 1 | namespace Inventory.API.Settings 2 | { 3 | /// 4 | /// Typed configuration class for accessing Service settings. 5 | /// 6 | public class ServiceSettings 7 | { 8 | /// 9 | /// Gets name of the microservice. 10 | /// 11 | public string ServiceName { get; init; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/services/Examples/Inventory/Inventory.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/services/Examples/Inventory/Inventory.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /src/services/Examples/RealTimeTransmission/RealTimeTransmission.API/Hubs/IViewHub.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace RealTimeTransmission.API.Hubs 4 | { 5 | /// 6 | /// Contract for SignalR . 7 | /// 8 | public interface IViewHub 9 | { 10 | Task ViewCountUpdate(int viewCount); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/services/Examples/RealTimeTransmission/RealTimeTransmission.API/RealTimeTransmission.API.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Docker 5 | ApiControllerEmptyScaffolder 6 | root/Common/Api 7 | 8 | -------------------------------------------------------------------------------- /src/services/Examples/RealTimeTransmission/RealTimeTransmission.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/services/Examples/RealTimeTransmission/RealTimeTransmission.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /src/services/Examples/SignalR.API/Dockerfile: -------------------------------------------------------------------------------- 1 | #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. 2 | 3 | FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base 4 | WORKDIR /app 5 | EXPOSE 80 6 | 7 | FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build 8 | WORKDIR /src 9 | COPY ["src/services/SignalR.API/SignalR.API.csproj", "src/services/SignalR.API/"] 10 | RUN dotnet restore "src/services/SignalR.API/SignalR.API.csproj" 11 | COPY . . 12 | WORKDIR "/src/src/services/SignalR.API" 13 | RUN dotnet build "SignalR.API.csproj" -c Release -o /app/build 14 | 15 | FROM build AS publish 16 | RUN dotnet publish "SignalR.API.csproj" -c Release -o /app/publish 17 | 18 | FROM base AS final 19 | WORKDIR /app 20 | COPY --from=publish /app/publish . 21 | ENTRYPOINT ["dotnet", "SignalR.API.dll"] -------------------------------------------------------------------------------- /src/services/Examples/SignalR.API/Hubs/CourierHub.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.SignalR; 2 | 3 | namespace SignalR.API.Hubs 4 | { 5 | public class CourierHub : Hub 6 | { 7 | 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/services/Examples/SignalR.API/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Configuration; 3 | using Microsoft.Extensions.Hosting; 4 | using Microsoft.Extensions.Logging; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | 10 | namespace SignalR.API 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/services/Examples/SignalR.API/SignalR.API.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | Linux 6 | ..\..\.. 7 | ..\..\..\docker-compose.dcproj 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/services/Examples/SignalR.API/SignalR.API.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Docker 5 | 6 | -------------------------------------------------------------------------------- /src/services/Examples/SignalR.API/SignalR/Contracts/CourierMessage.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace SignalR.API.SignalR.Contracts 4 | { 5 | public class CourierMessage 6 | { 7 | [JsonProperty("uid")] 8 | public string Uid { get; set; } 9 | 10 | [JsonProperty("token")] 11 | public string Token { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/services/Examples/SignalR.API/SignalR/Handlers/CourierTrackingHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | namespace SignalR.API.SignalR.Handlers 3 | { 4 | public static class CourierTrackingHandler 5 | { 6 | public static HashSet ConnectedIds = new HashSet(); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/services/Examples/SignalR.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/services/Examples/SignalR.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/IdentityAuth.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | cf8347a5-2713-42be-b830-6d2ecc9ab858 8 | Linux 9 | ..\..\.. 10 | ..\..\..\docker-compose.dcproj 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/IdentityAuth.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Docker 5 | 6 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/Quickstart/Account/AccountOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System; 6 | 7 | namespace IdentityServerHost.Quickstart.UI 8 | { 9 | public class AccountOptions 10 | { 11 | public static bool AllowLocalLogin = true; 12 | public static bool AllowRememberLogin = true; 13 | public static TimeSpan RememberMeLoginDuration = TimeSpan.FromDays(30); 14 | 15 | public static bool ShowLogoutPrompt = true; 16 | public static bool AutomaticRedirectAfterSignOut = false; 17 | 18 | public static string InvalidCredentialsErrorMessage = "Invalid username or password"; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/Quickstart/Account/ExternalProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServerHost.Quickstart.UI 6 | { 7 | public class ExternalProvider 8 | { 9 | public string DisplayName { get; set; } 10 | public string AuthenticationScheme { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /src/services/IdentityAuth/Quickstart/Account/LoggedOutViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServerHost.Quickstart.UI 6 | { 7 | public class LoggedOutViewModel 8 | { 9 | public string PostLogoutRedirectUri { get; set; } 10 | public string ClientName { get; set; } 11 | public string SignOutIframeUrl { get; set; } 12 | 13 | public bool AutomaticRedirectAfterSignOut { get; set; } 14 | 15 | public string LogoutId { get; set; } 16 | public bool TriggerExternalSignout => ExternalAuthenticationScheme != null; 17 | public string ExternalAuthenticationScheme { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/services/IdentityAuth/Quickstart/Account/LoginInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System.ComponentModel.DataAnnotations; 6 | 7 | namespace IdentityServerHost.Quickstart.UI 8 | { 9 | public class LoginInputModel 10 | { 11 | [Required] 12 | public string Username { get; set; } 13 | [Required] 14 | public string Password { get; set; } 15 | public bool RememberLogin { get; set; } 16 | public string ReturnUrl { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /src/services/IdentityAuth/Quickstart/Account/LogoutInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServerHost.Quickstart.UI 6 | { 7 | public class LogoutInputModel 8 | { 9 | public string LogoutId { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/Quickstart/Account/LogoutViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServerHost.Quickstart.UI 6 | { 7 | public class LogoutViewModel : LogoutInputModel 8 | { 9 | public bool ShowLogoutPrompt { get; set; } = true; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/Quickstart/Account/RedirectViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | 6 | namespace IdentityServerHost.Quickstart.UI 7 | { 8 | public class RedirectViewModel 9 | { 10 | public string RedirectUrl { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /src/services/IdentityAuth/Quickstart/Consent/ConsentInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace IdentityServerHost.Quickstart.UI 8 | { 9 | public class ConsentInputModel 10 | { 11 | public string Button { get; set; } 12 | public IEnumerable ScopesConsented { get; set; } 13 | public bool RememberConsent { get; set; } 14 | public string ReturnUrl { get; set; } 15 | public string Description { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /src/services/IdentityAuth/Quickstart/Consent/ConsentOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServerHost.Quickstart.UI 6 | { 7 | public class ConsentOptions 8 | { 9 | public static bool EnableOfflineAccess = true; 10 | public static string OfflineAccessDisplayName = "Offline Access"; 11 | public static string OfflineAccessDescription = "Access to your applications and resources, even when you are offline"; 12 | 13 | public static readonly string MustChooseOneErrorMessage = "You must pick at least one permission"; 14 | public static readonly string InvalidSelectionErrorMessage = "Invalid selection"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/Quickstart/Consent/ConsentViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace IdentityServerHost.Quickstart.UI 8 | { 9 | public class ConsentViewModel : ConsentInputModel 10 | { 11 | public string ClientName { get; set; } 12 | public string ClientUrl { get; set; } 13 | public string ClientLogoUrl { get; set; } 14 | public bool AllowRememberConsent { get; set; } 15 | 16 | public IEnumerable IdentityScopes { get; set; } 17 | public IEnumerable ApiScopes { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/Quickstart/Consent/ProcessConsentResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using IdentityServer4.Models; 6 | 7 | namespace IdentityServerHost.Quickstart.UI 8 | { 9 | public class ProcessConsentResult 10 | { 11 | public bool IsRedirect => RedirectUri != null; 12 | public string RedirectUri { get; set; } 13 | public Client Client { get; set; } 14 | 15 | public bool ShowView => ViewModel != null; 16 | public ConsentViewModel ViewModel { get; set; } 17 | 18 | public bool HasValidationError => ValidationError != null; 19 | public string ValidationError { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/Quickstart/Consent/ScopeViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServerHost.Quickstart.UI 6 | { 7 | public class ScopeViewModel 8 | { 9 | public string Value { get; set; } 10 | public string DisplayName { get; set; } 11 | public string Description { get; set; } 12 | public bool Emphasize { get; set; } 13 | public bool Required { get; set; } 14 | public bool Checked { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/Quickstart/Device/DeviceAuthorizationInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServerHost.Quickstart.UI 6 | { 7 | public class DeviceAuthorizationInputModel : ConsentInputModel 8 | { 9 | public string UserCode { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /src/services/IdentityAuth/Quickstart/Device/DeviceAuthorizationViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServerHost.Quickstart.UI 6 | { 7 | public class DeviceAuthorizationViewModel : ConsentViewModel 8 | { 9 | public string UserCode { get; set; } 10 | public bool ConfirmUserCode { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /src/services/IdentityAuth/Quickstart/Home/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using IdentityServer4.Models; 6 | 7 | namespace IdentityServerHost.Quickstart.UI 8 | { 9 | public class ErrorViewModel 10 | { 11 | public ErrorViewModel() 12 | { 13 | } 14 | 15 | public ErrorViewModel(string error) 16 | { 17 | Error = new ErrorMessage { Error = error }; 18 | } 19 | 20 | public ErrorMessage Error { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /src/services/IdentityAuth/Views/Account/AccessDenied.cshtml: -------------------------------------------------------------------------------- 1 |  2 |
3 |
4 |

Access Denied

5 |

You do not have access to that resource.

6 |
7 |
-------------------------------------------------------------------------------- /src/services/IdentityAuth/Views/Account/Logout.cshtml: -------------------------------------------------------------------------------- 1 | @model LogoutViewModel 2 | 3 |
4 |
5 |

Logout

6 |

Would you like to logut of IdentityServer?

7 |
8 | 9 |
10 | 11 |
12 | 13 |
14 |
15 |
16 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/Views/Device/Success.cshtml: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |

Success

5 |

You have successfully authorized the device

6 |
7 |
8 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/Views/Device/UserCodeCapture.cshtml: -------------------------------------------------------------------------------- 1 | @model string 2 | 3 |
4 |
5 |

User Code

6 |

Please enter the code displayed on your device.

7 |
8 | 9 | 10 | 11 |
12 |
13 |
14 |
15 | 16 | 17 |
18 | 19 | 20 |
21 |
22 |
23 |
24 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/Views/Shared/Redirect.cshtml: -------------------------------------------------------------------------------- 1 | @model RedirectViewModel 2 | 3 |
4 |
5 |

You are now being returned to the application

6 |

Once complete, you may close this tab.

7 |
8 |
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/Views/Shared/_ValidationSummary.cshtml: -------------------------------------------------------------------------------- 1 | @if (ViewContext.ModelState.IsValid == false) 2 | { 3 |
4 | Error 5 |
6 |
7 | } -------------------------------------------------------------------------------- /src/services/IdentityAuth/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using IdentityServerHost.Quickstart.UI 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | .body-container { 2 | margin-top: 60px; 3 | padding-bottom: 40px; } 4 | 5 | .welcome-page li { 6 | list-style: none; 7 | padding: 4px; } 8 | 9 | .logged-out-page iframe { 10 | display: none; 11 | width: 0; 12 | height: 0; } 13 | 14 | .grants-page .card { 15 | margin-top: 20px; 16 | border-bottom: 1px solid lightgray; } 17 | .grants-page .card .card-title { 18 | font-size: 120%; 19 | font-weight: bold; } 20 | .grants-page .card .card-title img { 21 | width: 100px; 22 | height: 100px; } 23 | .grants-page .card label { 24 | font-weight: bold; } 25 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | .body-container{margin-top:60px;padding-bottom:40px;}.welcome-page li{list-style:none;padding:4px;}.logged-out-page iframe{display:none;width:0;height:0;}.grants-page .card{margin-top:20px;border-bottom:1px solid #d3d3d3;}.grants-page .card .card-title{font-size:120%;font-weight:bold;}.grants-page .card .card-title img{width:100px;height:100px;}.grants-page .card label{font-weight:bold;} -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/css/site.scss: -------------------------------------------------------------------------------- 1 | .body-container { 2 | margin-top: 60px; 3 | padding-bottom:40px; 4 | } 5 | 6 | .welcome-page { 7 | li { 8 | list-style: none; 9 | padding: 4px; 10 | } 11 | } 12 | 13 | .logged-out-page { 14 | iframe { 15 | display: none; 16 | width: 0; 17 | height: 0; 18 | } 19 | } 20 | 21 | .grants-page { 22 | .card { 23 | margin-top: 20px; 24 | border-bottom: 1px solid lightgray; 25 | 26 | .card-title { 27 | img { 28 | width: 100px; 29 | height: 100px; 30 | } 31 | 32 | font-size: 120%; 33 | font-weight: bold; 34 | } 35 | 36 | label { 37 | font-weight: bold; 38 | } 39 | } 40 | } 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrikduch/netcore-microservices/5684a1e63b8ea158ea9343d7b7e2e6a02db5f7a5/src/services/IdentityAuth/wwwroot/favicon.ico -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrikduch/netcore-microservices/5684a1e63b8ea158ea9343d7b7e2e6a02db5f7a5/src/services/IdentityAuth/wwwroot/icon.jpg -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrikduch/netcore-microservices/5684a1e63b8ea158ea9343d7b7e2e6a02db5f7a5/src/services/IdentityAuth/wwwroot/icon.png -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/js/signin-redirect.js: -------------------------------------------------------------------------------- 1 | window.location.href = document.querySelector("meta[http-equiv=refresh]").getAttribute("data-url"); 2 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/js/signout-redirect.js: -------------------------------------------------------------------------------- 1 | window.addEventListener("load", function () { 2 | var a = document.querySelector("a.PostLogoutRedirectUri"); 3 | if (a) { 4 | window.location = a.href; 5 | } 6 | }); 7 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/_jumbotron.scss: -------------------------------------------------------------------------------- 1 | .jumbotron { 2 | padding: $jumbotron-padding ($jumbotron-padding / 2); 3 | margin-bottom: $jumbotron-padding; 4 | color: $jumbotron-color; 5 | background-color: $jumbotron-bg; 6 | @include border-radius($border-radius-lg); 7 | 8 | @include media-breakpoint-up(sm) { 9 | padding: ($jumbotron-padding * 2) $jumbotron-padding; 10 | } 11 | } 12 | 13 | .jumbotron-fluid { 14 | padding-right: 0; 15 | padding-left: 0; 16 | @include border-radius(0); 17 | } 18 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/_media.scss: -------------------------------------------------------------------------------- 1 | .media { 2 | display: flex; 3 | align-items: flex-start; 4 | } 5 | 6 | .media-body { 7 | flex: 1; 8 | } 9 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/_root.scss: -------------------------------------------------------------------------------- 1 | // Do not forget to update getting-started/theming.md! 2 | :root { 3 | // Custom variable values only support SassScript inside `#{}`. 4 | @each $color, $value in $colors { 5 | --#{$color}: #{$value}; 6 | } 7 | 8 | @each $color, $value in $theme-colors { 9 | --#{$color}: #{$value}; 10 | } 11 | 12 | @each $bp, $value in $grid-breakpoints { 13 | --breakpoint-#{$bp}: #{$value}; 14 | } 15 | 16 | // Use `inspect` for lists so that quoted items keep the quotes. 17 | // See https://github.com/sass/sass/issues/2383#issuecomment-336349172 18 | --font-family-sans-serif: #{inspect($font-family-sans-serif)}; 19 | --font-family-monospace: #{inspect($font-family-monospace)}; 20 | } 21 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/_transitions.scss: -------------------------------------------------------------------------------- 1 | .fade { 2 | @include transition($transition-fade); 3 | 4 | &:not(.show) { 5 | opacity: 0; 6 | } 7 | } 8 | 9 | .collapse { 10 | &:not(.show) { 11 | display: none; 12 | } 13 | } 14 | 15 | .collapsing { 16 | position: relative; 17 | height: 0; 18 | overflow: hidden; 19 | @include transition($transition-collapse); 20 | } 21 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/_utilities.scss: -------------------------------------------------------------------------------- 1 | @import "utilities/align"; 2 | @import "utilities/background"; 3 | @import "utilities/borders"; 4 | @import "utilities/clearfix"; 5 | @import "utilities/display"; 6 | @import "utilities/embed"; 7 | @import "utilities/flex"; 8 | @import "utilities/float"; 9 | @import "utilities/overflow"; 10 | @import "utilities/position"; 11 | @import "utilities/screenreaders"; 12 | @import "utilities/shadows"; 13 | @import "utilities/sizing"; 14 | @import "utilities/stretched-link"; 15 | @import "utilities/spacing"; 16 | @import "utilities/text"; 17 | @import "utilities/visibility"; 18 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/bootstrap-grid.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Grid v4.4.1 (https://getbootstrap.com/) 3 | * Copyright 2011-2019 The Bootstrap Authors 4 | * Copyright 2011-2019 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | */ 7 | 8 | html { 9 | box-sizing: border-box; 10 | -ms-overflow-style: scrollbar; 11 | } 12 | 13 | *, 14 | *::before, 15 | *::after { 16 | box-sizing: inherit; 17 | } 18 | 19 | @import "functions"; 20 | @import "variables"; 21 | 22 | @import "mixins/breakpoints"; 23 | @import "mixins/grid-framework"; 24 | @import "mixins/grid"; 25 | 26 | @import "grid"; 27 | @import "utilities/display"; 28 | @import "utilities/flex"; 29 | @import "utilities/spacing"; 30 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/bootstrap-reboot.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Reboot v4.4.1 (https://getbootstrap.com/) 3 | * Copyright 2011-2019 The Bootstrap Authors 4 | * Copyright 2011-2019 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) 7 | */ 8 | 9 | @import "functions"; 10 | @import "variables"; 11 | @import "mixins"; 12 | @import "reboot"; 13 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/mixins/_alert.scss: -------------------------------------------------------------------------------- 1 | @mixin alert-variant($background, $border, $color) { 2 | color: $color; 3 | @include gradient-bg($background); 4 | border-color: $border; 5 | 6 | hr { 7 | border-top-color: darken($border, 5%); 8 | } 9 | 10 | .alert-link { 11 | color: darken($color, 10%); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/mixins/_background-variant.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | // Contextual backgrounds 4 | 5 | @mixin bg-variant($parent, $color, $ignore-warning: false) { 6 | #{$parent} { 7 | background-color: $color !important; 8 | } 9 | a#{$parent}, 10 | button#{$parent} { 11 | @include hover-focus() { 12 | background-color: darken($color, 10%) !important; 13 | } 14 | } 15 | @include deprecate("The `bg-variant` mixin", "v4.4.0", "v5", $ignore-warning); 16 | } 17 | 18 | @mixin bg-gradient-variant($parent, $color) { 19 | #{$parent} { 20 | background: $color linear-gradient(180deg, mix($body-bg, $color, 15%), $color) repeat-x !important; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/mixins/_badge.scss: -------------------------------------------------------------------------------- 1 | @mixin badge-variant($bg) { 2 | color: color-yiq($bg); 3 | background-color: $bg; 4 | 5 | @at-root a#{&} { 6 | @include hover-focus() { 7 | color: color-yiq($bg); 8 | background-color: darken($bg, 10%); 9 | } 10 | 11 | &:focus, 12 | &.focus { 13 | outline: 0; 14 | box-shadow: 0 0 0 $badge-focus-width rgba($bg, .5); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/mixins/_box-shadow.scss: -------------------------------------------------------------------------------- 1 | @mixin box-shadow($shadow...) { 2 | @if $enable-shadows { 3 | $result: (); 4 | 5 | @if (length($shadow) == 1) { 6 | // We can pass `@include box-shadow(none);` 7 | $result: $shadow; 8 | } @else { 9 | // Filter to avoid invalid properties for example `box-shadow: none, 1px 1px black;` 10 | @for $i from 1 through length($shadow) { 11 | @if nth($shadow, $i) != "none" { 12 | $result: append($result, nth($shadow, $i), "comma"); 13 | } 14 | } 15 | } 16 | @if (length($result) > 0) { 17 | box-shadow: $result; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/mixins/_clearfix.scss: -------------------------------------------------------------------------------- 1 | @mixin clearfix() { 2 | &::after { 3 | display: block; 4 | clear: both; 5 | content: ""; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/mixins/_deprecate.scss: -------------------------------------------------------------------------------- 1 | // Deprecate mixin 2 | // 3 | // This mixin can be used to deprecate mixins or functions. 4 | // `$enable-deprecation-messages` is a global variable, `$ignore-warning` is a variable that can be passed to 5 | // some deprecated mixins to suppress the warning (for example if the mixin is still be used in the current version of Bootstrap) 6 | @mixin deprecate($name, $deprecate-version, $remove-version, $ignore-warning: false) { 7 | @if ($enable-deprecation-messages != false and $ignore-warning != true) { 8 | @warn "#{$name} has been deprecated as of #{$deprecate-version}. It will be removed entirely in #{$remove-version}."; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/mixins/_float.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | @mixin float-left() { 4 | float: left !important; 5 | @include deprecate("The `float-left` mixin", "v4.3.0", "v5"); 6 | } 7 | @mixin float-right() { 8 | float: right !important; 9 | @include deprecate("The `float-right` mixin", "v4.3.0", "v5"); 10 | } 11 | @mixin float-none() { 12 | float: none !important; 13 | @include deprecate("The `float-none` mixin", "v4.3.0", "v5"); 14 | } 15 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/mixins/_list-group.scss: -------------------------------------------------------------------------------- 1 | // List Groups 2 | 3 | @mixin list-group-item-variant($state, $background, $color) { 4 | .list-group-item-#{$state} { 5 | color: $color; 6 | background-color: $background; 7 | 8 | &.list-group-item-action { 9 | @include hover-focus() { 10 | color: $color; 11 | background-color: darken($background, 5%); 12 | } 13 | 14 | &.active { 15 | color: $white; 16 | background-color: $color; 17 | border-color: $color; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/mixins/_lists.scss: -------------------------------------------------------------------------------- 1 | // Lists 2 | 3 | // Unstyled keeps list items block level, just removes default browser padding and list-style 4 | @mixin list-unstyled() { 5 | padding-left: 0; 6 | list-style: none; 7 | } 8 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/mixins/_nav-divider.scss: -------------------------------------------------------------------------------- 1 | // Horizontal dividers 2 | // 3 | // Dividers (basically an hr) within dropdowns and nav lists 4 | 5 | @mixin nav-divider($color: $nav-divider-color, $margin-y: $nav-divider-margin-y, $ignore-warning: false) { 6 | height: 0; 7 | margin: $margin-y 0; 8 | overflow: hidden; 9 | border-top: 1px solid $color; 10 | @include deprecate("The `nav-divider()` mixin", "v4.4.0", "v5", $ignore-warning); 11 | } 12 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/mixins/_pagination.scss: -------------------------------------------------------------------------------- 1 | // Pagination 2 | 3 | @mixin pagination-size($padding-y, $padding-x, $font-size, $line-height, $border-radius) { 4 | .page-link { 5 | padding: $padding-y $padding-x; 6 | @include font-size($font-size); 7 | line-height: $line-height; 8 | } 9 | 10 | .page-item { 11 | &:first-child { 12 | .page-link { 13 | @include border-left-radius($border-radius); 14 | } 15 | } 16 | &:last-child { 17 | .page-link { 18 | @include border-right-radius($border-radius); 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/mixins/_reset-text.scss: -------------------------------------------------------------------------------- 1 | @mixin reset-text() { 2 | font-family: $font-family-base; 3 | // We deliberately do NOT reset font-size or word-wrap. 4 | font-style: normal; 5 | font-weight: $font-weight-normal; 6 | line-height: $line-height-base; 7 | text-align: left; // Fallback for where `start` is not supported 8 | text-align: start; 9 | text-decoration: none; 10 | text-shadow: none; 11 | text-transform: none; 12 | letter-spacing: normal; 13 | word-break: normal; 14 | word-spacing: normal; 15 | white-space: normal; 16 | line-break: auto; 17 | } 18 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/mixins/_resize.scss: -------------------------------------------------------------------------------- 1 | // Resize anything 2 | 3 | @mixin resizable($direction) { 4 | overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible` 5 | resize: $direction; // Options: horizontal, vertical, both 6 | } 7 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/mixins/_size.scss: -------------------------------------------------------------------------------- 1 | // Sizing shortcuts 2 | 3 | @mixin size($width, $height: $width) { 4 | width: $width; 5 | height: $height; 6 | @include deprecate("`size()`", "v4.3.0", "v5"); 7 | } 8 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/mixins/_text-emphasis.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | // Typography 4 | 5 | @mixin text-emphasis-variant($parent, $color, $ignore-warning: false) { 6 | #{$parent} { 7 | color: $color !important; 8 | } 9 | @if $emphasized-link-hover-darken-percentage != 0 { 10 | a#{$parent} { 11 | @include hover-focus() { 12 | color: darken($color, $emphasized-link-hover-darken-percentage) !important; 13 | } 14 | } 15 | } 16 | @include deprecate("`text-emphasis-variant()`", "v4.4.0", "v5", $ignore-warning); 17 | } 18 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/mixins/_text-hide.scss: -------------------------------------------------------------------------------- 1 | // CSS image replacement 2 | @mixin text-hide($ignore-warning: false) { 3 | // stylelint-disable-next-line font-family-no-missing-generic-family-keyword 4 | font: 0/0 a; 5 | color: transparent; 6 | text-shadow: none; 7 | background-color: transparent; 8 | border: 0; 9 | 10 | @include deprecate("`text-hide()`", "v4.1.0", "v5", $ignore-warning); 11 | } 12 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/mixins/_text-truncate.scss: -------------------------------------------------------------------------------- 1 | // Text truncate 2 | // Requires inline-block or block for proper styling 3 | 4 | @mixin text-truncate() { 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | white-space: nowrap; 8 | } 9 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/mixins/_transition.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable property-blacklist 2 | @mixin transition($transition...) { 3 | @if $enable-transitions { 4 | @if length($transition) == 0 { 5 | transition: $transition-base; 6 | } @else { 7 | transition: $transition; 8 | } 9 | } 10 | 11 | @if $enable-prefers-reduced-motion-media-query { 12 | @media (prefers-reduced-motion: reduce) { 13 | transition: none; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/mixins/_visibility.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | // Visibility 4 | 5 | @mixin invisible($visibility) { 6 | visibility: $visibility !important; 7 | @include deprecate("`invisible()`", "v4.3.0", "v5"); 8 | } 9 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/utilities/_align.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | .align-baseline { vertical-align: baseline !important; } // Browser default 4 | .align-top { vertical-align: top !important; } 5 | .align-middle { vertical-align: middle !important; } 6 | .align-bottom { vertical-align: bottom !important; } 7 | .align-text-bottom { vertical-align: text-bottom !important; } 8 | .align-text-top { vertical-align: text-top !important; } 9 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/utilities/_background.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | @each $color, $value in $theme-colors { 4 | @include bg-variant(".bg-#{$color}", $value, true); 5 | } 6 | 7 | @if $enable-gradients { 8 | @each $color, $value in $theme-colors { 9 | @include bg-gradient-variant(".bg-gradient-#{$color}", $value); 10 | } 11 | } 12 | 13 | .bg-white { 14 | background-color: $white !important; 15 | } 16 | 17 | .bg-transparent { 18 | background-color: transparent !important; 19 | } 20 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/utilities/_clearfix.scss: -------------------------------------------------------------------------------- 1 | .clearfix { 2 | @include clearfix(); 3 | } 4 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/utilities/_display.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | // 4 | // Utilities for common `display` values 5 | // 6 | 7 | @each $breakpoint in map-keys($grid-breakpoints) { 8 | @include media-breakpoint-up($breakpoint) { 9 | $infix: breakpoint-infix($breakpoint, $grid-breakpoints); 10 | 11 | @each $value in $displays { 12 | .d#{$infix}-#{$value} { display: $value !important; } 13 | } 14 | } 15 | } 16 | 17 | 18 | // 19 | // Utilities for toggling `display` in print 20 | // 21 | 22 | @media print { 23 | @each $value in $displays { 24 | .d-print-#{$value} { display: $value !important; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/utilities/_float.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | @each $breakpoint in map-keys($grid-breakpoints) { 4 | @include media-breakpoint-up($breakpoint) { 5 | $infix: breakpoint-infix($breakpoint, $grid-breakpoints); 6 | 7 | .float#{$infix}-left { float: left !important; } 8 | .float#{$infix}-right { float: right !important; } 9 | .float#{$infix}-none { float: none !important; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/utilities/_overflow.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | @each $value in $overflows { 4 | .overflow-#{$value} { overflow: $value !important; } 5 | } 6 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/utilities/_position.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | // Common values 4 | @each $position in $positions { 5 | .position-#{$position} { position: $position !important; } 6 | } 7 | 8 | // Shorthand 9 | 10 | .fixed-top { 11 | position: fixed; 12 | top: 0; 13 | right: 0; 14 | left: 0; 15 | z-index: $zindex-fixed; 16 | } 17 | 18 | .fixed-bottom { 19 | position: fixed; 20 | right: 0; 21 | bottom: 0; 22 | left: 0; 23 | z-index: $zindex-fixed; 24 | } 25 | 26 | .sticky-top { 27 | @supports (position: sticky) { 28 | position: sticky; 29 | top: 0; 30 | z-index: $zindex-sticky; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/utilities/_screenreaders.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Screenreaders 3 | // 4 | 5 | .sr-only { 6 | @include sr-only(); 7 | } 8 | 9 | .sr-only-focusable { 10 | @include sr-only-focusable(); 11 | } 12 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/utilities/_shadows.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | .shadow-sm { box-shadow: $box-shadow-sm !important; } 4 | .shadow { box-shadow: $box-shadow !important; } 5 | .shadow-lg { box-shadow: $box-shadow-lg !important; } 6 | .shadow-none { box-shadow: none !important; } 7 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/utilities/_sizing.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | // Width and height 4 | 5 | @each $prop, $abbrev in (width: w, height: h) { 6 | @each $size, $length in $sizes { 7 | .#{$abbrev}-#{$size} { #{$prop}: $length !important; } 8 | } 9 | } 10 | 11 | .mw-100 { max-width: 100% !important; } 12 | .mh-100 { max-height: 100% !important; } 13 | 14 | // Viewport additional helpers 15 | 16 | .min-vw-100 { min-width: 100vw !important; } 17 | .min-vh-100 { min-height: 100vh !important; } 18 | 19 | .vw-100 { width: 100vw !important; } 20 | .vh-100 { height: 100vh !important; } 21 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/utilities/_stretched-link.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Stretched link 3 | // 4 | 5 | .stretched-link { 6 | &::after { 7 | position: absolute; 8 | top: 0; 9 | right: 0; 10 | bottom: 0; 11 | left: 0; 12 | z-index: 1; 13 | // Just in case `pointer-events: none` is set on a parent 14 | pointer-events: auto; 15 | content: ""; 16 | // IE10 bugfix, see https://stackoverflow.com/questions/16947967/ie10-hover-pseudo-class-doesnt-work-without-background-color 17 | background-color: rgba(0, 0, 0, 0); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/services/IdentityAuth/wwwroot/lib/bootstrap/scss/utilities/_visibility.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | // 4 | // Visibility utilities 5 | // 6 | 7 | .visible { 8 | visibility: visible !important; 9 | } 10 | 11 | .invisible { 12 | visibility: hidden !important; 13 | } 14 | -------------------------------------------------------------------------------- /src/services/Ordering/Ordering.API/Configurations/DatabaseSettings.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.API.Settings 2 | { 3 | /// 4 | /// Arbitrary class that supports accessing to the database setting from appsettings.json file. 5 | /// 6 | public class DatabaseSettings 7 | { 8 | /// 9 | /// Gets or sets db connectionstring. 10 | /// 11 | public string ConnectionString { get; set; } 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/services/Ordering/Ordering.API/Ordering.API.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Ordering.API 5 | ApiControllerEmptyScaffolder 6 | root/Common/Api 7 | 8 | 9 | ProjectDebugger 10 | 11 | -------------------------------------------------------------------------------- /src/services/Ordering/Ordering.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/services/Ordering/Ordering.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /src/services/Ordering/Ordering.Application/Contracts/Infrastructure/IEmailService.cs: -------------------------------------------------------------------------------- 1 | using Ordering.Application.Models; 2 | using System.Threading.Tasks; 3 | 4 | namespace Ordering.Application.Contracts.Infrastructure 5 | { 6 | /// 7 | /// Contract of e-mail service functionality. 8 | /// 9 | public interface IEmailService 10 | { 11 | Task SendEmailAsync(Email email); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/services/Ordering/Ordering.Application/Contracts/Persistence/IOrderRepository.cs: -------------------------------------------------------------------------------- 1 | using NetMicroservices.SqlWrapper.Nuget; 2 | using Ordering.Domain.Entities; 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | 6 | namespace Ordering.Application.Contracts.Persistence 7 | { 8 | /// 9 | /// Data repository contract of entity. 10 | /// 11 | public interface IOrderRepository : IAsyncRepository 12 | { 13 | Task> GetOrdersByUserName(string userName); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/services/Ordering/Ordering.Application/Features/Orders/Commands/DeleteOrder/DeleteOrderCommand.cs: -------------------------------------------------------------------------------- 1 | using MediatR; 2 | using Ordering.Domain.Entities; 3 | 4 | namespace Ordering.Application.Features.Commands.DeleteOrder 5 | { 6 | /// 7 | /// Structure for CQRS deletion command of particular entity. 8 | /// 9 | public class DeleteOrderCommand : IRequest 10 | { 11 | /// 12 | /// Gets or sets numeric identifier for Order entity deletion. 13 | /// 14 | public int Id { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/services/Ordering/Ordering.Application/Features/Orders/Commands/DeleteOrder/DeleteOrderCommandValidator.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.Application.Features.Commands.DeleteOrder 2 | { 3 | /// 4 | /// CQRS validation for DeleteOrderCommand. 5 | /// 6 | public class DeleteOrderCommandValidator 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/services/Ordering/Ordering.Application/Models/Email.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.Application.Models 2 | { 3 | /// 4 | /// Data model for sending emails. 5 | /// 6 | public class Email 7 | { 8 | public string To { get; set; } 9 | 10 | public string Subject { get; set; } 11 | 12 | public string Body { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/services/Ordering/Ordering.Application/Models/EmailSettings.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.Application.Models 2 | { 3 | /// 4 | /// Global configuration for sending sending emails. 5 | /// 6 | public class EmailSettings 7 | { 8 | public string ApiKey { get; set; } 9 | public string FromAddress { get; set; } 10 | public string FromName { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/services/Ordering/Ordering.Domain/Ordering.Domain.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/services/Ordering/Ordering.Infrastructure/EmailService.cs: -------------------------------------------------------------------------------- 1 | using Ordering.Application.Contracts.Infrastructure; 2 | using Ordering.Application.Models; 3 | using System; 4 | using System.Threading.Tasks; 5 | 6 | namespace Ordering.Infrastructure 7 | { 8 | /// 9 | /// Service for sending e-mails. 10 | /// 11 | public class EmailService : IEmailService 12 | { 13 | /// 14 | /// Execution of e-mail sending functionality. 15 | /// 16 | /// Setzo of new incoming e-mail 17 | /// 18 | public Task SendEmailAsync(Email email) 19 | { 20 | throw new NotImplementedException(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/services/Ordering/Ordering.Persistence/Ordering.Persistence.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/services/Product/Product.API/Controllers/IdentityController.cs: -------------------------------------------------------------------------------- 1 | namespace Product.API.Controllers; 2 | 3 | using Microsoft.AspNetCore.Authorization; 4 | using Microsoft.AspNetCore.Mvc; 5 | 6 | [Authorize("ClientIdPolicy")] 7 | [Route("api/v1/{controller}")] 8 | [ApiController] 9 | public class IdentityController : ControllerBase 10 | { 11 | [HttpGet] 12 | [ProducesResponseType(StatusCodes.Status200OK)] 13 | public IActionResult GetClaims() 14 | { 15 | var user = User.Claims.Select(c => new 16 | { 17 | tzpe = c.Type, 18 | value = c.Value 19 | }); 20 | 21 | 22 | return new JsonResult(user); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/services/Product/Product.API/Product.API.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Docker 5 | ApiControllerEmptyScaffolder 6 | root/Common/Api 7 | 8 | -------------------------------------------------------------------------------- /src/services/Product/Product.API/Program.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrikduch/netcore-microservices/5684a1e63b8ea158ea9343d7b7e2e6a02db5f7a5/src/services/Product/Product.API/Program.cs -------------------------------------------------------------------------------- /src/services/Product/Product.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "DatabaseSettings": { 9 | "ConnectionString": "Server=localhost;Database=ProjectDb;User Id=sa;Password=SwN12345678;" 10 | }, 11 | "IDENTITY_SERVER_URL": "" 12 | } 13 | -------------------------------------------------------------------------------- /src/services/Product/Product.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "IDENTITY_SERVER_URL": "" 10 | } 11 | -------------------------------------------------------------------------------- /src/services/Product/Product.Application/Categories/Dtos/CategoryDto.cs: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | //--------------------------------------------------------------------------- 7 | namespace Product.Application.Categories.Dtos; 8 | 9 | /// 10 | /// Data transfer object for transfer relevant product category information. 11 | /// 12 | /// Unique category identifier. 13 | /// Category name. 14 | /// Category url. 15 | public record CategoryDto(Guid Id, string Name, string Url); -------------------------------------------------------------------------------- /src/services/Product/Product.Application/Categories/Interfaces/ICategoryReader.cs: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | //--------------------------------------------------------------------------- 7 | namespace Product.Application.Categories.Interfaces; 8 | 9 | using Dtos; 10 | 11 | /// 12 | /// Contract for product categories management. 13 | /// 14 | public interface ICategoryReader 15 | { 16 | Task> GetCategoryList(); 17 | } 18 | -------------------------------------------------------------------------------- /src/services/Product/Product.Application/Categories/Interfaces/ICategoryReaderEf.cs: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | //--------------------------------------------------------------------------- 7 | namespace Product.Application.Categories.Interfaces; 8 | 9 | using Dtos; 10 | 11 | /// 12 | /// Contract for CategoryReader implementation class, that provides querying product's category data. 13 | /// 14 | public interface ICategoryReaderEf 15 | { 16 | Task> FetchCategoryList(); 17 | } -------------------------------------------------------------------------------- /src/services/Product/Product.Application/Categories/UseCases/GetCategoryListUseCase.cs: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | //---------------------------------------------------------------------------- 7 | namespace Product.Application.Categories.UseCases; 8 | 9 | using Dtos; 10 | using MediatR; 11 | 12 | /// 13 | /// CQRS read action operation for fetching list of categories. 14 | /// 15 | public class GetCategoryListUseCase : IRequest> 16 | { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/services/Product/Product.Application/Products/Dtos/ProductTypeItemDto.cs: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | //--------------------------------------------------------------------------- 7 | namespace Product.Application.Products.Dtos; 8 | 9 | /// 10 | /// ProductType DTO object for transfering only relevant data about product type inside product variant object. 11 | /// 12 | /// ProductType name. 13 | public record ProductTypeItemDto(string Name); 14 | -------------------------------------------------------------------------------- /src/services/Product/Product.Application/Products/Interfaces/Repositories/ICategoryRepository.cs: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | //--------------------------------------------------------------------------- 7 | 8 | namespace Product.Application.Products.Interfaces.Repositories; 9 | 10 | using Domain.Entities; 11 | using NetMicroservices.SqlWrapper.Nuget; 12 | 13 | /// 14 | /// Data layer contract for . 15 | /// 16 | public interface ICategoryRepository : IAsyncRepository 17 | { 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/services/Product/Product.Application/Products/Interfaces/Repositories/IProductRepository.cs: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | //--------------------------------------------------------------------------- 7 | 8 | namespace Product.Application.Products.Interfaces.Repositories; 9 | 10 | using Domain.Entities; 11 | using NetMicroservices.SqlWrapper.Nuget; 12 | 13 | /// 14 | /// Data layer contract for . 15 | /// 16 | public interface IProductRepository : IAsyncRepository 17 | { 18 | } 19 | -------------------------------------------------------------------------------- /src/services/Product/Product.Application/Products/Interfaces/Services/ICategoryService.cs: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | //--------------------------------------------------------------------------- 7 | 8 | namespace Product.Application.Products.Interfaces.Services; 9 | 10 | using Product.Application.Categories.Dtos; 11 | 12 | /// 13 | /// Contract for CategoryService, that provides all functionality for reading and mutating product's category data. 14 | /// 15 | public interface ICategoryService 16 | { 17 | public Task> GetCategoryList(); 18 | } 19 | -------------------------------------------------------------------------------- /src/services/Product/Product.Application/Products/UseCases/GetProductListUseCase.cs: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | //--------------------------------------------------------------------------- 7 | namespace Product.Application.Products.UseCases; 8 | 9 | using Dtos; 10 | using MediatR; 11 | using NetMicroservices.ServiceConfig.Nuget; 12 | 13 | /// 14 | /// CQRS object for getting list of products. 15 | /// 16 | public class GetProductListUseCase : IRequest>> 17 | { 18 | } 19 | -------------------------------------------------------------------------------- /src/services/Product/Product.Application/Products/UseCases/GetProductUseCase.cs: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | //--------------------------------------------------------------------------- 7 | namespace Product.Application.Products.UseCases; 8 | 9 | using Dtos; 10 | using MediatR; 11 | using NetMicroservices.ServiceConfig.Nuget; 12 | 13 | /// 14 | /// CQRS object for getting product by unique identifier. 15 | /// 16 | public class GetProductUseCase : IRequest> 17 | { 18 | public Guid ProductId { get; set; } 19 | } 20 | -------------------------------------------------------------------------------- /src/services/Product/Product.Application/Products/UseCases/GetProductsByCategoryUseCase.cs: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | //--------------------------------------------------------------------------- 7 | namespace Product.Application.Products.UseCases; 8 | 9 | using Dtos; 10 | using MediatR; 11 | using NetMicroservices.ServiceConfig.Nuget; 12 | 13 | /// 14 | /// CQRS object for getting list of products by provided category url. 15 | /// 16 | public class GetProductsByCategoryUseCase : IRequest>> 17 | { 18 | public string CategoryUrl { get; set; } = string.Empty; 19 | } 20 | -------------------------------------------------------------------------------- /src/services/Product/Product.Application/Products/UseCases/GetProductsSuggestionsUseCase.cs: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | //--------------------------------------------------------------------------------------- 7 | namespace Product.Application.Products.UseCases; 8 | 9 | using MediatR; 10 | using NetMicroservices.ServiceConfig.Nuget; 11 | 12 | /// 13 | /// CQRS query for fetching list of product suggestions. 14 | /// 15 | public class GetProductsSuggestionsUseCase : IRequest>> 16 | { 17 | public string SearchText { get; set; } = string.Empty; 18 | } 19 | -------------------------------------------------------------------------------- /src/services/Product/Product.Application/Products/UseCases/SearchProductsUseCase.cs: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | //--------------------------------------------------------------------------- 7 | namespace Product.Application.Products.UseCases; 8 | 9 | using Dtos; 10 | using MediatR; 11 | using NetMicroservices.ServiceConfig.Nuget; 12 | 13 | /// 14 | /// CQRS query for searching products by title or description. 15 | /// 16 | public class SearchProductsUseCase : IRequest>> 17 | { 18 | public string SearchText { get; set; } = string.Empty; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /src/services/Product/Product.Domain/Entities/ProductTypeEntity.cs: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | //--------------------------------------------------------------------------- 7 | namespace Product.Domain.Entities; 8 | 9 | using NetMicroservices.SqlWrapper.Nuget; 10 | 11 | /// 12 | /// Entity for representation product's type inside product's variants. 13 | /// 14 | public class ProductTypeEntity : EntityBase 15 | { 16 | public string Name { get; set; } = string.Empty; 17 | } 18 | -------------------------------------------------------------------------------- /src/services/Product/Product.Domain/Product.Domain.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/services/Product/Product.Infrastructure/Product.Infrastructure.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/services/Product/Product.Persistence/Migrations/20221216094617_ProductEntityReset.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace Product.Persistence.Migrations 6 | { 7 | public partial class ProductEntityReset : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.Sql("TRUNCATE TABLE public.product;"); 12 | migrationBuilder.Sql("DELETE FROM public.product;"); 13 | } 14 | 15 | protected override void Down(MigrationBuilder migrationBuilder) 16 | { 17 | 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/services/Product/Product.Persistence/Migrations/20221216220156_CleanProductCategories.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace Product.Persistence.Migrations 6 | { 7 | public partial class CleanProductCategories : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.Sql("DELETE FROM public.category;"); 12 | migrationBuilder.Sql("DELETE FROM public.product;"); 13 | 14 | } 15 | 16 | protected override void Down(MigrationBuilder migrationBuilder) 17 | { 18 | 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/services/Product/Product.Persistence/Migrations/20221217092242_ClearProductCategoriesData.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace Product.Persistence.Migrations 6 | { 7 | public partial class ClearProductCategoriesData : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | 12 | migrationBuilder.Sql("DELETE FROM public.category;"); 13 | migrationBuilder.Sql("DELETE FROM public.product;"); 14 | } 15 | 16 | protected override void Down(MigrationBuilder migrationBuilder) 17 | { 18 | 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/services/Product/Product.Tests/Usings.cs: -------------------------------------------------------------------------------- 1 | global using Xunit; -------------------------------------------------------------------------------- /src/services/Product/Product.Tests/nuget.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/services/ProjectDetail/ProjectDetail.API/Program.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrikduch/netcore-microservices/5684a1e63b8ea158ea9343d7b7e2e6a02db5f7a5/src/services/ProjectDetail/ProjectDetail.API/Program.cs -------------------------------------------------------------------------------- /src/services/ProjectDetail/ProjectDetail.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | 9 | "DatabaseSettings": { 10 | "ConnectionString": "Server=localhost;Database=ProjectDb;User Id=sa;Password=SwN12345678;" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/services/ProjectDetail/ProjectDetail.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /src/services/ProjectDetail/ProjectDetail.Application/ProjectName/Dtos/ProjectDetailDto.cs: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | //--------------------------------------------------------------------------- 7 | namespace ProjectDetail.Application.ProjectName.Dtos; 8 | 9 | using System; 10 | 11 | /// 12 | /// View model class for mediator design pattern. 13 | /// 14 | public record ProjectDetailDto(Guid Id, string Name); 15 | -------------------------------------------------------------------------------- /src/services/ProjectDetail/ProjectDetail.Application/ProjectName/Interfaces/Persistence/Repositories/IProjectRepository.cs: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | //--------------------------------------------------------------------------- 7 | namespace ProjectDetail.Application.ProjectName.Interfaces.Persistence.Repositories; 8 | 9 | using Domain.Entities; 10 | using NetMicroservices.SqlWrapper.Nuget; 11 | 12 | /// 13 | /// Data repository contract of entity. 14 | /// 15 | public interface IProjectRepository : IAsyncRepository 16 | { 17 | } 18 | -------------------------------------------------------------------------------- /src/services/ProjectDetail/ProjectDetail.Application/ProjectName/UseCases/GetProjectNameUseCase.cs: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | //--------------------------------------------------------------------------- 7 | namespace ProjectDetail.Application.ProjectName.UseCases; 8 | 9 | using Dtos; 10 | using MediatR; 11 | using NetMicroservices.ServiceConfig.Nuget; 12 | 13 | /// 14 | /// CQRS query for fetching current project name. 15 | /// 16 | public class GetProjectNameUseCase : IRequest> 17 | { 18 | 19 | } 20 | 21 | -------------------------------------------------------------------------------- /src/services/ProjectDetail/ProjectDetail.Domain/Entities/ProjectDetailEntity.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------------ 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | // ----------------------------------------------------------------------------------- 7 | namespace ProjectDetail.Domain.Entities; 8 | 9 | using NetMicroservices.SqlWrapper.Nuget; 10 | 11 | /// 12 | /// Project domain entity object. 13 | /// 14 | public class ProjectDetailEntity : EntityBase 15 | { 16 | /// 17 | /// Gets or sets project name. 18 | /// 19 | public string Name { get; set; } 20 | } 21 | -------------------------------------------------------------------------------- /src/services/ProjectDetail/ProjectDetail.Domain/ProjectDetail.Domain.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/services/ProjectDetail/ProjectDetail.Infrastructure/ProjectDetail.Infrastructure.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/services/User/User.API/Controllers/IdentityController.cs: -------------------------------------------------------------------------------- 1 | namespace User.API.Controllers; 2 | 3 | using Microsoft.AspNetCore.Authorization; 4 | using Microsoft.AspNetCore.Mvc; 5 | 6 | 7 | [Route("api/v1/[controller]")] 8 | [ApiController] 9 | [Authorize] 10 | public class IdentityController : ControllerBase 11 | { 12 | [HttpGet] 13 | public IActionResult GetClaims() 14 | { 15 | var user = User.Claims.Select(c => new 16 | { 17 | tzpe = c.Type, 18 | value = c.Value 19 | }); 20 | 21 | 22 | return new JsonResult(user); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/services/User/User.API/User.API.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Docker 5 | ApiControllerEmptyScaffolder 6 | root/Common/Api 7 | 8 | -------------------------------------------------------------------------------- /src/services/User/User.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "DatabaseSettings": { 9 | "ConnectionString": "Server=localhost;Database=UserDb;User Id=sa;Password=SwN12345678;" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/services/User/User.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | 10 | "AppSettings": { 11 | "Token": "my top secret key" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/services/User/User.Application/Contracts/IAuthService.cs: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | //--------------------------------------------------------------------------- 7 | namespace User.Application.Contracts; 8 | 9 | using NetMicroservices.ServiceConfig.Nuget; 10 | using User.Application.Dtos; 11 | using User.Application.Dtos.Requests; 12 | 13 | public interface IAuthService 14 | { 15 | Task> Register(UserRegistrationDto user, string password); 16 | 17 | Task UserExists(string email); 18 | 19 | Task> Login(UserLoginRequestDto userloginDto); 20 | } 21 | -------------------------------------------------------------------------------- /src/services/User/User.Application/Dtos/AuthorizedUserDto.cs: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | //--------------------------------------------------------------------------- 7 | namespace User.Application.Dtos; 8 | 9 | /// 10 | /// Data transfer object for getting relevant data about particular authorized user. 11 | /// 12 | /// Name of user. 13 | public record AuthorizedUserDto(string Name); 14 | -------------------------------------------------------------------------------- /src/services/User/User.Application/Dtos/Requests/UserLoginRequestDto.cs: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | //--------------------------------------------------------------------------- 7 | namespace User.Application.Dtos.Requests; 8 | 9 | public record UserLoginRequestDto(string Email, string Password); 10 | -------------------------------------------------------------------------------- /src/services/User/User.Application/Dtos/Requests/UserRegistrationRequestDto.cs: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | //--------------------------------------------------------------------------- 7 | namespace User.Application.Dtos.Requests; 8 | 9 | public record UserRegistrationRequestDto(string Email, string Password); 10 | -------------------------------------------------------------------------------- /src/services/User/User.Application/Dtos/SignInUserDto.cs: -------------------------------------------------------------------------------- 1 | namespace User.Application.Dtos; 2 | 3 | public class SignInUserDto 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /src/services/User/User.Application/Dtos/UserRegistrationDto.cs: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | //--------------------------------------------------------------------------- 7 | namespace User.Application.Dtos; 8 | 9 | public class UserRegistrationDto 10 | { 11 | public Guid Id { get; set; } 12 | public string Email { get; set; } = string.Empty; 13 | 14 | public byte[]? PasswordHash { get; set; } 15 | 16 | public byte[]? PasswordSalt { get; set; } 17 | } 18 | -------------------------------------------------------------------------------- /src/services/User/User.Application/Features/Auth/Commands/UserLogin/UserLoginCommand.cs: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | //--------------------------------------------------------------------------- 7 | namespace User.Application.Features.Auth.Commands.UserLogin; 8 | 9 | using MediatR; 10 | using NetMicroservices.ServiceConfig.Nuget; 11 | 12 | public class UserLoginCommand : IRequest> 13 | { 14 | public string Email { get; set; } = string.Empty; 15 | 16 | public string Password { get; set; } = string.Empty; 17 | } 18 | -------------------------------------------------------------------------------- /src/services/User/User.Application/Features/Auth/Commands/UserRegistration/UserRegistrationCommand.cs: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | //--------------------------------------------------------------------------- 7 | namespace User.Application.Features.Auth.Commands.UserRegistration; 8 | 9 | using MediatR; 10 | using NetMicroservices.ServiceConfig.Nuget; 11 | 12 | public class UserRegistrationCommand : IRequest> 13 | { 14 | public string Email { get; set; } = string.Empty; 15 | public string Password { get; set; } = string.Empty; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /src/services/User/User.Domain/User.Domain.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/services/User/User.Infrastructure/User.Infrastructure.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Not found 13 | 14 |

Sorry, there's nothing at this address.

15 |
16 |
17 |
18 |
19 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Pages/public-side/BooksPage.razor: -------------------------------------------------------------------------------- 1 | @page "/books" 2 | 3 | Books 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Pages/public-side/Customers.razor: -------------------------------------------------------------------------------- 1 | @page "/customers" 2 | 3 | Customers 4 | 5 | 6 | @code { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Pages/public-side/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 | Home page 4 | 5 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Pages/public-side/MoviesPage.razor: -------------------------------------------------------------------------------- 1 | @page "/movies" 2 | 3 | Movies 4 | 5 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Pages/public-side/ProductDetail.razor: -------------------------------------------------------------------------------- 1 | @page "/product/{id:guid}" 2 | @inject IProductService ProductService 3 | 4 | @if(_product == null) 5 | { 6 | @_message 7 | } 8 | else 9 | { 10 | 11 | } 12 | 13 | @code { 14 | private Product? _product; 15 | private string _message = string.Empty; 16 | 17 | [Parameter] 18 | public Guid Id { get; set; } 19 | 20 | protected override async Task OnParametersSetAsync() 21 | { 22 | _message = "Loading Product..."; 23 | 24 | var result = await ProductService.GetProductAsync(Id); 25 | 26 | if (!result.Success) 27 | { 28 | _message = result.Message; 29 | 30 | } else 31 | { 32 | _product = result.Data; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Pages/public-side/ProfilePage.razor: -------------------------------------------------------------------------------- 1 | @page "/profile" 2 | @attribute [Authorize] 3 |

Profile Page

4 | 5 | 6 |
7 | Hi! You're logged in with @context.User.Identity?.Name 8 |
9 |
10 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Pages/public-side/SearchProductPage.razor: -------------------------------------------------------------------------------- 1 | @page "/search/{searchText}" 2 | 3 | Search products 4 | 5 | 6 | 7 | @code { 8 | [Parameter] 9 | public string? SearchText { get; set; } 10 | } -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Pages/public-side/VideoGamesPage.razor: -------------------------------------------------------------------------------- 1 | @page "/video-games" 2 | 3 | Video Games 4 | 5 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Services/Auth/IAuthService.cs: -------------------------------------------------------------------------------- 1 | namespace Web.Blazor.Client.Services.Auth; 2 | 3 | using NetMicroservices.ServiceConfig.Nuget; 4 | using Web.Blazor.Shared; 5 | 6 | public interface IAuthService 7 | { 8 | Task> Register(UserRegister request); 9 | 10 | Task> Login(UserLogin request); 11 | } -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Services/Category/ICategoryService.cs: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Patrik Duch, IČ: 09225471 4 | // 5 | // Patrik Duch 6 | //--------------------------------------------------------------------------- 7 | 8 | using Web.Blazor.Shared; 9 | 10 | namespace Web.Blazor.Client.Services.Category; 11 | 12 | public interface ICategoryService 13 | { 14 | List Categories { get; set;} 15 | Task GetCategoriesAsync(); 16 | } 17 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Services/Products/IProductService.cs: -------------------------------------------------------------------------------- 1 | namespace Web.Blazor.Client.Services.Products; 2 | 3 | using NetMicroservices.ServiceConfig.Nuget; 4 | using Web.Blazor.Shared; 5 | 6 | public interface IProductService 7 | { 8 | public List Products { get; set; } 9 | 10 | public string Message { get; set; } 11 | 12 | 13 | Task GetProductsAsync(string? categoryUrl=null); 14 | 15 | Task> GetProductAsync(Guid id); 16 | 17 | Task SearchProducts(string searchText); 18 | 19 | Task>> GetProductSearchSuggestions(string searchText); 20 | } 21 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Services/ProjectDetail/IProjectDetailService.cs: -------------------------------------------------------------------------------- 1 | namespace Web.Blazor.Client.Services.ProjectDetail; 2 | 3 | using Web.Blazor.Shared; 4 | 5 | public interface IProjectDetailService 6 | { 7 | public ProjectDetail ProjectDetail { get; set; } 8 | 9 | Task GetProjectDetailAsync(); 10 | } 11 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Services/ProjectDetail/ProjectDetailService.cs: -------------------------------------------------------------------------------- 1 | namespace Web.Blazor.Client.Services.ProjectDetail; 2 | 3 | using System.Net.Http.Json; 4 | using Web.Blazor.Shared; 5 | 6 | public class ProjectDetailService : IProjectDetailService 7 | { 8 | private readonly HttpClient _http; 9 | 10 | public ProjectDetail ProjectDetail { get; set; } = new (); 11 | 12 | public ProjectDetailService(HttpClient http) 13 | { 14 | _http = http; 15 | } 16 | 17 | public async Task GetProjectDetailAsync() 18 | { 19 | var response = await _http.GetFromJsonAsync("/projectdetail"); 20 | 21 | 22 | if (response is not null) 23 | { 24 | ProjectDetail = response; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Shared/App/Cart/Common/CartBuyCTA.razor: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Shared/App/Coupon/Common/ApplyCouponCTA.razor: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Shared/App/Products/Common/ProductDescription/ProductDescription.razor: -------------------------------------------------------------------------------- 1 | 

@Description

2 | 3 | @code { 4 | [Parameter] 5 | public string Description { get; set; } = string.Empty; 6 | } -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Shared/App/Products/Common/ProductDescription/ProductDescription.razor.css: -------------------------------------------------------------------------------- 1 | body { 2 | } 3 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Shared/App/Products/Common/ProductImage/ProductImage.razor: -------------------------------------------------------------------------------- 1 | 
2 | 3 | @ProductName 4 | 5 |
6 | 7 | @code { 8 | [Parameter] 9 | public Guid ProductId { get; set; } 10 | 11 | [Parameter] 12 | public string ImgUrl { get; set; } = string.Empty; 13 | 14 | [Parameter] 15 | public string ProductName { get; set; } = string.Empty; 16 | } 17 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Shared/App/Products/Common/ProductImage/ProductImage.razor.css: -------------------------------------------------------------------------------- 1 | .media-img { 2 | max-height: 200px; 3 | max-width: 200px; 4 | border-radius: 6px; 5 | margin-bottom: 10px; 6 | transition: transform .2s; 7 | } 8 | 9 | .media-img:hover { 10 | transform: scale(1.1); 11 | } 12 | 13 | .media-img-wrapper { 14 | margin-top: 2vh; 15 | width: 200px; 16 | text-align: center; 17 | } 18 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Shared/App/Products/Common/ProductItemContainer/ProductItemContainer.razor: -------------------------------------------------------------------------------- 1 | 
2 |
3 | @ChildContent 4 |
5 |
6 | 7 | @code { 8 | 9 | [Parameter] 10 | public RenderFragment? ChildContent { get; set; } 11 | } 12 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Shared/App/Products/Common/ProductItemContainer/ProductItemContainer.razor.css: -------------------------------------------------------------------------------- 1 | .media { 2 | display: flex; 3 | align-items: flex-start; 4 | } 5 | 6 | .media-body { 7 | flex: 1; 8 | } -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Shared/App/Products/Common/ProductName/ProductName.razor: -------------------------------------------------------------------------------- 1 |  2 |

@Name

3 |
4 | 5 | @code { 6 | [Parameter] 7 | public string Name { get; set; } = string.Empty; 8 | 9 | [Parameter] 10 | public string Url { get; set; } = string.Empty; 11 | } 12 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Shared/App/Products/Common/ProductName/ProductName.razor.css: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Shared/App/Products/Common/ProductPrice/ProductPrice.razor: -------------------------------------------------------------------------------- 1 | 

@Price

2 | 3 | @code { 4 | [Parameter] 5 | public string Price { get; set; } = string.Empty; 6 | } 7 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Shared/App/Products/Common/ProductPrice/ProductPrice.razor.css: -------------------------------------------------------------------------------- 1 | .price { 2 | margin-top: 0.5vh; 3 | color: green; 4 | } 5 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Shared/App/Products/Common/ProductVariant/ProductVariantPrice/ProductVariantPrice.razor.css: -------------------------------------------------------------------------------- 1 | .not-available { 2 | color: red; 3 | } -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Shared/App/Products/ProductItem/ProductItemDetail/ProductItemDetail.razor.css: -------------------------------------------------------------------------------- 1 | .original-price { 2 | text-decoration: line-through; 3 | } -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Shared/App/Products/ProductList/ProductList.razor.css: -------------------------------------------------------------------------------- 1 | @media (max-width: 1023.98px) { 2 | .media { 3 | flex-direction: column; 4 | } 5 | 6 | .media-img-wrapper { 7 | width: 100%; 8 | height: auto; 9 | } 10 | } -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Shared/Common/Auth/NotAuthorizedContent.razor: -------------------------------------------------------------------------------- 1 | 

Whoops! You'are not allowed to see this page.

2 |
Please Login or Register for a new account
-------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Shared/Common/PageHeading.razor: -------------------------------------------------------------------------------- 1 | 

@Title

2 | 3 | @code { 4 | [Parameter] 5 | public string Title { get; set; } = string.Empty; 6 | } 7 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Shared/Skeleton/Header/Nav/NavTitle.razor: -------------------------------------------------------------------------------- 1 | @inject HttpClient HttpClient; 2 | @inject IProjectDetailService ProjectDetailService; 3 | 4 |

@ProjectDetailService.ProjectDetail.Name

5 | 6 | @code { 7 | protected override async Task OnInitializedAsync() 8 | { 9 | await ProjectDetailService.GetProjectDetailAsync(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Shared/Skeleton/Header/Nav/NavTitle.razor.css: -------------------------------------------------------------------------------- 1 | h1 { 2 | font-size: 17px; 3 | } -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Shared/Skeleton/Header/UserButton/UserButton.razor: -------------------------------------------------------------------------------- 1 | 

UserButton

2 | 3 | @code { 4 | 5 | } -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/Shared/SurveyPrompt.razor: -------------------------------------------------------------------------------- 1 | 
2 | 3 | @Title 4 | 5 | 6 | Please take our 7 | brief survey 8 | 9 | and tell us what you think. 10 |
11 | 12 | @code { 13 | // Demonstrates how a parent component can supply parameters 14 | [Parameter] 15 | public string? Title { get; set; } 16 | } 17 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/wwwroot/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "message": "Blazor is bad.", 3 | "APIGwUrl": "http://localhost:9000" 4 | } -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/wwwroot/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "message": "Blazor is awesome.", 3 | "APIGwUrl": "https://api.shopwinner.org" 4 | } -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrikduch/netcore-microservices/5684a1e63b8ea158ea9343d7b7e2e6a02db5f7a5/src/webapps/Web.Blazor/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrikduch/netcore-microservices/5684a1e63b8ea158ea9343d7b7e2e6a02db5f7a5/src/webapps/Web.Blazor/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrikduch/netcore-microservices/5684a1e63b8ea158ea9343d7b7e2e6a02db5f7a5/src/webapps/Web.Blazor/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrikduch/netcore-microservices/5684a1e63b8ea158ea9343d7b7e2e6a02db5f7a5/src/webapps/Web.Blazor/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrikduch/netcore-microservices/5684a1e63b8ea158ea9343d7b7e2e6a02db5f7a5/src/webapps/Web.Blazor/Client/wwwroot/favicon.ico -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/wwwroot/icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrikduch/netcore-microservices/5684a1e63b8ea158ea9343d7b7e2e6a02db5f7a5/src/webapps/Web.Blazor/Client/wwwroot/icon-192.png -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/wwwroot/icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrikduch/netcore-microservices/5684a1e63b8ea158ea9343d7b7e2e6a02db5f7a5/src/webapps/Web.Blazor/Client/wwwroot/icon-512.png -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/wwwroot/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Web.Blazor", 3 | "short_name": "Web.Blazor", 4 | "start_url": "./", 5 | "display": "standalone", 6 | "background_color": "#ffffff", 7 | "theme_color": "#03173d", 8 | "prefer_related_applications": false, 9 | "icons": [ 10 | { 11 | "src": "icon-512.png", 12 | "type": "image/png", 13 | "sizes": "512x512" 14 | }, 15 | { 16 | "src": "icon-192.png", 17 | "type": "image/png", 18 | "sizes": "192x192" 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Client/wwwroot/service-worker.js: -------------------------------------------------------------------------------- 1 | // In development, always fetch from the network and do not enable offline support. 2 | // This is because caching would make development more difficult (changes would not 3 | // be reflected on the first load after each change). 4 | //self.addEventListener('fetch', () => { }); 5 | 6 | // 👇 Add these line to accept the message from this library. 7 | self.addEventListener('message', event => { 8 | if (event.data?.type === 'SKIP_WAITING') self.skipWaiting(); 9 | }); -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Server/Pages/Error.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.AspNetCore.Mvc.RazorPages; 3 | using System.Diagnostics; 4 | 5 | namespace Web.Blazor.Server.Pages 6 | { 7 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 8 | [IgnoreAntiforgeryToken] 9 | public class ErrorModel : PageModel 10 | { 11 | public string? RequestId { get; set; } 12 | 13 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 14 | 15 | private readonly ILogger _logger; 16 | 17 | public ErrorModel(ILogger logger) 18 | { 19 | _logger = logger; 20 | } 21 | 22 | public void OnGet() 23 | { 24 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Server/Program.cs: -------------------------------------------------------------------------------- 1 | var builder = WebApplication.CreateBuilder(args); 2 | 3 | // Add services to the container. 4 | 5 | builder.Services.AddControllersWithViews(); 6 | builder.Services.AddRazorPages(); 7 | 8 | 9 | builder.Services.AddControllers().AddNewtonsoftJson(); 10 | 11 | var app = builder.Build(); 12 | 13 | app.UseHttpsRedirection(); 14 | 15 | // Configure the HTTP request pipeline. 16 | if (app.Environment.IsDevelopment()) 17 | { 18 | app.UseWebAssemblyDebugging(); 19 | } 20 | else 21 | { 22 | app.UseExceptionHandler("/Error"); 23 | } 24 | 25 | app.UseBlazorFrameworkFiles(); 26 | app.UseStaticFiles(); 27 | 28 | app.UseRouting(); 29 | 30 | 31 | app.MapRazorPages(); 32 | app.MapControllers(); 33 | app.MapFallbackToFile("index.html"); 34 | 35 | app.Run(); 36 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Server/Web.Blazor.Server.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Web.Blazor.Server 5 | 6 | 7 | ProjectDebugger 8 | 9 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "APIGwUrl": "a" 9 | } 10 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Shared/CategoryDto.cs: -------------------------------------------------------------------------------- 1 | namespace Web.Blazor.Shared; 2 | 3 | public record CategoryDto(Guid Id, string Name, string Url); 4 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Shared/Product.cs: -------------------------------------------------------------------------------- 1 | namespace Web.Blazor.Shared; 2 | 3 | public class Product 4 | { 5 | public Guid Id { get; set; } 6 | 7 | public string Name { get; set; } = string.Empty; 8 | 9 | public string ImgUrl { get; set; } = string.Empty; 10 | 11 | public string Description { get; set; } = string.Empty; 12 | 13 | public decimal Price { get; set; } 14 | 15 | public List ProductVariants { get; set; } = new (); 16 | } -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Shared/ProductType.cs: -------------------------------------------------------------------------------- 1 | namespace Web.Blazor.Shared; 2 | 3 | public class ProductType 4 | { 5 | public string Name { get; set; } = string.Empty; 6 | } -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Shared/ProductVariant.cs: -------------------------------------------------------------------------------- 1 | namespace Web.Blazor.Shared; 2 | 3 | public class ProductVariant 4 | { 5 | public Guid Id { get; set; } 6 | 7 | public Guid ProductTypeId { get; set; } 8 | 9 | public decimal Price { get; set; } 10 | 11 | public decimal OriginalPrice { get; set; } 12 | 13 | public ProductType ProductType { get; set; } = new(); 14 | } -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Shared/ProjectDetail.cs: -------------------------------------------------------------------------------- 1 | namespace Web.Blazor.Shared; 2 | 3 | public class ProjectDetail 4 | { 5 | public string Name { get; set; } = string.Empty; 6 | } 7 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Shared/UserLogin.cs: -------------------------------------------------------------------------------- 1 | namespace Web.Blazor.Shared; 2 | 3 | using System.ComponentModel.DataAnnotations; 4 | 5 | public class UserLogin 6 | { 7 | [Required] 8 | public string Email { get; set; } = string.Empty; 9 | [Required] 10 | public string Password { get; set; } = string.Empty; 11 | } -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Shared/UserRegister.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Web.Blazor.Shared; 4 | 5 | public class UserRegister 6 | { 7 | [Required] 8 | public string Email { get; set; } = string.Empty; 9 | 10 | [Required, StringLength(100, MinimumLength = 6)] 11 | public string Password { get; set; } = string.Empty; 12 | 13 | [Compare("Password", ErrorMessage = "The passwords do not match")] 14 | public string ConfirmPassword { get; set; } = string.Empty; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/Shared/Web.Blazor.Shared.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/webapps/Web.Blazor/nginx.conf: -------------------------------------------------------------------------------- 1 | events { } 2 | http { 3 | include mime.types; 4 | 5 | server { 6 | listen 80; 7 | 8 | location / { 9 | root /var/www/web; 10 | try_files $uri $uri/ /index.html =404; 11 | 12 | location ~* \.(dll|wasm|json)$ { 13 | add_header Cache-Control "no-cache"; 14 | } 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /src/webapps/Web.Mvc/Constants/HttpClientConstants.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Patrik Duch, IČ: 09225471 3 | // 4 | namespace Web.Mvc.Constants; 5 | 6 | /// 7 | /// Defines a static class that contains constant values related to HttpClient configurations. 8 | /// 9 | public static class HttpClientConstants 10 | { 11 | /// 12 | /// The name of the HttpClient instance used for making requests to the API Gateway. 13 | /// 14 | public static string ApiGwHttpClientName = "api-gw"; 15 | 16 | /// 17 | /// The name of the HttpClient instance used for making requests to the Identity Server. 18 | /// 19 | public static string IdenityServerHttpClientName = "identity-server"; 20 | } -------------------------------------------------------------------------------- /src/webapps/Web.Mvc/Controllers/ProductController.cs: -------------------------------------------------------------------------------- 1 | namespace Web.Mvc.Controllers; 2 | 3 | using ApiServices; 4 | using Microsoft.AspNetCore.Authorization; 5 | using Microsoft.AspNetCore.Mvc; 6 | 7 | public class ProductController : Controller 8 | { 9 | private readonly IProductService _productService; 10 | 11 | public ProductController(IProductService productService) 12 | { 13 | _productService = productService; 14 | } 15 | 16 | 17 | // GET: ProductController1cs 18 | [Authorize] 19 | public async Task Index() 20 | { 21 | var products = await _productService.GetProductAsync(Guid.NewGuid()); 22 | 23 | 24 | return View(products); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/webapps/Web.Mvc/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace Web.Mvc.Models 2 | { 3 | public class ErrorViewModel 4 | { 5 | public string? RequestId { get; set; } 6 | 7 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 8 | } 9 | } -------------------------------------------------------------------------------- /src/webapps/Web.Mvc/Models/Product.cs: -------------------------------------------------------------------------------- 1 | namespace Web.Mvc.Models; 2 | 3 | public class Product 4 | { 5 | public Guid Id { get; set; } 6 | 7 | public string Name { get; set; } = string.Empty; 8 | 9 | public string ImgUrl { get; set; } = string.Empty; 10 | 11 | public string Description { get; set; } = string.Empty; 12 | 13 | public decimal Price { get; set; } 14 | } 15 | -------------------------------------------------------------------------------- /src/webapps/Web.Mvc/Models/ProductVariant.cs: -------------------------------------------------------------------------------- 1 | namespace Web.Mvc.Models; 2 | 3 | public class ProductVariant 4 | { 5 | public string Id { get; set; } 6 | public decimal Price { get; set; } 7 | public decimal OriginalPrice { get; set; } 8 | public string ProductType { get; set; } 9 | } 10 | -------------------------------------------------------------------------------- /src/webapps/Web.Mvc/Program.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrikduch/netcore-microservices/5684a1e63b8ea158ea9343d7b7e2e6a02db5f7a5/src/webapps/Web.Mvc/Program.cs -------------------------------------------------------------------------------- /src/webapps/Web.Mvc/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |
6 |

Welcome

7 |

Learn about building Web apps with ASP.NET Core.

8 |
9 | -------------------------------------------------------------------------------- /src/webapps/Web.Mvc/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /src/webapps/Web.Mvc/Views/Product/Index.cshtml: -------------------------------------------------------------------------------- 1 | @* 2 | For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 3 | *@ 4 | @{ 5 | } 6 | 7 | @using NetMicroservices.ServiceConfig.Nuget; 8 | 9 | @model ServiceResponse>; 10 | 11 | 12 |

Products

13 | 14 | @foreach (var item in Model.Data) 15 | { 16 |

@item.Name

17 | } -------------------------------------------------------------------------------- /src/webapps/Web.Mvc/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /src/webapps/Web.Mvc/Views/User/Profile.cshtml: -------------------------------------------------------------------------------- 1 | @* 2 | View to display user details (profile) from IdentityServer 4. 3 | *@ 4 | 5 | @using Web.Mvc.Models.Identity; 6 | @model IdentityProfileModel 7 | 8 | 9 |

Your profile

10 | 11 |

FirstName: @Model.GivenName

12 |

Surname: @Model.FamilyName

-------------------------------------------------------------------------------- /src/webapps/Web.Mvc/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using Web.Mvc 2 | @using Web.Mvc.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /src/webapps/Web.Mvc/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /src/webapps/Web.Mvc/Web.Mvc.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Docker 5 | MvcControllerWithActionsScaffolder 6 | root/Common/MVC/Controller 7 | RazorViewEmptyScaffolder 8 | root/Common/MVC/View 9 | 10 | -------------------------------------------------------------------------------- /src/webapps/Web.Mvc/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "ApiGwUrl": "", 3 | "IdentityUrl": "", 4 | "Logging": { 5 | "LogLevel": { 6 | "Default": "Information", 7 | "Microsoft.AspNetCore": "Warning" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/webapps/Web.Mvc/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning", 6 | "Microsoft.AspNetCore.Authentication.OpenIdConnect": "Debug", 7 | "Microsoft.AspNetCore.Authentication.Cookies": "Debug", 8 | "Microsoft.AspNetCore.Authentication": "Debug", 9 | "Microsoft.AspNetCore.Authorization": "Trace" 10 | } 11 | }, 12 | "AllowedHosts": "*", 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/webapps/Web.Mvc/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | html { 2 | font-size: 14px; 3 | } 4 | 5 | @media (min-width: 768px) { 6 | html { 7 | font-size: 16px; 8 | } 9 | } 10 | 11 | html { 12 | position: relative; 13 | min-height: 100%; 14 | } 15 | 16 | body { 17 | margin-bottom: 60px; 18 | } -------------------------------------------------------------------------------- /src/webapps/Web.Mvc/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrikduch/netcore-microservices/5684a1e63b8ea158ea9343d7b7e2e6a02db5f7a5/src/webapps/Web.Mvc/wwwroot/favicon.ico -------------------------------------------------------------------------------- /src/webapps/Web.Mvc/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /src/webapps/Web.Mvc/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | --------------------------------------------------------------------------------