Welcome to the E-commerce API, a robust and scalable solution built using ASP.NET Core. This API provides comprehensive functionalities for managing products, categories, user authentication, orders, reviews, shopping carts, customers, and inventory, making it an ideal backbone for any online retail platform.
- Features
- Technologies Used
- Prerequisites
- Getting Started
- Configuration
- API Versioning
- Authentication
- API Documentation
- Contributing
- License
- Contact
- Category Management: Create, update, delete, and list product categories.
- Product Management: Add, update, delete, and retrieve product details.
- Order Management: Place, cancel, and get order details.
- Review Management: Add, update, delete, and list product reviews.
- Shopping Cart Management: Add, update, and remove items from the shopping cart.
- Customer Management: Edit and view customer details.
- Inventory Management: Retrieve and update inventory information.
- User Authentication: Register, login, change password, reset password, confirm email, and resend email confirmation with JWT authentication.
- Rate Limiting: Protect your API with configurable rate limiting.
- Exception Handling: Centralized exception handling for consistent error responses.
- Swagger Integration: Comprehensive API documentation with Swagger UI.
- .NET 8.0
- ASP.NET Core
- Entity Framework Core
- MediatR
- FluentResults
- FluentValidation
- Swashbuckle (Swagger)
- Azure Communication Email
- SQL Server
Before you begin, ensure you have met the following requirements:
- .NET 8 SDK: Download Here
- SQL Server: Download Here
Follow these steps to set up the project on your local machine.
git clone https://github.com/DotNetTitan/e-commerce.git
cd e-commerce
dotnet restore
-
Navigate to the
src
directory:cd src
-
Add the initial migration:
dotnet ef migrations add InitDatabase --project Ecommerce.Infrastructure -s Ecommerce.Api -c ApplicationDbContext
-
Update the database:
dotnet ef database update --project Ecommerce.Infrastructure -s Ecommerce.Api -c ApplicationDbContext
dotnet run --project src/Ecommerce.Api
The API will be available at https://localhost:7045
and http://localhost:33251
.
The application settings are configured based on the environment. The following files are used:
appsettings.json
appsettings.{Environment}.json
- User secrets (optional)
Ensure to update these files with your specific settings, such as database connection strings, JWT settings, and email configurations.
The API supports versioning to manage changes efficiently. The default API version is 1.0
. You can specify the version in the URL or use the default version.
The API uses JWT Bearer Tokens for authentication. Secure endpoints require a valid JWT token. Follow the authentication endpoints to register and obtain tokens.
Interactive API documentation is available via Swagger UI. Once the application is running, navigate to:
https://localhost:7045/swagger
Here, you can explore and test the API endpoints directly from your browser.
Contributions are welcome! Please follow these steps to contribute:
-
Fork the Repository
-
Create a Feature Branch
git checkout -b feature/YourFeature
-
Commit Your Changes
git commit -m "Add some feature"
-
Push to the Branch
git push origin feature/YourFeature
-
Open a Pull Request
Please read the contributing guidelines for more details.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or suggestions, feel free to reach out:
- GitHub: DotNetTitan
✨ Happy Coding!