----- 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.
ASP.NET Core Web API C# Entity Framework Core (Code-First) SQL Server JWT Authentication Repository Pattern Services Swagger (API Testing & Documentation)
The project uses JWT (JSON Web Token) based authentication.
User Registration & Login Role-Based Authorization (Admin / User) Secure Password Hashing Token-based request validation Protected endpoints using [Authorize]
The project follows Clean Architecture principles:
Handle HTTP requests and responses.
Contain business logic and validation.
Handle database operations using Entity Framework Core.
This separation ensures: Clean code structure Maintainability Scalability Testability
Users Roles Products Categories Cart CartItems Orders OrderDetails RefreshTokens Payment
User → Cart (One-to-One) User → Orders (One-to-Many) Order → OrderDetails (One-to-Many) Product → Category (Many-to-One)
Clone the repository:
Update appsettings.json with your SQL Server connection string. Run migrations: Update-Database Run the project. Open Swagger: https://localhost:7260/swagger
POST /api/Auth/Register POST /api/Auth/Login POST /api/Auth/Refresh POST /api/Auth/Logout
GET /api/Category/GetAll GET /api/Category/GetBy/{Id} POST /api/Category/Create PUT /api/Category/Update/{Id} DELETE /api/Category/Delete
GET /api/Product/GetAll GET /api/Product/GetBy{id} POST /api/Product/Create PUT /api/Product/Update/{id} DELETE /api/Product//Delete{id}
POST /api/Cart/Add GET /api/Cart/GetBy{userId} DELETE /api/Cart/Remove/GetBy{userId}
POST /api/Order/PlaceOrder GET /api/Order/GetBy/{id}
POST /api/Payment