Skip to content

harshu10-coder/E-CommerceShopSphere

Repository files navigation

E-CommerceShopSphere (Backend API)

----- Project Overview ----- E-CommerceShopSphere is a Backend RESTful Web API built using ASP.NET Core, C#, Entity Framework Core, and SQL Server.

This project implements a clean and scalable architecture using Controller -> Service -> Repository pattern. It includes authentication, authorization, product management, cart functionality,Payment Method and order processing.

The API is tested using Swagger and Postman and follows best backend development practices.

Technologies Used

ASP.NET Core Web API C# Entity Framework Core (Code-First) SQL Server JWT Authentication Repository Pattern Services Swagger (API Testing & Documentation)

Authentication System (JWT)

The project uses JWT (JSON Web Token) based authentication.

Features:

User Registration & Login Role-Based Authorization (Admin / User) Secure Password Hashing Token-based request validation Protected endpoints using [Authorize]

Architecture

The project follows Clean Architecture principles:

Controller → Service → Repository → Database

Controllers

Handle HTTP requests and responses.

Services

Contain business logic and validation.

Repository

Handle database operations using Entity Framework Core.

This separation ensures: Clean code structure Maintainability Scalability Testability

Database Design (Main Tables)

Users Roles Products Categories Cart CartItems Orders OrderDetails RefreshTokens Payment

Relationships:

User → Cart (One-to-One) User → Orders (One-to-Many) Order → OrderDetails (One-to-Many) Product → Category (Many-to-One)

How to Run the Project

Clone the repository:

Open in Visual Studio.

Update appsettings.json with your SQL Server connection string. Run migrations: Update-Database Run the project. Open Swagger: https://localhost:7260/swagger

API Endpoints (Main Modules)

Auth

POST /api/Auth/Register POST /api/Auth/Login POST /api/Auth/Refresh POST /api/Auth/Logout

Category

GET /api/Category/GetAll GET /api/Category/GetBy/{Id} POST /api/Category/Create PUT /api/Category/Update/{Id} DELETE /api/Category/Delete

Products

GET /api/Product/GetAll GET /api/Product/GetBy{id} POST /api/Product/Create PUT /api/Product/Update/{id} DELETE /api/Product//Delete{id}

Cart

POST /api/Cart/Add GET /api/Cart/GetBy{userId} DELETE /api/Cart/Remove/GetBy{userId}

Orders

POST /api/Order/PlaceOrder GET /api/Order/GetBy/{id}

Payment

POST /api/Payment

About

This project demonstrates backend architecture design, authentication implementation, and scalable API development practices.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages