How byseif21/depi-e-commerce-.net-project works
1. Overall shape
Styleza is a classic ASP.NET Core MVC (.NET 8) monolith for e-commerce. The runtime path is: browser requests hit MVC controllers, controllers use EF Core/Identity-backed services and models, then render Razor views with Bootstrap-based static assets.
2. Presentation layer
UI lives in Views/ plus Areas/Identity/Pages/ for auth UI. Shared layout and reusable fragments are centralized in Views/Shared/ (_Layout, _LoginPartial, _ProductCard, _Footer, loader/error partials). Styling and client behavior are split across feature-specific files in wwwroot/css and wwwroot/js.
3. Application boundaries by controller
The main functional boundaries are the controllers: Home, Products, Category, Cart, Order, Account, and Admin. Each controller maps to a dedicated view folder, which makes the app organized by business capability rather than by technical layer.
4. Identity and user account flow
Authentication is built on ASP.NET Core Identity. The repo includes the Identity area plus custom account views and models for login, registration, password reset, confirmation, and lockout. AccountController likely wraps or extends these flows, while Services/EmailSender.cs supports confirmation/reset email delivery.
5. Catalog domain and data model
The product catalog is modeled in Models/Product, Category, SubCategory, and ProductImage. These objects form the core browse/search/shop experience and are likely the main data shape returned to ProductsController, CategoryController, and the home page.
6. Shopping cart and wishlist flow
Cart, CartItem, and Wishlist are separate domain objects, indicating user-specific shopping state. CartController and Views/Home/Wishlist.cshtml suggest a flow where users add products from catalog views, manage quantities/items in the cart, and persist or display wishlist state.
7. Order and checkout flow
Orders are modeled explicitly with Order and OrderItem. The checkout UI is split into Views/Checkout/Checkout.cshtml and OrderConfirmation.cshtml, so the data flow is: cart contents are converted into an order, order items are stored, then the confirmation view summarizes the result.
8. Admin subsystem
AdminController and the Views/Admin/ folder form a separate management boundary for back-office tasks: product CRUD, category CRUD, user management, order management, and order details. This is the main operational surface for staff rather than customers.
9. Persistence layer
Data/ApplicationDbContext.cs is the EF Core persistence boundary. It likely maps all ecommerce entities plus Identity tables to SQL Server, with Data/DbSeeder.cs providing initial data or bootstrapping for categories, products, users, or order-related reference data.
10. View models and form models
The Models/ folder also contains request/view models such as LoginModel, RegisterModel, ForgotPasswordModel, ResetPasswordModel, ContactFormModel, and ShopViewModel. These indicate the app avoids binding UI directly to persistence entities when a screen needs tailored input or aggregated data.
11. Reusable server-side helpers
Extensions/ControllerExtensions.cs suggests shared controller helper behavior, likely for consistent redirects, notifications, or user/context access. This is a small cross-cutting layer rather than a separate subsystem.
12. Static frontend assets and behavior
wwwroot/ contains the app’s full client-side footprint: Bootstrap libraries, page-specific CSS, and JavaScript for cart, wishlist, validation, loader behavior, and shop interactions. This means the UI is mostly server-rendered, with lightweight enhancement scripts rather than a SPA frontend.
13. Configuration and environment
Program.cs is the composition root where MVC, Identity, EF Core, and services are wired together. Connection settings live in appsettings.json, and the presence of launchSettings.json plus serviceDependencies files indicates local environment and deployment configuration are part of the project setup.
14. Non-runtime repo artifacts
ecommerce_data/ contains spreadsheet files that look like seed/reference datasets for carts, products, orders, users, and shipping methods. They are not part of the app’s request flow, but they likely support data preparation, import, or presentation/demo material.
15. External/automation boundary
.github/workflows/label-pr.yml is the only visible CI automation and is focused on PR labeling, not build/deploy. It does not affect runtime architecture, but it shows the repo uses GitHub-based collaboration conventions.
Main entry points: Program.cs Program · AdminController.cs Admin · ProductsController.cs Products · AccountController.cs Account
Components 22
Presentation
MVC views, Razor pages, and static assets
- Shared Views · Layout, header/footer, login partial, product card, loader, and validation partials
Views/Shared/_Layout.cshtml - Account Views · Login, registration, password recovery, and lockout UI
Views/Account/Login.cshtml - Storefront Views · Home, products, cart, checkout, and policy pages
Views/Home/Index.cshtml - Admin Views · Back-office management screens for catalog and orders
Views/Admin/Index.cshtml - Identity Area · Identity UI area used for auth-related pages
Areas/Identity/Pages/_ViewStart.cshtml - Static Assets · Feature CSS, client scripts, and bundled libraries
wwwroot/css/global.css
Application
Controllers, services, and cross-cutting helpers
- Program · Wires MVC, Identity, EF Core, and services
Program.cs - Email Sender · Sends account confirmation and reset emails
Services/EmailSender.cs - Controller Ext · Shared controller-side helper behavior
Extensions/ControllerExtensions.cs - Home · Landing pages, content pages, and wishlist entry points
Controllers/HomeController.cs - Products · Browse, shop, and product preview flows
Controllers/ProductsController.cs - Category · Category browsing and navigation
Controllers/CategoryController.cs - Cart · Cart management and quantity updates
Controllers/CartController.cs - Order · Checkout, order creation, and confirmation
Controllers/OrderController.cs - Account · Custom authentication and account flows
Controllers/AccountController.cs - Admin · Management surface for products, categories, users, and orders
Controllers/AdminController.cs
Domain
E-commerce entities and view models
- Catalog Models · Products, categories, subcategories, and images
Models/Product.cs - Commerce Models · Cart, wishlist, orders, and order items
Models/Cart.cs - Auth Models · Login, register, reset, and contact form models
Models/LoginModel.cs - Shop VM · Aggregated data for shop and browsing screens
Models/ShopViewModel.cs
Connections 30
- Program → App Db: configures · Registers EF Core persistence
- Program → Email Sender: registers · Adds email delivery support
- Program → Controller Ext: uses · Shares common controller helpers
- Program → Home: hosts · Enables MVC request routing
- Program → Products: hosts · Enables MVC request routing
- Program → Cart: hosts · Enables MVC request routing
- Program → Order: hosts · Enables MVC request routing
- Program → Account: hosts · Enables MVC request routing
- Program → Admin: hosts · Enables MVC request routing
- Home → Catalog Models: reads · Composes landing and browse content
- Products → Catalog Models: reads · Builds product browsing and preview screens
- Category → Catalog Models: reads · Uses category and subcategory data
- Cart → Commerce Models: updates · Manages cart state and line items
- Order → Commerce Models: creates · Converts cart content into orders
- Account → Auth Models: binds · Handles login and recovery forms
- Admin → Catalog Models: manages · CRUD over products and categories
- Admin → Commerce Models: manages · Views and processes orders
- Admin → App Db: persists · Reads and writes admin data
- Home → Shared Views: renders · Uses shared layout and partials
- Products → Storefront Views: renders · Uses shop and product pages
- Cart → Storefront Views: renders · Uses cart UI
- Order → Storefront Views: renders · Uses checkout and confirmation pages
- Account → Account Views: renders · Uses custom auth pages
- Admin → Admin Views: renders · Uses management pages
- Identity Area → Account: complements · Identity UI supports account flows
- Storefront Views → Static Assets: uses · Loads site CSS and scripts
- Admin Views → Static Assets: uses · Loads admin styles and scripts
- Shared Views → Static Assets: uses · Shared layout and components depend on assets
- Seeder → App Db: seeds · Initializes persistent data
- Shop VM → Products: shapes · Backs shop browsing responses