Skip to content

An e-commerce platform using microservices, system is broken down into independent, scalable services, each handling a specific business function.

Notifications You must be signed in to change notification settings

MandyK94/ECommerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Microservices E-Commerce Platform

A blueprint for the system

Business Requirements

  • User registration & authentication.
  • Product catalog & search.
  • Shopping cart & checkout.
  • Order processing & payments.
  • Shipping & notifications.
  • Reviews & recommendations.
  • Microservices breakdown

    Service Responsibility Database Protocol
    1. User Service Auth, profiles, roles. PostgreSQL REST/JWT
    2. Product Service Product catalog, categories, inventory. MongoDB REST/gRPC
    3. Cart Service Shopping cart management. Redis REST
    4. Order Service Order creation, status tracking. PostgreSQL REST+Kafka
    5. Paymet Service Payments (Stripe/PayPal integration). PostgreSQL REST
    6. Shipping Service Shipping cost calculation, tracking. PostgreSQL REST
    7. Notification Service Emails/SMS (order confirmations). MongoDB Kafka
    8. Search Service Elasticsearch-powered product search. Elasticsearch REST

    User Service

    This service handles user profile, authentication, and role management.

    Responsibilities

  • User registration & login (JWT authentication)
  • Profile management (CRUD operations)
  • Role-based access control (RBAC)
  • Password hashing & security
  • API endpoints

    Endpoint Method Description Auth Required
    /api/auth/register POST Register new user No
    /api/auth/login POST Login (returns JWT) No
    /api/users/me GET Get current user profile YES
    /api/users/{id} PUT Update user details Yes (owner/admin)
    /api/admin/users GET List all users (admin only) Yes (admin)

    Miscelleneous

    Curl commands:
    curl -X POST http://localhost:8080/api/auth/register \
    -H "Content-Type: application/json" \
    -d '{"username":"testuser","password":"testpass"}'

    PostgreSQL install:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    brew install postgresql
    brew services start postgresql

    Create postgre db:

    createuser -s -P postgres

    psql -U postgres
    -- Create database
    CREATE DATABASE shop;
    -- List all DB
    \l
    -- Create a user
    CREATE USER shop_user WITH PASSWORD 'secret';
    -- Create a database
    CREATE DATABASE shop;
    -- Give your user access
    GRANT ALL PRIVILEGES ON DATABASE shop TO shop_user;
    -- log into shop database using shop_user account
    psql -U shop_user -d shop

    install maven:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    brew install maven

    start spring boot:
    mvn spring-boot:run

    Ppstgres start and stop:
    brew services start postgresql
    brew services restart postgresql@14

    About

    An e-commerce platform using microservices, system is broken down into independent, scalable services, each handling a specific business function.

    Topics

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published