All Projects → hdimitrieski → e-shop

hdimitrieski / e-shop

Licence: MIT license
Sample Spring Cloud microservices e-shop.

Programming Languages

java
68154 projects - #9 most used programming language
typescript
32286 projects
kotlin
9241 projects
HTML
75241 projects
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to e-shop

Eventhorizon
CQRS/ES toolkit for Go
Stars: ✭ 961 (+1902.08%)
Mutual labels:  cqrs, ddd, domain-driven-design, event-sourcing
Eventflow.example
DDD+CQRS+Event-sourcing examples using EventFlow following CQRS-ES architecture. It is configured with RabbitMQ, MongoDB(Snapshot store), PostgreSQL(Read store), EventStore(GES). It's targeted to .Net Core 2.2 and include docker compose file.
Stars: ✭ 131 (+172.92%)
Mutual labels:  cqrs, ddd, domain-driven-design, event-sourcing
Event Sourcing Castanha
An Event Sourcing service template with DDD, TDD and SOLID. It has High Cohesion and Loose Coupling, it's a good start for your next Microservice application.
Stars: ✭ 68 (+41.67%)
Mutual labels:  cqrs, ddd, domain-driven-design, event-sourcing
Modular Monolith With Ddd
Full Modular Monolith application with Domain-Driven Design approach.
Stars: ✭ 6,210 (+12837.5%)
Mutual labels:  cqrs, ddd, domain-driven-design, event-sourcing
Kreta
Modern project management solution
Stars: ✭ 177 (+268.75%)
Mutual labels:  cqrs, ddd, domain-driven-design, event-sourcing
Eventsourcing
A library for event sourcing in Python.
Stars: ✭ 760 (+1483.33%)
Mutual labels:  cqrs, ddd, domain-driven-design, event-sourcing
Bifrost
This is the stable release of Dolittle till its out of alpha->beta stages
Stars: ✭ 111 (+131.25%)
Mutual labels:  cqrs, ddd, domain-driven-design, event-sourcing
eventuous
Minimalistic Event Sourcing library for .NET
Stars: ✭ 236 (+391.67%)
Mutual labels:  cqrs, ddd, domain-driven-design, event-sourcing
Revo
Event Sourcing, CQRS and DDD framework for C#/.NET Core.
Stars: ✭ 162 (+237.5%)
Mutual labels:  cqrs, ddd, domain-driven-design, event-sourcing
Event Sourcing Jambo
An Hexagonal Architecture with DDD + Aggregates + Event Sourcing using .NET Core, Kafka e MongoDB (Blog Engine)
Stars: ✭ 159 (+231.25%)
Mutual labels:  cqrs, ddd, domain-driven-design, event-sourcing
Akkatecture
a cqrs and event sourcing framework for dotnet core using akka.net
Stars: ✭ 414 (+762.5%)
Mutual labels:  cqrs, ddd, domain-driven-design, event-sourcing
EcommerceDDD
Experimental full-stack application using Domain-Driven Design, CQRS, and Event Sourcing.
Stars: ✭ 178 (+270.83%)
Mutual labels:  cqrs, ddd, domain-driven-design, event-sourcing
Event Sourcing Cqrs Examples
Event Sourcing and CQRS in practice.
Stars: ✭ 265 (+452.08%)
Mutual labels:  cqrs, ddd, domain-driven-design, event-sourcing
Rails event store
A Ruby implementation of an Event Store based on Active Record
Stars: ✭ 947 (+1872.92%)
Mutual labels:  cqrs, ddd, domain-driven-design, event-sourcing
delta
DDD-centric event-sourcing library for the JVM
Stars: ✭ 15 (-68.75%)
Mutual labels:  cqrs, ddd, domain-driven-design, event-sourcing
Productcontext Eventsourcing
A practical/experimental Event Sourcing application on Product Bounded Context in an e-commerce
Stars: ✭ 88 (+83.33%)
Mutual labels:  cqrs, ddd, domain-driven-design, event-sourcing
educational-platform
Modular Monolith Java application with DDD
Stars: ✭ 124 (+158.33%)
Mutual labels:  cqrs, ddd, domain-driven-design, axon
Goes
Go Event Sourcing made easy
Stars: ✭ 144 (+200%)
Mutual labels:  cqrs, ddd, domain-driven-design, event-sourcing
Messagebus
A MessageBus (CommandBus, EventBus and QueryBus) implementation in PHP7
Stars: ✭ 178 (+270.83%)
Mutual labels:  cqrs, ddd, domain-driven-design, event-sourcing
Dotnet New Caju
Learn Clean Architecture with .NET Core 3.0 🔥
Stars: ✭ 228 (+375%)
Mutual labels:  cqrs, ddd, domain-driven-design, event-sourcing

GitHub license

e-shop

This project is inspired by eShopOnContainers and it's built to demonstrate features of Spring Cloud for implementing microservices architecture. In this project you can find examples of:

  • Spring Cloud Config
  • Eureka Service Discovery
  • Spring Cloud Gateway
  • Spring Cloud Circuit Breaker
  • Resilience4j
  • Spring Cloud Sleuth
  • Spring Cloud Stream
  • Spring Kafka
  • Kafka Streams API
  • Keycloak
  • Event Sourcing with Axon
  • GraphQL API with Netflix DGS
  • Angular
  • React and Apollo Client

Architectural Diagram

Assign Admin Role

Services

How To Run

You need to have Gradle 7+, Java 17+, Node.js and Docker. By default, Docker Desktop is set to use 2 GB runtime memory, allocated from the total available memory. We recommend setting the runtime memory to 6GB.

The best way to run the services is with IDEs like IntelliJ IDEA or Eclipse. Check their documentation for more details.

Run Infrastructural Components

Run all infrastructural containers(Postgres, Redis, Kafka, Keycloak authorization service) using the following command:

~ cd docker
~ docker-compose up

The keystore file on path docker/keycloak/auth-server.keystore is generated using the following command:

keytool -genkeypair -alias configkey -keyalg RSA \
  -dname "CN=authorization-service,C=MK,S=OH" \
  -keystore auth-server.keystore -storepass secure-keystore-password

Certificate file on path docker/base/sh/certificate.crt must be recreate when keystore changed.

Run micro-services

After you start the infrastructural components, you can run all micro-services using your favourite IDE. Check their corresponding documentation.

Keycloak https is enabled, so certificate must be imported before start micro-services.

Import cert

Use keytool to import certificate.

On linux like OS, you can excute shell here directly:

~ ./docker/base/sh/install-certs.sh

On other OS, you can do it with keytool easy.

Run micro-services with Docker

If you want to run the services with docker, first build the services with the following command:

~ ./gradlew clean build

Then:

  1. Run all infrastructure services Config, Discovery, API Gateway using the following command:

    ~ cd docker ~ docker-compose -f docker-compose.infra.yml up --build

  2. Run all domain services Order Processing, Catalog, Basket, Payment, Order Grace Period Task, Order Notifications, Analytics, Rating using the following command:

    ~ cd docker ~ docker-compose -f docker-compose.services.yml up --build

Run imaging service

We use imgproxy service to resize images on-the-fly. It is a fast and secure standalone server for resizing and converting remote images.

All catalog item images are stored in Minio. Minio is an object storage server. It is compatible with Amazon S3, so it can be used with imgproxy.

The images are uploaded to Minio via Image Service.

If you don't run these services, the spa client won't be able to fetch catalog item images.

Run imgproxy and Minio services:

~ cd docker
~ docker-compose -f docker-compose.img.yml up

You can access Minio at http://localhost:8086, and imgproxy at http://localhost:8887.

ELK (optional)

We use ELK for log analysis.

Run ELK stack:

~ cd docker
~ docker-compose -f docker-compose.elk.yml up

Also, you should run all services with 'elk' profile.

Zipkin (optional)

Spring Cloud Sleuth and Zipkin are used for monitoring microservices.

Run Zipkin:

~ cd docker
~ docker-compose -f docker-compose.zipkin.yml up

To enable distributed tracing, run all services with 'distributed-tracing' profile.

Run Angular Client

This client application is implemented with Angular and uses API Gateway.

~ cd clients/ng-rest-client
~ npm install
~ npm start

You can access the client application at http://localhost:4200. You can stop some services such as basket, order processing, or analytics, and you will notice that you can still use the application without some of its features.

Run React Client

This client application is implemented with React and uses GraphQL API Gateway.

~ cd clients/react-graphql-client
~ yarn install
~ yarn start

You can access the client application at http://localhost:4201.

Run everything

Alternatively, you can run the system as described bellow.

You can run all docker containers and Spring applications by running the ./scripts/start.sh. By default, the script won't start ELK and Zipkin. If you want to use ELK and Zipkin, you can run the script as: ./scripts/start.sh --elk --distributed-tracing. To stop everything you can run ./scripts/stop.sh.

Create user

Before you start using the application, you need to create a user. You can access Keycloak authorization service at http://localhost:8080/auth Login with admin/admin, go to "Users", click "Add user" and fill in the necessary data.

Add User

After you save the user, go to "Credentials" to set a password.

Set Password

If you want to assign admin role to the user, go to "Role Mappings", select "admin" under "Available Roles" and click "Add selected".

Assign Admin Role

Contributing

The issue tracker is the preferred channel for bug reports and features requests. If you want to contribute please do not hesitate to submit a pull request.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].