GithubHelp home page GithubHelp logo

phongnguyend / practical.cleanarchitecture Goto Github PK

View Code? Open in Web Editor NEW
1.9K 108.0 493.0 72.87 MB

Full-stack .Net 8 Clean Architecture (Microservices, Modular Monolith, Monolith), Blazor, Angular 17, React 18, Vue 3, BFF with YARP, Domain-Driven Design, CQRS, SOLID, Asp.Net Core Identity Custom Storage, OpenID Connect, Entity Framework Core, Selenium, SignalR, Hosted Services, Health Checks, Rate Limiting, Cloud Services (Azure, AWS, Google)...

License: MIT License

C# 64.65% Dockerfile 1.01% HTML 12.40% CSS 1.98% PowerShell 0.06% JavaScript 7.76% TypeScript 8.94% Vue 1.53% Less 1.34% TSQL 0.30% SCSS 0.01%
cqrs domain-driven-design clean-architecture oauth2 signalr docker azure aws rabbitmq kafka

practical.cleanarchitecture's Introduction

โš ๏ธ Warning

The code samples contain multiple ways and patterns to do things and not always be considered best practices or recommended for all situations.

Database Centric vs Domain Centric Architecture

alt text

(open on draw.io)

Hexagonal Architecture

alt text

(open on draw.io)

Onion Architecture

alt text

(open on draw.io)

The Clean Architecture

alt text

(open on draw.io)

Classic Three-layer Architecture

alt text

(open on draw.io)

Modern Four-layer Architecture

alt text

(open on draw.io)

Layer Dependencies

alt text

(open on draw.io)

Layer Examples

alt text

(open on draw.io)

Testing Pyramid

alt text alt text alt text

(open on draw.io)

Vertical Slice Architecture (Modular Monolith)

alt text

(open on draw.io)

Solution Structure

alt text

alt text

alt text

How to Run:

Update Configuration

Database
  • Update Connection Strings:

    Project Configuration File Configuration Key
    ClassifiedAds.Migrator appsettings.json ConnectionStrings:ClassifiedAds
    ClassifiedAds.BackgroundServer appsettings.json ConnectionStrings:ClassifiedAds
    ClassifiedAds.IdentityServer appsettings.json ConnectionStrings:ClassifiedAds
    ClassifiedAds.WebAPI appsettings.json ConnectionStrings:ClassifiedAds
    ClassifiedAds.WebMVC appsettings.json ConnectionStrings:ClassifiedAds
  • Run Migration:

    • Option 1: Using dotnet cli:
      • Install dotnet-ef cli:
        dotnet tool install --global dotnet-ef --version="5.0"
        
      • Navigate to ClassifiedAds.Migrator and run these commands:
        dotnet ef migrations add Init --context AdsDbContext -o Migrations/AdsDb
        dotnet ef migrations add Init --context ConfigurationDbContext -o Migrations/ConfigurationDb
        dotnet ef migrations add Init --context PersistedGrantDbContext -o Migrations/PersistedGrantDb
        dotnet ef database update --context AdsDbContext
        dotnet ef database update --context ConfigurationDbContext
        dotnet ef database update --context PersistedGrantDbContext
        
    • Option 2: Using Package Manager Console:
      • Set ClassifiedAds.Migrator as StartUp Project
      • Open Package Manager Console, select ClassifiedAds.Migrator as Default Project
      • Run these commands:
        Add-Migration -Context AdsDbContext Init -OutputDir Migrations/AdsDb
        Add-Migration -Context ConfigurationDbContext Init -OutputDir Migrations/ConfigurationDb
        Add-Migration -Context PersistedGrantDbContext Init -OutputDir Migrations/PersistedGrantDb
        Update-Database -Context AdsDbContext
        Update-Database -Context ConfigurationDbContext
        Update-Database -Context PersistedGrantDbContext
        
Additional Configuration Sources
  • Open ClassifiedAds.WebMVC/appsettings.json and jump to ConfigurationSources section.

    "ConfigurationSources": {
      "SqlServer": {
        "IsEnabled": false,
        "ConnectionString": "Server=127.0.0.1;Database=ClassifiedAds;User Id=sa;Password=sqladmin123!@#",
        "SqlQuery": "select [Key], [Value] from ConfigurationEntries"
      },
      "AzureKeyVault": {
        "IsEnabled": false,
        "VaultName": "https://xxx.vault.azure.net/"
      }
    },
  • Get from Sql Server database:

    "ConfigurationSources": {
      "SqlServer": {
        "IsEnabled": true,
        "ConnectionString": "Server=127.0.0.1;Database=ClassifiedAds;User Id=sa;Password=sqladmin123!@#",
        "SqlQuery": "select [Key], [Value] from ConfigurationEntries"
      },
    },
  • Get from Azure Key Vault:

    "ConfigurationSources": {
      "AzureKeyVault": {
        "IsEnabled": true,
        "VaultName": "https://xxx.vault.azure.net/"
      }
    },
  • Use Both:

    "ConfigurationSources": {
      "SqlServer": {
        "IsEnabled": true,
        "ConnectionString": "Server=127.0.0.1;Database=ClassifiedAds;User Id=sa;Password=sqladmin123!@#",
        "SqlQuery": "select [Key], [Value] from ConfigurationEntries"
      },
      "AzureKeyVault": {
        "IsEnabled": true,
        "VaultName": "https://xxx.vault.azure.net/"
      }
    },
Storage
  • Open ClassifiedAds.WebMVC/appsettings.json, ClassifiedAds.WebAPI/appsettings.json and jump to Storage section.

    "Storage": {
      "Provider": "Local",
    },
  • Use Local Files:

    "Storage": {
      "Provider": "Local",
      "Local": {
        "Path": "E:\\files"
      },
    },
  • Use Azure Blob:

    "Storage": {
      "Provider": "Azure",
      "Azure": {
        "ConnectionString": "xxx",
        "Container": "classifiedadds"
      },
    },
  • Use Amazon S3:

    "Storage": {
      "Provider": "Amazon",
      "Amazon": {
        "AccessKeyID": "xxx",
        "SecretAccessKey": "xxx",
        "BucketName": "classifiedadds",
        "RegionEndpoint": "ap-southeast-1"
      }
    },
Message Broker
  • Open below files and jump to MessageBroker section:

    "MessageBroker": {
      "Provider": "RabbitMQ",
    }
  • Use RabbitMQ

    "MessageBroker": {
      "Provider": "RabbitMQ",
      "RabbitMQ": {
        "HostName": "localhost",
        "UserName": "guest",
        "Password": "guest",
        "ExchangeName": "amq.direct",
        "RoutingKeys": {
          "FileUploadedEvent": "classifiedadds_fileuploaded",
          "FileDeletedEvent": "classifiedadds_filedeleted",
          "EmailMessageCreatedEvent": "classifiedadds_emailcreated",
          "SmsMessageCreatedEvent": "classifiedadds_smscreated"
        },
        "QueueNames": {
          "FileUploadedEvent": "classifiedadds_fileuploaded",
          "FileDeletedEvent": "classifiedadds_filedeleted",
          "EmailMessageCreatedEvent": "classifiedadds_emailcreated",
          "SmsMessageCreatedEvent": "classifiedadds_smscreated"
        }
      }
    }
  • Use Kafka:

    "MessageBroker": {
      "Provider": "Kafka",
      "Kafka": {
        "BootstrapServers": "localhost:9092",
        "Topics": {
          "FileUploadedEvent": "classifiedadds_fileuploaded",
          "FileDeletedEvent": "classifiedadds_filedeleted",
          "EmailMessageCreatedEvent": "classifiedadds_emailcreated",
          "SmsMessageCreatedEvent": "classifiedadds_smscreated"
        },
      }
    }
  • Use Azure Queue Storage:

    "MessageBroker": {
      "Provider": "AzureQueue",
      "AzureQueue": {
        "ConnectionString": "xxx",
        "QueueNames": {
          "FileUploadedEvent": "classifiedadds-fileuploaded",
          "FileDeletedEvent": "classifiedadds-filedeleted",
          "EmailMessageCreatedEvent": "classifiedadds-emailcreated",
          "SmsMessageCreatedEvent": "classifiedadds-smscreated"
        }
      }
    }
  • Use Azure Service Bus:

    "MessageBroker": {
      "Provider": "AzureServiceBus",
      "AzureServiceBus": {
        "ConnectionString": "xxx",
        "QueueNames": {
          "FileUploadedEvent": "classifiedadds_fileuploaded",
          "FileDeletedEvent": "classifiedadds_filedeleted",
          "EmailMessageCreatedEvent": "classifiedadds_emailcreated",
          "SmsMessageCreatedEvent": "classifiedadds_smscreated"
        }
      }
    }
  • Use Azure Event Grid:

    "MessageBroker": {
      "Provider": "AzureEventGrid",
      "AzureEventGrid": {
        "DomainEndpoint": "https://xxx.xxx-1.eventgrid.azure.net/api/events",
        "DomainKey": "xxxx",
        "Topics": {
          "FileUploadedEvent": "classifiedadds_fileuploaded",
          "FileDeletedEvent": "classifiedadds_filedeleted"
          "EmailMessageCreatedEvent": "classifiedadds_emailcreated",
          "SmsMessageCreatedEvent": "classifiedadds_smscreated"
        }
      }
    }
  • Use Azure Event Hubs:

    "MessageBroker": {
      "Provider": "AzureEventHub",
      "AzureEventHub": {
        "ConnectionString": "Endpoint=sb://xxx.servicebus.windows.net/;SharedAccessKeyName=xxx;SharedAccessKey=xxx",
        "Hubs": {
          "FileUploadedEvent": "classifiedadds_fileuploaded",
          "FileDeletedEvent": "classifiedadds_filedeleted",
          "EmailMessageCreatedEvent": "classifiedadds_emailcreated",
          "SmsMessageCreatedEvent": "classifiedadds_smscreated"
        },
        "StorageConnectionString": "DefaultEndpointsProtocol=https;AccountName=xxx;AccountKey=xxx;EndpointSuffix=core.windows.net",
        "StorageContainerNames": {
          "FileUploadedEvent": "eventhub-fileuploaded",
          "FileDeletedEvent": "eventhub-filedeleted",
          "EmailMessageCreatedEvent": "eventhub-emailcreated",
          "SmsMessageCreatedEvent": "eventhub-smscreated"
        }
      }
    }
Logging
  • Open and jump to Logging section of below files:
    "Logging": {
      "LogLevel": {
        "Default": "Warning"
      },
      "File": {
        "MinimumLogEventLevel": "Information"
      },
      "Elasticsearch": {
        "IsEnabled": false,
        "Host": "http://localhost:9200",
        "IndexFormat": "classifiedads",
        "MinimumLogEventLevel": "Information"
      },
      "EventLog": {
        "IsEnabled": false,
        "LogName": "Application",
        "SourceName": "ClassifiedAds.WebAPI"
      }
    },
  • Write to Local file (./logs/log.txt). Always enabled.
    "Logging": {
      "File": {
        "MinimumLogEventLevel": "Information"
      },
    },
  • Write to Elasticsearch:
    "Logging": {
      "Elasticsearch": {
        "IsEnabled": true,
        "Host": "http://localhost:9200",
        "IndexFormat": "classifiedads",
        "MinimumLogEventLevel": "Information"
      },
    },
  • Write to Windows Event Log (Windows only):
    "Logging": {
      "EventLog": {
        "IsEnabled": true,
        "LogName": "Application",
        "SourceName": "ClassifiedAds.WebAPI"
      }
    },
  • Enable all options:
    "Logging": {
      "LogLevel": {
        "Default": "Warning"
      },	
      "File": {
        "MinimumLogEventLevel": "Information"
      },
      "Elasticsearch": {
        "IsEnabled": true,
        "Host": "http://localhost:9200",
        "IndexFormat": "classifiedads",
        "MinimumLogEventLevel": "Information"
      },
      "EventLog": {
        "IsEnabled": true,
        "LogName": "Application",
        "SourceName": "ClassifiedAds.WebAPI"
      }
    },
Caching
  • Open and jump to Caching section of below files:
    "Caching": {
      "InMemory": {
    
      },
      "Distributed": {
    
      }
    },
  • Configure options for In Memory Cache:
    "Caching": {
      "InMemory": {
        "SizeLimit": null
      },
    },
  • Use In Memory Distributed Cache (For Local Testing):
    "Caching": {
      "Distributed": {
        "Provider": "InMemory",
        "InMemory": {
          "SizeLimit": null
        }
      }
    },
  • Use Redis Distributed Cache:
    "Caching": {
      "Distributed": {
        "Provider": "Redis",
        "Redis": {
          "Configuration": "xxx.redis.cache.windows.net:6380,password=xxx,ssl=True,abortConnect=False",
          "InstanceName": ""
        }
      }
    },
  • Use Sql Server Distributed Cache:
    dotnet tool install --global dotnet-sql-cache --version="5.0"
    dotnet sql-cache create "Server=127.0.0.1;Database=ClassifiedAds;User Id=sa;Password=sqladmin123!@#" dbo CacheEntries
    "Caching": {
      "Distributed": {
        "Provider": "SqlServer",
        "SqlServer": {
          "ConnectionString": "Server=127.0.0.1;Database=ClassifiedAds;User Id=sa;Password=sqladmin123!@#",
          "SchemaName": "dbo",
          "TableName": "CacheEntries"
        }
      }
    },
Monitoring
  • Open and jump to Monitoring section of below files:
    "Monitoring": {
      "MiniProfiler": {
        
      },
      "AzureApplicationInsights": {
        
      }
    },
  • Use MiniProfiler:
    "Monitoring": {
      "MiniProfiler": {
        "IsEnabled": true,
        "SqlServerStorage": {
          "ConectionString": "Server=127.0.0.1;Database=ClassifiedAds;User Id=sa;Password=sqladmin123!@#;MultipleActiveResultSets=true;Encrypt=False",
          "ProfilersTable": "MiniProfilers",
          "TimingsTable": "MiniProfilerTimings",
          "ClientTimingsTable": "MiniProfilerClientTimings"
        }
      },
    },
  • Use Azure Application Insights:
    "Monitoring": {
      "AzureApplicationInsights": {
        "IsEnabled": true,
    	"InstrumentationKey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    	"EnableSqlCommandTextInstrumentation": true
      }
    },
  • Use AppMetrics:
    "Monitoring": {
      "AppMetrics": {
        "IsEnabled": true,
        "MetricsOptions": {
          "DefaultContextLabel": "ClassifiedAds.WebAPI",
          "Enabled": true,
          "ReportingEnabled": true
        },
        "MetricsWebTrackingOptions": {
          "ApdexTrackingEnabled": true,
          "ApdexTSeconds": 0.1,
          "IgnoredHttpStatusCodes": [ 404 ],
          "IgnoredRoutesRegexPatterns": [],
          "OAuth2TrackingEnabled": true
        },
        "MetricEndpointsOptions": {
          "MetricsEndpointEnabled": true,
          "MetricsTextEndpointEnabled": true,
          "EnvironmentInfoEndpointEnabled": true
        }
      }
    },
  • Use Both:
    "Monitoring": {
      "MiniProfiler": {
        "IsEnabled": true,
        "SqlServerStorage": {
          "ConectionString": "Server=127.0.0.1;Database=ClassifiedAds;User Id=sa;Password=sqladmin123!@#;MultipleActiveResultSets=true;Encrypt=False",
          "ProfilersTable": "MiniProfilers",
          "TimingsTable": "MiniProfilerTimings",
          "ClientTimingsTable": "MiniProfilerClientTimings"
        }
      },
      "AzureApplicationInsights": {
        "IsEnabled": true,
        "InstrumentationKey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "EnableSqlCommandTextInstrumentation": true
      },
      "AppMetrics": {
        "IsEnabled": true,
        "MetricsOptions": {
          "DefaultContextLabel": "ClassifiedAds.WebAPI",
          "Enabled": true,
          "ReportingEnabled": true
        },
        "MetricsWebTrackingOptions": {
          "ApdexTrackingEnabled": true,
          "ApdexTSeconds": 0.1,
          "IgnoredHttpStatusCodes": [ 404 ],
          "IgnoredRoutesRegexPatterns": [],
          "OAuth2TrackingEnabled": true
        },
        "MetricEndpointsOptions": {
          "MetricsEndpointEnabled": true,
          "MetricsTextEndpointEnabled": true,
          "EnvironmentInfoEndpointEnabled": true
        }
      }
    },
Interceptors
Security Headers
  • Open ClassifiedAds.WebAPI/appsettings.json and jump to SecurityHeaders section:
    "SecurityHeaders": {
      "Cache-Control": "no-cache, no-store, must-revalidate",
      "Pragma": "no-cache",
      "Expires": "0"
    },
  • Open ClassifiedAds.WebMVC/appsettings.json and jump to SecurityHeaders section:
    "SecurityHeaders": {
      "Content-Security-Policy": "form-action 'self'; frame-ancestors 'none'",
      "Feature-Policy": "camera 'none'",
      "Referrer-Policy": "strict-origin-when-cross-origin",
      "X-Content-Type-Options": "nosniff",
      "X-Frame-Options": "DENY",
      "X-XSS-Protection": "1; mode=block",
      "Cache-Control": "no-cache, no-store, must-revalidate",
      "Pragma": "no-cache",
      "Expires": "0"
    },
Cross-Origin Resource Sharing (CORS)
External Login
  • Open ClassifiedAds.IdentityServer/appsettings.json and jump to ExternalLogin section:
    "ExternalLogin": {
      "AzureActiveDirectory": {
        "IsEnabled": true,
        "Authority": "https://login.microsoftonline.com/<Directory (tenant) ID>",
        "ClientId": "<Application (client) ID",
        "ClientSecret": "xxx"
      },
      "Microsoft": {
        "IsEnabled": true,
        "ClientId": "<Application (client) ID",
        "ClientSecret": "xxx"
      },
      "Google": {
        "IsEnabled": true,
        "ClientId": "xxx",
        "ClientSecret": "xxx"
      },
      "Facebook": {
        "IsEnabled": true,
        "AppId": "xxx",
        "AppSecret": "xxx"
      }
    },
Sending Email
  • Open ClassifiedAds.BackgroundServer/appsettings.json and jump to Notification -> Email section:
    "Notification": {
      "Email": {
        "Provider": "Fake",
      }
    }
  • Use SmtpClient:
    "Notification": {
      "Email": {
        "Provider": "SmtpClient",
        "SmtpClient": {
          "Host": "localhost",
          "Port": "",
          "UserName": "",
          "Password": "",
          "EnableSsl": ""
        }
      }
    }
Sending SMS
  • Open ClassifiedAds.BackgroundServer/appsettings.json and jump to Notification -> Sms section:
    "Notification": {
      "Sms": {
        "Provider": "Fake",
      }
    }
  • Use Twilio
    "Notification": {
      "Sms": {
        "Provider": "Twilio",
        "Twilio": {
          "AccountSId": "",
          "AuthToken": "",
          "FromNumber": ""
        }
      }
    }

Set Startup Projects

alt text

Run or Debug the Solution

How to Build and Run Single Page Applications:

  • Angular:

    • Navigate to folder: UIs/angular/

      npm install
      ng serve
      
    • Update environment.ts & environment.prod.ts

      export const environment = {
        OpenIdConnect: {
          Authority: "https://localhost:44367",
          ClientId: "ClassifiedAds.Angular"
        },
        ResourceServer: {
          Endpoint: "https://localhost:44312/api/"
        },
        CurrentUrl: "http://localhost:4200/"
      };
    • Go to http://localhost:4200/

      alt text

  • React:

    • Navigate to folder: UIs/reactjs/

      npm install
      npm run start
      
    • Update environment.dev.js & environment.js

      const environment = {
          OpenIdConnect: {
              Authority: "https://localhost:44367",
              ClientId: "ClassifiedAds.React"
          },
          ResourceServer: {
              Endpoint: "https://localhost:44312/api/"
          },
          CurrentUrl: "http://localhost:3000/"
      };
      export default environment;
    • Go to http://localhost:3000/

      alt text

  • Vue:

    • Navigate to folder: UIs/vuejs/
      npm install
      npm run serve
      
    • Update environment.dev.js & environment.dev.js
      const environment = {
          OpenIdConnect: {
              Authority: "https://localhost:44367",
              ClientId: "ClassifiedAds.Vue"
          },
          ResourceServer: {
              Endpoint: "https://localhost:44312/api/"
          },
          CurrentUrl: "http://localhost:8080/"
      };
      export default environment;

How to Run on Docker Containers:

How to Run Integration & End to End Tests:

  • Update ClassifiedAds.IntegrationTests/appsettings.json

    {
      "OpenIdConnect": {
        "Authority": "https://localhost:44367",
        "ClientId": "ClassifiedAds.WebMVC",
        "ClientSecret": "secret",
        "RequireHttpsMetadata": "true"
      },
      "WebAPI": {
        "Endpoint": "https://localhost:44312"
      },
      "GraphQL": {
        "Endpoint": "https://localhost:44392/graphql"
      },
      "Login": {
        "UserName": "[email protected]",
        "Password": "v*7Un8b4rcN@<-RN",
        "Scope": "ClassifiedAds.WebAPI"
      }
    }
  • Download Chrome Driver

    alt text

  • Update ClassifiedAds.EndToEndTests/appsettings.json

    {
      "ChromeDriverPath": "D:\\Downloads\\chromedriver_win32\\72",
      "Login": {
        "Url": "https://localhost:44364/Home/Login",
        "UserName": "[email protected]",
        "Password": "v*7Un8b4rcN@<-RN"
      }
    }

    alt text

Application URLs:

https://github.com/phongnguyend/Practical.CleanArchitecture/wiki/Application-URLs

Roadmap:

https://github.com/phongnguyend/Practical.CleanArchitecture/wiki/Roadmap

Licence ๐Ÿ”‘

This repository is licensed under the MIT license.

Duende.IdentityServer License ๐Ÿ”‘

Duende.IdentityServer is available under both a FOSS (RPL) and a commercial license.

For the production environment, it is necessary to get a specific license, if you would like more information about the licensing of Duende.IdentityServer - please check this link.

The source code under /src/IdentityServer/Duende folder uses the source code from https://github.com/DuendeSoftware/IdentityServer.Quickstart.UI which is under the terms of the following license.

EPPLus License ๐Ÿ”‘

EPPlus 5 can be used under Polyform Noncommercial license or a commercial license.

For the production environment, it is necessary to get a specific license, if you would like more information about the licensing of EPPlus 5 - please check this link.

practical.cleanarchitecture's People

Contributors

amitpnk avatar cuno92 avatar igor-toporet avatar phongnguyend avatar qyperion avatar skobovm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

practical.cleanarchitecture's Issues

Upgrade to React 17

npm outdated
"@testing-library/jest-dom": "^5.11.6",
"@testing-library/react": "^11.2.2",
"@testing-library/user-event": "^12.2.2",
"axios": "^0.21.0",
"bootstrap": "^4.5.3",
"react": "^17.0.1",
"react-bootstrap": "^1.4.0",
"react-datepicker": "^3.3.0",
"react-dom": "^17.0.1",
"react-redux": "^7.2.2",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.1",

Adding Elasticsearch / Kibana

Any plans to add Elasticsearch / Kibana to extend the possibility of serilog?

version: '3.4'

services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.2.2
container_name: elasticsearch
ports:
- "9200:9200"
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- xpack.monitoring.enabled=true
- xpack.watcher.enabled=false
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
networks:
- docker-network

kibana:
image: docker.elastic.co/kibana/kibana:7.5.2
container_name: kibana
ports:
- "5601:5601"
depends_on:
- elasticsearch
environment:
- ELASTICSEARCH_HOSTS=${ELASTICSEARCH_URL}
- XPACK_MONITORING_ENABLED=true
networks:
- docker-network

networks:
docker-network:
driver: bridge

volumes:
elasticsearch-data:

https://stackoverflow.com/questions/38314197/how-to-send-serilog-data-to-elasticsearch-with-fields

Incorrect references in ClassifiedAds.GRPC project

Hi

May be I'm missing something but just doing:

  1. git clone --recursive https://github.com/phongnguyend/Practical.CleanArchitecture.git
  2. cd Practical.CleanArchitecture/src/ClassifiedAds.Microservices/Services/ClassifiedAds.GRPC
  3. dotnet build

will result to error because some projects missing ??????

Actually this project reference other projects like this:

    <ItemGroup>
      <ProjectReference Include="..\ClassifiedAds.Application\ClassifiedAds.Application.csproj" />
      <ProjectReference Include="..\ClassifiedAds.Infrastructure\ClassifiedAds.Infrastructure.csproj" />
      <ProjectReference Include="..\ClassifiedAds.Persistence\ClassifiedAds.Persistence.csproj" />
    </ItemGroup>

and all those above projects are located somewhere else ???

Could you fix those references ?
May be provide SLN/script file in root folder to just build everything ?
Add something to documentation on how to actually build those projects from scratch ?

Ignore the Migrations folder

Ignore the Migrations folder (src/ClassifiedAds.Projects/ClassifiedAds.Persistence/Migrations/) for now since this repo is for learning and testing purposes.

We don't want to mess things up with lot of migration files anytime we make changes to the database structure.

How about audit logging?

Is logging/audit logging a cross-cutting concern? or just infrastructure. State of the domain (objects) could be changed by any external actor(s) - web app, server, background job. How can I get a unified view of state changes to my domain objects?

Question: ClassifiedAds.Monolith vs ClassifiedAds.ModularMonolith

I'm curious what the difference between ClassifiedAds.Monolith and ClassifiedAds.ModularMonolith is?

My favorite architecture is Domain-Driven Design and I like Mediatr and AutoMapper. I'm also thinking about GraphSQL because it's the future and it will replace the REST services.

Which project would you recommend me? Btw, I'm using Angular and IdentityServer4, I don't need the rest stuff like SignalR, Hangfire, etc.

How to publish?

First, thanks for this repo. I really like it. I have a question on publishing. For example, I want to publish to folder. I use Blazor as the frontend, but I also use BackgroundServer, NotificationServer, IdentityServer. On persistence I change to Sqlite instead of SQL Server. I can run it in VS 2019 without problem. Could you let me know what is the correct way to publish this? Thanks!

Not possible to get it run

Hey :-)

Is it possible to make a standalone?

i have vs 2019 & changed:

  1. RUN dotnet restore in all DockerFiles needed a solution or Project. i added each
  2. changed "ConnectionStrings" in appsettings.json & docker-compose.yml
  3. added an docker-compose -f docker-compose.yml up -d batch in the tools path
  4. changed all the volumes pathes to my environment in docker-compose.yml
  5. tried to install / create / install the certificated in Cert (grpc & ClassifiedAds.IdentityServer)
  6. run ClassifiedAds.Migrator for sql tables, etc.

all in all it still not started. maybe better documentation for install or a really standalone one, where nothing has to be changed. just may install 2 certificates, run a tools install, & a initialize mcr.microsoft.com/mssql/server:2017-latest

wonderful architecture, but it wont start :-(

Greetz Stephan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.