Skip to content

Latest commit

 

History

History
33 lines (27 loc) · 1.53 KB

File metadata and controls

33 lines (27 loc) · 1.53 KB

🛒 E-Commerce Store REST API

A robust backend system for an online store, handling product catalogs, shopping carts, and order management with secure authentication and role-based access control.

🚀 Key Features

  • JWT Authentication: Secure token-based authentication for all users.
  • Role-Based Access Control (RBAC): Distinct permissions for Admins (manage products/orders) and Customers (browse/buy).
  • Order Management: Complex relational data modeling for carts, orders, and order items.
  • Product Catalog: Efficient CRUD operations with image and category management.

🛠️ Tech Stack

  • Framework: Laravel (PHP)
  • Database: MySQL
  • Authentication: JWT (JSON Web Tokens)
  • Architecture: RESTful API Design

🏗️ Architecture

The API is designed using RESTful principles with a focus on modular controllers and service classes to handle complex e-commerce business logic (e.g., cart calculations, stock validation during checkout).

📡 API Endpoints (Examples)

Method Endpoint Role Description
POST /api/auth/login Public Login and get JWT
GET /api/products Public List all products
POST /api/addtocart Customer Add item to cart
POST /api/makeneworder Customer Place a new order

⚙️ Installation & Setup

  1. Clone the repository.
  2. Run composer install.
  3. Configure .env (Database and JWT Secret).
  4. Run php artisan migrate --seed to seed dummy data.
  5. Run php artisan serve.