A production-ready e-commerce REST API built using ASP.NET Core Web API 8 and Entity Framework Core. This backend powers a full shopping experience with user authentication, product catalog, cart, orders, payments, admin controls, and more.
- Swagger UI Link : https://storegrid-api.azurewebsites.net/swagger/index.html
- ASP.NET Core 8 (Web API)
- Entity Framework Core 8
- SQL Server
- AutoMapper
- JWT Authentication
- Gmail SMTP (for email services)
- Swagger – API documentation
Controllers/
– API controllers by featureModels/
– Entity modelsDTOs/
– Request and response data modelsServices/
– Business logic for each moduleMappings/
– AutoMapper configurationConstants/
– All the constants like order status etc goes here.Data/
– ApplicationDbContext & migrations
- JWT-based Auth
- Role-based system with 3 roles:
User
Admin
SuperAdmin
(seeded user)
- Secure password hashing and email verification
- Signup, Login, JWT Token generation
- Change password, forgot/reset password
- Update username & phone number
- Get user profile
- Browse all products, categories, brands
- Product details with variants (color/size)
- Related products & new arrivals
- Add/remove favorites
- Add/update/remove items from cart
- Clear cart
- Partial cart checkout
- Checkout preview endpoint
- Place order with optional proof image
- Add, update, delete addresses
- Set default address
- View all orders
- View order details
- Cancel orders
- Leave reviews only for purchased products
- View all personal reviews
- Edit/delete reviews
- Manage categories, products, orders, and reviews
- Toggle product active/inactive
- Filter orders by status
- Create other admins (only SuperAdmin)
POST /api/Auth/Signup
POST /api/Auth/Login
POST /api/Auth/VerifyEmail
GET /api/UserProfile/GetUserProfile
POST /api/UserProfile/UpdateUsername
POST /api/UserProfile/UpdatePhoneNumber
POST /api/UserProfile/ChangePassword
POST /api/UserProfile/ForgotPassword
POST /api/UserProfile/ResetPassword
GET /api/UserCart/GetCartItems
POST /api/UserCart/AddCartItem
PUT /api/UserCart/UpdateCartItemQuantity
DELETE /api/UserCart/RemoveCartItem/{cartItemId}
DELETE /api/UserCart/ClearCart
GET /api/UserFavorite
POST /api/UserFavorite/AddtoFavorite/{ProductId}
DELETE /api/UserFavorite/RemoveFavorite/{ProductId}
GET /api/UserAddress/GetAddresses
POST /api/UserAddress/AddAddress
PUT /api/UserAddress/UpdateAddress/{AddressId}
DELETE /api/UserAddress/DeleteAddress/{AddressId}
GET /api/UserOrder/MyOrders
GET /api/UserOrder/OrderDetails/{orderId}
POST /api/UserOrder/CheckoutPreview
POST /api/UserOrder/PlaceOrder
PUT /api/UserOrder/cancel/{orderId}
GET /api/UserReview/GetMyReviews
GET /api/UserReview/GetMyReviewForProduct/{productId}
POST /api/UserReview/AddReview
PUT /api/UserReview/UpadateReview/{reviewId}
DELETE /api/UserReview/DeleteReview/{reviewId}
GET /api/UserReview/GetReviewableProducts
GET /api/Product/AllProducts
GET /api/Product/NewArrivals
GET /api/Product/{productId}
GET /api/Product/Category/{categoryName}
GET /api/Product/Brand/{brandName}
GET /api/Product/{productId}/Related
GET /api/Product/GetCategories
POST /api/AdminProduct/create
GET /api/AdminProduct/all
GET /api/AdminProduct/{id}
PUT /api/AdminProduct/update/{id}
PUT /api/AdminProduct/DeactiveProduct/{ProductId}
PUT /api/AdminProduct/ActiveProduct/{ProductId}
POST /api/AdminCategory/CreateCategory
DELETE /api/AdminCategory/DeleteCategory/{id}
GET /api/AdminCategory/GetAllCategories
GET /api/AdminCategory/GetCategoryById/{id}
PUT /api/AdminCategory/UpdateCategory/{id}
GET /api/AdminOrder
GET /api/AdminOrder/GetOrderByStatus
GET /api/AdminOrder/{orderId}
PUT /api/AdminOrder/{orderId}/UpdateStatus
GET /api/AdminOrder/AllStatuses
GET /api/AdminReview/GetAllReviews
GET /api/AdminReview/FilterByProduct/{productId}
DELETE /api/AdminReview/DeleteReview/{id}
POST /api/AdminRegister/RegisterAdmin
- All endpoints use [Authorize] with policy/role-based checks
- Passwords are securely hashed
- JWT tokens expire in 1 hour
- Email-based verification for password reset
- Admin-only endpoints protected with
Role = Admin/SuperAdmin
- .NET 8 SDK
- SQL Server / LocalDB
git clone https://github.com/Mutashim99/EcommerceAPI
cd ecommerce-backend
- Add
appsettings.json
with:
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"DefaultString": "Your Connection String"
},
"JwtSettings": {
"Key": "Your Key",
"Issuer": "Your Issuer",
"Audience": "Your Audience"
},
"EmailSettings": {
"SmtpServer": "smtp.gmail.com",
"Port": "587",
"SenderEmail": "Your sender Email",
"SenderName": "Your Sender Name",
"Password": "Your Gmail APP Password"
},
"FrontendDomainForEmailVerification": "Your Front end Domain to send in the emails with links"
}
- Run the migration:
dotnet ef database update
- Start the API:
dotnet run
- Open Swagger:
https://localhost:<port>/swagger
Built by Mutashim Mohsin
Open for internship & collaboration opportunities!
🔗 GitHub: https://github.com/Mutashim99\ 📧 Email: muhtashimmohsin@outlook.com
This project is licensed under the MIT License.