From 69af60b842745a6a42468209321fc0b79dd9d873 Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Tue, 15 Jan 2019 15:40:24 +0300 Subject: [PATCH 1/4] Added empty solution for microservice demo --- samples/MicroserviceDemo/MicroserviceDemo.sln | 13 +++++++++++++ samples/MicroserviceDemo/docs/design/Overall.md | 3 +++ 2 files changed, 16 insertions(+) create mode 100644 samples/MicroserviceDemo/MicroserviceDemo.sln create mode 100644 samples/MicroserviceDemo/docs/design/Overall.md diff --git a/samples/MicroserviceDemo/MicroserviceDemo.sln b/samples/MicroserviceDemo/MicroserviceDemo.sln new file mode 100644 index 0000000000..a7d77ae029 --- /dev/null +++ b/samples/MicroserviceDemo/MicroserviceDemo.sln @@ -0,0 +1,13 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.168 +MinimumVisualStudioVersion = 10.0.40219.1 +Global + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {37474F0D-2E52-4D2F-B39B-7FE3FF31B4EC} + EndGlobalSection +EndGlobal diff --git a/samples/MicroserviceDemo/docs/design/Overall.md b/samples/MicroserviceDemo/docs/design/Overall.md new file mode 100644 index 0000000000..e44622f85a --- /dev/null +++ b/samples/MicroserviceDemo/docs/design/Overall.md @@ -0,0 +1,3 @@ +# Microservice Demo Overall + +... \ No newline at end of file From c07608ebbe77cfff7395d5afeeeacefe65c7430c Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Tue, 15 Jan 2019 17:03:30 +0300 Subject: [PATCH 2/4] Added overall document --- .../MicroserviceDemo/docs/design/Overall.md | 51 ++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/samples/MicroserviceDemo/docs/design/Overall.md b/samples/MicroserviceDemo/docs/design/Overall.md index e44622f85a..d6e6b20118 100644 --- a/samples/MicroserviceDemo/docs/design/Overall.md +++ b/samples/MicroserviceDemo/docs/design/Overall.md @@ -1,3 +1,52 @@ # Microservice Demo Overall -... \ No newline at end of file +## Introduction + +The goal of this work is to show how to create a complete microservice solution based on the ABP framework. + +## Tooling + +* **[ASP.NET Core](https://docs.microsoft.com/en-us/aspnet/core/?view=aspnetcore-2.2)** as the web framework. +* **[ABP](https://abp.io)** as the application framework. +* **[Ocelot](https://github.com/ThreeMammals/Ocelot)** as the API Gateway. +* **[IdentityServer4](https://identityserver.io/)** as the authentication server/framework. +* [**Redis**](https://redis.io/) for distributed cache. +* [**RabbitMQ**](https://www.rabbitmq.com/) for distributed messaging. + +## The Solution + +The solution consists of; + +* **MVC applications**: + * **AuthServer Application** + * Hosts the [IdentityServer4](https://github.com/abpframework/abp/tree/master/modules/identityserver) module for authentication. + * Uses an SQL server database and [EF Core](https://abp.io/documents/abp/latest/Entity-Framework-Core) as the ORM. + * **Public Site Application** + * Hosts the [docs](https://github.com/abpframework/abp/tree/master/modules/docs) module UI. Uses the docs microservice as backend. + * Hosts the [blogging](https://github.com/abpframework/abp/tree/master/modules/blogging) module UI. Uses the blogging microservice as backend. + * Contains a sample page that uses multiple microservice API calls. + * Authenticates from the AuthServer. + * **Backend Admin Application** + * Hosts the [Identity](https://github.com/abpframework/abp/tree/master/modules/identity) module UI for user/role/permission management. Uses the identity microservice as backend. + * Hosts the blogging admin UI to manage the docs web site. Uses the blogging microservice as backend. +* **Microservices**: + * **Blogging Microservice** + * Hosts the [blogging](https://github.com/abpframework/abp/tree/master/modules/blogging) module API. + * Uses its own [MongoDB](https://abp.io/documents/abp/latest/MongoDB) database. + * Listens user update events (of the Identity microservice) to update the users stored in its own database. + * **Docs Microservice** + * Serves the docs module API. + * Uses its own SQL Server database. + * **Identity Microservice** + * Hosts the [identity](https://github.com/abpframework/abp/tree/master/modules/identity) module API. + * Shares the same SQL Server database with the AuthServer application. +* **API Gateways** + * **Public Site Gateway**: Used by the public site application. + * **Backend Gateway**: Used by the Backend admin application. + +## Notes + +* Microservices and the AuthServer application use Redis for caching and RabbitMQ for distributed messaging. +* Every microservice is configured for auditing. +* Uses docker-compose. +* Will create sample background jobs for demonstration. \ No newline at end of file From 5f3709f8b8394d8582477836c9c0752723b4c2bf Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Tue, 15 Jan 2019 17:28:29 +0300 Subject: [PATCH 3/4] Update Overall.md --- samples/MicroserviceDemo/docs/design/Overall.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/samples/MicroserviceDemo/docs/design/Overall.md b/samples/MicroserviceDemo/docs/design/Overall.md index d6e6b20118..10b1c74830 100644 --- a/samples/MicroserviceDemo/docs/design/Overall.md +++ b/samples/MicroserviceDemo/docs/design/Overall.md @@ -22,24 +22,23 @@ The solution consists of; * Hosts the [IdentityServer4](https://github.com/abpframework/abp/tree/master/modules/identityserver) module for authentication. * Uses an SQL server database and [EF Core](https://abp.io/documents/abp/latest/Entity-Framework-Core) as the ORM. * **Public Site Application** - * Hosts the [docs](https://github.com/abpframework/abp/tree/master/modules/docs) module UI. Uses the docs microservice as backend. + * "Our products" page to list the products using the products microservice. * Hosts the [blogging](https://github.com/abpframework/abp/tree/master/modules/blogging) module UI. Uses the blogging microservice as backend. - * Contains a sample page that uses multiple microservice API calls. * Authenticates from the AuthServer. * **Backend Admin Application** * Hosts the [Identity](https://github.com/abpframework/abp/tree/master/modules/identity) module UI for user/role/permission management. Uses the identity microservice as backend. - * Hosts the blogging admin UI to manage the docs web site. Uses the blogging microservice as backend. + * A CRUD page to manage products using the products microservice. * **Microservices**: * **Blogging Microservice** * Hosts the [blogging](https://github.com/abpframework/abp/tree/master/modules/blogging) module API. * Uses its own [MongoDB](https://abp.io/documents/abp/latest/MongoDB) database. * Listens user update events (of the Identity microservice) to update the users stored in its own database. - * **Docs Microservice** - * Serves the docs module API. - * Uses its own SQL Server database. * **Identity Microservice** * Hosts the [identity](https://github.com/abpframework/abp/tree/master/modules/identity) module API. * Shares the same SQL Server database with the AuthServer application. + * **Product Microservice** + * A simple microservice that is used to manage products (simple CRUD API). + * Uses its own SQL Server database. * **API Gateways** * **Public Site Gateway**: Used by the public site application. * **Backend Gateway**: Used by the Backend admin application. From 2816d8e5ea8d3c4dc04b37973d2f823b6b6e79a0 Mon Sep 17 00:00:00 2001 From: Goxy Date: Wed, 16 Jan 2019 14:51:34 +0800 Subject: [PATCH 4/4] Fixed required module in IdentityServerHost --- .../service/host/IdentityServerHost/IdentityServerHostModule.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/service/host/IdentityServerHost/IdentityServerHostModule.cs b/templates/service/host/IdentityServerHost/IdentityServerHostModule.cs index 8883c8848b..5cf1b7e511 100644 --- a/templates/service/host/IdentityServerHost/IdentityServerHostModule.cs +++ b/templates/service/host/IdentityServerHost/IdentityServerHostModule.cs @@ -17,6 +17,7 @@ namespace IdentityServerHost [DependsOn( typeof(AbpAutofacModule), typeof(AbpAspNetCoreMvcModule), + typeof(AbpIdentityAspNetCoreModule), typeof(AbpIdentityServerEntityFrameworkCoreModule), typeof(AbpIdentityEntityFrameworkCoreModule), typeof(AbpEntityFrameworkCoreSqlServerModule)