How arifshn/dotnetstore works
Project Type and Purpose
• DotnetStore is a monolithic, ASP.NET Core 9.0 MVC e-commerce web application with an admin panel and built-in authentication/authorization.
• Users browse products, add to cart, checkout, and review; admins manage products, categories, orders, and reviews.
• A future Angular-based SPA front end and a REST API (DotnetStoreApi) are in progress.
File Structure
• Controllers (AccountController, CartController, OrderController, AdminController, etc.) implement HTTP endpoints.
• Views & ViewComponents render Razor pages.
• Services (CartService, FavoriteService, SmtpEmailService) contain business logic.
• Data folder has EF Core entities, ApplicationDbContext, Entities (Urun, Kategori, Cart, Order, Review), ASP.NET Identity models (AppUser, AppRole), and migrations.
• Models folder holds request/response DTOs.
• wwwroot serves static assets (CSS, JS, Bootstrap, jQuery).
• Program.cs / appsettings*.json configure DI, middleware, EF Core, Identity, SMTP.
Key Insights from README
• ASP.NET Core MVC layered architecture (Presentation → Business → Data).
• SQL Server 2019 as the relational store.
• External SMTP email service for notifications and password resets.
• Upcoming Angular 19 front end with REST API endpoints.
Main Components
a. Presentation Layer
– Client browsers (desktop/mobile) with HTTP/TLS requests.
– (Future) Angular SPA calling REST API endpoints.
– Current Razor Views + ViewComponents served from ASP.NET MVC.
b. Web Application
– Controllers (Account, Home, Urun, Cart, Order, Admin, etc.).
– Services (business logic): CartService, FavoriteService, SmtpEmailService, etc.
– Dependency Injection container (configured in Program.cs).
c. Data Layer
– EF Core DbContext (DataContext) → SQL Server database.
– Migrations manage schema.
d. Authentication/Authorization
– ASP.NET Core Identity (AppUser, AppRole).
e. External Services
– SMTP Email server.
– (Optional) Payment gateway if added later.
f. Static Asset Server
– wwwroot (CSS, JS, images, Bootstrap, jQuery).
Relationships & Data Flow
1. Client → HTTP GET/POST → ASP.NET Core MVC middleware (Program.cs).
2. Middleware → Router → Controller Action.
3. Controller uses injected Services for business operations.
4. Services call DataContext (EF Core) → SQL Server (CRUD).
5. Controller returns a ViewModel → Razor View / JSON (for REST API).
6. (Optional) SmtpEmailService uses SMTP to send emails.
7. Static files served directly from wwwroot.
Architectural Patterns & Principles
• Layered Architecture (Separation of Concerns: Presentation, Business, Data).
• MVC pattern in the web layer.
• Dependency Injection for loose coupling.
• Repository-style data access via EF Core DbContext.
• DTOs/ViewModels isolate domain entities from views/API.
Essential Elements to Capture
• Presentation: Razor Views / Angular SPA (future)
• Controllers & Routing
• Service Layer (business logic)
• Data Layer & Migrations
• Authentication/Authorization (ASP.NET Identity)
• Static Assets (wwwroot)
• External SMTP Email service