Skip to content

abdfahmawe/KA_11

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛍️ E-Commerce Backend API – ASP.NET Core

This project is a RESTful E-Commerce Web API built with ASP.NET Core 8.
It provides separate endpoints for Admin and Customer operations, including product management, brand management, orders, users, and reporting.


🚀 Features

  • 🧑‍💼 Admin Panel APIs: Manage brands, products, orders, users, and reports.
  • 🛒 Customer APIs: Browse products, manage cart, and place orders.
  • 🧠 Role-based Authorization: Admin, Super_Admin, and Customer.
  • 📄 PDF Reporting for orders.
  • 🔐 Secure endpoints using authentication and roles.

🧠 Tech Stack

  • Backend: ASP.NET Core 8 (C#)
  • Database: SQL Server
  • ORM: Entity Framework Core
  • Authentication: JWT
  • Reporting: iTextSharp / PDF Generator
  • Architecture: Layered (Entities, Repositories, Services, Controllers)

🗄️ Database Models

  • Brands
  • Carts
  • Categories
  • orderItems
  • orders
  • productImages
  • Products
  • Reviews
  • Roles
  • Users
  • UsersRoles

📡 API Endpoints

🧑‍💼 Admin Endpoints

📌 Brand Management

Method Endpoint Description Roles
GET /api/Admin/Brands Get all brands Admin, Super_Admin
GET /api/Admin/Brands/{id} Get brand by ID Admin, Super_Admin
POST /api/Admin/Brands Create new brand Admin, Super_Admin
PUT /api/Admin/Brands/{id} Update brand Admin, Super_Admin
DELETE /api/Admin/Brands/{id} Delete brand Admin, Super_Admin

📌 Product Management

Method Endpoint Description Roles
GET /api/Admin/Products Get paginated products Admin, Super_Admin
POST /api/Admin/Products Create new product Admin, Super_Admin
PUT /api/Admin/Products/{id} Update product Admin, Super_Admin
DELETE /api/Admin/Products/{id} Delete product Admin, Super_Admin

📌 Order Management

Method Endpoint Description Roles
GET /api/Admin/Orders Get all orders Admin, Super_Admin
GET /api/Admin/Orders/{status} Get orders by status Admin, Super_Admin
PATCH /api/Admin/Orders/{orderId}/status Change order status Admin, Super_Admin

📌 User Management

Method Endpoint Description Roles
GET /api/Admin/Users Get all users Admin, Super_Admin
PATCH /api/Admin/Users/{userId}/role Change user role Super_Admin
PATCH /api/Admin/Users/{userId}/block Block user Admin, Super_Admin
PATCH /api/Admin/Users/{userId}/unblock Unblock user Admin, Super_Admin

🧍‍♂️ Customer Endpoints

📌 Products

Method Endpoint Description Roles
GET /api/Customer/Products Get all products Customer
GET /api/Customer/Products/{id} Get product details Customer
GET /api/Customer/Products/search/{query} Search products Customer

📌 Cart

Method Endpoint Description Roles
GET /api/Customer/Cart Get cart items Customer
POST /api/Customer/Cart Add to cart Customer
PUT /api/Customer/Cart/{itemId} Update cart item Customer
DELETE /api/Customer/Cart/{itemId} Remove from cart Customer

📌 Orders

Method Endpoint Description Roles
POST /api/Customer/Orders Place order Customer
GET /api/Customer/Orders Get user orders Customer
GET /api/Customer/Orders/{orderId} Get order details Customer

📌 Reviews

Method Endpoint Description Roles
POST /api/Customer/Reviews Add review Customer
GET /api/Customer/Reviews/product/{productId} Get product reviews Customer

🛠️ Installation & Setup

✅ Prerequisites

  • .NET 8 SDK
  • SQL Server
  • Visual Studio 2022 or VS Code

🧭 Installation Steps

  1. Clone the repository
    git clone https://github.com/yourusername/ecommerce-api.git
    cd ecommerce-api
    ---
    

🔐 Authentication & Authorization

🧠 Roles

  • Super_Admin: Full system access (brands, products, orders, users, reports, roles).
  • Admin: Management access (brands, products, orders, users).
  • Customer: Shopping, cart, reviews, and placing orders.

All secured endpoints use JWT Authentication with role-based access control.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages