A modular e-commerce web application built with ASP.NET Core (.NET 10), Clean Architecture, and PostgreSQL.
It includes an admin panel, product management, shopping cart, orders, payments, blog system, and background jobs.
- ASP.NET Core (.NET 10)
- Entity Framework Core 10
- PostgreSQL (Npgsql)
- Clean Architecture
- Cookie Authentication (Role-based Authorization)
- Hangfire (Background Jobs)
- Swagger (API Documentation)
- Clean Architecture (Domain / Application / Infrastructure / Presentation)
- Admin panel (Products, Categories, Blog, Users)
- Role-based authentication & authorization
- Shopping cart system
- Order & payment system (ZarinPal / IDPay integration)
- Background jobs with Hangfire
- Blog system with SEO-friendly routing
- Pagination, search, and filtering
Shop/
βββ EndPoint.Site (Presentation Layer)
β βββ Controllers
β βββ Areas (Admin)
β βββ Views
β βββ wwwroot
β βββ ViewComponents
β βββ Models
β βββ RestApis
β
βββ Shop.Application
β βββ Dtos
β βββ Interfaces
β βββ Services
β
βββ Shop.Domain
β βββ Entities
β
βββ Shop.Infrastructure
β βββ Contexts
β βββ Migrations
β βββ Persistence
β
βββ Shop.Common
β βββ Helpers
β βββ Roles
β βββ Utilities
Infrastructure layer contains implementations for external dependencies such as database access (EF Core) and third-party services.
git clone <repo-url>
cd ShopUpdate connection string in appsettings.json:
"ConnectionStrings": {
"DefaultConnection": "YOUR_CONNECTION_STRING"
}Update connection string in EndPoint.Site/Program.cs:
Host=127.0.0.1;Port=5432;Database=ShopDB;Username=postgres;Password=123456dotnet tool install --global dotnet-efdotnet ef database update \
--project Shop.Infrastructure \
--startup-project EndPoint.Site \
--context DataBaseContextdotnet run --project EndPoint.Site-
Cookie-based authentication
-
Role-based policies:
- Admin
- Operator
- Customer
- Author
Configured in Program.cs
This project follows Clean Architecture:
- Core entities and business rules
- DTOs, interfaces, services, business logic
- EF Core DbContext
- Database access
- Migrations
- ASP.NET Core MVC UI
- Controllers / Views / REST APIs
- Dependency Injection setup
- Shared helpers, roles, DTO utilities
This project demonstrates:
- Clean Architecture in ASP.NET Core
- Scalable e-commerce backend design
- Integration with payment gateways
- Background job processing using Hangfire
- Docker support
- Unit & Integration tests
- CI/CD pipeline (GitHub Actions)
- Caching (Redis)
- Migrations must be executed from Infrastructure project
- Startup project is EndPoint.Site
- DbContext is located in Shop.Infrastructure
- Use EF CLI instead of Add-Migration in PowerShell
git clone <repo-url>
cd Shop
dotnet ef database update --project Shop.Infrastructure --startup-project EndPoint.Site
dotnet run --project EndPoint.Site
---
## π License
MIT License