Skip to content

Ahmad123975/E-Commerce-API-.NET

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

🛒 E-Commerce API (.NET)

A scalable and production-ready E-Commerce REST API built with ASP.NET Core following Clean Architecture principles. This project demonstrates modern backend development practices including authentication, modular design, and maintainable code structure.


🚀 Features

  • 🧠 AI Chatbot Integration Smart assistant for product search and customer support.

  • 🏗️ Clean Architecture Structured into Domain, Application, Infrastructure, and API layers.

  • 📁 Repository Pattern Decoupled data access layer for better testability and maintainability.

  • 🔐 JWT Authentication & Authorization Secure login system with role-based access control (Admin/User).

  • 🗄️ Entity Framework Core Code-first approach with SQL Server.

  • 📦 Core E-Commerce Modules

    • Product Management
    • Order Management
    • Shopping Cart System
  • FluentValidation Robust request validation for API endpoints.


🏛️ Project Architecture

This project follows Clean Architecture, ensuring separation of concerns:

├── Domain          # Entities, Enums, Core Logic
├── Application     # Business Logic, Interfaces
├── Infrastructure  # Database, Repositories, External Services
├── API             # Controllers, Middleware, Endpoints

🛠️ Technologies Used

  • ASP.NET Core Web API
  • Entity Framework Core
  • SQL Server
  • JWT Authentication
  • FluentValidation
  • AutoMapper

🔐 Authentication Flow

  1. User registers or logs in
  2. API generates JWT Token
  3. Token is used for authorized requests
  4. Role-based access (Admin/User)

📦 API Modules

👤 User

  • Register
  • Login
  • Role Management

🛍️ Products

  • Create / Update / Delete
  • Get All Products
  • Product Details

🛒 Cart

  • Add to Cart
  • Remove from Cart
  • View Cart

📑 Orders

  • Place Order
  • Order History

⚙️ Setup Instructions

  1. Clone the repository:
git clone https://github.com/your-username/ecommerce-api.git
  1. Navigate to project:
cd ecommerce-api
  1. Update appsettings.json with your SQL Server connection string

  2. Run database migrations:

dotnet ef database update
  1. Run the project:
dotnet run

🧪 Testing

  • Clean structure supports easy unit testing
  • Repository pattern allows mocking dependencies

📌 Future Improvements

  • Payment Gateway Integration (Stripe / PayPal)
  • Caching (Redis)
  • Docker Support
  • API Rate Limiting
  • Advanced AI Recommendations

📧 Contact

Muhammad Ahmad 📍 Pakistan 💻 .NET Developer


⭐ Show Your Support

If you like this project, please ⭐ the repository!

About

A production-ready E-Commerce REST API built with ASP.NET Core, Clean Architecture, Repository Pattern, and chatbot integration.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages