This project is for learning purposes only. It is not intended to be used in production. It implements API endpoints for a simple e-commerce application, including authentication and authorization, product management, and order management.
- Clone the repository:
git clone https://github.com/khoa288/ecommerce-web-api.git
-
Open the
EcommerceWebApi.sln
solution file in Visual Studio. Make sure you have installed the .NET 6.0 SDK. -
Run the application:
dotnet run
- Authentication and authorization using JWT and refresh tokens
- Time-based OTP for two-factor authentication
- Using JSON flat file as database
- Support transaction for database operations
- Pagination, sorting and filtering for API endpoints
- Real-time notification using SignalR
- Logging to file using Serilog
- Using Dependency Injection for services, Repositories and Unit of Work patterns for data access
- POST
/register
- POST
/login
- POST
/loginSecondFactor
- DELETE
/revokeToken
- GET
/isAuthenticated
- GET
/getQrCode
- POST
/validateTotp
- GET
/getUsers
- GET
/getUserInfo
- POST
/updateUser
- POST
/changeUserPassword
- POST
/changeUserTwoFactorStatus
- DELETE
/deleteUser
- GET
/getProducts
- GET
/getProductById/{id}
- POST
/insertProduct
- PUT
/updateProduct
- DELETE
/deleteProduct/{id}
- GET
/getOrders
- GET
/getOrderById/{id}
- POST
/insertOrder
- PUT
/updateOrderStatus/{id}
- DELETE
/deleteOrder/{id}