Skip to content

A maintainable bookstore API built with ASP.NET Core and N-Layer Architecture, featuring JWT authentication, EF Core, and SOLID principles.

Notifications You must be signed in to change notification settings

sinanganiz/bookstore-ecommerce-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BookStore E-Commerce API

A robust and scalable e-commerce API built with .NET 9, implementing modern software architecture principles and best practices.

🏗 Architecture

This project follows a clean, maintainable, and scalable N-Layer Architecture:

BookStore.API (Presentation Layer)
    ↓
BookStore.Business (Business Layer)
    ↓
BookStore.Data (Data Access Layer)

Key Architectural Features

  • Clean Architecture principles
  • Domain-Driven Design (DDD) approach
  • Repository Pattern for data access abstraction
  • SOLID Principles implementation
  • Dependency Injection for loose coupling

🛠 Technologies & Tools

  • .NET 9
  • Entity Framework Core 9.0
  • SQL Server
  • AutoMapper for object mapping
  • JWT Authentication
  • Identity Framework for user management
  • Swagger/OpenAPI for API documentation
  • CORS configuration for cross-origin requests

🏢 Project Structure

BookStore.API

  • RESTful API endpoints
  • JWT authentication
  • Swagger documentation
  • CORS configuration

BookStore.Business

  • Business logic implementation
  • DTOs (Data Transfer Objects)
  • AutoMapper profiles
  • Service implementations
  • Business rules and validations

BookStore.Data

  • Entity Framework Core configurations
  • Entity models
  • Repository implementations
  • Database context
  • Migrations

🔑 Key Features

  • User authentication and authorization
  • Book and Category management
  • Shopping cart functionality
  • Order processing
  • Role-based access control

🎯 Best Practices Implemented

  • Clean Code principles
  • SOLID principles
  • DRY (Don't Repeat Yourself)
  • Interface Segregation
  • Dependency Inversion
  • Repository Pattern
  • DTO Pattern

📚 Main API Endpoints

Authentication

  • POST /api/auth/register - Register
  • POST /api/auth/login - Login

Books

  • GET /api/book/list - List books
  • GET /api/book/get/{id} - Get specific book
  • POST /api/book/create - Add new book (Admin)
  • PUT /api/book/update/{id} - Update book (Admin)
  • DELETE /api/book/delete/{id} - Delete book (Admin)

Categories

  • GET /api/category/list - List categories
  • GET /api/category/get/{id} - Get specific category
  • POST /api/category/create - Add new categoy (Admin)
  • PUT /api/category/update/{id} - Update category (Admin)
  • DELETE /api/category/delete/{id} - Delete category (Admin)

Shopping Cart

  • GET /api/cart - Get user's cart
  • POST /api/cart/add - Add item to cart
  • PUT /api/cart/items/{id} - Update item in cart
  • DELETE /api/cart/items/{id} - Delete item from cart
  • DELETE /api/cart - Clear cart

Orders

  • POST /api/order - Add new order
  • GET /api/order/my-orders - Get user's orders
  • GET /api/order/{id} - Get order details
  • PUT /api/order/{id}/status - Update order's status
  • PUT /api/order/{id}/payment - Update order's payment status
  • POST /api/order/{id}/cancel - Cancel order

About

A maintainable bookstore API built with ASP.NET Core and N-Layer Architecture, featuring JWT authentication, EF Core, and SOLID principles.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages