豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Emir-Khan/ECommerceAPI

Repository files navigation

ECOMMERCEAPI

license repo-top-language repo-language-count


Table of Contents


Overview

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.


Features

Authentication

  • 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.

Order Management

  • 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.

Cart Management

  • 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.

Project-Structure

└── ECommerceAPI/
    ├── Core
    │   ├── ECommerceAPI.Application
    │   └── ECommerceAPI.Domain
    ├── Infrastructure
    │   ├── ECommerceAPI.Infrastructure
    │   ├── ECommerceAPI.Persistence
    │   └── ECommerceAPI.SignalR
    └── Presentation
        └── ECommerceAPI.API

Project-Index

ECOMMERCEAPI/
Core
ECommerceAPI.Domain
ECommerceAPI.Domain.csproj ❯ REPLACE-ME
Entities
Product.cs ❯ REPLACE-ME
CompletedOrder.cs ❯ REPLACE-ME
BasketItem.cs ❯ REPLACE-ME
Order.cs ❯ REPLACE-ME
File.cs ❯ REPLACE-ME
ProductImageFile.cs ❯ REPLACE-ME
InvoiceFile.cs ❯ REPLACE-ME
Endpoint.cs ❯ REPLACE-ME
Menu.cs ❯ REPLACE-ME
Basket.cs ❯ REPLACE-ME
Customer.cs ❯ REPLACE-ME
Common
BaseEntity.cs ❯ REPLACE-ME
Identity
AppRole.cs ❯ REPLACE-ME
AppUser.cs ❯ REPLACE-ME
ECommerceAPI.Application
ServiceRegistration.cs ❯ REPLACE-ME
ECommerceAPI.Application.csproj ❯ REPLACE-ME
Exceptions
UserCreateFailedException.cs ❯ REPLACE-ME
UserNotFoundException.cs ❯ REPLACE-ME
PasswordChangeFieldException.cs ❯ REPLACE-ME
RequestParameters
Pagination.cs ❯ REPLACE-ME
Enums
ActionType.cs ❯ REPLACE-ME
Consts
AuthorizeDefinitionConstants.cs ❯ REPLACE-ME
Features
Queries
AuthorizationEndpoint
GetEndpointRoles
GetEndpointRolesQueryRequest.cs ❯ REPLACE-ME
GetEndpointRolesQueryResponse.cs ❯ REPLACE-ME
GetEndpointRolesQueryHandler.cs ❯ REPLACE-ME
AppUser
GetMe
GetMeQueryHandler.cs ❯ REPLACE-ME
GetUserRoles
GetUserRolesQueryHandler.cs ❯ REPLACE-ME
GetUserRolesQueryResponse.cs ❯ REPLACE-ME
GetUserRolesQueryRequest.cs ❯ REPLACE-ME
GetAllUsers
GetAllUsersQueryResponse.cs ❯ REPLACE-ME
GetAllUsersQueryRequest.cs ❯ REPLACE-ME
GetAllUsersQueryHandler.cs ❯ REPLACE-ME
ProductImageFile
GetProductShowCaseImage
GetProductShowCaseImageQueryHandler.cs ❯ REPLACE-ME
GetProductShowCaseImageQueryResponse.cs ❯ REPLACE-ME
GetProductShowCaseImageQueryRequest.cs ❯ REPLACE-ME
GetProductImages
GetProductImagesQueryHandler.cs ❯ REPLACE-ME
GetProductImagesQueryRequest.cs ❯ REPLACE-ME
GetProductImagesQueryResponse.cs ❯ REPLACE-ME
Role
GetRoles
GetRolesQueryResponse.cs ❯ REPLACE-ME
GetRolesQueryRequest.cs ❯ REPLACE-ME
GetRolesQueryHandler.cs ❯ REPLACE-ME
GetRoleById
GetRoleByIdQueryRequest.cs ❯ REPLACE-ME
GetRoleByIdQueryResponse.cs ❯ REPLACE-ME
GetRoleByIdQueryHandler.cs ❯ REPLACE-ME
Product
GetAllProduct
GetAllProductQueryHandler.cs ❯ REPLACE-ME
GetAllProductQueryResponse.cs ❯ REPLACE-ME
GetAllProductQueryRequest.cs ❯ REPLACE-ME
GetByIdProduct
GetByIdProductQueryResponse.cs ❯ REPLACE-ME
GetByIdProductQueryHandler.cs ❯ REPLACE-ME
GetByIdProductQueryRequest.cs ❯ REPLACE-ME
Order
GetOrderById
GetOrderByIdQueryResponse.cs ❯ REPLACE-ME
GetOrderByIdQueryRequest.cs ❯ REPLACE-ME
GetOrderByIdQueryHandler.cs ❯ REPLACE-ME
GetAllOrders
GetAllOrderQueryResponse.cs ❯ REPLACE-ME
GetAllOrderQueryHandler.cs ❯ REPLACE-ME
GetAllOrderQueryRequest.cs ❯ REPLACE-ME
Basket
GetBasketItems
GetBasketItemsQueryRequest.cs ❯ REPLACE-ME
GetBasketItemsQueryResponse.cs ❯ REPLACE-ME
GetBasketItemsQueryHandler.cs ❯ REPLACE-ME
Commands
AuthorizationEndpoint
AssignRoleEndpoint
AssignRoleEndpointCommandRequest.cs ❯ REPLACE-ME
AssignRoleEndpointCommandHandler.cs ❯ REPLACE-ME
AssignRoleEndpointCommandResponse.cs ❯ REPLACE-ME
AppUser
PasswordReset
PasswordResetCommandHandler.cs ❯ REPLACE-ME
PasswordResetCommandRequest.cs ❯ REPLACE-ME
PasswordResetCommandResponse.cs ❯ REPLACE-ME
GoogleLogin
GoogleLoginCommandRequest.cs ❯ REPLACE-ME
GoogleLoginCommandHandler.cs ❯ REPLACE-ME
GoogleLoginCommandResponse.cs ❯ REPLACE-ME
RefreshTokenLogin
RefreshTokenLoginRequest.cs ❯ REPLACE-ME
RefreshTokenLoginResponse.cs ❯ REPLACE-ME
RefreshTokenLoginHandler.cs ❯ REPLACE-ME
AssignRoleToUser
AssignRoleToUserCommandHandler.cs ❯ REPLACE-ME
AssignRoleToUserCommandRequest.cs ❯ REPLACE-ME
AssignRoleToUserCommandResponse.cs ❯ REPLACE-ME
CreateUser
CreateUserCommandResponse.cs ❯ REPLACE-ME
CreateUserCommandHandler.cs ❯ REPLACE-ME
CreateUserCommandRequest.cs ❯ REPLACE-ME
LoginUser
LoginUserCommandRequest.cs ❯ REPLACE-ME
LoginUserCommandResponse.cs ❯ REPLACE-ME
LoginUserCommandHandler.cs ❯ REPLACE-ME
VerifyResetToken
VerifyResetTokenCommandRequest.cs ❯ REPLACE-ME
VerifyResetTokenCommandHandler.cs ❯ REPLACE-ME
VerifyResetTokenCommandResponse.cs ❯ REPLACE-ME
FacebookLogin
FacebookLoginCommandHandler.cs ❯ REPLACE-ME
FacebookLoginCommandResponse.cs ❯ REPLACE-ME
FacebookLoginCommandRequest.cs ❯ REPLACE-ME
UpdatePassword
UpdatePasswordCommandHandler.cs ❯ REPLACE-ME
UpdatePasswordCommandRequest.cs ❯ REPLACE-ME
UpdatePasswordCommandResponse.cs ❯ REPLACE-ME
ProductImageFile
UploadProductImage
UploadProductImageCommandResponse.cs ❯ REPLACE-ME
UploadProductImageCommandHandler.cs ❯ REPLACE-ME
UploadProductImageCommandRequest.cs ❯ REPLACE-ME
RemoveProductImage
RemoveProductImageCommandRequest.cs ❯ REPLACE-ME
RemoveProductImageCommandResponse.cs ❯ REPLACE-ME
RemoveProductImageCommandHandler.cs ❯ REPLACE-ME
Role
DeleteRole
DeleteRoleCommandRequest.cs ❯ REPLACE-ME
DeleteRoleCommandResponse.cs ❯ REPLACE-ME
DeleteRoleCommandHandler.cs ❯ REPLACE-ME
IRoleRepository.cs ❯ REPLACE-ME
UpdateRole
UpdateRoleCommandRequest.cs ❯ REPLACE-ME
UpdateRoleCommandHandler.cs ❯ REPLACE-ME
UpdateRoleCommandResponse.cs ❯ REPLACE-ME
CreateRole
CreateRoleCommandHandler.cs ❯ REPLACE-ME
CreateRoleCommandResponse.cs ❯ REPLACE-ME
CreateRoleCommandRequest.cs ❯ REPLACE-ME
Product
UpdateQrCodeProductStock
UpdateQrCodeProductStockCommandHandler.cs ❯ REPLACE-ME
UpdateQrCodeProductStockCommandResponse.cs ❯ REPLACE-ME
UpdateQrCodeProductStockCommandRequest.cs ❯ REPLACE-ME
ChangeShowcase
ChangeShowcaseCommandHandler.cs ❯ REPLACE-ME
ChangeShowcaseCommandRequest.cs ❯ REPLACE-ME
ChangeShowcaseCommandResponse.cs ❯ REPLACE-ME
UpdateProduct
UpdateProductCommandHandler.cs ❯ REPLACE-ME
UpdateProductCommandRequest.cs ❯ REPLACE-ME
UpdateProductCommandResponse.cs ❯ REPLACE-ME
CreateProduct
CreateProductCommandResponse.cs ❯ REPLACE-ME
CreateProductCommandHandler.cs ❯ REPLACE-ME
CreateProductCommandRequest.cs ❯ REPLACE-ME
RemoveProduct
RemoveProductCommandResponse.cs ❯ REPLACE-ME
RemoveProductCommandRequest.cs ❯ REPLACE-ME
RemoveProductCommandHandler.cs ❯ REPLACE-ME
Order
CreateOrder
CreateOrderCommandResponse.cs ❯ REPLACE-ME
CreateOrderCommandRequest.cs ❯ REPLACE-ME
CreateOrderCommandHandler.cs ❯ REPLACE-ME
CompleteOrder
CompleteOrderCommandHandler.cs ❯ REPLACE-ME
CompleteOrderCommandResponse.cs ❯ REPLACE-ME
CompleteOrderCommandRequest.cs ❯ REPLACE-ME
Basket
RemoveBasketItem
RemoveBasketItemCommandResponse.cs ❯ REPLACE-ME
RemoveBasketItemCommandHandler.cs ❯ REPLACE-ME
RemoveBasketItemCommandRequest.cs ❯ REPLACE-ME
AddItemToBasket
AddItemToBasketCommandHandler.cs ❯ REPLACE-ME
AddItemToBasketCommandResponse.cs ❯ REPLACE-ME
AddItemToBasketCommandRequest.cs ❯ REPLACE-ME
UpdateQuantity
UpdateQuantityCommandHandler.cs ❯ REPLACE-ME
UpdateQuantityCommandResponse.cs ❯ REPLACE-ME
UpdateQuantityCommandRequest.cs ❯ REPLACE-ME
Abstractions
Hubs
IOrderHubService.cs ❯ REPLACE-ME
IProductHubService.cs ❯ REPLACE-ME
Services
IProductService.cs ❯ REPLACE-ME
IRoleService.cs ❯ REPLACE-ME
IQRCodeService.cs ❯ REPLACE-ME
IAuthService.cs ❯ REPLACE-ME
IAuthorizationEndpointService.cs ❯ REPLACE-ME
IUserService.cs ❯ REPLACE-ME
IOrderService.cs ❯ REPLACE-ME
IMailService.cs ❯ REPLACE-ME
IBasketService.cs ❯ REPLACE-ME
Configurations
IApplicationService.cs ❯ REPLACE-ME
Authentication
IExternalAuthentication.cs ❯ REPLACE-ME
IInternalAuthentication.cs ❯ REPLACE-ME
Token
ITokenHandler.cs ❯ REPLACE-ME
Storage
IStorageService.cs ❯ REPLACE-ME
IStorage.cs ❯ REPLACE-ME
Azure
IAzureStorage.cs ❯ REPLACE-ME
Local
ILocalStorage.cs ❯ REPLACE-ME
DTOs
Token.cs ❯ REPLACE-ME
Configuration
Action.cs ❯ REPLACE-ME
Menu.cs ❯ REPLACE-ME
Order
CompletedOrder.cs ❯ REPLACE-ME
ListOrder.cs ❯ REPLACE-ME
SingleOrder.cs ❯ REPLACE-ME
CreateOrder.cs ❯ REPLACE-ME
User
CreateUserResponse.cs ❯ REPLACE-ME
ListUser.cs ❯ REPLACE-ME
VerifyUserResetToken.cs ❯ REPLACE-ME
UserDetail.cs ❯ REPLACE-ME
CreateUser.cs ❯ REPLACE-ME
Facebook
FacebookAccessTokenResponse.cs ❯ REPLACE-ME
FacebookAccessTokenValidation.cs ❯ REPLACE-ME
FacebookUserInfoResponse.cs ❯ REPLACE-ME
Repositories
IReadRepository.cs ❯ REPLACE-ME
IWriteRepository.cs ❯ REPLACE-ME
IRepository.cs ❯ REPLACE-ME
BasketItem
IBasketItemWriteRepository.cs ❯ REPLACE-ME
IBasketItemReadRepository.cs ❯ REPLACE-ME
Customer
ICustomerWriteRepository.cs ❯ REPLACE-ME
ICustomerReadRepository.cs ❯ REPLACE-ME
ProductImageFile
IProductImageFileReadRepository.cs ❯ REPLACE-ME
IProductImageFileWriteRepository.cs ❯ REPLACE-ME
CompletedOrder
ICompletedOrderReadRepository.cs ❯ REPLACE-ME
ICompletedOrderWrtieRepository.cs ❯ REPLACE-ME
Product
IProductReadRepository.cs ❯ REPLACE-ME
IProductWriteRepository.cs ❯ REPLACE-ME
Endpoint
IEndpointReadRepository.cs ❯ REPLACE-ME
IEndpointWriteRepository.cs ❯ REPLACE-ME
Order
IOrderReadRepository.cs ❯ REPLACE-ME
IOrderWriteRepository.cs ❯ REPLACE-ME
Menu
IMenuReadRepository.cs ❯ REPLACE-ME
IMenuWriteRepository.cs ❯ REPLACE-ME
Basket
IBasketWriteRepository.cs ❯ REPLACE-ME
IBasketReadRepository.cs ❯ REPLACE-ME
File
IFileReadRepository.cs ❯ REPLACE-ME
IFileWriteRepository.cs ❯ REPLACE-ME
InvoiceFile
IInvoiceFileReadRepository.cs ❯ REPLACE-ME
IInvoiceFileWriteRepository.cs ❯ REPLACE-ME
CustomAttributes
AuthorizeDefinitionAttribute.cs ❯ REPLACE-ME
Helpers
CustomEncoders.cs ❯ REPLACE-ME
Validators
Products
CreateProductValidator.cs ❯ REPLACE-ME
AppUsers
UpdatePassword.cs ❯ REPLACE-ME
ViewModels
Products
VM_Create_Product.cs ❯ REPLACE-ME
VM_Update_Product.cs ❯ REPLACE-ME
Baskets
VM_Create_BasketItem.cs ❯ REPLACE-ME
VM_Update_BasketItem.cs ❯ REPLACE-ME
Presentation
ECommerceAPI.API
ECommerceAPI.API.csproj ❯ REPLACE-ME
appsettings.Development.json ❯ REPLACE-ME
appsettings.json ❯ REPLACE-ME
Program.cs ❯ REPLACE-ME
Controllers
AuthController.cs ❯ REPLACE-ME
ProductsController.cs ❯ REPLACE-ME
UsersController.cs ❯ REPLACE-ME
ApplicationServicesController.cs ❯ REPLACE-ME
RolesController.cs ❯ REPLACE-ME
FilesController.cs ❯ REPLACE-ME
AuthorizationEndpointsController.cs ❯ REPLACE-ME
OrdersController.cs ❯ REPLACE-ME
BasketsController.cs ❯ REPLACE-ME
Configurations
ColumnWriters
UsernameColumnWriter.cs ❯ REPLACE-ME
.config
dotnet-tools.json ❯ REPLACE-ME
Properties
serviceDependencies.ECommerceAPIAPI20230718135833 - Web Deploy.json ❯ REPLACE-ME
launchSettings.json ❯ REPLACE-ME
serviceDependencies.json ❯ REPLACE-ME
ServiceDependencies
ECommerceAPIAPI20230718135833 - Web Deploy
profile.arm.json ❯ REPLACE-ME
apis1.arm.json ❯ REPLACE-ME
Filters
RolePermissionFilter.cs ❯ REPLACE-ME
Extensions
ConfigureExceptionHandlerExtension.cs ❯ REPLACE-ME
Infrastructure
ECommerceAPI.Persistence
DesignTimeDbContextFactory.cs ❯ REPLACE-ME
ServiceRegistration.cs ❯ REPLACE-ME
ECommerceAPI.Persistence.csproj ❯ REPLACE-ME
Configuration.cs ❯ REPLACE-ME
Migrations
ECommerceAPIDbContextModelSnapshot.cs ❯ REPLACE-ME
20230718104956_Init.Designer.cs ❯ REPLACE-ME
20230718104956_Init.cs ❯ REPLACE-ME
Services
AuthService.cs ❯ REPLACE-ME
RoleService.cs ❯ REPLACE-ME
UserService.cs ❯ REPLACE-ME
BasketService.cs ❯ REPLACE-ME
AuthorizationEndpointService.cs ❯ REPLACE-ME
ProductService.cs ❯ REPLACE-ME
OrderService.cs ❯ REPLACE-ME
Properties
launchSettings.json ❯ REPLACE-ME
Repositories
WriteRepository.cs ❯ REPLACE-ME
ReadRepository.cs ❯ REPLACE-ME
BasketItem
BasketItemReadRepository.cs ❯ REPLACE-ME
BasketItemWriteRepository.cs ❯ REPLACE-ME
Customer
CustomerReadRepository.cs ❯ REPLACE-ME
CustomerWriteRepository.cs ❯ REPLACE-ME
ProductImageFile
ProductImageFileReadRepository.cs ❯ REPLACE-ME
ProductImageFileWriteRepository.cs ❯ REPLACE-ME
CompletedOrder
CompletedOrderWriteRepository.cs ❯ REPLACE-ME
CompletedOrderReadRepository.cs ❯ REPLACE-ME
Product
ProductWriteRepository.cs ❯ REPLACE-ME
ProductReadRepository.cs ❯ REPLACE-ME
Endpoint
EndpointWriteRepository.cs ❯ REPLACE-ME
EndpointReadRepository.cs ❯ REPLACE-ME
Order
OrderReadRepository.cs ❯ REPLACE-ME
OrderWriteRepository.cs ❯ REPLACE-ME
Menu
MenuWriteRepository.cs ❯ REPLACE-ME
MenuReadRepository.cs ❯ REPLACE-ME
Basket
BasketWriteRepository.cs ❯ REPLACE-ME
BasketReadRepository.cs ❯ REPLACE-ME
File
FileWriteRepository.cs ❯ REPLACE-ME
FileReadRepository.cs ❯ REPLACE-ME
InvoiceFile
InvoiceFileWriteRepository.cs ❯ REPLACE-ME
InvoiceFileReadRepository.cs ❯ REPLACE-ME
Contexts
ECommerceAPIDbContext.cs ❯ REPLACE-ME
ECommerceAPI.SignalR
ECommerceAPI.SignalR.csproj ❯ REPLACE-ME
ServiceRegistration.cs ❯ REPLACE-ME
RecieveFunctionNames.cs ❯ REPLACE-ME
HubRegistration.cs ❯ REPLACE-ME
Hubs
ProductHub.cs ❯ REPLACE-ME
OrderHub.cs ❯ REPLACE-ME
HubServices
ProductHubService.cs ❯ REPLACE-ME
OrderHubService.cs ❯ REPLACE-ME
ECommerceAPI.Infrastructure
ServiceRegistration.cs ❯ REPLACE-ME
ECommerceAPI.Infrastructure.csproj ❯ REPLACE-ME
Enums
StorageType.cs ❯ REPLACE-ME
Services
MailService.cs ❯ REPLACE-ME
FileService.cs ❯ REPLACE-ME
QRCodeService.cs ❯ REPLACE-ME
Configuration
ApplicationService.cs ❯ REPLACE-ME
Token
TokenHandler.cs ❯ REPLACE-ME
Storage
StorageService.cs ❯ REPLACE-ME
Storage.cs ❯ REPLACE-ME
Azure
AzureStorage.cs ❯ REPLACE-ME
Local
LocalStorage.cs ❯ REPLACE-ME
Filters
ValidationFilter.cs ❯ REPLACE-ME
StaticServices
RenameHelper.cs ❯ REPLACE-ME

Getting Started

Prerequisites

Before getting started with ECommerceAPI, ensure your runtime environment meets the following requirements:

  • Programming Language: CSharp
  • Package Manager: Nuget

Installation

Install ECommerceAPI using one of the following methods:

Build from source:

  1. Clone the ECommerceAPI repository:
❯ git clone https://github.com/Emir-Khan/ECommerceAPI
  1. Navigate to the project directory:
cd ECommerceAPI
  1. Install the project dependencies:  
❯ dotnet restore

Usage

Run ECommerceAPI using the following command:  

❯ dotnet run

Project-Roadmap

  • Task 1: Update to .Net 9.0
  • Task 2: Redis Caching.
  • Task 3: Soft Delete.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages