Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Web front- and backend for an e-commerce platform utilizing DDD principles based on an existing cookiecutter template

License

Notifications You must be signed in to change notification settings

MGTheTrain/e-commerce-service

Repository files navigation

e-commerce-service

Table of Contents

Summary

Web front- and backend for an e-commerce platform utilizing DDD principles based on an existing cookiecutter template for the web backend

Features

  • User Management

    • User Registration & Authentication
      • Securely handle user sign-up, login, and role management.
      • Communicate with IAM provider APIs like Auth0.
      • Configuring authorization URLs with Auth0 as the central IAM system for external IdPs (e.g. Apple, Microsoft, Google).
  • Product Management

    • Product Catalog
      • Create, read, update, and delete (CRUD) operations for products.
  • Order Management

    • Order Processing
      • Manage customer orders from creation to completion.
      • Incorporate payment APIs like PayPal or Stripe
    • Order Items
      • Handle individual items within an order, including quantity and price details.
  • Shopping Cart

    • Cart Functionality
      • Allow users to add products to their cart, view cart contents and update quantities.
    • Cart Persistence
      • Ensure cart contents persist across user sessions.
  • Review Management

    • Product Reviews
      • Enable users to write reviews for products, rate them and provide feedback.
    • Review Moderation
      • Manage and moderate user reviews to maintain quality and trustworthiness. Therefore leverage OpenAI APIs.
  • Optimizations

    • Reduce the number of web backend calls from the web frontend by providing HTTP endpoints that perform multiple logical backend operations
    • Decompose monolith web backend into µServices
    • Implement filtering and pagination for specific list calls in web backend
    • Increase and measure code coverage
    • Enable uploading of product images
    • Deployment of Auth0 resources using Terraform required by web backend and web frontend
    • Continuous Integration workflows considering Docker image builds and pushing them to a Docker registry
    • Continuous Deployment workflow for creating public cloud infrastructure including storage solutions and a Kubernetes cluster or deploying Kubernetes manifests to the Kubernetes cluster

NOTE: Also consider checking out the entity relationship diagram

Getting Started

Preconditions

  • Install Docker Engine
  • Auth0 instance and expertise in creating necessary resources (roles, permissions, applications, APIs).
  • PayPal Developer Account with Dashboard Access. Checkout following link

Backend

You can find instructions on applicable commands for the backend source code in the following README.md

Frontend

You can find instructions on applicable commands for the frontend source code in the following README.md

Local docker compose setup

Precondition: Update the values in Mgtt.ECom.Web.env and environment.ts

You can start the web front-end and back-end using the command:

docker-compose up -d --build # Optionally run this command twice if internal services are not yet up and running

To view the web backend, open a browser and go to localhost:5000/swagger/index.html. Results should resemble:

Swagger UI trough Docker

To view the web frontend, open a browser and go to localhost:4200. After manually creating or adding resources (such as products, reviews, orders, order items and cart items) the results should resemble:


Products Products


Shopping cart Shopping cart


Paypal checkout link Paypal checkout link


User Order User Order


Order Details Order Details


Product Reviews Product Reviews


Auth0 Login Auth0 Login


Product Creation Product Creation


You can remove all Docker resources with:

docker-compose down -v

Documentation

Explore the initial Web API structure here. For more details on the use case overview checkout following diagram. For more details on user roles and permissions required for RBAC checkout following diagram.

Optionally copy contents of the swagger.json to the Swagger Online editor to view the available HTTP/s endpoints.