Git Product home page Git Product logo

sayyedulawwab / ecommerceapp Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 390 KB

Ecommerce API for managing products, categories, user authentication, reviews, and orders seamlessly within an ecommerce platform. Built with ASP.NET Core Web API and employing clean architecture principles, Domain Driven Design (DDD) and Mediator pattern for CQRS implementation.

C# 99.15% Dockerfile 0.85%
asp-net-core clean-architecture cqrs dapper docker domain-driven-design entity-framework-core fluentvalidation redis repository-pattern

ecommerceapp's Introduction

Ecommerce API

Welcome to the Ecommerce API repository! This API provides various functionalities for managing products, categories, user authentication, reviews, and orders for an ecommerce platform. It is a project in progress!

Features

  • Product Management:
    • Add, edit, delete, and retrieve products
  • Category Management:
    • Add, edit, delete, and retrieve product categories
  • User Authentication:
    • Register and login with username and password
    • JWT token authentication and authorization
  • Review System:
    • Add reviews to products
    • Get reviews of a product
  • Order Placement:
    • Place orders

Technologies Used

  • ASP.NET Core 8 Web API, PostgreSQL, Entity Framework Core 8, Dapper, FluentValidation, MediatR, Redis, Docker
  • Architecture Patterns: Clean architecture, Domain-driven design (DDD), CQRS by implementing Mediator pattern using MediatR package

Getting Started

To get started with the Ecommerce API, follow these steps:

  1. Clone this repository to your local machine.
  2. Install Docker Desktop for windows.
  3. Navigate to the project directory in your terminal.
  4. Run the command docker-compose up.

API Endpoints

Users

  • POST /api/users/register: Registers a new user.

    • Request Body:
      {
        "firstName": "John",
        "lastName": "Doe",
        "email": "[email protected]",
        "password": "Password123!"
      }
    • Response: Success (200)
  • POST /api/users/login: Logs in a user.

    • Request Body:
      {
        "email": "[email protected]",
        "password": "Password123!"
      }
    • Response: Success (200)

Products

  • GET /api/products: Retrieves a list of products. Optionally filter by product name.

    • Query Parameters:
      • name (string) - Filter products by name.
    • Response: Success (200)
  • POST /api/products: Creates a new product.

    • Request Body:
      {
        "name": "Laptop",
        "description": "High-performance laptop with the latest specifications.",
        "priceCurrency": "USD",
        "priceAmount": 1099.99,
        "quantity": 50,
        "productCategoryId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
      }
    • Response: Success (200)
  • GET /api/products/{id}: Retrieves details of a specific product.

    • Request Parameters:
      • id (string, format: uuid) - ID of the product to retrieve.
    • Response: Success (200)
  • PUT /api/products/{id}: Updates details of a specific product.

    • Request Parameters:
      • id (string, format: uuid) - ID of the product to update.
    • Request Body:
      {
        "name": "Updated Laptop",
        "description": "Updated description of the laptop.",
        "priceCurrency": "USD",
        "priceAmount": 1199.99,
        "quantity": 60,
        "productCategoryId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
      }
    • Response: Success (200)
  • DELETE /api/products/{id}: Deletes a specific product.

    • Request Parameters:
      • id (string, format: uuid) - ID of the product to delete.
    • Response: Success (200)

Product Categories

  • GET /api/productcategories: Retrieves a list of product categories.

    • No request body.
    • Response: Success (200)
  • POST /api/productcategories: Creates a new product category.

    • Request Body:
      {
        "name": "Electronics",
        "code": "electronics"
      }
    • Response: Success (200)
  • GET /api/productcategories/{id}: Retrieves details of a specific product category.

    • Request Parameters:
      • id (string, format: uuid) - ID of the product category to retrieve.
    • Response: Success (200)
  • PUT /api/productcategories/{id}: Updates details of a specific product category.

    • Request Parameters:
      • id (string, format: uuid) - ID of the product category to update.
    • Request Body:
      {
        "name": "Updated Electronics",
        "code": "electronics"
      }
    • Response: Success (200)
  • DELETE /api/productcategories/{id}: Deletes a specific product category.

    • Request Parameters:
      • id (string, format: uuid) - ID of the product category to delete.
    • Response: Success (200)

Reviews

  • POST /api/reviews: Posts a review for a product.
    • Request Body:
      {
        "productId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "rating": 5,
        "comment": "This laptop exceeded my expectations. Highly recommended!"
      }
    • Response: Success (200)

Orders

  • GET /api/orders: Retrieves a list of orders.

    • No request body.
    • Response: Success (200)
  • POST /api/orders: Places a new order.

    • Request Body:
      {
        "orderItems": [
          {
            "productId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
            "quantity": 1
          },
          {
            "productId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
            "quantity": 2
          }
        ]
      }
    • Response: Success (200)

ecommerceapp's People

Contributors

sayyedulawwab avatar

Stargazers

 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.