An e-commerce web application built with C# and ASP.NET Core, designed as a Modular Monolith following Clean Architecture principles, with logically separated read/write operations (CQS).
- Modular Monolith — each module owns its Domain and Application layers, fully independent of Infrastructure.
- Clean Architecture — dependencies point inward; Infrastructure is replaceable.
- CQS — read and write operations are logically separated.
- Modular DbContexts — each module manages its own EF Core
DbContext. - Cross-module communication happens in the Application layer.
- UI with Razor Pages, Cookie-Based Authentication, and Role-Based Authorization.
| Module | Responsibility |
|---|---|
| AccountManagement | Registration, authentication, and role management |
| ShopManagement | Products, categories, brands, and product images |
| InventoryManagement | Stock tracking and warehouse operations |
| DiscountManagement | Pricing strategies and discount codes |
| BlogManagement | Articles and content management |
| CommentManagement | User comments and moderation |
- Language: C#
- Framework: ASP.NET Core (Razor Pages)
- ORM: Entity Framework Core
- Database: PostgreSQL
- Architecture & Patterns: Modular Monolith, Clean Architecture, CQS, SOLID
- Authentication: Cookie-Based Authentication, Role-Based Authorization
- Containerization: Docker & Docker Compose
- CI/CD: GitHub Actions (Build → Push → Auto-Deploy)
- Create a
.envfile from.env.exampleand set your PostgreSQL credentials. - Run
docker compose up -d. - Open
http://localhost:8080.
- Set up PostgreSQL and update the connection string in
appsettings.Development.json. - Run
dotnet run --project ServiceHost.
A GitHub Actions pipeline (.github/workflows/ci-cd.yml) runs on every push to main:
- Build & Push — builds the Docker image and pushes it to Docker Hub.
- Deploy — copies
docker-compose.prod.ymlto the server over SSH and runsdocker compose up -d.
Required secrets: DOCKER_USERNAME, DOCKER_PASSWORD, SERVER_IP, SERVER_USERNAME, SERVER_SSH_KEY.
In production, an Nginx reverse proxy (configured via nginx.conf in this repository,
running as a separate stack on the server) forwards incoming HTTP traffic to the app
container through the external shared_network.
Note: the server must already have the
.envfile,init.sql, and the externalshared_networkcreated before the first deployment. `