How aakku106/kuramacart works
Project Type and Purpose
• KuramaCart (“OnlineStore” folder) is a single-page application (SPA) built with Blazor (.NET 9.0).
• Purpose: Provide an interactive, responsive online shopping UI with product browsing, cart management, and notification features.
• No separate backend API or database layer is yet implemented; state is managed in-memory via C# services.
File Structure
• Top-level “OnlineStore” directory contains:
• Components/ (UI components and pages)
• Data/ (state containers: CartData.cs, ProductData.cs, UserData.cs)
• Models/ (domain models: Product, Cart, User, Admin)
• Services/ (business logic: ProductServices, UserServices)
• wwwroot/ (static assets: CSS, images, sounds)
• Program.cs & OnlineStore.csproj (application bootstrap & dependency injection)
• appsettings.json & launchSettings.json (configuration & launch profiles)
README for Insights
• Tech stack: Blazor (Frontend), C# components, CSS/Bootstrap for styling, no explicit database.
• Features: categorized pages (Beauty, Kitchen, Clothing), real-time cart updates, search, notifications.
• Future enhancements: suggests adding authentication, order processing, payment integration, reviews.
Main Components
a. Client Browser
• Hosts the Blazor application (WASM or Server).
b. Blazor App Shell
• App.razor → Routes.razor → Layouts (MainLayout, EmptyLayout) → NavBar
c. Pages & UI Components
• Home, Beauty, Kitchen, Cloths, Cart, LoginPage, Error, PageNotFound
d. State Containers (Data)
• CartData, ProductData, UserData injected via DI
e. Business Services
• ProductServices, UserServices
f. Domain Models
• Product, Cart, User, Admin
g. Static Resources
• wwwroot (CSS, images, sounds)
h. Configuration & Startup
• Program.cs sets up routing, DI, and configuration (appsettings.json)
Relationships & Interactions
• User Actions in the Browser → trigger UI Component Events
• UI Components call Injected Services (e.g., ProductServices.AddToCart)
• Services manipulate Data objects (CartData, ProductData)
• Data objects update bound UI via Blazor’s reactivity (StateHasChanged)
• UI triggers Toast notifications on Data changes
• Static assets served directly from wwwroot
Architectural Patterns & Principles
• Component-based UI (Blazor components with .razor files)
• Dependency Injection for Services and Data state
• Separation of Concerns:
• UI Components handle rendering and user interaction
• Services contain business logic
• Data classes manage in-memory state
• Models define the domain entities
• Single Responsibility: each folder/subsystem has a clear role
2. Under it, place a large container labeled “Blazor App Shell” containing:
• App.razor → Routes.razor → Layouts (MainLayout, NavBar)
• Services (ProductServices, UserServices)
• Data (CartData, ProductData, UserData)
6. At the bottom, show Infrastructure:
• Static Assets (wwwroot: CSS, images, sounds)
• Configuration (appsettings.json, launchSettings.json)