Coder Social home page Coder Social logo

emreaknci / eshopping Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.04 MB

This repo demonstrates the use of microservices architecture in an e-commerce application.

C# 63.96% JavaScript 0.05% HTML 0.04% CSS 0.03% TypeScript 34.97% Dockerfile 0.95%
asp-net-core backend docker eshopping frontend microservices react eventbus mongodb mui postgresql rabbitmq redis signalr

eshopping's Introduction

eShopping

This project shows how to use microservices in e-commerce. Microservices split big systems into small pieces, making them flexible. Things like Event Driven help services talk to each other, cutting down on how much they rely on each other. This new way of doing things is important for online stores.

Run Locally

Before running the application, you need to copy the project to your desired directory using the following command:

   git clone https://github.com/emreaknci/eShopping.git

The project is dockerized. You can launch the application by running the following command in the project's root directory.

   docker-compose -p eshopping up -d

If you wish, you can change the database usernames and passwords to your preferences in the docker-compose.override.yml file.

After all containers are running, you can access the web application at http://localhost:5173/.

You can sign in as an admin using the email "[email protected]" and the password "123456".

Tech Stack

System Diagram

  • Identity Service: This service is developed to manage users. It handles basic functions such as registration, authentication, and token generation.

  • Catalog Service: This service manages and presents the project's products. It allows users to search, filter, and access detailed information about the products. Additionally, admin users can add, update, and delete products through this service.

  • Basket Service: This service manages the shopping cart functionality of the project. It enables authenticated users to add products to the cart, update product quantities, and remove products from the cart.

  • Comment Service: This service is responsible for product reviews. Users can post comments on products and view existing comments.

  • Notification Service: This service handles notifications. Currently, it can send notifications via email and console output. It listens for events published by the PaymentService and sends notifications based on these events. Currently, only email notifications are supported.

  • Payment Service: This service is responsible for payment processing. Since there is no integration with a real payment system, payments are accepted using standard-compliant card information. Based on the payment status, events are published through the EventBus to notify other services.

  • Order Service: This service is responsible for order management. It stands out from other services by using methods such as the CQRS Pattern and Onion Architecture.

  • Ocelot API Gateway: It acts as a single entry point for clients to access microservices, handling tasks like routing, security, and monitoring.

  • Consul: Consul is a service mesh solution providing features like service discovery and health checking, enabling dynamic and resilient communication between microservices.

Event Driven Architecture

The main purpose of the project can be perceived as developing a microservices project, but actually, the primary goal is to facilitate communication between these microservices. For this, we need an event-driven architecture, which is named Event Bus. The workflow consists of the following steps:

1. User Checkout Request: The user enters the information to purchase items in their cart and sends a request to the Basket Service.

2. Order Creation: When the Basket Service receives the Checkout request, it sends a request to the Order Service to create an order.

3. Payment and Stock Update: While creating the order, the Order Service sends a payment request to the Payment Service and updates the stock from the Catalog Service.

4. Processing Based on Payment Result: If the payment is successful, a notification is sent to the user, and the cart is emptied. If it fails, the order is canceled, and the stocks are updated.

eshopping's People

Contributors

emreaknci avatar

Stargazers

emirhan usta avatar

Watchers

 avatar

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.