Skip to content

nikodevv13/e-commerce

Repository files navigation

e-commerce

School e-commerce system project

Available features:

  • Users (authentication and authorization by JWT):
    • Register user
    • Login user
    • Refresh tokens(access and refresh)
    • Change user email(used to log in)
  • Customers:
    • Register customer (allowed for registered user)
    • managing address book (max. 3 addresses)
    • managing wishlist (max. 10 products)
  • Products:
    • CRUD
    • setting sale data (price, quantity, is active)
  • CRUD for categories
  • Orders:
    • Placing order (by registered and logged in customers)
    • setting order status (for admin)
    • changing order line product quantity (for admin)
    • changing delivery address (for admin)
    • setting delivery tracking number (for admin)

Tech stack

Onion Architecture

  • ApplicationCore
    • Place for data-centric entities
    • Implementation of commands and queries as use cases
    • Application services interfaces, i.a. UserContextProvider
  • Infrastructure
    • Implements application services
    • Provides logging, database access
  • API
    • Provides HTTP endpoints
    • Interacts with application layer
    • Implements application services

Moreover

  • The idea of using repository pattern with EF in most cases is just bad so we use DbSet<TEntity> as repositories in interface IAppDbContext in application layers which is implemented in infrastructure layer using provider for SQL Server.
  • We do not use result types or similar to handle success or failure in commands or queries. C# is a language where errors are handled using exception mechanism so we use it to manage failures using ExceptionMiddleware in API layer.
  • We do not use mapper libraries (e.g. AutoMapper) because that may hurt performance. We use record with static methods to map entities to read models or request to commands.
  • For authentication and authorization we use JWT tokens. Permissions are not stored in token for better security and always checked by middleware.
  • We do not use MVC Controllers for mapping endpoints because we believe that minimal apis are more performant and better for maintaining.

Swagger (API endpoints):

swagger-1.png swagger-2.png swagger-3.png

About

School e-commerce system project.

Resources

Stars

Watchers

Forks

Contributors

Languages