Git Product home page Git Product logo

ecommerce-api's Introduction

E-Commerce API

Welcome to the E-Commerce API! This API provides endpoints for managing products and variants in an e-commerce system.

Table of Contents:

  • Getting Started:
  • Prerequisites:
  • Installation:
  • Running the Tests:
  • API Endpoints:
  • Architectural Decisions:
  • Assumptions:
  • Contributing:
  • License:

Getting Started

Prerequisites

  • PHP (>= 7.4)
  • Composer
  • Laravel (>= 9)
  • MySQL or any other compatible database

Installation

  1. Clone the repository:
git clone https://github.com/PrathmeshSarate/ecommerce-api.git cd ecommerce-api
  1. Install dependencies:
composer install
  1. Configure your database settings:
    • Copy the .env.example file to .env and update the settings.
  2. Generate application key:
php artisan key:generate
  1. Run migrations and seed the database:
php artisan migrate --seed

Running the Tests

To run the PHPUnit tests:

php artisan test

API Endpoints

Products:

  • GET /api/products: Retrieve a list of all products.
  • GET /api/products/{id}: Retrieve details of a specific product.
  • POST /api/products: Create a new product.
  • PUT /api/products/{id}: Update an existing product.
  • DELETE /api/products/{id}: Delete a product.
  • GET /api/products/search/{keyword}: Search for products based on a keyword.

Variants:

  • GET /api/products/{productId}/variants: Retrieve variants of a product.
  • POST /api/products/{productId}/variants: Create a new variant for a product.
  • PUT /api/products/{productId}/variants/{variantId}: Update an existing variant.
  • DELETE /api/products/{productId}/variants/{variantId}: Delete a variant.

Architectural Decisions

Technologies Used:

  • Laravel: PHP web application framework.
  • MySQL: Relational database management system.
  • PHPUnit: Testing framework for PHP.

Design Patterns:

  • Repository Pattern: Separation of concerns for database operations.
  • Resourceful Controllers: Using Laravel's conventions for RESTful API controllers.
  • Factory Pattern: Generating model instances for testing.

Assumptions

  • The API assumes a MySQL database for data storage.

License

This project is licensed under the MIT License.

ecommerce-api's People

Contributors

prathmeshsarate 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.