Skip to main content

Posts

Showing posts from July, 2024

๐Ÿš€Master User Authentication in .NET 8 Web API Email Confirmation, Password Reset, 2FA & Lockout with JWT & Identity๐Ÿ”

Part 4️⃣ - JWT Authentication API |๐Ÿ›’ Build .NET 8 eCommerce Microservice ๐Ÿš€with API Gateway, Rate Limiting, Caching & more ๐Ÿงบ

Entity Description - AppUser AppUser Class Description The AppUser class represents a user in the application, encapsulating various properties related to user identity, contact information, and roles. Here’s a detailed breakdown of each property: Id Type : int Description : A unique identifier for the user. Name Type : string? Description : The user's name. It is nullable, allowing the possibility of no name being provided. TelephoneNumber Type : string? Description : The user's telephone number. It is nullable. Address Type : string? Description : The user's physical address. It is nullable. Email Type : string? Description : The user's email address. It is nullable. Password Type : string? Description : The user's password for authentication. It is nullable. Role Type : string? Description : The role assigned to the user (e.g., Admin, User). It is nullable. DateRegistered Type : DateTime Description : The date and time when the user registered. It defaults to th

Part 3️⃣ - Order API |๐Ÿ›’ Build .NET 8 eCommerce Microservice ๐Ÿš€with API Gateway, Rate Limiting, Caching & more ๐Ÿงบ

Domain Layer Order Entity The Order entity represents an order within the e-commerce system. It captures essential details related to a customer's purchase and is a core component of the Order API. Properties Id : Type: int Description: Unique identifier for the order. This serves as the primary key in the database. ProductId : Type: int Description: Identifier for the product associated with the order. This links the order to a specific product in the Product API. ClientId : Type: int Description: Identifier for the client who placed the order. This associates the order with a specific customer. PurchaseQuantity : Type: int Description: The quantity of the product purchased in the order. OrderedDate : Type: DateTime Description: The date and time when the order was placed. Defaults to the current UTC time when the order is created. Summary The Order entity is a crucial part of the Order API, encapsulating the data required to manage and process customer orders. It link

Part 2️⃣ - Product API |๐Ÿ›’ Build .NET 8 eCommerce Microservice ๐Ÿš€with API Gateway, Rate Limiting, Caching & more ๐Ÿงบ

๐Ÿ›’ Build .NET 8 eCommerce Microservice ๐Ÿš€with API Gateway, Rate Limiting, Caching & more ๐Ÿงบ - [Part 2️⃣] Product Description This code defines the Product class within the ProductApi.Domain.Entities namespace. The Product class represents a product entity with properties commonly associated with products in an e-commerce application. Features Id : Represents the unique identifier for the product. It is an integer property and serves as the primary key for the product entity. Name : Represents the name of the product. It is a nullable string property, allowing the product name to be optional. Price : Represents the price of the product. It is a decimal property, ensuring accurate representation of the product's cost, including fractions of currency units. Quantity : Represents the quantity of the product available in stock. It is an integer property, indicating the number of units of the product that are available. Usage Data Representation : The Product class is used to rep

Part 1️⃣ - Common Shared Library |๐Ÿ›’ Build .NET 8 eCommerce Microservice ๐Ÿš€with API Gateway, Rate Limiting, Caching & more ๐Ÿงบ

RESPONSE This code defines a C# record named Response with two properties: Flag , a boolean initialized to false , and Message , a string that defaults to null . Records in C# are immutable reference types that provide built-in functionality for value equality and concise syntax for defining data containers. GLOBAL EXCEPTION This code defines a middleware class named GlobalException for handling exceptions and specific HTTP response statuses in an ASP.NET Core application. The middleware checks for and modifies responses with status codes 401 (Unauthorized), 403 (Forbidden), and 429 (Too Many Requests). It also handles internal server errors and request timeouts by logging the exceptions and sending user-friendly error messages in JSON format. Key components of this middleware include: Dependencies : Uses Microsoft.AspNetCore.Http , Microsoft.AspNetCore.Mvc , System.Net , and System.Text.Json . Constructor : Takes a RequestDele

Ready to Scale? ๐Ÿš€ Build & Run Your .NET Web API in Kubernetes with Docker! ๐Ÿณ Learn How Today

Ready to Scale? ๐Ÿš€ Build & Run Your .NET Web API in Kubernetes with Docker! ๐Ÿณ Learn How Today! Introduction Hello, Netcode-Hub community! ๐Ÿ‘‹ Frederick is here with another exciting lesson for you, we're diving into the world of Kubernetes and Docker, specifically focusing on how to build and run your .NET Web API application in Kubernetes using Docker. If you've been using Docker Compose to manage your containerized applications, you're already familiar with the convenience it brings. However, as your applications grow and require more advanced orchestration capabilities, Kubernetes becomes a powerful ally. In this section, I'll walk you through why you should consider Kubernetes over Docker Compose for orchestrating your applications, and we'll set up a practical scenario to highlight the benefits of using Kubernetes. Why Choose Kubernetes Over Docker Compose? Kubernetes and Docker Compose both serve the purpose of managing containerized applicati