{"id":30258884,"url":"https://github.com/mscbuild/-e-commerce-app","last_synced_at":"2026-05-13T21:36:25.459Z","repository":{"id":292545301,"uuid":"981227074","full_name":"mscbuild/-e-commerce-app","owner":"mscbuild","description":"🧱Building Ecommerce web application","archived":false,"fork":false,"pushed_at":"2025-08-08T13:18:50.000Z","size":56,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-15T18:03:36.517Z","etag":null,"topics":["core","development","ecommerce","framework","net","payment","postgresql","razor-pages","server","webapp","website"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mscbuild.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-10T16:15:40.000Z","updated_at":"2025-08-08T13:18:53.000Z","dependencies_parsed_at":"2025-05-10T17:37:35.794Z","dependency_job_id":null,"html_url":"https://github.com/mscbuild/-e-commerce-app","commit_stats":null,"previous_names":["mscbuild/-e-commerce-app"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mscbuild/-e-commerce-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscbuild%2F-e-commerce-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscbuild%2F-e-commerce-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscbuild%2F-e-commerce-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscbuild%2F-e-commerce-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mscbuild","download_url":"https://codeload.github.com/mscbuild/-e-commerce-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscbuild%2F-e-commerce-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33001368,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"ssl_error","status_checked_at":"2026-05-13T13:14:51.610Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["core","development","ecommerce","framework","net","payment","postgresql","razor-pages","server","webapp","website"],"created_at":"2025-08-15T17:46:17.687Z","updated_at":"2026-05-13T21:36:25.448Z","avatar_url":"https://github.com/mscbuild.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Building Ecommerce web application with C#\n![](https://komarev.com/ghpvc/?username=mscbuild) \n ![](https://img.shields.io/github/license/mscbuild/e-learning) \n ![](https://img.shields.io/github/repo-size/mscbuild/-e-commerce-app)\n![](https://img.shields.io/badge/PRs-Welcome-green)\n![](https://img.shields.io/badge/code%20style-asp.net-green)\n![](https://img.shields.io/github/stars/mscbuild)\n![](https://img.shields.io/badge/Topic-Github-lighred)\n![](https://img.shields.io/website?url=https%3A%2F%2Fgithub.com%2Fmscbuild)\n\n## 🔧 Core Functional Requirements.\n\n### 1. Product Management.\n \n\u003cli\u003eAdd, update, delete products.\n\n\u003cli\u003eStore product details: name, description, price, SKU, images, category, etc.\n\n\u003cli\u003eDisplay products for customers. \n\n### 2. Inventory Management.\n\n\u003cli\u003eTrack inventory per product.\n\n\u003cli\u003eAdd stock (e.g., when restocking).\n\n\u003cli\u003eSubtract stock when orders are placed (and paid).\n\n\u003cli\u003eOptional: Alert for low inventory levels.\n\n### 3. Customer Management.\n\n\u003cli\u003eRegister and authenticate customers.\n\n\u003cli\u003eStore profile: name, email, phone, shipping address, etc.\n\n\u003cli\u003eAllow customers to update their info.\n\n### 4. Order Management\n\n\u003cli\u003eStore order details: products, quantities, price, customer info, shipping status.\n\n\u003cli\u003eAllow order history viewing for users.\n\n\u003cli\u003eAdmins can manage or update order statuses (e.g., Processing, Shipped, Delivered).\n\n### 5. Shopping Cart \u0026 Checkout\n\n\u003cli\u003eAdd/remove items to/from cart.\n\n\u003cli\u003eShow total cost, taxes, and shipping.\n\n\u003cli\u003eCheckout page with payment and shipping details.\n\n### 6. Payment Processing\n\n\u003cli\u003eIntegrate a payment gateway (e.g., Stripe, PayPal, Square).\n\n\u003cli\u003eSecurely handle payment details (PCI compliance).\n\n\u003cli\u003eConfirm successful/failed transactions and update order status accordingly.\n\n## 📂 Optional (but valuable) Features\n\n\u003cli\u003eUser authentication with JWT/cookies.\n\n\u003cli\u003eProduct search and filtering (by category, price, etc.).\n\n\u003cli\u003ePromo codes or discount system.\n\n\u003cli\u003eEmail confirmation and notifications.\n\n\u003cli\u003eAdmin panel for managing products, customers, and orders.\n\n\u003cli\u003eReviews/ratings system.\n\n## 🧱 Technology Stack Suggestion (C#/.NET Core)\n\n\u003cli\u003eBackend: ASP.NET Core Web API\n\n\u003cli\u003eFrontend: Razor Pages, Blazor, or a JS framework (React, Angular) with API\n\n\u003cli\u003eDatabase: SQL Server or PostgreSQL via Entity Framework Core\n\n\u003cli\u003eAuthentication: ASP.NET Identity or JWT\n\n\u003cli\u003ePayments: Stripe API (easiest to integrate/test)\n\n## 🗂️ Project Structure\n\nAssuming you're building an ASP.NET Core Web API backend, your folder structure might look like this:\n```ruby\n\nEcommerceApp/\n│\n├── Controllers/           → API endpoints (ProductsController, OrdersController, etc.)\n├── Models/                → Data models (Product, Customer, Order, etc.)\n├── Data/                  → DbContext and seed data\n├── DTOs/                  → Data Transfer Objects for requests/responses\n├── Services/              → Business logic (e.g., OrderService, PaymentService)\n├── Repositories/          → Data access layer (optional abstraction)\n├── Migrations/            → EF Core migrations\n├── wwwroot/               → Static files (if applicable)\n├── Program.cs             → App entry point\n└── appsettings.json       → Configuration (connection strings, etc.)\n```\n### 🧩 1. Database Schema\n### 📦 2. Order\n### 📄 3. OrderItem\n### 👤 4. Customer\n### 💳 5. Payment (Optional if using external gateway only)\n### 🔗 6. AppDbContext.cs\n### 🧾 7. ProductsController.cs\n\n# 🧪 Example Test with curl or Postman.\n\n### GET all products\n```ruby\nGET http://localhost:5000/api/products\n```\n### POST new product\n\n```ruby\nPOST http://localhost:5000/api/products\nContent-Type: application/json\n\n{\n    \"name\": \"Laptop\",\n    \"description\": \"High-performance laptop\",\n    \"price\": 1200.00,\n    \"stock\": 15,\n    \"sku\": \"LAP123\",\n    \"imageUrl\": \"https://example.com/laptop.jpg\"\n}\n```\n### 🧩 8. OrderService.cs\n\n# ✅ How to Use OrderService\n\nExample us\n\n```ruby\n[HttpPost(\"create\")]\npublic async Task\u003cIActionResult\u003e CreateOrder(CreateOrderRequest request)\n{\n    var result = await _orderService.CreateOrderAsync(request.CustomerId, request.Items);\n\n    if (!result.Success)\n        return BadRequest(result.Message);\n\n    return Ok(result.Message);\n}\n```\n### DTO\n\n```ruby\npublic class CreateOrderRequest\n{\n    public int CustomerId { get; set; }\n    public List\u003cOrderItemRequest\u003e Items { get; set; }\n}\n\npublic class OrderItemRequest\n{\n    public int ProductId { get; set; }\n    public int Quantity { get; set; }\n}\n```\n# 💳 Step-by-Step: Stripe Integration for\n\n### ✅ 1. Set Up Stripe in Your\n\nInstall the Stripe\n\n```ruby\ndotnet add package Stripe.net\n```\n\nIn `appsettings.json`, add you\n```ruby\n\"Stripe\": {\n  \"SecretKey\": \"sk_test_YourSecretKey\",\n  \"PublishableKey\": \"pk_test_YourPublicKey\"\n}\n```\n### Load Stripe configuration in Program.cs or Startup.cs:\n\n```ruby\nStripeConfiguration.ApiKey = builder.Configuration[\"Stripe:SecretKey\"];\n```\n### 🧾 2. Create a PaymentService\n\nThis will handle creating a Stripe charge (or PaymentIntent for newer APIs):\n  \n### 🎯 3. Payment Controller Endpoint\n\n### 🧪 4. Testing\n\nYou can now POST to /api/payments/create-checkout-session/{orderId} and redirect the user to the returned url\n\n# 📡 Stripe Webhook Integration (Payment Confirmation)\n\n### ✅ 1. Why Use Webhooks?\n\nStripe Checkout redirects users after payment, but the most secure way to confirm payment is by listening to Stripe’s server-side webhooks.\n\n### 🛠️ 2. Add Webhook Endpoint to Your App\n\n\u003e📌 Note: When creating the Checkout Session earlier, you can add Metadata = new Dictionary\u003cstring, string\u003e { { \"order_id\", order.Id.ToString() } } to the SessionCreateOptions.\nStripe Checkout redirects users after payment, but the most secure way to confirm payment is by listening to Stripe’s server-side webhooks.\n\n### 🧪 3. Expose Localhost for Stripe Testing\n\n# ✅ Result\n\n1.Now your app will:\n\n2.Create Stripe Checkout sessions.\n\n3.Send users to Stripe to pay.\n\n4.Listen for successful payments via webhook.\n\n5.Automatically mark the order as “Paid” in your database.\n\n# 🖼️  Basic UI Components\n\n### 📄 Pages/Products.razor\n\n### 🛒 Services/CartService.cs\n\n# 💳 Checkout Page\n\n### 📄 Pages/Checkout.razor\n\n### 🧪 Test Flow\n\n1.Run your backend API and Blazor app\n\n2.Visit /products\n\n3.Add items to cart\n\n4. /checkout\n\n5.Click \"Proceed to Payment\" → redirects to Stripe\n\n6.After successful payment, Stripe webhook marks order as \"Paid\"\n\n# 🚀 Azure Deployment:\n\n✅ Backend (ASP.NET Core Web API)\n\n✅ Frontend\n\n✅ SQL Databas\n\n✅ Stripe Webhooks (via Stripe CLI or Azure F)\n\n# 🚀 GitHub Ac\n\n🧭 Y\n\n✅ Automatic build and test on each push\n\n✅ Publish to Azure App Servi (API and Blazor)\n\n### 🔧 Step 1: Prep Your Azure App Services\n\n### 🔑 Step 2: Create Azure Deployment Credentials\n\n### 📁 Step 3: Create GitHub Workflow Files\n\n### 🔐 Step 4: Add Secrets to GitHub\n\n### 🧪 Step 5: Test CI/CD\n\n# ✅ Result\n\nEvery time you push changes:\n\n\u003cli\u003eAPI and frontend are built\n\n\u003cli\u003eDeployed automatically to Azure App Services\n\n\u003cli\u003eNo manual steps needed\n\n### Perfect — you're now fully set up with:\n\n✅ A C# e-commerce backend (API)\n\n✅ A Blazor Server frontend\n\n✅ Stripe payment + webhook handling\n\n✅ Azure SQL integration\n\n✅ Fully automated CI/CD via GitHub Actions\n\nThis stack is solid for portfolio use, production trials, or job interviews.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmscbuild%2F-e-commerce-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmscbuild%2F-e-commerce-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmscbuild%2F-e-commerce-app/lists"}