ECommerceAPI is a robust and scalable API designed to handle various authentication mechanisms for an e-commerce platform. This project leverages the power of .NET 9 and C# 13.0 to provide secure and efficient user authentication and authorization services. The API supports multiple login methods, including traditional username/password, Google, and Facebook logins, as well as token-based authentication for session management.
- User Login: Authenticate users using their username or email and password.
- Google Login: Allow users to log in using their Google account credentials.
- Facebook Login: Allow users to log in using their Facebook account credentials.
- Refresh Token: Support for refreshing authentication tokens to maintain user sessions without requiring re-login.
- Password Reset: Enable users to reset their passwords via email.
- Verify Reset Token: Verify the validity of password reset tokens.
- Create Order: Place a new order for products.
- Order Details: Retrieve details of a specific order.
- Order History: Get a list of past orders for a user.
- Update Order Status: Update the status of an existing order (e.g., processing, shipped, delivered).
- Cancel Order: Cancel an existing order.
- Add to Cart: Add products to the user's shopping cart.
- Remove from Cart: Remove products from the user's shopping cart.
- View Cart: Retrieve the current contents of the user's shopping cart.
- Update Cart: Update quantities or details of items in the cart.
└── ECommerceAPI/
├── Core
│ ├── ECommerceAPI.Application
│ └── ECommerceAPI.Domain
├── Infrastructure
│ ├── ECommerceAPI.Infrastructure
│ ├── ECommerceAPI.Persistence
│ └── ECommerceAPI.SignalR
└── Presentation
└── ECommerceAPI.APIECOMMERCEAPI/
Core
ECommerceAPI.Domain
ECommerceAPI.Domain.csproj ❯ REPLACE-MEEntities
Product.cs ❯ REPLACE-MECompletedOrder.cs ❯ REPLACE-MEBasketItem.cs ❯ REPLACE-MEOrder.cs ❯ REPLACE-MEFile.cs ❯ REPLACE-MEProductImageFile.cs ❯ REPLACE-MEInvoiceFile.cs ❯ REPLACE-MEEndpoint.cs ❯ REPLACE-MEMenu.cs ❯ REPLACE-MEBasket.cs ❯ REPLACE-MECustomer.cs ❯ REPLACE-MECommon
BaseEntity.cs ❯ REPLACE-MEIdentity
AppRole.cs ❯ REPLACE-MEAppUser.cs ❯ REPLACE-MEECommerceAPI.Application
ServiceRegistration.cs ❯ REPLACE-MEECommerceAPI.Application.csproj ❯ REPLACE-MEExceptions
UserCreateFailedException.cs ❯ REPLACE-MEUserNotFoundException.cs ❯ REPLACE-MEPasswordChangeFieldException.cs ❯ REPLACE-MERequestParameters
Pagination.cs ❯ REPLACE-MEEnums
ActionType.cs ❯ REPLACE-MEConsts
AuthorizeDefinitionConstants.cs ❯ REPLACE-MEFeatures
Queries
AuthorizationEndpoint
GetEndpointRoles
GetEndpointRolesQueryRequest.cs ❯ REPLACE-MEGetEndpointRolesQueryResponse.cs ❯ REPLACE-MEGetEndpointRolesQueryHandler.cs ❯ REPLACE-MEAppUser
GetMe
GetMeQueryHandler.cs ❯ REPLACE-MEGetUserRoles
GetUserRolesQueryHandler.cs ❯ REPLACE-MEGetUserRolesQueryResponse.cs ❯ REPLACE-MEGetUserRolesQueryRequest.cs ❯ REPLACE-MEGetAllUsers
GetAllUsersQueryResponse.cs ❯ REPLACE-MEGetAllUsersQueryRequest.cs ❯ REPLACE-MEGetAllUsersQueryHandler.cs ❯ REPLACE-MEProductImageFile
GetProductShowCaseImage
GetProductShowCaseImageQueryHandler.cs ❯ REPLACE-MEGetProductShowCaseImageQueryResponse.cs ❯ REPLACE-MEGetProductShowCaseImageQueryRequest.cs ❯ REPLACE-MEGetProductImages
GetProductImagesQueryHandler.cs ❯ REPLACE-MEGetProductImagesQueryRequest.cs ❯ REPLACE-MEGetProductImagesQueryResponse.cs ❯ REPLACE-MERole
GetRoles
GetRolesQueryResponse.cs ❯ REPLACE-MEGetRolesQueryRequest.cs ❯ REPLACE-MEGetRolesQueryHandler.cs ❯ REPLACE-MEGetRoleById
GetRoleByIdQueryRequest.cs ❯ REPLACE-MEGetRoleByIdQueryResponse.cs ❯ REPLACE-MEGetRoleByIdQueryHandler.cs ❯ REPLACE-MEProduct
GetAllProduct
GetAllProductQueryHandler.cs ❯ REPLACE-MEGetAllProductQueryResponse.cs ❯ REPLACE-MEGetAllProductQueryRequest.cs ❯ REPLACE-MEGetByIdProduct
GetByIdProductQueryResponse.cs ❯ REPLACE-MEGetByIdProductQueryHandler.cs ❯ REPLACE-MEGetByIdProductQueryRequest.cs ❯ REPLACE-MEOrder
GetOrderById
GetOrderByIdQueryResponse.cs ❯ REPLACE-MEGetOrderByIdQueryRequest.cs ❯ REPLACE-MEGetOrderByIdQueryHandler.cs ❯ REPLACE-MEGetAllOrders
GetAllOrderQueryResponse.cs ❯ REPLACE-MEGetAllOrderQueryHandler.cs ❯ REPLACE-MEGetAllOrderQueryRequest.cs ❯ REPLACE-MEBasket
GetBasketItems
GetBasketItemsQueryRequest.cs ❯ REPLACE-MEGetBasketItemsQueryResponse.cs ❯ REPLACE-MEGetBasketItemsQueryHandler.cs ❯ REPLACE-MECommands
AuthorizationEndpoint
AssignRoleEndpoint
AssignRoleEndpointCommandRequest.cs ❯ REPLACE-MEAssignRoleEndpointCommandHandler.cs ❯ REPLACE-MEAssignRoleEndpointCommandResponse.cs ❯ REPLACE-MEAppUser
PasswordReset
PasswordResetCommandHandler.cs ❯ REPLACE-MEPasswordResetCommandRequest.cs ❯ REPLACE-MEPasswordResetCommandResponse.cs ❯ REPLACE-MEGoogleLogin
GoogleLoginCommandRequest.cs ❯ REPLACE-MEGoogleLoginCommandHandler.cs ❯ REPLACE-MEGoogleLoginCommandResponse.cs ❯ REPLACE-MERefreshTokenLogin
RefreshTokenLoginRequest.cs ❯ REPLACE-MERefreshTokenLoginResponse.cs ❯ REPLACE-MERefreshTokenLoginHandler.cs ❯ REPLACE-MEAssignRoleToUser
AssignRoleToUserCommandHandler.cs ❯ REPLACE-MEAssignRoleToUserCommandRequest.cs ❯ REPLACE-MEAssignRoleToUserCommandResponse.cs ❯ REPLACE-MECreateUser
CreateUserCommandResponse.cs ❯ REPLACE-MECreateUserCommandHandler.cs ❯ REPLACE-MECreateUserCommandRequest.cs ❯ REPLACE-MELoginUser
LoginUserCommandRequest.cs ❯ REPLACE-MELoginUserCommandResponse.cs ❯ REPLACE-MELoginUserCommandHandler.cs ❯ REPLACE-MEVerifyResetToken
VerifyResetTokenCommandRequest.cs ❯ REPLACE-MEVerifyResetTokenCommandHandler.cs ❯ REPLACE-MEVerifyResetTokenCommandResponse.cs ❯ REPLACE-MEFacebookLogin
FacebookLoginCommandHandler.cs ❯ REPLACE-MEFacebookLoginCommandResponse.cs ❯ REPLACE-MEFacebookLoginCommandRequest.cs ❯ REPLACE-MEUpdatePassword
UpdatePasswordCommandHandler.cs ❯ REPLACE-MEUpdatePasswordCommandRequest.cs ❯ REPLACE-MEUpdatePasswordCommandResponse.cs ❯ REPLACE-MEProductImageFile
UploadProductImage
UploadProductImageCommandResponse.cs ❯ REPLACE-MEUploadProductImageCommandHandler.cs ❯ REPLACE-MEUploadProductImageCommandRequest.cs ❯ REPLACE-MERemoveProductImage
RemoveProductImageCommandRequest.cs ❯ REPLACE-MERemoveProductImageCommandResponse.cs ❯ REPLACE-MERemoveProductImageCommandHandler.cs ❯ REPLACE-MERole
DeleteRole
DeleteRoleCommandRequest.cs ❯ REPLACE-MEDeleteRoleCommandResponse.cs ❯ REPLACE-MEDeleteRoleCommandHandler.cs ❯ REPLACE-MEIRoleRepository.cs ❯ REPLACE-MEUpdateRole
UpdateRoleCommandRequest.cs ❯ REPLACE-MEUpdateRoleCommandHandler.cs ❯ REPLACE-MEUpdateRoleCommandResponse.cs ❯ REPLACE-MECreateRole
CreateRoleCommandHandler.cs ❯ REPLACE-MECreateRoleCommandResponse.cs ❯ REPLACE-MECreateRoleCommandRequest.cs ❯ REPLACE-MEProduct
UpdateQrCodeProductStock
UpdateQrCodeProductStockCommandHandler.cs ❯ REPLACE-MEUpdateQrCodeProductStockCommandResponse.cs ❯ REPLACE-MEUpdateQrCodeProductStockCommandRequest.cs ❯ REPLACE-MEChangeShowcase
ChangeShowcaseCommandHandler.cs ❯ REPLACE-MEChangeShowcaseCommandRequest.cs ❯ REPLACE-MEChangeShowcaseCommandResponse.cs ❯ REPLACE-MEUpdateProduct
UpdateProductCommandHandler.cs ❯ REPLACE-MEUpdateProductCommandRequest.cs ❯ REPLACE-MEUpdateProductCommandResponse.cs ❯ REPLACE-MECreateProduct
CreateProductCommandResponse.cs ❯ REPLACE-MECreateProductCommandHandler.cs ❯ REPLACE-MECreateProductCommandRequest.cs ❯ REPLACE-MERemoveProduct
RemoveProductCommandResponse.cs ❯ REPLACE-MERemoveProductCommandRequest.cs ❯ REPLACE-MERemoveProductCommandHandler.cs ❯ REPLACE-MEOrder
CreateOrder
CreateOrderCommandResponse.cs ❯ REPLACE-MECreateOrderCommandRequest.cs ❯ REPLACE-MECreateOrderCommandHandler.cs ❯ REPLACE-MECompleteOrder
CompleteOrderCommandHandler.cs ❯ REPLACE-MECompleteOrderCommandResponse.cs ❯ REPLACE-MECompleteOrderCommandRequest.cs ❯ REPLACE-MEBasket
RemoveBasketItem
RemoveBasketItemCommandResponse.cs ❯ REPLACE-MERemoveBasketItemCommandHandler.cs ❯ REPLACE-MERemoveBasketItemCommandRequest.cs ❯ REPLACE-MEAddItemToBasket
AddItemToBasketCommandHandler.cs ❯ REPLACE-MEAddItemToBasketCommandResponse.cs ❯ REPLACE-MEAddItemToBasketCommandRequest.cs ❯ REPLACE-MEUpdateQuantity
UpdateQuantityCommandHandler.cs ❯ REPLACE-MEUpdateQuantityCommandResponse.cs ❯ REPLACE-MEUpdateQuantityCommandRequest.cs ❯ REPLACE-MEAbstractions
Hubs
IOrderHubService.cs ❯ REPLACE-MEIProductHubService.cs ❯ REPLACE-MEServices
IProductService.cs ❯ REPLACE-MEIRoleService.cs ❯ REPLACE-MEIQRCodeService.cs ❯ REPLACE-MEIAuthService.cs ❯ REPLACE-MEIAuthorizationEndpointService.cs ❯ REPLACE-MEIUserService.cs ❯ REPLACE-MEIOrderService.cs ❯ REPLACE-MEIMailService.cs ❯ REPLACE-MEIBasketService.cs ❯ REPLACE-MEConfigurations
IApplicationService.cs ❯ REPLACE-MEAuthentication
IExternalAuthentication.cs ❯ REPLACE-MEIInternalAuthentication.cs ❯ REPLACE-METoken
ITokenHandler.cs ❯ REPLACE-MEStorage
IStorageService.cs ❯ REPLACE-MEIStorage.cs ❯ REPLACE-MEAzure
IAzureStorage.cs ❯ REPLACE-MELocal
ILocalStorage.cs ❯ REPLACE-MEDTOs
Token.cs ❯ REPLACE-MEOrder
CompletedOrder.cs ❯ REPLACE-MEListOrder.cs ❯ REPLACE-MESingleOrder.cs ❯ REPLACE-MECreateOrder.cs ❯ REPLACE-MEUser
CreateUserResponse.cs ❯ REPLACE-MEListUser.cs ❯ REPLACE-MEVerifyUserResetToken.cs ❯ REPLACE-MEUserDetail.cs ❯ REPLACE-MECreateUser.cs ❯ REPLACE-ME
FacebookAccessTokenResponse.cs ❯ REPLACE-MEFacebookAccessTokenValidation.cs ❯ REPLACE-MEFacebookUserInfoResponse.cs ❯ REPLACE-MERepositories
IReadRepository.cs ❯ REPLACE-MEIWriteRepository.cs ❯ REPLACE-MEIRepository.cs ❯ REPLACE-MEBasketItem
IBasketItemWriteRepository.cs ❯ REPLACE-MEIBasketItemReadRepository.cs ❯ REPLACE-MECustomer
ICustomerWriteRepository.cs ❯ REPLACE-MEICustomerReadRepository.cs ❯ REPLACE-MEProductImageFile
IProductImageFileReadRepository.cs ❯ REPLACE-MEIProductImageFileWriteRepository.cs ❯ REPLACE-MECompletedOrder
ICompletedOrderReadRepository.cs ❯ REPLACE-MEICompletedOrderWrtieRepository.cs ❯ REPLACE-MEProduct
IProductReadRepository.cs ❯ REPLACE-MEIProductWriteRepository.cs ❯ REPLACE-MEEndpoint
IEndpointReadRepository.cs ❯ REPLACE-MEIEndpointWriteRepository.cs ❯ REPLACE-MEOrder
IOrderReadRepository.cs ❯ REPLACE-MEIOrderWriteRepository.cs ❯ REPLACE-MEMenu
IMenuReadRepository.cs ❯ REPLACE-MEIMenuWriteRepository.cs ❯ REPLACE-MEBasket
IBasketWriteRepository.cs ❯ REPLACE-MEIBasketReadRepository.cs ❯ REPLACE-MEFile
IFileReadRepository.cs ❯ REPLACE-MEIFileWriteRepository.cs ❯ REPLACE-MEInvoiceFile
IInvoiceFileReadRepository.cs ❯ REPLACE-MEIInvoiceFileWriteRepository.cs ❯ REPLACE-MECustomAttributes
AuthorizeDefinitionAttribute.cs ❯ REPLACE-MEHelpers
CustomEncoders.cs ❯ REPLACE-MEValidators
Products
CreateProductValidator.cs ❯ REPLACE-MEAppUsers
UpdatePassword.cs ❯ REPLACE-MEViewModels
Products
VM_Create_Product.cs ❯ REPLACE-MEVM_Update_Product.cs ❯ REPLACE-MEBaskets
VM_Create_BasketItem.cs ❯ REPLACE-MEVM_Update_BasketItem.cs ❯ REPLACE-ME
Presentation
ECommerceAPI.API
ECommerceAPI.API.csproj ❯ REPLACE-MEappsettings.Development.json ❯ REPLACE-MEappsettings.json ❯ REPLACE-MEProgram.cs ❯ REPLACE-MEControllers
AuthController.cs ❯ REPLACE-MEProductsController.cs ❯ REPLACE-MEUsersController.cs ❯ REPLACE-MEApplicationServicesController.cs ❯ REPLACE-MERolesController.cs ❯ REPLACE-MEFilesController.cs ❯ REPLACE-MEAuthorizationEndpointsController.cs ❯ REPLACE-MEOrdersController.cs ❯ REPLACE-MEBasketsController.cs ❯ REPLACE-MEConfigurations
ColumnWriters
UsernameColumnWriter.cs ❯ REPLACE-ME.config
dotnet-tools.json ❯ REPLACE-MEProperties
serviceDependencies.ECommerceAPIAPI20230718135833 - Web Deploy.json ❯ REPLACE-MElaunchSettings.json ❯ REPLACE-MEserviceDependencies.json ❯ REPLACE-MEServiceDependencies
ECommerceAPIAPI20230718135833 - Web Deploy
profile.arm.json ❯ REPLACE-MEapis1.arm.json ❯ REPLACE-MEFilters
RolePermissionFilter.cs ❯ REPLACE-MEExtensions
ConfigureExceptionHandlerExtension.cs ❯ REPLACE-ME
Infrastructure
ECommerceAPI.Persistence
DesignTimeDbContextFactory.cs ❯ REPLACE-MEServiceRegistration.cs ❯ REPLACE-MEECommerceAPI.Persistence.csproj ❯ REPLACE-MEConfiguration.cs ❯ REPLACE-MEMigrations
ECommerceAPIDbContextModelSnapshot.cs ❯ REPLACE-ME20230718104956_Init.Designer.cs ❯ REPLACE-ME20230718104956_Init.cs ❯ REPLACE-MEServices
AuthService.cs ❯ REPLACE-MERoleService.cs ❯ REPLACE-MEUserService.cs ❯ REPLACE-MEBasketService.cs ❯ REPLACE-MEAuthorizationEndpointService.cs ❯ REPLACE-MEProductService.cs ❯ REPLACE-MEOrderService.cs ❯ REPLACE-MEProperties
launchSettings.json ❯ REPLACE-MERepositories
WriteRepository.cs ❯ REPLACE-MEReadRepository.cs ❯ REPLACE-MEBasketItem
BasketItemReadRepository.cs ❯ REPLACE-MEBasketItemWriteRepository.cs ❯ REPLACE-MECustomer
CustomerReadRepository.cs ❯ REPLACE-MECustomerWriteRepository.cs ❯ REPLACE-MEProductImageFile
ProductImageFileReadRepository.cs ❯ REPLACE-MEProductImageFileWriteRepository.cs ❯ REPLACE-MECompletedOrder
CompletedOrderWriteRepository.cs ❯ REPLACE-MECompletedOrderReadRepository.cs ❯ REPLACE-MEProduct
ProductWriteRepository.cs ❯ REPLACE-MEProductReadRepository.cs ❯ REPLACE-MEEndpoint
EndpointWriteRepository.cs ❯ REPLACE-MEEndpointReadRepository.cs ❯ REPLACE-MEOrder
OrderReadRepository.cs ❯ REPLACE-MEOrderWriteRepository.cs ❯ REPLACE-MEMenu
MenuWriteRepository.cs ❯ REPLACE-MEMenuReadRepository.cs ❯ REPLACE-MEBasket
BasketWriteRepository.cs ❯ REPLACE-MEBasketReadRepository.cs ❯ REPLACE-MEFile
FileWriteRepository.cs ❯ REPLACE-MEFileReadRepository.cs ❯ REPLACE-MEInvoiceFile
InvoiceFileWriteRepository.cs ❯ REPLACE-MEInvoiceFileReadRepository.cs ❯ REPLACE-MEContexts
ECommerceAPIDbContext.cs ❯ REPLACE-MEECommerceAPI.SignalR
ECommerceAPI.SignalR.csproj ❯ REPLACE-MEServiceRegistration.cs ❯ REPLACE-MERecieveFunctionNames.cs ❯ REPLACE-MEHubRegistration.cs ❯ REPLACE-MEHubs
ProductHub.cs ❯ REPLACE-MEOrderHub.cs ❯ REPLACE-MEHubServices
ProductHubService.cs ❯ REPLACE-MEOrderHubService.cs ❯ REPLACE-MEECommerceAPI.Infrastructure
ServiceRegistration.cs ❯ REPLACE-MEECommerceAPI.Infrastructure.csproj ❯ REPLACE-MEEnums
StorageType.cs ❯ REPLACE-MEServices
MailService.cs ❯ REPLACE-MEFileService.cs ❯ REPLACE-MEQRCodeService.cs ❯ REPLACE-MEConfiguration
ApplicationService.cs ❯ REPLACE-METoken
TokenHandler.cs ❯ REPLACE-MEStorage
StorageService.cs ❯ REPLACE-MEStorage.cs ❯ REPLACE-MEAzure
AzureStorage.cs ❯ REPLACE-MELocal
LocalStorage.cs ❯ REPLACE-MEFilters
ValidationFilter.cs ❯ REPLACE-MEStaticServices
RenameHelper.cs ❯ REPLACE-ME
Before getting started with ECommerceAPI, ensure your runtime environment meets the following requirements:
- Programming Language: CSharp
- Package Manager: Nuget
Install ECommerceAPI using one of the following methods:
Build from source:
- Clone the ECommerceAPI repository:
❯ git clone https://github.com/Emir-Khan/ECommerceAPI- Navigate to the project directory:
❯ cd ECommerceAPI❯ dotnet restoreRun ECommerceAPI using the following command:
❯ dotnet run-
Task 1:Update to .Net 9.0 -
Task 2: Redis Caching. -
Task 3: Soft Delete.