Skip to content

DotNetTitan/e-commerce

Repository files navigation

E-commerce API

License .NET Build

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.

🚀 Table of Contents

🎯 Features

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

🛠 Technologies Used

  • .NET 8.0
  • ASP.NET Core
  • Entity Framework Core
  • MediatR
  • FluentResults
  • FluentValidation
  • Swashbuckle (Swagger)
  • Azure Communication Email
  • SQL Server

📋 Prerequisites

Before you begin, ensure you have met the following requirements:

🚀 Getting Started

Follow these steps to set up the project on your local machine.

Clone the Repository

git clone https://github.com/DotNetTitan/e-commerce.git
cd e-commerce

Install Dependencies

dotnet restore

Set Up the Database

  1. Navigate to the src directory:

    cd src
  2. Add the initial migration:

    dotnet ef migrations add InitDatabase --project Ecommerce.Infrastructure -s Ecommerce.Api -c ApplicationDbContext
  3. Update the database:

    dotnet ef database update --project Ecommerce.Infrastructure -s Ecommerce.Api -c ApplicationDbContext

Run the Application

dotnet run --project src/Ecommerce.Api

The API will be available at https://localhost:7045 and http://localhost:33251.

⚙️ Configuration

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.

📚 API Versioning

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.

🔒 Authentication

The API uses JWT Bearer Tokens for authentication. Secure endpoints require a valid JWT token. Follow the authentication endpoints to register and obtain tokens.

📄 API Documentation

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.

🤝 Contributing

Contributions are welcome! Please follow these steps to contribute:

  1. Fork the Repository

  2. Create a Feature Branch

    git checkout -b feature/YourFeature
  3. Commit Your Changes

    git commit -m "Add some feature"
  4. Push to the Branch

    git push origin feature/YourFeature
  5. Open a Pull Request

Please read the contributing guidelines for more details.

📝 License

This project is licensed under the MIT License. See the LICENSE file for details.

📧 Contact

For any questions or suggestions, feel free to reach out:


Happy Coding!

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages