<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Bishesh Dhiman on Medium]]></title>
        <description><![CDATA[Stories by Bishesh Dhiman on Medium]]></description>
        <link>https://medium.com/@bisheshdhiman5514?source=rss-94bab91a8562------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*juLEKuwyxu5LMI-g</url>
            <title>Stories by Bishesh Dhiman on Medium</title>
            <link>https://medium.com/@bisheshdhiman5514?source=rss-94bab91a8562------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 04:53:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bisheshdhiman5514/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Memory Caching in ASP.NET Core: A Complete Guide to In-Memory Cache and Redis Cache]]></title>
            <link>https://medium.com/@bisheshdhiman5514/memory-caching-in-asp-net-core-a-complete-guide-to-in-memory-cache-and-redis-cache-67a292b57526?source=rss-94bab91a8562------2</link>
            <guid isPermaLink="false">https://medium.com/p/67a292b57526</guid>
            <category><![CDATA[dotnet-core]]></category>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Bishesh Dhiman]]></dc:creator>
            <pubDate>Wed, 03 Jun 2026 16:45:18 GMT</pubDate>
            <atom:updated>2026-06-03T16:45:18.198Z</atom:updated>
            <content:encoded><![CDATA[<p>Performance is one of the most important factors in modern web applications. Users expect applications to respond instantly, regardless of the amount of data being processed behind the scenes.</p><p>However, many applications repeatedly execute the same database queries or API calls for data that rarely changes. These repeated operations increase server load, consume database resources, and slow down response times.</p><p>Caching is one of the most effective techniques for solving this problem.</p><p>In this article, we’ll explore what caching is, why it matters, and how to implement both In-Memory Caching and Redis Distributed Caching in ASP.NET Core applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iKwpLhadP6Chw-m6X-BzxQ.png" /></figure><h3>What is Caching?</h3><p>Caching is the process of storing frequently accessed data in a temporary storage location so that future requests can retrieve the data faster.</p><p>Instead of querying a database every time, the application first checks whether the requested data already exists in the cache.</p><p>If it exists, the application returns the cached data immediately.</p><p>If it does not exist, the application fetches the data from the database, stores it in the cache, and returns it to the user.</p><h3>Why Do We Need Caching?</h3><p>Consider an e-commerce application displaying product information.</p><p>Without caching:</p><ol><li>User requests products.</li><li>Application queries the database.</li><li>Database returns data.</li><li>Application sends response.</li></ol><p>This process happens for every request.</p><p>Imagine 10,000 users requesting the same product catalog every hour.</p><p>The database will receive 10,000 identical queries.</p><p>This results in:</p><ul><li>Increased database load</li><li>Slower response times</li><li>Higher infrastructure costs</li><li>Reduced scalability</li></ul><p>Caching helps eliminate these repeated operations.</p><h3>Types of Caching in ASP.NET Core</h3><p>ASP.NET Core primarily supports two caching approaches:</p><h3>1. In-Memory Caching</h3><p>Data is stored in the memory of the application server.</p><h3>2. Distributed Caching</h3><p>Data is stored in a centralized cache server such as Redis.</p><p>Both approaches serve different use cases.</p><h3>Understanding In-Memory Caching</h3><p>In-Memory Cache stores data directly inside the application’s memory.</p><p>When a request arrives, the application first checks the memory cache.</p><p>If the data exists, it is returned immediately without querying the database.</p><h3>Request Flow</h3><pre>Request<br>   ↓<br>Check Memory Cache<br>   ↓<br>Data Found?<br>   ↓ Yes<br>Return Cached Data<br>   ↓ No<br>Database Query<br>   ↓<br>Store in Cache<br>   ↓<br>Return Data</pre><h3>Benefits of In-Memory Cache</h3><h3>Extremely Fast</h3><p>Data is stored in RAM, making retrieval almost instantaneous.</p><h3>Easy to Implement</h3><p>ASP.NET Core provides built-in support through IMemoryCache.</p><h3>Reduces Database Load</h3><p>Repeated database calls are minimized.</p><h3>Improves User Experience</h3><p>Users receive responses much faster.</p><h3>Configuring In-Memory Cache</h3><h3>Step 1: Register Memory Cache</h3><pre>builder.Services.AddMemoryCache();</pre><h3>Step 2: Inject IMemoryCache</h3><pre>public class ProductService<br>{<br>    private readonly IMemoryCache _cache;<br><br>    public ProductService(IMemoryCache cache)<br>    {<br>        _cache = cache;<br>    }<br>}</pre><h3>Step 3: Store and Retrieve Data</h3><pre>public async Task&lt;List&lt;Product&gt;&gt; GetProducts()<br>{<br>    const string cacheKey = &quot;products&quot;;<br><br>    if (!_cache.TryGetValue(cacheKey, out List&lt;Product&gt; products))<br>    {<br>        products = await _context.Products.ToListAsync();<br>        var options = new MemoryCacheEntryOptions()<br>            .SetAbsoluteExpiration(TimeSpan.FromMinutes(10));<br>        _cache.Set(cacheKey, products, options);<br>    }<br>    return products;<br>}</pre><p>The first request fetches data from the database.</p><p>Subsequent requests retrieve data directly from memory.</p><h3>Cache Expiration Strategies</h3><p>Caching forever is dangerous because data can become outdated.</p><p>ASP.NET Core provides expiration mechanisms.</p><h3>Absolute Expiration</h3><p>The cache expires after a fixed duration.</p><pre>.SetAbsoluteExpiration(TimeSpan.FromMinutes(10))</pre><p>Even if users access the cache repeatedly, it will expire after 10 minutes.</p><h3>Sliding Expiration</h3><p>The expiration timer resets every time the cache is accessed.</p><pre>.SetSlidingExpiration(TimeSpan.FromMinutes(5))</pre><p>As long as the cache is being used, it remains active.</p><h3>Combined Strategy</h3><p>A common approach is combining both.</p><pre>var options = new MemoryCacheEntryOptions()<br>    .SetSlidingExpiration(TimeSpan.FromMinutes(5))<br>    .SetAbsoluteExpiration(TimeSpan.FromHours(1));</pre><p>This prevents stale data from living forever.</p><h3>Limitations of In-Memory Cache</h3><p>Although fast, In-Memory Cache has limitations.</p><h3>Single Server Only</h3><p>The cache exists only within one application instance.</p><p>If the application restarts, the cache is lost.</p><h3>Not Shared Across Servers</h3><p>Consider a load-balanced environment:</p><pre>User Request<br>       ↓<br>Load Balancer<br>     ↙     ↘<br>Server A  Server B</pre><p>Server A and Server B maintain separate caches.</p><p>This may lead to inconsistent data.</p><h3>Memory Consumption</h3><p>Large datasets can consume significant server memory.</p><h3>Understanding Distributed Caching</h3><p>Distributed Cache stores data in an external cache server that multiple application instances can access.</p><p>The most popular distributed cache solution is Redis.</p><h3>What is Redis?</h3><p>Redis (Remote Dictionary Server) is an open-source, in-memory data store used as:</p><ul><li>Cache</li><li>Database</li><li>Message Broker</li><li>Session Store</li></ul><p>Redis stores data in RAM, making it extremely fast.</p><h3>Distributed Cache Flow</h3><pre>Request<br>   ↓<br>Check Redis Cache<br>   ↓<br>Data Found?<br>   ↓ Yes<br>Return Cached Data<br>   ↓ No<br>Database Query<br>   ↓<br>Store in Redis<br>   ↓<br>Return Data</pre><h3>Advantages of Redis Cache</h3><h3>Shared Across Multiple Servers</h3><p>All application instances use the same cache.</p><h3>Persistent Options</h3><p>Redis can optionally persist data to disk.</p><h3>High Scalability</h3><p>Supports large-scale distributed systems.</p><h3>Better for Cloud Applications</h3><p>Ideal for microservices and containerized environments.</p><h3>Configuring Redis in ASP.NET Core</h3><h3>Install Package</h3><pre>dotnet add package Microsoft.Extensions.Caching.StackExchangeRedis</pre><h3>Register Redis</h3><pre>builder.Services.AddStackExchangeRedisCache(options =&gt;<br>{<br>    options.Configuration = &quot;localhost:6379&quot;;<br>});</pre><h3>Inject IDistributedCache</h3><pre>private readonly IDistributedCache _cache;<br><br>public ProductService(IDistributedCache cache)<br>{<br>    _cache = cache;<br>}</pre><h3>Store Data in Redis</h3><pre>var options = new DistributedCacheEntryOptions<br>{<br>    AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(10)<br>};<br><br>await _cache.SetStringAsync(<br>    &quot;products&quot;,<br>    JsonSerializer.Serialize(products),<br>    options);</pre><h3>Retrieve Data from Redis</h3><pre>var cachedData = await _cache.GetStringAsync(&quot;products&quot;);<br><br>if (cachedData != null)<br>{<br>    return JsonSerializer.Deserialize&lt;List&lt;Product&gt;&gt;(cachedData);<br>}</pre><h3>In-Memory Cache vs Redis Cache</h3><p><strong>Storage</strong></p><ul><li>In-Memory Cache: Application Memory</li><li>Redis Cache: External Server</li></ul><p><strong>Speed</strong></p><ul><li>In-Memory Cache: Extremely Fast</li><li>Redis Cache: Very Fast</li></ul><p><strong>Multi-Server Support</strong></p><ul><li>In-Memory Cache: No</li><li>Redis Cache: Yes</li></ul><p><strong>Persistence</strong></p><ul><li>In-Memory Cache: No</li><li>Redis Cache: Optional</li></ul><p><strong>Scalability</strong></p><ul><li>In-Memory Cache: Limited</li><li>Redis Cache: High</li></ul><p><strong>Setup Complexity</strong></p><ul><li>In-Memory Cache: Easy</li><li>Redis Cache: Moderate</li></ul><p><strong>Cloud Friendly</strong></p><ul><li>In-Memory Cache: Limited</li><li>Redis Cache: Excellent</li></ul><h3>When Should You Use In-Memory Cache?</h3><p>Choose In-Memory Cache when:</p><ul><li>Small to medium applications</li><li>Single server deployment</li><li>Frequently accessed data</li><li>Development environments</li><li>Dashboard metrics</li><li>Configuration data</li></ul><h3>When Should You Use Redis Cache?</h3><p>Choose Redis when:</p><ul><li>Multiple application servers</li><li>Cloud-native applications</li><li>Microservices architecture</li><li>Session storage</li><li>High traffic systems</li><li>Enterprise applications</li></ul><h3>Common Caching Best Practices</h3><h3>Cache Frequently Read Data</h3><p>Cache data that is read often but changes infrequently.</p><h3>Avoid Caching Everything</h3><p>Not all data belongs in cache.</p><h3>Use Proper Expiration</h3><p>Always define expiration policies.</p><h3>Monitor Cache Hit Ratio</h3><p>A higher cache hit ratio means better performance.</p><h3>Invalidate Stale Data</h3><p>Remove or update cache entries when underlying data changes.</p><h3>Real-World Example</h3><p>Imagine an online shopping platform.</p><h3>Product Catalog</h3><p>Use Redis Cache because product data is accessed by multiple servers.</p><h3>Application Settings</h3><p>Use In-Memory Cache because settings rarely change.</p><h3>User Sessions</h3><p>Use Redis Cache to share session data across servers.</p><h3>Dashboard Statistics</h3><p>Use either caching strategy depending on deployment architecture.</p><h3>Conclusion</h3><p>Caching is one of the simplest yet most powerful techniques for improving application performance.</p><p>For smaller applications running on a single server, In-Memory Cache offers a quick and efficient solution with minimal setup.</p><p>For enterprise-grade applications running across multiple servers, Redis provides a scalable and distributed caching solution that ensures consistency and high availability.</p><p>The best caching strategy depends on your application’s architecture, traffic patterns, and scalability requirements.</p><p>Before optimizing database queries or upgrading infrastructure, evaluate whether caching can solve the performance bottleneck. In many cases, a well-designed caching strategy can reduce response times dramatically while lowering database load and operational costs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67a292b57526" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[   —    …]]></title>
            <link>https://medium.com/@bisheshdhiman5514/mastering-solid-principles-with-real-world-examples-c-focus-80552ab28280?source=rss-94bab91a8562------2</link>
            <guid isPermaLink="false">https://medium.com/p/80552ab28280</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Bishesh Dhiman]]></dc:creator>
            <pubDate>Sun, 24 May 2026 17:00:14 GMT</pubDate>
            <atom:updated>2026-05-24T17:32:54.393Z</atom:updated>
            <content:encoded><![CDATA[<h3>𝗠𝗮𝘀𝘁𝗲𝗿𝗶𝗻𝗴 𝗦𝗢𝗟𝗜𝗗 𝗣𝗿𝗶𝗻𝗰𝗶𝗽𝗹𝗲𝘀 — 𝗧𝗵𝗲 𝗙𝗼𝘂𝗻𝗱𝗮𝘁𝗶𝗼𝗻 𝗼𝗳 𝗖𝗹𝗲𝗮𝗻 𝗮𝗻𝗱 𝗦𝗰𝗮𝗹𝗮𝗯𝗹𝗲 𝗖𝗼𝗱𝗲</h3><p>If you’ve ever written code that <em>worked</em> but became painful to maintain after a few weeks, you’ve already felt the absence of SOLID principles.</p><p>SOLID is not about writing more code — it’s about writing code that survives change.</p><p>In this article, we’ll break down each principle with:</p><ul><li>Simple explanation</li><li>Real-world analogy</li><li>Practical C# example</li><li>What goes wrong if you ignore it</li></ul><h3>What is SOLID?</h3><p>SOLID is a set of 5 object-oriented design principles:</p><ul><li><strong>S</strong> → Single Responsibility Principle</li><li><strong>O</strong> → Open/Closed Principle</li><li><strong>L</strong> → Liskov Substitution Principle</li><li><strong>I</strong> → Interface Segregation Principle</li><li><strong>D</strong> → Dependency Inversion Principle</li></ul><p>Let’s go one by one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x7ZL0Iexx10_GbYjV8bO4w.png" /></figure><h3>1. Single Responsibility Principle (SRP)</h3><h3>Definition</h3><p>A class should have <strong>only one reason to change</strong>.</p><h3>Real-World Analogy</h3><p>A chef cooks food. A cashier handles billing.<br>If one person does both, things get messy.</p><h3>Bad Example</h3><pre>class Invoice<br>{<br>    public void CalculateTotal() { }<br>    public void PrintInvoice() { }<br>    public void SaveToDatabase() { } <br>}</pre><p>Problems:</p><ul><li>One class handles <strong>business logic</strong>, <strong>printing</strong>, and <strong>database</strong></li><li>Any change in one area affects the whole class</li></ul><h3>Good Example</h3><pre>class Invoice<br>{<br>    public void CalculateTotal() { }<br>}<br>class InvoicePrinter <br>{ <br>    public void Print(Invoice invoice) { } <br>}<br>class InvoiceRepository <br>{ <br>    public void Save(Invoice invoice) { } <br>}</pre><p>Now:</p><ul><li>Each class has <strong>one responsibility</strong></li><li>Easier to test and maintain</li></ul><h3>If you ignore SRP:</h3><ul><li>Code becomes tightly coupled</li><li>Small changes break unrelated functionality</li></ul><h3>2. Open/Closed Principle (OCP)</h3><h3>Definition</h3><p>Software should be <strong>open for extension but closed for modification</strong>.</p><h3>Bad Example</h3><pre>class DiscountCalculator<br>{<br>    public double Calculate(string customerType)<br>    {<br>        if (customerType == &quot;Regular&quot;)<br>            return 0.1;<br>        else if (customerType == &quot;Premium&quot;)<br>            return 0.2;<br>            <br>        return 0;<br>    }<br>}</pre><p>Problem:</p><ul><li>Every new customer type requires modifying this class</li></ul><h3>Good Example</h3><pre>interface IDiscount<br>{<br>    double GetDiscount();<br>}<br><br>class RegularCustomer : IDiscount<br>{<br>    public double GetDiscount() =&gt; 0.1;<br>}<br><br>class PremiumCustomer : IDiscount<br>{<br>    public double GetDiscount() =&gt; 0.2;<br>}<br><br>class DiscountCalculator<br>{<br>    public double Calculate(IDiscount customer)<br>    {<br>        return customer.GetDiscount();<br>    }<br>}</pre><p>Now:</p><ul><li>Add new customer types <strong>without modifying existing code</strong></li></ul><h3>If you ignore OCP:</h3><ul><li>Frequent changes break stable code</li><li>High risk during feature updates</li></ul><h3>3. Liskov Substitution Principle (LSP)</h3><h3>Definition</h3><p>Subclasses should be replaceable with their base class <strong>without breaking behavior</strong>.</p><h3>Bad Example</h3><pre>class Bird<br>{<br>    public virtual void Fly() { }<br>}<br><br>class Ostrich : Bird<br>{<br>    public override void Fly()<br>    {<br>        throw new Exception(&quot;Ostrich can&#39;t fly&quot;);<br>    }<br>}</pre><p>Problem:</p><ul><li>Replacing Bird with Ostrich breaks the program</li></ul><h3>Good Example</h3><pre>class Bird { }<br><br>class FlyingBird : Bird<br>{<br>    public virtual void Fly() { }<br>}<br><br>class Sparrow : FlyingBird<br>{<br>    public override void Fly() { }<br>}<br><br>class Ostrich : Bird<br>{<br>    // No Fly method<br>}</pre><p>Now:</p><ul><li>No unexpected behavior</li><li>Subclasses respect base expectations</li></ul><h3>If you ignore LSP:</h3><ul><li>Runtime errors</li><li>Broken polymorphism</li></ul><h3>4. Interface Segregation Principle (ISP)</h3><h3>Definition</h3><p>Clients should not be forced to depend on methods they don’t use.</p><h3>Bad Example</h3><pre>interface IWorker<br>{<br>    void Work();<br>    void Eat();<br>}<br><br>class Robot : IWorker<br>{<br>    public void Work() { }<br>    public void Eat()<br>    {<br>        throw new Exception(&quot;Robot doesn&#39;t eat&quot;);<br>    }<br>}</pre><h3>Good Example</h3><pre>interface IWork<br>{<br>    void Work();<br>}<br><br>interface IEat<br>{<br>    void Eat();<br>}<br><br>class Human : IWork, IEat<br>{<br>    public void Work() { }<br>    public void Eat() { }<br>}<br><br>class Robot : IWork<br>{<br>    public void Work() { }<br>}</pre><p>Now:</p><ul><li>Classes implement only what they need</li></ul><h3>If you ignore ISP:</h3><ul><li>Unnecessary dependencies</li><li>Confusing and bloated interfaces</li></ul><h3>5. Dependency Inversion Principle (DIP)</h3><h3>Definition</h3><p>High-level modules should not depend on low-level modules.<br>Both should depend on <strong>abstractions</strong>.</p><h3>Bad Example</h3><pre>class EmailService<br>{<br>    public void SendEmail() { }<br>}<br><br>class Notification<br>{<br>    private EmailService _email = new EmailService();<br>    public void Notify()<br>    {<br>        _email.SendEmail();<br>    }<br>}</pre><p>Problem:</p><ul><li>Tight coupling</li><li>Hard to replace EmailService</li></ul><h3>Good Example</h3><pre>interface IMessageService<br>{<br>    void SendMessage();<br>}<br><br>class EmailService : IMessageService<br>{<br>    public void SendMessage() { }<br>}<br><br>class SMSService : IMessageService<br>{<br>    public void SendMessage() { }<br>}<br><br>class Notification<br>{<br>    private readonly IMessageService _service;<br>    public Notification(IMessageService service)<br>    {<br>        _service = service;<br>    }<br>    public void Notify()<br>    {<br>        _service.SendMessage();<br>    }<br>}</pre><p>Now:</p><ul><li>Easily switch between Email, SMS, etc.</li><li>Perfect for <strong>Dependency Injection</strong></li></ul><h3>If you ignore DIP:</h3><ul><li>Hard to test</li><li>Difficult to scale</li><li>Rigid architecture</li></ul><h3>Final Thoughts</h3><p>SOLID is not about memorizing definitions — it’s about writing code that <strong>handles change gracefully</strong>.</p><p>When applied correctly:</p><ul><li>Your code becomes modular</li><li>Your system becomes scalable</li><li>Your debugging time reduces significantly</li></ul><h3>Quick Recap</h3><p>PrincipleFocusSRPOne responsibility per classOCPExtend without modifyingLSPReplace safelyISPSmall, focused interfacesDIPDepend on abstractions</p><h3>Closing Line</h3><p>Great developers don’t just write code that works — <br>they write code that <strong>still works after change</strong>.</p><p>If you’re working with <strong>C#, ASP.NET Core, or Angular</strong>, mastering SOLID will directly improve your architecture and code quality.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80552ab28280" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microservices Architecture vs Monolithic Architecture in .NET]]></title>
            <link>https://medium.com/@bisheshdhiman5514/microservices-architecture-vs-monolithic-architecture-in-net-116ba7ce19d0?source=rss-94bab91a8562------2</link>
            <guid isPermaLink="false">https://medium.com/p/116ba7ce19d0</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[data-structures]]></category>
            <dc:creator><![CDATA[Bishesh Dhiman]]></dc:creator>
            <pubDate>Mon, 20 Apr 2026 16:42:31 GMT</pubDate>
            <atom:updated>2026-04-20T16:42:31.038Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>When building modern applications, one of the most critical decisions is choosing the right architecture. Two dominant approaches are:</p><ul><li><strong>Monolithic Architecture</strong> (traditional, simple)</li><li><strong>Microservices Architecture</strong> (modern, scalable)</li></ul><p>Understanding their <strong>structure, trade-offs, and implementation in .NET</strong> is essential for designing efficient and scalable systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yf8LXvjmXmCR99lmW_qviw.png" /></figure><h3>1. What is Monolithic Architecture?</h3><p>Monolithic architecture is a <strong>single unified application</strong> where all components are tightly coupled and deployed together.</p><h3>Key Characteristics</h3><ul><li>Single codebase</li><li>Single deployment unit</li><li>Shared database</li><li>Tight coupling between modules</li></ul><h3>Monolithic Architecture Flow</h3><pre>Client (Browser / Mobile)<br>        ↓<br>   ASP.NET Core Application<br>        ↓<br>---------------------------------<br>| Controllers                  |<br>| Services                     |<br>| Business Logic               |<br>| Data Access Layer (EF Core)  |<br>---------------------------------<br>        ↓<br>     Database</pre><h3>Monolithic Project Structure (.NET)</h3><pre>MonolithicApp/<br>│<br>├── Controllers/<br>│   └── ProductController.cs<br>│<br>├── Services/<br>│   └── ProductService.cs<br>│<br>├── Data/<br>│   ├── AppDbContext.cs<br>│   └── Repositories/<br>│<br>├── Models/<br>│   └── Product.cs<br>│<br>├── DTOs/<br>│<br>├── Program.cs<br>├── appsettings.json</pre><h3>Sample Code (Monolithic)</h3><h3>Controller</h3><pre>[ApiController]<br>[Route(&quot;api/[controller]&quot;)]<br>public class ProductController : ControllerBase<br>{<br>    private readonly ProductService _service;<br><br>    public ProductController(ProductService service)<br>    {<br>        _service = service;<br>    }<br><br>    [HttpGet]<br>    public IActionResult Get()<br>    {<br>        var products = _service.GetAll();<br>        return Ok(products);<br>    }<br>}</pre><h3>Service</h3><pre>public class ProductService<br>{<br>    private readonly AppDbContext _context;<br><br>    public ProductService(AppDbContext context)<br>    {<br>        _context = context;<br>    }<br><br>    public List&lt;Product&gt; GetAll()<br>    {<br>        return _context.Products.ToList();<br>    }<br>}</pre><h3>Advantages of Monolithic Architecture</h3><ul><li>Simple to develop and deploy</li><li>Easy debugging</li><li>No network latency between components</li><li>Ideal for small applications</li></ul><h3>Disadvantages</h3><ul><li>Hard to scale</li><li>Tight coupling</li><li>Large codebase becomes difficult to manage</li><li>Single point of failure</li></ul><h3>2. What is Microservices Architecture?</h3><p>Microservices architecture breaks an application into <strong>small, independent services</strong>, each responsible for a specific business function.</p><p>Each service:</p><ul><li>Has its own database</li><li>Is independently deployable</li><li>Communicates via APIs (HTTP, gRPC, messaging)</li></ul><h3>Microservices Architecture Flow</h3><pre>Client<br>   ↓<br>API Gateway (Optional)<br>   ↓<br>----------------------------------------<br>| Product Service  | Order Service     |<br>| User Service     | Payment Service   |<br>----------------------------------------<br>   ↓         ↓          ↓<br> DB1        DB2        DB3</pre><h3>Key Characteristics</h3><ul><li>Loosely coupled services</li><li>Independent deployment</li><li>Technology flexibility</li><li>Distributed system</li></ul><h3>Microservices Project Structure (.NET)</h3><pre>MicroservicesSolution/<br>│<br>├── ProductService/<br>│   ├── Controllers/<br>│   ├── Services/<br>│   ├── Data/<br>│   ├── Models/<br>│   └── Program.cs<br>│<br>├── OrderService/<br>│   ├── Controllers/<br>│   ├── Services/<br>│   ├── Data/<br>│   └── Program.cs<br>│<br>├── ApiGateway/<br>│   └── Ocelot.json<br>│<br>├── Shared/<br>│   └── Common Libraries</pre><h3>Sample Microservice Code</h3><h3>Product Service Controller</h3><pre>[ApiController]<br>[Route(&quot;api/products&quot;)]<br>public class ProductController : ControllerBase<br>{<br>    [HttpGet]<br>    public IActionResult Get()<br>    {<br>        return Ok(new List&lt;string&gt; { &quot;Laptop&quot;, &quot;Mobile&quot; });<br>    }<br>}</pre><h3>Order Service Calling Product Service</h3><pre>public class OrderService<br>{<br>    private readonly HttpClient _httpClient;<br><br>    public OrderService(HttpClient httpClient)<br>    {<br>        _httpClient = httpClient;<br>    }<br><br>    public async Task&lt;string&gt; GetProducts()<br>    {<br>        var response = await _httpClient.GetAsync(&quot;http://productservice/api/products&quot;);<br>        return await response.Content.ReadAsStringAsync();<br>    }<br>}</pre><h3>Communication Between Microservices</h3><ul><li>HTTP (REST APIs)</li><li>gRPC (high performance)</li><li>Message Brokers (RabbitMQ, Kafka)</li></ul><h3>3. Key Differences</h3><p><strong>1. Deployment</strong></p><ul><li>Monolithic: Entire application is deployed as a single unit</li><li>Microservices: Each service is deployed independently</li></ul><p><strong>2. Scalability</strong></p><ul><li>Monolithic: Scaling is difficult and usually requires scaling the whole application</li><li>Microservices: Easy to scale individual services based on demand</li></ul><p><strong>3. Codebase</strong></p><ul><li>Monolithic: Large and tightly coupled codebase</li><li>Microservices: Small, independent codebases for each service</li></ul><p><strong>4. Fault Isolation</strong></p><ul><li>Monolithic: Failure in one module can affect the entire system</li><li>Microservices: Failures are isolated to specific services</li></ul><p><strong>5. Development Speed</strong></p><ul><li>Monolithic: Slower due to large codebase and dependencies</li><li>Microservices: Faster with parallel development across teams</li></ul><p><strong>6. Technology Flexibility</strong></p><ul><li>Monolithic: Limited to a single tech stack</li><li>Microservices: High flexibility — different services can use different technologies</li></ul><h3>4. Architecture Diagram Comparison</h3><h3>Monolithic</h3><pre>[ UI ] → [ Single Backend ] → [ Single DB ]</pre><h3>Microservices</h3><pre>[ UI ]<br>   ↓<br>[ API Gateway ]<br>   ↓<br>[ Service A ] → DB A<br>[ Service B ] → DB B<br>[ Service C ] → DB C</pre><h3>5. When to Use Monolithic Architecture</h3><p>Choose monolithic when:</p><ul><li>Application is small</li><li>Team size is small</li><li>Faster development is needed</li><li>MVP (Minimum Viable Product)</li></ul><h3>6. When to Use Microservices Architecture</h3><p>Choose microservices when:</p><ul><li>Application is large and complex</li><li>Need independent scaling</li><li>Multiple teams working</li><li>High availability required</li></ul><h3>7. Challenges in Microservices</h3><p>Microservices are powerful, but not easy:</p><ul><li>Distributed system complexity</li><li>Network latency</li><li>Data consistency issues</li><li>Deployment and monitoring complexity</li><li>Requires DevOps maturity</li></ul><h3>8. Best Practices in Microservices (.NET)</h3><ul><li>Use <strong>API Gateway (Ocelot / YARP)</strong></li><li>Implement <strong>Centralized Logging</strong></li><li>Use <strong>Docker &amp; Kubernetes</strong></li><li>Apply <strong>Circuit Breaker Pattern (Polly)</strong></li><li>Use <strong>Event-driven architecture</strong></li><li>Implement <strong>Authentication (JWT)</strong></li></ul><h3>9. Real-World Insight</h3><p>Many companies start with <strong>Monolithic Architecture</strong> and gradually move to <strong>Microservices</strong> as the system grows.</p><p>This approach is called:</p><p><strong>Strangler Pattern</strong></p><h3>Conclusion</h3><p>Monolithic and Microservices architectures are not competitors — they are <strong>solutions for different problems</strong>.</p><ul><li>Monolithic = Simplicity &amp; Speed</li><li>Microservices = Scalability &amp; Flexibility</li></ul><p>The key is choosing the right architecture based on your <strong>project size, team, and future growth</strong>.</p><h3>Final Thought</h3><p>A bad microservices design is worse than a good monolith.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=116ba7ce19d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Filters in ASP.NET Core (.NET) — Complete Deep Dive]]></title>
            <link>https://medium.com/@bisheshdhiman5514/filters-in-asp-net-core-net-complete-deep-dive-b3fd88827132?source=rss-94bab91a8562------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3fd88827132</guid>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[dotnet-core]]></category>
            <category><![CDATA[dotnet]]></category>
            <dc:creator><![CDATA[Bishesh Dhiman]]></dc:creator>
            <pubDate>Sun, 29 Mar 2026 17:37:14 GMT</pubDate>
            <atom:updated>2026-03-29T17:37:14.656Z</atom:updated>
            <content:encoded><![CDATA[<h3>1. Introduction</h3><p>In <strong>ASP.NET Core</strong>, filters are a powerful feature that allow you to execute code <strong>before or after specific stages of the request processing pipeline</strong>.</p><p>They help you handle <strong>cross-cutting concerns</strong> such as:</p><ul><li>Logging</li><li>Authentication &amp; Authorization</li><li>Exception handling</li><li>Result modification</li><li>Performance monitoring</li></ul><p>Instead of repeating logic in every controller or action, filters provide a <strong>clean and reusable approach</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JpP12JS1Rgq1yhU5IVQ64w.png" /></figure><h3>2. Where Filters Fit in Architecture</h3><p>ASP.NET Core request pipeline:</p><pre>HTTP Request <br>   ↓<br>Middleware Pipeline<br>   ↓<br>Routing<br>   ↓<br>Model Binding<br>   ↓<br>Filters (Multiple Stages)<br>   ↓<br>Controller Action Execution<br>   ↓<br>Result Execution<br>   ↓<br>HTTP Response</pre><p>Filters are executed <strong>after routing but before and after action execution</strong>, making them ideal for controlling behavior at a granular level.</p><h3>3. Types of Filters in ASP.NET Core</h3><p>There are <strong>5 main types of filters</strong>:</p><h3>3.1 Authorization Filters</h3><ul><li>Executed <strong>first</strong></li><li>Used to check whether a user is authorized</li></ul><p>Interface:</p><pre>IAuthorizationFilter<br>IAsyncAuthorizationFilter</pre><p>Example:</p><pre>public class CustomAuthFilter : IAuthorizationFilter<br>{<br>    public void OnAuthorization(AuthorizationFilterContext context)<br>    {<br>        if (!context.HttpContext.User.Identity.IsAuthenticated)<br>        {<br>            context.Result = new UnauthorizedResult();<br>        }<br>    }<br>}</pre><p>Use Case:</p><ul><li>Role-based access</li><li>Token validation</li></ul><h3>3.2 Resource Filters</h3><ul><li>Run <strong>before and after model binding</strong></li><li>Useful for caching and performance optimization</li></ul><p>Interface:</p><pre>IResourceFilter<br>IAsyncResourceFilter</pre><p>Example:</p><pre>public class ResourceFilterExample : IResourceFilter<br>{<br>    public void OnResourceExecuting(ResourceExecutingContext context)<br>    {<br>        // Before model binding<br>    }<br><br>    public void OnResourceExecuted(ResourceExecutedContext context)<br>    {<br>        // After execution<br>    }<br>}</pre><p>Use Case:</p><ul><li>Caching responses</li><li>Short-circuiting pipeline</li></ul><h3>3.3 Action Filters</h3><ul><li>Run <strong>before and after controller action execution</strong></li></ul><p>Interface:</p><pre>IActionFilter<br>IAsyncActionFilter</pre><p>Example:</p><pre>public class LoggingFilter : IActionFilter<br>{<br>    public void OnActionExecuting(ActionExecutingContext context)<br>    {<br>        Console.WriteLine(&quot;Before Action Execution&quot;);<br>    }<br><br>    public void OnActionExecuted(ActionExecutedContext context)<br>    {<br>        Console.WriteLine(&quot;After Action Execution&quot;);<br>    }<br>}</pre><p>Use Case:</p><ul><li>Logging</li><li>Input validation</li><li>Modifying action arguments</li></ul><h3>3.4 Exception Filters</h3><ul><li>Handle exceptions thrown during action execution</li></ul><p>Interface:</p><pre>IExceptionFilter<br>IAsyncExceptionFilter</pre><p>Example:</p><pre>public class CustomExceptionFilter : IExceptionFilter<br>{<br>    public void OnException(ExceptionContext context)<br>    {<br>        context.Result = new ObjectResult(&quot;An error occurred&quot;)<br>        {<br>            StatusCode = 500<br>        };<br>    }<br>}</pre><p>Use Case:</p><ul><li>Centralized error handling</li></ul><h3>3.5 Result Filters</h3><ul><li>Run <strong>before and after action result execution</strong></li></ul><p>Interface:</p><pre>IResultFilter<br>IAsyncResultFilter</pre><p>Example:</p><pre>public class ResultFilterExample : IResultFilter<br>{<br>    public void OnResultExecuting(ResultExecutingContext context)<br>    {<br>        Console.WriteLine(&quot;Before Result Execution&quot;);<br>    }<br><br>    public void OnResultExecuted(ResultExecutedContext context)<br>    {<br>        Console.WriteLine(&quot;After Result Execution&quot;);<br>    }<br>}</pre><p>Use Case:</p><ul><li>Modifying response</li><li>Adding headers</li></ul><h3>4. Filter Execution Order</h3><p>Execution order is critical:</p><pre>Authorization Filter<br>   ↓<br>Resource Filter<br>   ↓<br>Action Filter (Before)<br>   ↓<br>Controller Action<br>   ↓<br>Action Filter (After)<br>   ↓<br>Result Filter<br>   ↓<br>Exception Filter (if error occurs)</pre><p>Important Notes:</p><ul><li>Exception filters run only when an exception occurs</li><li>Authorization filters can short-circuit the pipeline</li></ul><h3>5. Filter Scopes</h3><p>Filters can be applied at three levels:</p><h3>Global Level</h3><pre>builder.Services.AddControllers(options =&gt;<br>{<br>    options.Filters.Add&lt;LoggingFilter&gt;();<br>});</pre><h3>Controller Level</h3><pre>[ServiceFilter(typeof(LoggingFilter))]<br>public class HomeController : Controller<br>{<br>}</pre><h3>Action Level</h3><pre>[ServiceFilter(typeof(LoggingFilter))]<br>public IActionResult Index()<br>{<br>    return View();<br>}</pre><h3>6. Synchronous vs Asynchronous Filters</h3><p>ASP.NET Core supports both:</p><p>TypeInterfaceSyncIActionFilterAsyncIAsyncActionFilter</p><p>Example Async:</p><pre>public class AsyncFilter : IAsyncActionFilter<br>{<br>    public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)<br>    {<br>        Console.WriteLine(&quot;Before&quot;);<br>        await next();<br>        Console.WriteLine(&quot;After&quot;);<br>    }<br>}</pre><h3>7. Dependency Injection in Filters</h3><p>Use ServiceFilter or TypeFilter:</p><h3>ServiceFilter</h3><pre>[ServiceFilter(typeof(MyFilter))]</pre><h3>TypeFilter</h3><pre>[TypeFilter(typeof(MyFilter))]</pre><p>Difference:</p><ul><li>ServiceFilter uses DI container</li><li>TypeFilter allows constructor arguments</li></ul><h3>8. Short-Circuiting in Filters</h3><p>Filters can <strong>stop execution</strong>:</p><pre>context.Result = new BadRequestResult();</pre><p>This prevents:</p><ul><li>Controller execution</li><li>Further filters</li></ul><h3>9. Real-World Architecture Usage</h3><p>Filters are used in enterprise applications for:</p><h3>Logging Layer</h3><ul><li>Request/Response logging</li></ul><h3>Security Layer</h3><ul><li>JWT validation</li><li>Role-based access</li></ul><h3>Exception Layer</h3><ul><li>Global error handling</li></ul><h3>Performance Layer</h3><ul><li>Response caching</li></ul><p>Architecture Example:</p><pre>Client<br> ↓<br>Middleware (Auth, Logging)<br> ↓<br>Filters (Validation, Caching, Exception)<br> ↓<br>Controllers<br> ↓<br>Services<br> ↓<br>Repository / Database</pre><h3>10. Best Practices</h3><ul><li>Prefer <strong>Action Filters</strong> for business-related logic</li><li>Use <strong>Middleware</strong> for global concerns (e.g., logging across all requests)</li><li>Keep filters <strong>lightweight</strong></li><li>Use <strong>async filters</strong> for I/O operations</li><li>Avoid putting heavy business logic inside filters</li></ul><h3>11. Filters vs Middleware</h3><p>FeatureFiltersMiddlewareScopeMVC onlyEntire pipelineAccessController contextFull HTTP contextUse CaseAction-level logicGlobal logic</p><h3>12. When to Use Filters</h3><p>Use filters when:</p><ul><li>You need logic tied to MVC actions</li><li>You want reusable cross-cutting concerns</li><li>You need pre/post action control</li></ul><p>Avoid filters when:</p><ul><li>Logic applies to all requests → use middleware</li><li>Complex business logic → use services</li></ul><h3>13. Conclusion</h3><p>Filters in ASP.NET Core provide a <strong>clean, structured, and reusable way</strong> to manage cross-cutting concerns within the MVC pipeline.</p><p>Understanding filters deeply helps you:</p><ul><li>Build scalable applications</li><li>Maintain clean architecture</li><li>Reduce code duplication</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3fd88827132" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building an AI-Powered Translator App Using Angular, .NET Core, and Python]]></title>
            <link>https://medium.com/@bisheshdhiman5514/building-an-ai-powered-translator-app-using-angular-net-core-and-python-74840c4b2cde?source=rss-94bab91a8562------2</link>
            <guid isPermaLink="false">https://medium.com/p/74840c4b2cde</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[dotnet]]></category>
            <dc:creator><![CDATA[Bishesh Dhiman]]></dc:creator>
            <pubDate>Wed, 18 Mar 2026 05:23:45 GMT</pubDate>
            <atom:updated>2026-03-18T05:48:51.036Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Language barriers remain a major challenge in global communication. With the advancement of Artificial Intelligence and Natural Language Processing, modern systems can translate text with context awareness rather than simple word mapping.</p><p>This article demonstrates how to build a full-stack AI-powered translator application using:</p><ul><li>Angular for frontend</li><li>.NET Core Web API for backend</li><li>Python (FastAPI with NLP models) for AI processing</li><li>SQL database for storage</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SoJUnCJbFXY-eG4ynIVm_Q.png" /></figure><h3>System Architecture</h3><pre>Angular Frontend (UI Layer)<br>        |<br>        | HTTP Requests<br>        v<br>.NET Core Web API (Business Logic Layer)<br>        |<br>        | HTTP Requests<br>        v<br>Python FastAPI (AI Translation Service)<br>        |<br>        v<br>Database (SQL Server)</pre><h3>Architecture Explanation</h3><h3>Angular Frontend</h3><p>Handles user interaction:</p><ul><li>Input text</li><li>Language selection</li><li>Display output</li><li>Calls backend API</li></ul><h3>.NET Core Backend</h3><p>Acts as a middleware:</p><ul><li>Receives requests from Angular</li><li>Calls Python AI service</li><li>Processes responses</li><li>Stores translation data</li></ul><h3>Python AI Service</h3><p>Handles translation logic:</p><ul><li>Uses NLP models (HuggingFace Transformers)</li><li>Processes and returns translated text</li></ul><h3>Database</h3><p>Stores:</p><ul><li>Translation history</li><li>Logs</li><li>User data (optional)</li></ul><h3>Data Flow</h3><ol><li>User enters text in Angular</li><li>Angular sends request to .NET API</li><li>.NET calls Python service</li><li>Python processes translation</li><li>Response returns to .NE</li><li>Angular displays result</li><li>Data is stored in database</li></ol><h3>Python AI Service (FastAPI)</h3><h3>Install Dependencies</h3><pre>pip install fastapi uvicorn transformers torch</pre><h3>Python Code</h3><pre>from fastapi import FastAPI<br>from pydantic import BaseModel<br>from transformers import pipeline<br><br>app = FastAPI()<br><br>translator = pipeline(&quot;translation&quot;, model=&quot;Helsinki-NLP/opus-mt-en-fr&quot;)<br><br>class RequestModel(BaseModel):<br>    text: str<br><br>@app.post(&quot;/translate&quot;)<br>def translate(req: RequestModel):<br>    result = translator(req.text)<br>    return {&quot;translated_text&quot;: result[0][&#39;translation_text&#39;]}</pre><h3>Run the Service</h3><pre>uvicorn app:app --reload --port 8000</pre><h3>.NET Core Backend</h3><h3>Create Project</h3><h3>System Architecture</h3><pre>Angular Frontend (UI Layer)<br>        |<br>        | HTTP Requests<br>        v<br>.NET Core Web API (Business Logic Layer)<br>        |<br>        | HTTP Requests<br>        v<br>Python FastAPI (AI Translation Service)<br>        |<br>        v<br>Database (SQL Server)</pre><h3>Architecture Explanation</h3><h3>Angular Frontend</h3><p>Handles user interaction:</p><ul><li>Input text</li><li>Language selection</li><li>Display output</li><li>Calls backend API</li></ul><h3>.NET Core Backend</h3><p>Acts as a middleware:</p><ul><li>Receives requests from Angular</li><li>Calls Python AI service</li><li>Processes responses</li><li>Stores translation data</li></ul><h3>Python AI Service</h3><p>Handles translation logic:</p><ul><li>Uses NLP models (HuggingFace Transformers)</li><li>Processes and returns translated text</li></ul><h3>Database</h3><p>Stores:</p><ul><li>Translation history</li><li>Logs</li><li>User data (optional)</li></ul><h3>Data Flow</h3><ol><li>User enters text in Angular</li><li>Angular sends request to .NET API</li><li>.NET calls Python service</li><li>Python processes translation</li><li>Response returns to .NE</li><li>Angular displays result</li><li>Data is stored in database</li></ol><h3>Python AI Service (FastAPI)</h3><h3>Install Dependencies</h3><pre>pip install fastapi uvicorn transformers torch</pre><h3>Python Code</h3><pre>from fastapi import FastAPI<br>from pydantic import BaseModel<br>from transformers import pipeline<br><br>app = FastAPI()<br><br>translator = pipeline(&quot;translation&quot;, model=&quot;Helsinki-NLP/opus-mt-en-fr&quot;)<br><br>class RequestModel(BaseModel):<br>    text: str<br><br>@app.post(&quot;/translate&quot;)<br>def translate(req: RequestModel):<br>    result = translator(req.text)<br>    return {&quot;translated_text&quot;: result[0][&#39;translation_text&#39;]}</pre><h3>Run the Service</h3><pre>uvicorn app:app --reload --port 8000</pre><h3>.NET Core Backend</h3><h3>Create Project</h3><h3>System Architecture</h3><pre>Angular Frontend (UI Layer)<br>        |<br>        | HTTP Requests<br>        v<br>.NET Core Web API (Business Logic Layer)<br>        |<br>        | HTTP Requests<br>        v<br>Python FastAPI (AI Translation Service)<br>        |<br>        v<br>Database (SQL Server)</pre><h3>Architecture Explanation</h3><h3>Angular Frontend</h3><p>Handles user interaction:</p><ul><li>Input text</li><li>Language selection</li><li>Display output</li><li>Calls backend API</li></ul><h3>.NET Core Backend</h3><p>Acts as a middleware:</p><ul><li>Receives requests from Angular</li><li>Calls Python AI service</li><li>Processes responses</li><li>Stores translation data</li></ul><h3>Python AI Service</h3><p>Handles translation logic:</p><ul><li>Uses NLP models (HuggingFace Transformers)</li><li>Processes and returns translated text</li></ul><h3>Database</h3><p>Stores:</p><ul><li>Translation history</li><li>Logs</li><li>User data (optional)</li></ul><h3>Data Flow</h3><ol><li>User enters text in Angular</li><li>Angular sends request to .NET API</li><li>.NET calls Python service</li><li>Python processes translation</li><li>Response returns to .NE</li><li>Angular displays result</li><li>Data is stored in database</li></ol><h3>Python AI Service (FastAPI)</h3><h3>Install Dependencies</h3><pre>pip install fastapi uvicorn transformers torch</pre><h3>Python Code</h3><pre>from fastapi import FastAPI<br>from pydantic import BaseModel<br>from transformers import pipeline<br><br>app = FastAPI()<br><br>translator = pipeline(&quot;translation&quot;, model=&quot;Helsinki-NLP/opus-mt-en-fr&quot;)<br><br>class RequestModel(BaseModel):<br>    text: str<br><br>@app.post(&quot;/translate&quot;)<br>def translate(req: RequestModel):<br>    result = translator(req.text)<br>    return {&quot;translated_text&quot;: result[0][&#39;translation_text&#39;]}</pre><h3>Run the Service</h3><pre>uvicorn app:app --reload --port 8000</pre><h3>.NET Core Backend</h3><h3>Create Project</h3><pre>dotnet new webapi -n TranslatorAPI</pre><h3>Model</h3><pre>public class TranslateRequest<br>{<br>    public string Text { get; set; }<br>}</pre><h3>Service Layer</h3><pre>public class TranslationService<br>{<br>    private readonly HttpClient _http;<br><br>    public TranslationService(HttpClient http)<br>    {<br>        _http = http;<br>    }<br><br>    public async Task&lt;string&gt; TranslateAsync(string text)<br>    {<br>        var response = await _http.PostAsJsonAsync(<br>            &quot;http://localhost:8000/translate&quot;,<br>            new { text = text });<br><br>        var result = await response.Content.ReadFromJsonAsync&lt;dynamic&gt;();<br>        return result.translated_text;<br>    }<br>}</pre><h3>Controller</h3><pre>[ApiController]<br>[Route(&quot;api/[controller]&quot;)]<br>public class TranslateController : ControllerBase<br>{<br>    private readonly TranslationService _service;<br><br>    public TranslateController(TranslationService service)<br>    {<br>        _service = service;<br>    }<br><br>    [HttpPost]<br>    public async Task&lt;IActionResult&gt; Translate([FromBody] TranslateRequest req)<br>    {<br>        var result = await _service.TranslateAsync(req.Text);<br>        return Ok(new { output = result });<br>    }<br>}</pre><h3>Register Service</h3><pre>builder.Services.AddHttpClient&lt;TranslationService&gt;();</pre><h3>Angular Frontend</h3><h3>Create Project</h3><pre>ng new translator-app<br>cd translator-app<br>ng generate component translator</pre><h3>HTML</h3><pre>&lt;div class=&quot;container&quot;&gt;<br>  &lt;h2&gt;Translator App&lt;/h2&gt;<br><br>  &lt;textarea [(ngModel)]=&quot;inputText&quot;&gt;&lt;/textarea&gt;<br><br>  &lt;button (click)=&quot;translate()&quot;&gt;Translate&lt;/button&gt;<br><br>  &lt;h3&gt;Translated Output:&lt;/h3&gt;<br>  &lt;p&gt;{{ translatedText }}&lt;/p&gt;<br>&lt;/div&gt;</pre><h3>TypeScript</h3><pre>import { HttpClient } from &#39;@angular/common/http&#39;;<br><br>export class TranslatorComponent {<br>  inputText = &#39;&#39;;<br>  translatedText = &#39;&#39;;<br><br>  constructor(private http: HttpClient) {}<br><br>  translate() {<br>    this.http.post&lt;any&gt;(&#39;http://localhost:5000/api/translate&#39;, {<br>      text: this.inputText<br>    }).subscribe(res =&gt; {<br>      this.translatedText = res.output;<br>    });<br>  }<br>}</pre><h3>Import Required Modules</h3><pre>import { FormsModule } from &#39;@angular/forms&#39;;<br>import { HttpClientModule } from &#39;@angular/common/http&#39;;</pre><h3>Database Design</h3><h3>SQL Table</h3><pre>CREATE TABLE Translations (<br>    Id INT IDENTITY PRIMARY KEY,<br>    InputText NVARCHAR(MAX),<br>    OutputText NVARCHAR(MAX),<br>    CreatedAt DATETIME DEFAULT GETDATE()<br>);</pre><h3>Advanced Features</h3><h3>Multi-language Support</h3><p>Change model dynamically in Python:</p><pre>pipeline(&quot;translation&quot;, model=&quot;Helsinki-NLP/opus-mt-en-hi&quot;)</pre><h3>Voice Translation</h3><ul><li>Use browser speech API in Angular</li></ul><h3>Image Translation</h3><ul><li>Use OCR in Python (Tesseract)</li></ul><h3>Caching</h3><ul><li>Implement Redis in backend</li></ul><h3>Authentication</h3><ul><li>Use JWT in .NET Core</li></ul><h3>Production Architecture</h3><pre>Angular Frontend<br>      |<br>API Gateway<br>      |<br>.NET Microservices<br>      |<br>Python AI Services (Scalable)<br>      |<br>Redis Cache + SQL Database</pre><h3>Deployment Strategy</h3><ul><li>Angular: Deploy on Netlify or similar platforms</li><li>.NET API: Deploy on cloud services like Azure or AWS</li><li>Python AI: Deploy using Docker containers</li><li>Database: Use managed SQL services</li></ul><h3>Folder Structure</h3><h3>Angular</h3><pre>src/<br>  app/<br>    translator/<br>    services/<br>    models/</pre><h3>.NET</h3><pre>Controllers/<br>Services/<br>Models/</pre><h3>Python</h3><pre>app.py<br>models/<br>utils/</pre><h3>Conclusion</h3><p>This architecture provides a scalable and modular translator application:</p><ul><li>Angular ensures responsive UI</li><li>.NET Core manages business logic</li><li>Python handles AI processing</li><li>Database enables tracking and improvements</li></ul><p>You can start with a basic setup and extend it into an enterprise-grade system by adding features like real-time translation, feedback loops, and custom-trained models.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74840c4b2cde" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI-Based Fraud Detection System using ASP.NET Core and Machine Learning]]></title>
            <link>https://medium.com/@bisheshdhiman5514/ai-based-fraud-detection-system-using-asp-net-core-and-machine-learning-57b15b046ec8?source=rss-94bab91a8562------2</link>
            <guid isPermaLink="false">https://medium.com/p/57b15b046ec8</guid>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Bishesh Dhiman]]></dc:creator>
            <pubDate>Wed, 04 Mar 2026 18:29:42 GMT</pubDate>
            <atom:updated>2026-03-04T18:36:48.131Z</atom:updated>
            <content:encoded><![CDATA[<p>Fraud detection is one of the most powerful real-world applications of Artificial Intelligence. Banks, fintech companies, and e-commerce platforms process millions of transactions daily — and detecting fraudulent activity in real time is critical.</p><p>In this article, we will build a complete AI-Based Fraud Detection System using:</p><ul><li>ASP.NET Core (Backend API)</li><li>Machine Learning (ML.NET)</li><li>SQL Server (Database)</li><li>Angular (Frontend — optional overview)</li><li>Docker (Production Ready Architecture)</li></ul><p>We will cover:</p><ul><li>System Architecture</li><li>Machine Learning Model</li><li>Backend API Implementation</li><li>Prediction Endpoint</li><li>Deployment Architecture</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*19gTe0vJOidM0lqF4rbHgQ.png" /></figure><h3>1. System Overview</h3><p>Our goal is simple:</p><p>When a transaction is made:</p><ol><li>Transaction data is sent to ASP.NET Core API</li><li>The ML model evaluates the transaction</li><li>The API returns:</li></ol><ul><li>Fraud = True</li><li>Fraud = False</li></ul><p>4. The result is stored in the database</p><h3>2. High-Level Architecture</h3><p>Client (Angular / Postman)<br> ↓<br> ASP.NET Core Web API<br> ↓<br> ML.NET Model (Fraud Detection Model)<br> ↓<br> SQL Server Database</p><h3>3. Machine Learning Approach</h3><p>We will use:</p><p>Binary Classification</p><p>Because fraud detection is:</p><ul><li>0 → Legitimate</li><li>1 → Fraudulent</li></ul><p>ML.NET provides:</p><p>FastTree (Gradient Boosting)<br> SDCA Logistic Regression</p><p>For this example, we will use:</p><p>FastTree Binary Classification</p><h3>4. Creating the ML Model</h3><p>Install NuGet Packages:</p><p>Microsoft.ML<br> Microsoft.ML.FastTree</p><h3>Step 1: Create the Transaction Model</h3><p>TransactionData.cs</p><pre>using Microsoft.ML.Data;</pre><pre>public class TransactionData<br>{<br>    public float Amount { get; set; }<br>    public float TransactionTime { get; set; }<br>    public float LocationRiskScore { get; set; }<br>    public float DeviceTrustScore { get; set; }</pre><pre>    [ColumnName(&quot;Label&quot;)]<br>    public bool IsFraud { get; set; }<br>}</pre><h3>Step 2: Create Prediction Output Model</h3><p>FraudPrediction.cs</p><pre>using Microsoft.ML.Data;</pre><pre>public class FraudPrediction<br>{<br>    [ColumnName(&quot;PredictedLabel&quot;)]<br>    public bool IsFraud { get; set; }</pre><pre>    public float Probability { get; set; }<br>    public float Score { get; set; }<br>}</pre><h3>Step 3: Training the Model</h3><p>FraudDetectionModel.cs</p><pre>using Microsoft.ML;</pre><pre>public class FraudDetectionModel<br>{<br>    private readonly MLContext _mlContext;<br>    private ITransformer _model;</pre><pre>    public FraudDetectionModel()<br>    {<br>        _mlContext = new MLContext();<br>    }</pre><pre>    public void Train(string dataPath)<br>    {<br>        var data = _mlContext.Data.LoadFromTextFile&lt;TransactionData&gt;(<br>            dataPath,<br>            hasHeader: true,<br>            separatorChar: &#39;,&#39;);</pre><pre>        var pipeline = _mlContext.Transforms<br>            .Concatenate(&quot;Features&quot;,<br>                nameof(TransactionData.Amount),<br>                nameof(TransactionData.TransactionTime),<br>                nameof(TransactionData.LocationRiskScore),<br>                nameof(TransactionData.DeviceTrustScore))<br>            .Append(_mlContext.BinaryClassification.Trainers.FastTree());</pre><pre>        _model = pipeline.Fit(data);<br>    }</pre><pre>    public FraudPrediction Predict(TransactionData input)<br>    {<br>        var predictionEngine = _mlContext.Model.CreatePredictionEngine&lt;TransactionData, FraudPrediction&gt;(_model);<br>        return predictionEngine.Predict(input);<br>    }<br>}</pre><h3>5. ASP.NET Core Web API Integration</h3><p>Create a new Web API project:</p><p>dotnet new webapi -n FraudDetectionAPI</p><h3>Register Model in Program.cs</h3><pre>builder.Services.AddSingleton&lt;FraudDetectionModel&gt;();</pre><h3>Fraud Controller</h3><p>FraudController.cs</p><pre>using Microsoft.AspNetCore.Mvc;</pre><pre>[ApiController]<br>[Route(&quot;api/[controller]&quot;)]<br>public class FraudController : ControllerBase<br>{<br>    private readonly FraudDetectionModel _model;</pre><pre>    public FraudController(FraudDetectionModel model)<br>    {<br>        _model = model;<br>        _model.Train(&quot;Data/transactions.csv&quot;);<br>    }</pre><pre>    [HttpPost(&quot;predict&quot;)]<br>    public IActionResult Predict([FromBody] TransactionData data)<br>    {<br>        var result = _model.Predict(data);</pre><pre>        return Ok(new<br>        {<br>            IsFraud = result.IsFraud,<br>            Probability = result.Probability<br>        });<br>    }<br>}</pre><h3>6. Sample Input JSON</h3><pre>{<br>  &quot;amount&quot;: 5000,<br>  &quot;transactionTime&quot;: 23,<br>  &quot;locationRiskScore&quot;: 0.8,<br>  &quot;deviceTrustScore&quot;: 0.2<br>}</pre><h3>7. Database Design (SQL Server)</h3><p>Transactions Table</p><pre>CREATE TABLE Transactions (<br>    Id INT PRIMARY KEY IDENTITY,<br>    Amount FLOAT,<br>    TransactionTime FLOAT,<br>    LocationRiskScore FLOAT,<br>    DeviceTrustScore FLOAT,<br>    IsFraud BIT,<br>    Probability FLOAT,<br>    CreatedAt DATETIME DEFAULT GETDATE()<br>);</pre><p>You can store prediction results after evaluation.</p><h3>8. Real-Time Prediction Flow</h3><ol><li>User makes payment</li><li>API receives transaction</li><li>ML model evaluates instantly (milliseconds)</li><li>If fraud probability &gt; 0.8 → block transaction</li><li>Store result in database</li><li>Notify user / admin</li></ol><h3>9. Production Deployment Architecture</h3><p>Production-Ready Architecture:</p><p>Angular Frontend → Nginx<br> ASP.NET Core API → Docker Container<br> ML Model → Inside API Container<br> SQL Server → Separate Container<br> Redis → Caching (Optional)</p><p>Docker Compose Setup:</p><ul><li>fraud-api</li><li>sql-server</li><li>redis</li></ul><p>This ensures scalability and microservices readiness.</p><h3>10. Performance Optimization</h3><p>Important in real-world fraud systems:</p><ul><li>Use async endpoints</li><li>Load model once (Singleton)</li><li>Use batch prediction for high traffic</li><li>Use Redis caching</li><li>Use background services for retraining</li></ul><h3>11. Model Improvement Ideas</h3><p>You can improve model accuracy by:</p><ul><li>Adding more features (IP risk score, user history, transaction frequency)</li><li>Using deep learning models</li><li>Using Azure ML</li><li>Implementing real-time retraining</li><li>Using anomaly detection</li></ul><h3>12. Enterprise-Level Enhancement</h3><p>For large-scale banking systems:</p><ul><li>Use message queue (RabbitMQ)</li><li>Microservices architecture</li><li>Use vector database for behavior profiling</li><li>Add AI explainability (SHAP values)</li></ul><h3>13. Final Thoughts</h3><p>With ASP.NET Core and ML.NET, building an AI-powered fraud detection system is straightforward and production-ready.</p><p>This project demonstrates:</p><ul><li>Real-world AI implementation</li><li>Clean architecture</li><li>Scalable backend</li><li>Practical ML integration</li></ul><p>As a .NET developer, you do not need to switch to Python to build AI solutions. The .NET ecosystem is powerful enough for enterprise AI applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57b15b046ec8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Smart AI Customer Support Chatbot with Angular + ASP.NET Core + Python (ML/NLP)]]></title>
            <link>https://medium.com/@bisheshdhiman5514/smart-ai-customer-support-chatbot-4c5e795ae312?source=rss-94bab91a8562------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c5e795ae312</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[self-improvement]]></category>
            <dc:creator><![CDATA[Bishesh Dhiman]]></dc:creator>
            <pubDate>Tue, 17 Feb 2026 16:53:13 GMT</pubDate>
            <atom:updated>2026-02-17T16:57:29.136Z</atom:updated>
            <content:encoded><![CDATA[<h3>Transforming Customer Support with AI &amp; Full-Stack Engineering</h3><p>In today’s fast-paced digital world, customers expect instant responses and seamless support experiences. Traditional rule-based chat systems often fail to understand context, sentiment, and intent — leading to frustration and escalations.</p><p>To solve this problem, I built a <strong>Smart AI Customer Support Chatbot</strong> powered by:</p><ul><li><strong>Angular</strong> for a modern, real-time chat interface</li><li><strong>ASP.NET Core</strong> for secure and scalable backend APIs</li><li><strong>Python (Machine Learning &amp; NLP)</strong> for intelligent intent detection and sentiment analysis</li></ul><p>This system is designed not just to reply — but to understand.</p><h3>What Makes This Chatbot Smart?</h3><p>Unlike basic scripted bots, this solution:</p><ul><li>Detects user intent using machine learning</li><li>Analyzes sentiment (positive, neutral, negative)</li><li>Generates contextual responses</li><li>Calculates confidence score</li><li>Escalates complex issues to human agents</li><li>Stores full conversation history</li><li>Works in real-time using SignalR</li></ul><p>It combines <strong>AI intelligence with enterprise-level architecture</strong>, making it production-ready and scalable.</p><h3>High-Level Architecture Overview</h3><p>The system follows a microservices-inspired architecture:</p><ol><li>Angular sends the user message</li><li>ASP.NET Core API processes and validates</li><li>Python AI service predicts intent &amp; sentiment</li><li>Confidence score determines next action</li><li>Data is stored in SQL Server</li><li>Response is sent back in real-time</li></ol><p>This clean separation ensures flexibility, scalability, and maintainability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kv9Gi8SSwT9_OK4nPOE2ig.png" /></figure><h3>Project Overview</h3><p>A <strong>production-ready AI-powered customer support chatbot</strong> that:</p><ul><li>Answers FAQs automatically</li><li>Detects customer intent</li><li>Analyzes sentiment (angry / neutral / happy)</li><li>Escalates complex issues to human agents</li><li>Stores chat history</li><li>Learns from previous conversations</li></ul><p>This system uses:</p><ul><li><strong>Angular</strong> → Modern chat UI</li><li><strong>ASP.NET Core Web API</strong> → Backend + Business logic</li><li><strong>Python (FastAPI + ML/NLP)</strong> → AI Intelligence layer</li><li>SQL Server → Database</li><li>SignalR → Real-time chat</li></ul><h3>Full Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/539/0*5or7CtTj0H4V4wnd.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JwVD3pKWpiteJCYk.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cs-0vcyIuEwkxhNw.png" /></figure><h3>System Flow</h3><h3>1 User Sends Message (Angular)</h3><p>User types message in chatbot UI.</p><h3>2 Angular calls .NET API</h3><p>POST /api/chat/send</p><h3>3 .NET forwards message to Python AI service</h3><p>HTTP call to FastAPI:</p><pre>POST http://ai-service:8000/predict</pre><h3>4 Python AI does:</h3><ul><li>Intent detection</li><li>Sentiment analysis</li><li>FAQ similarity matching</li></ul><h3>5 AI returns structured response:</h3><pre>{<br>  &quot;intent&quot;: &quot;refund_request&quot;,<br>  &quot;sentiment&quot;: &quot;negative&quot;,<br>  &quot;confidence&quot;: 0.94,<br>  &quot;reply&quot;: &quot;I understand you&#39;re facing refund issues...&quot;<br>}</pre><h3>6 .NET:</h3><ul><li>Stores conversation in DB</li><li>If low confidence → escalate</li><li>Sends response to Angular via SignalR</li></ul><h3>7 Angular updates chat in real-time</h3><h3>Technology Stack</h3><p>LayerTechnologyFrontendAngular 17BackendASP.NET Core 8 Web APIAI LayerPython FastAPI + Scikit-learnReal-timeSignalRDatabaseSQL ServerAuthJWTDeploymentDocker</p><h3>Database Design</h3><h3>Users</h3><pre>Id (PK)<br>Name<br>Email<br>Role</pre><h3>Conversations</h3><pre>Id<br>UserId (FK)<br>StartedAt</pre><h3>Messages</h3><pre>Id<br>ConversationId (FK)<br>Sender (User/Bot)<br>Text<br>Intent<br>Sentiment<br>CreatedAt</pre><h3>Python AI Service (FastAPI)</h3><h3>Install Dependencies</h3><pre>pip install fastapi uvicorn scikit-learn nltk joblib</pre><h3>AI Model (Intent Classification)</h3><h3>train_model.py</h3><pre>import pandas as pd<br>from sklearn.feature_extraction.text import TfidfVectorizer<br>from sklearn.linear_model import LogisticRegression<br>import joblib</pre><pre>data = {<br>    &quot;text&quot;: [<br>        &quot;I want refund&quot;,<br>        &quot;Order not delivered&quot;,<br>        &quot;How to reset password&quot;,<br>        &quot;Track my order&quot;<br>    ],<br>    &quot;intent&quot;: [<br>        &quot;refund_request&quot;,<br>        &quot;delivery_issue&quot;,<br>        &quot;password_reset&quot;,<br>        &quot;track_order&quot;<br>    ]<br>}</pre><pre>df = pd.DataFrame(data)</pre><pre>vectorizer = TfidfVectorizer()<br>X = vectorizer.fit_transform(df[&quot;text&quot;])</pre><pre>model = LogisticRegression()<br>model.fit(X, df[&quot;intent&quot;])</pre><pre>joblib.dump(model, &quot;model.pkl&quot;)<br>joblib.dump(vectorizer, &quot;vectorizer.pkl&quot;)</pre><p>Run once to train.</p><h3>FastAPI Service</h3><pre>from fastapi import FastAPI<br>import joblib<br>from pydantic import BaseModel</pre><pre>app = FastAPI()</pre><pre>model = joblib.load(&quot;model.pkl&quot;)<br>vectorizer = joblib.load(&quot;vectorizer.pkl&quot;)</pre><pre>class ChatRequest(BaseModel):<br>    message: str</pre><pre>@app.post(&quot;/predict&quot;)<br>def predict(chat: ChatRequest):<br>    X = vectorizer.transform([chat.message])<br>    intent = model.predict(X)[0]<br>    confidence = max(model.predict_proba(X)[0])</pre><pre>    return {<br>        &quot;intent&quot;: intent,<br>        &quot;confidence&quot;: float(confidence),<br>        &quot;reply&quot;: generate_reply(intent)<br>    }</pre><pre>def generate_reply(intent):<br>    replies = {<br>        &quot;refund_request&quot;: &quot;Please share your order ID for refund processing.&quot;,<br>        &quot;delivery_issue&quot;: &quot;We are checking your delivery status.&quot;,<br>        &quot;password_reset&quot;: &quot;Click on &#39;Forgot Password&#39; to reset.&quot;,<br>        &quot;track_order&quot;: &quot;Please provide your tracking ID.&quot;<br>    }<br>    return replies.get(intent, &quot;Can you please clarify?&quot;</pre><p>Run:</p><pre>uvicorn main:app --reload</pre><h3>ASP.NET Core Web API</h3><h3>ChatController.cs</h3><pre>[ApiController]<br>[Route(&quot;api/chat&quot;)]<br>public class ChatController : ControllerBase<br>{<br>    private readonly HttpClient _httpClient;</pre><pre>    public ChatController(IHttpClientFactory factory)<br>    {<br>        _httpClient = factory.CreateClient();<br>    }</pre><pre>    [HttpPost(&quot;send&quot;)]<br>    public async Task&lt;IActionResult&gt; SendMessage([FromBody] ChatRequest request)<br>    {<br>        var response = await _httpClient.PostAsJsonAsync(<br>            &quot;http://localhost:8000/predict&quot;,<br>            new { message = request.Message });</pre><pre>        var aiResponse = await response.Content.ReadFromJsonAsync&lt;AIResponse&gt;();</pre><pre>        return Ok(aiResponse);<br>    }<br>}</pre><h3>Models</h3><pre>public class ChatRequest<br>{<br>    public string Message { get; set; }<br>}</pre><pre>public class AIResponse<br>{<br>    public string Intent { get; set; }<br>    public double Confidence { get; set; }<br>    public string Reply { get; set; }<br>}</pre><h3>Angular Frontend</h3><h3>Install</h3><pre>ng new chatbot-ui</pre><h3>chat.service.ts</h3><pre>@Injectable({ providedIn: &#39;root&#39; })<br>export class ChatService {</pre><pre>  constructor(private http: HttpClient) {}</pre><pre>  sendMessage(message: string) {<br>    return this.http.post&lt;any&gt;(<br>      &#39;https://localhost:5001/api/chat/send&#39;,<br>      { message }<br>    );<br>  }<br>}</pre><h3>chat.component.ts</h3><pre>export class ChatComponent {<br>  messages: any[] = [];<br>  userInput = &#39;&#39;;</pre><pre>  constructor(private chatService: ChatService) {}</pre><pre>  send() {<br>    this.messages.push({ sender: &#39;user&#39;, text: this.userInput });</pre><pre>    this.chatService.sendMessage(this.userInput)<br>      .subscribe(res =&gt; {<br>        this.messages.push({<br>          sender: &#39;bot&#39;,<br>          text: res.reply<br>        });<br>      });</pre><pre>    this.userInput = &#39;&#39;;<br>  }<br>}</pre><h3>chat.component.html</h3><pre>&lt;div class=&quot;chat-box&quot;&gt;<br>  &lt;div *ngFor=&quot;let msg of messages&quot;<br>       [ngClass]=&quot;msg.sender&quot;&gt;<br>    {{ msg.text }}<br>  &lt;/div&gt;</pre><pre>  &lt;input [(ngModel)]=&quot;userInput&quot; /&gt;<br>  &lt;button (click)=&quot;send()&quot;&gt;Send&lt;/button&gt;<br>&lt;/div&gt;</pre><h3>Advanced Features You Can Add</h3><ul><li>Sentiment Analysis (TextBlob)</li><li>Multi-language Support</li><li>Voice Input</li><li>OpenAI Integration</li><li>Knowledge Base Search (Vector DB)</li><li>Admin Dashboard</li><li>Human Agent Escalation</li><li>Docker Compose Deployment</li></ul><h3>Production Deployment Architecture</h3><p>Use Docker:</p><pre>Angular → Nginx<br>.NET API → Container<br>Python AI → Container<br>SQL Server → Container</pre><h3>Final Thoughts</h3><p>Building a Smart AI Customer Support Chatbot using Angular, ASP.NET Core, and Python ML is more than just connecting three technologies — it’s about designing a scalable, intelligent, and production-ready system.</p><p>This architecture demonstrates:</p><ul><li>Clean separation of concerns</li><li>Microservices communication</li><li>Real-time interaction using SignalR</li><li>AI-driven decision making</li><li>Confidence-based escalation</li><li>Containerized deployment using Docker</li></ul><p>By containerizing each service independently, we achieve flexibility, scalability, and easier maintenance. The AI layer can evolve independently without impacting frontend or backend logic. This makes the system enterprise-ready and cloud-deployable.</p><p>In real-world applications, such an architecture can significantly reduce support costs, improve response time, and enhance customer satisfaction through intelligent automation.</p><p>The future of customer support lies in combining Full-Stack Engineering with AI — and this project is a step toward that intelligent future.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c5e795ae312" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building an AI-Powered Resume Screening System with Angular, ASP.NET Core, and Machine Learning]]></title>
            <link>https://medium.com/@bisheshdhiman5514/building-an-ai-powered-resume-screening-system-with-angular-asp-net-core-and-machine-learning-622bc3348aa1?source=rss-94bab91a8562------2</link>
            <guid isPermaLink="false">https://medium.com/p/622bc3348aa1</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Bishesh Dhiman]]></dc:creator>
            <pubDate>Thu, 05 Feb 2026 16:57:00 GMT</pubDate>
            <atom:updated>2026-02-05T16:57:00.156Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, we’ll build a <strong>real-world AI Resume Screening System</strong> using:</p><ul><li><strong>Angular</strong> — frontend UI</li><li><strong>ASP.NET Core</strong> — secure backend &amp; orchestration</li><li><strong>Python (Machine Learning)</strong> — resume analysis and scoring</li></ul><p>This system automatically analyzes resumes, compares them with job descriptions, and ranks candidates intelligently.</p><h3>What We Are Building</h3><h3>System Capabilities</h3><ul><li>Upload resumes (PDF/DOCX)</li><li>Parse resume text</li><li>Analyze resumes using ML</li><li>Match resumes with job descriptions</li><li>Rank candidates based on relevance</li><li>Display results in an Angular dashboard</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yEg7SuD_3FheEoBVHX8bQw.png" /></figure><h3>High-Level Architecture</h3><pre>Angular UI<br>   ↓<br>ASP.NET Core Web API<br>   ↓<br>Python ML Service<br>   ↓<br>Scoring &amp; Ranking<br>   ↓<br>Angular Dashboard</pre><h3>Technology Stack</h3><p>LayerTechnologyFrontendAngular 17BackendASP.NET Core Web APIAI / MLPython, scikit-learnResume ParsingPython (PyPDF2, docx)CommunicationREST APIsSecurityJWT Authentication</p><h3>Step 1: Angular Frontend (Resume Upload &amp; Results)</h3><h3>Resume Upload Component</h3><pre>// resume-upload.component.ts<br>import { HttpClient } from &#39;@angular/common/http&#39;;<br>import { Component } from &#39;@angular/core&#39;;<br><br>@Component({<br>  selector: &#39;app-resume-upload&#39;,<br>  templateUrl: &#39;./resume-upload.component.html&#39;<br>})<br>export class ResumeUploadComponent {<br>  jobDescription = &#39;&#39;;<br>  selectedFiles: File[] = [];<br><br>  constructor(private http: HttpClient) {}<br><br>  onFileChange(event: any) {<br>    this.selectedFiles = Array.from(event.target.files);<br>  }<br><br>  submit() {<br>    const formData = new FormData();<br>    this.selectedFiles.forEach(file =&gt;<br>      formData.append(&#39;files&#39;, file)<br>    );<br>    formData.append(&#39;jobDescription&#39;, this.jobDescription);<br><br>    this.http.post(<br>      &#39;https://localhost:5001/api/resume/analyze&#39;,<br>      formData<br>    ).subscribe(res =&gt; console.log(res));<br>  }<br>}</pre><h3>Template</h3><pre>&lt;textarea [(ngModel)]=&quot;jobDescription&quot;<br>  placeholder=&quot;Paste Job Description&quot;&gt;&lt;/textarea&gt;<br><br>&lt;input type=&quot;file&quot; multiple (change)=&quot;onFileChange($event)&quot; /&gt;<br>&lt;button (click)=&quot;submit()&quot;&gt;Analyze Resumes&lt;/button&gt;</pre><h3>Step 2: ASP.NET Core Backend</h3><p>ASP.NET Core acts as the <strong>orchestrator</strong> between Angular and Python ML.</p><h3>Resume Controller</h3><pre>[ApiController]<br>[Route(&quot;api/resume&quot;)]<br>public class ResumeController : ControllerBase<br>{<br>    private readonly HttpClient _httpClient;<br><br>    public ResumeController(IHttpClientFactory factory)<br>    {<br>        _httpClient = factory.CreateClient();<br>    }<br><br>    [HttpPost(&quot;analyze&quot;)]<br>    public async Task&lt;IActionResult&gt; Analyze(<br>        [FromForm] List&lt;IFormFile&gt; files,<br>        [FromForm] string jobDescription)<br>    {<br>        var resumes = new List&lt;string&gt;();<br><br>        foreach (var file in files)<br>        {<br>            using var ms = new MemoryStream();<br>            await file.CopyToAsync(ms);<br>            resumes.Add(Convert.ToBase64String(ms.ToArray()));<br>        }<br><br>        var payload = new<br>        {<br>            jobDescription,<br>            resumes<br>        };<br><br>        var response = await _httpClient.PostAsJsonAsync(<br>            &quot;http://localhost:8000/analyze&quot;,<br>            payload<br>        );<br><br>        var result = await response.Content.ReadAsStringAsync();<br>        return Ok(result);<br>    }<br>}</pre><h3>Step 3: Python ML Service (AI Brain)</h3><h3>Python Dependencies</h3><pre>pip install flask scikit-learn numpy PyPDF2 python-docx</pre><h3>Flask API</h3><pre>from flask import Flask, request, jsonify<br>import base64<br>from ml_engine import score_resumes<br><br>app = Flask(__name__)<br><br>@app.route(&quot;/analyze&quot;, methods=[&quot;POST&quot;])<br>def analyze():<br>    data = request.json<br>    job_desc = data[&quot;jobDescription&quot;]<br>    resumes = data[&quot;resumes&quot;]<br><br>    results = score_resumes(job_desc, resumes)<br>    return jsonify(results)<br><br>if __name__ == &quot;__main__&quot;:<br>    app.run(port=8000)</pre><h3>Step 4: Resume Text Extraction</h3><pre>import PyPDF2<br>import io<br>import base64<br><br>def extract_text(encoded_file):<br>    data = base64.b64decode(encoded_file)<br>    reader = PyPDF2.PdfReader(io.BytesIO(data))<br>    text = &quot;&quot;<br>    for page in reader.pages:<br>        text += page.extract_text()<br>    return text</pre><h3>Step 5: Machine Learning Matching Logic</h3><p>We use <strong>TF-IDF + Cosine Similarity</strong>, a proven NLP technique.</p><pre>from sklearn.feature_extraction.text import TfidfVectorizer<br>from sklearn.metrics.pairwise import cosine_similarity<br>from resume_parser import extract_textdef score_resumes(job_desc, encoded_resumes):<br>    resume_texts = [extract_text(r) for r in encoded_resumes]<br>    documents = [job_desc] + resume_texts<br>    vectorizer = TfidfVectorizer(stop_words=&#39;english&#39;)<br>    tfidf = vectorizer.fit_transform(documents)<br>    similarities = cosine_similarity(tfidf[0:1], tfidf[1:]).flatten()<br>    results = []<br>    for i, score in enumerate(similarities):<br>        results.append({<br>            &quot;candidateId&quot;: i + 1,<br>            &quot;score&quot;: round(score * 100, 2),<br>            &quot;recommendation&quot;: classify(score)<br>        })<br>    return sorted(results, key=lambda x: x[&quot;score&quot;], reverse=True)<br>def classify(score):<br>    if score &gt; 0.75:<br>        return &quot;Strong Match&quot;<br>    elif score &gt; 0.5:<br>        return &quot;Medium Match&quot;<br>    return &quot;Low Match&quot;</pre><h3>Step 6: Display Results in Angular</h3><pre>this.http.post&lt;any[]&gt;(<br>  &#39;https://localhost:5001/api/resume/analyze&#39;,<br>  formData<br>).subscribe(data =&gt; {<br>  this.candidates = data;<br>});</pre><pre>&lt;div *ngFor=&quot;let c of candidates&quot;&gt;<br>  &lt;h4&gt;Candidate {{c.candidateId}}&lt;/h4&gt;<br>  &lt;p&gt;Score: {{c.score}}%&lt;/p&gt;<br>  &lt;p&gt;Status: {{c.recommendation}}&lt;/p&gt;<br>&lt;/div&gt;</pre><h3>Security Considerations</h3><ul><li>JWT authentication in ASP.NET Core</li><li>Secure file handling</li><li>Encrypted storage</li><li>Role-based access</li><li>GDPR-compliant retention policies</li></ul><h3>Performance Optimization</h3><ul><li>Async processing in .NET</li><li>Background ML jobs</li><li>Resume caching</li><li>Scalable Python service</li><li>Cloud-based storage</li></ul><h3>Real-World Benefits</h3><ul><li>70–80% reduction in screening time</li><li>Consistent candidate evaluation</li><li>Scalable hiring pipeline</li><li>Bias reduction through structured scoring</li></ul><h3>Future Enhancements</h3><ul><li>Deep learning (BERT / transformers)</li><li>Skill gap analysis</li><li>AI interview questions</li><li>Bias detection</li><li>Multilingual resumes</li><li>Recruiter analytics dashboard</li></ul><h3>Final Thoughts</h3><p>AI resume screening is no longer experimental — it’s inevitable.</p><p>By combining <strong>Angular’s UI power</strong>, <strong>ASP.NET Core’s enterprise backend</strong>, and <strong>Python-based machine learning</strong>, we can build hiring platforms that are smarter, faster, and fairer.</p><p>This architecture can be extended to any document-intelligence system — contracts, invoices, compliance reports, or audits.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=622bc3348aa1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Firebase Notifications with Angular + ASP.NET Core]]></title>
            <link>https://medium.com/@bisheshdhiman5514/firebase-notifications-with-angular-asp-net-core-119152624156?source=rss-94bab91a8562------2</link>
            <guid isPermaLink="false">https://medium.com/p/119152624156</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[dotnet]]></category>
            <dc:creator><![CDATA[Bishesh Dhiman]]></dc:creator>
            <pubDate>Sun, 01 Feb 2026 17:31:25 GMT</pubDate>
            <atom:updated>2026-02-01T17:31:25.477Z</atom:updated>
            <content:encoded><![CDATA[<h3>End-to-End Push Notification Flow :</h3><p>Modern web applications are expected to <strong>engage users in real time</strong> — order updates, system alerts, chat messages, and reminders. Relying on API polling leads to delayed updates and unnecessary server load.</p><p>That’s where <strong>Firebase Cloud Messaging (FCM)</strong> comes in.</p><p>In this article, we’ll build a <strong>complete push notification flow</strong> using <strong>Angular (Frontend)</strong> and <strong>ASP.NET Core (Backend)</strong> — the right way, with security and scalability in mind.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R19Io9L9dV7cy1ifcKFyIg.png" /></figure><h3>What You’ll Learn</h3><p>How Firebase fits into Angular + .NET architecture<br>Full notification flow (Frontend → Backend → Firebase → User)<br>Angular FCM token handling<br>Sending notifications securely from ASP.NET Core<br>Common mistakes &amp; best practices</p><h3>High-Level Architecture</h3><pre>User Browser (Angular)<br>   ↓  (Generate FCM Token)<br>ASP.NET Core API<br>   ↓  (Send Message Request)<br>Firebase Cloud Messaging (FCM)<br>   ↓<br>User Receives Push Notification</pre><p><strong>Key Idea:</strong><br> Firebase is <strong>shared</strong>, but <strong>never directly called from Angular</strong> for sending notifications.<br> All notification sending happens <strong>from ASP.NET Core</strong>.</p><h3>Why This Approach?</h3><p>Secure (Server keys stay on backend)</p><p>Scalable (Multiple users &amp; devices)</p><p>Production-friendly</p><p>Real-world architecture used in enterprise apps</p><h3>Step 1: Firebase Project Setup</h3><ol><li>Go to <strong>Firebase Console</strong></li><li>Create a new project</li><li>Enable <strong>Cloud Messaging</strong></li><li>Generate:</li></ol><ul><li>Web Push Certificate (VAPID key)</li><li>Server key (⚠ keep this secret)</li></ul><p>These keys will be <strong>used differently</strong> in Angular and ASP.NET Core.</p><h3>Step 2: Angular — Frontend Integration</h3><h3>Install Firebase SDK</h3><pre>npm install firebase @angular/fire</pre><h3>Initialize Firebase</h3><pre>initializeApp(firebaseConfig);</pre><h3>Request Notification Permission</h3><pre>Notification.requestPermission().then(permission =&gt; {<br>  if (permission === &#39;granted&#39;) {<br>    console.log(&#39;Notification permission granted&#39;);<br>  }<br>});</pre><h3>Generate FCM Token</h3><pre>getToken(messaging, { vapidKey: &#39;YOUR_VAPID_KEY&#39; })<br>  .then(token =&gt; {<br>    // Send token to ASP.NET Core API<br>  });</pre><p>This token uniquely identifies the user/device.</p><h3>Store Token in Backend</h3><p>Send the token to ASP.NET Core:</p><pre>POST /api/notifications/register-token</pre><p>This allows the backend to know <strong>where to send notifications</strong>.</p><h3>Handle Foreground Messages</h3><pre>onMessage(messaging, payload =&gt; {<br>  console.log(&#39;Message received&#39;, payload);<br>});</pre><h3>Step 3: ASP.NET Core — Backend Integration</h3><h3>Store FCM Tokens</h3><p>Create a table like:</p><ul><li>UserId</li><li>FcmToken</li><li>Device</li><li>CreatedAt</li></ul><p>One user can have <strong>multiple tokens</strong> (mobile + web).</p><h3>Create Notification Service</h3><pre>public async Task SendNotificationAsync(string token)<br>{<br>    var message = new<br>    {<br>        to = token,<br>        notification = new<br>        {<br>            title = &quot;Order Update 📦&quot;,<br>            body = &quot;Your order has been shipped!&quot;<br>        }<br>    };<br>  // Call Firebase REST API<br>}</pre><h3>Call Firebase Cloud Messaging API</h3><ul><li>Use HttpClient</li><li>Add <strong>Authorization: Bearer SERVER_KEY</strong></li><li>Send JSON payload</li></ul><p><strong>Never expose the server key to Angular</strong></p><h3>Step 4: End-to-End Flow Example</h3><p><strong>User places an order</strong><br> Backend saves order<br> Backend fetches user FCM tokens<br> Backend sends notification via Firebase<br> User receives instant push</p><p>This is <strong>real-time engagement done right</strong>.</p><h3>Common Mistakes (Very Important)</h3><p>Sending notifications directly from Angular<br> Exposing Firebase server key in frontend<br> Not handling token refresh<br> Ignoring multiple devices per user<br> Assuming notifications work without service workers</p><h3>Security Best Practices</h3><p>Keep Firebase server keys in backend only<br> Use HTTPS everywhere<br> Log failed notification attempts<br> Use Topics for broadcast messages<br> Clean up expired tokens regularly</p><h3>When Should You Use Firebase Notifications?</h3><ul><li>Order status updates</li><li>Chat messages</li><li>System alerts</li><li>Marketing notifications</li><li>Real-time dashboards</li></ul><h3>Final Thoughts</h3><p>Firebase notifications are not just a feature — they are a <strong>cross-cutting system concern</strong>.<br> When implemented correctly with <strong>Angular + ASP.NET Core</strong>, they provide:</p><ul><li>Better UX</li><li>Real-time engagement</li><li>Clean separation of responsibilities</li><li>Production-grade scalability</li></ul><p>If you’re building <strong>modern full-stack applications</strong>, this pattern is a must-have.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=119152624156" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular + ASP.NET Core: Building a Real-Time App with SignalR]]></title>
            <link>https://medium.com/@bisheshdhiman5514/angular-asp-net-core-building-a-real-time-app-with-signalr-52abcde75a09?source=rss-94bab91a8562------2</link>
            <guid isPermaLink="false">https://medium.com/p/52abcde75a09</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[dotnet]]></category>
            <dc:creator><![CDATA[Bishesh Dhiman]]></dc:creator>
            <pubDate>Tue, 20 Jan 2026 15:39:46 GMT</pubDate>
            <atom:updated>2026-01-20T15:40:13.906Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Modern web applications increasingly rely on <strong>real-time features</strong> such as live notifications, dashboards, chat systems, and activity tracking. Traditional HTTP-based request–response models fall short when instant updates are required.</p><p>This is where <strong>SignalR</strong> comes in.</p><p>In this article, we’ll build a <strong>real-time notification system</strong> using:</p><ul><li><strong>Angular</strong> for the frontend</li><li><strong>ASP.NET Core</strong> for the backend</li><li><strong>SignalR</strong> for real-time communication</li></ul><p>By the end, you’ll understand how to integrate SignalR into a real-world Angular + .NET application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y91O1X0jQUnLbdwIaPk4mQ.png" /></figure><h3>What Is SignalR?</h3><p><strong>SignalR</strong> is a real-time communication library from Microsoft that allows the server to <strong>push data to connected clients instantly</strong>.</p><h3>Key Features</h3><ul><li>WebSocket-based (with automatic fallbacks)</li><li>Strongly typed hubs</li><li>Automatic connection management</li><li>Scales well with cloud services</li></ul><h3>Architecture Overview</h3><pre>Angular App<br>   │<br>   │  SignalR Connection<br>   │<br>ASP.NET Core API<br>   │<br>   └── SignalR Hub<br>           │<br>        Broadcast Updates</pre><h3>Use Cases</h3><ul><li>Live notifications</li><li>Real-time dashboards</li><li>Chat applications</li><li>Monitoring systems</li></ul><h3>Backend: ASP.NET Core with SignalR</h3><h3>1 Install Required Package</h3><pre>dotnet add package Microsoft.AspNetCore.SignalR</pre><h3>2 Create a SignalR Hub</h3><pre>using Microsoft.AspNetCore.SignalR;</pre><pre>public class NotificationHub : Hub<br>{<br>    public async Task SendNotification(string message)<br>    {<br>        await Clients.All.SendAsync(&quot;ReceiveNotification&quot;, message);<br>    }<br>}</pre><h3>3 Register SignalR in Program.cs</h3><pre>builder.Services.AddSignalR();</pre><pre>var app = builder.Build();</pre><pre>app.MapHub&lt;NotificationHub&gt;(&quot;/notificationHub&quot;);</pre><pre>app.Run();</pre><h3>4 Trigger Notifications from Controller</h3><pre>[ApiController]<br>[Route(&quot;api/notify&quot;)]<br>public class NotificationController : ControllerBase<br>{<br>    private readonly IHubContext&lt;NotificationHub&gt; _hubContext;</pre><pre>    public NotificationController(IHubContext&lt;NotificationHub&gt; hubContext)<br>    {<br>        _hubContext = hubContext;<br>    }</pre><pre>    [HttpPost]<br>    public async Task&lt;IActionResult&gt; Send(string message)<br>    {<br>        await _hubContext.Clients.All<br>            .SendAsync(&quot;ReceiveNotification&quot;, message);</pre><pre>        return Ok();<br>    }<br>}</pre><p>This allows <strong>any API event</strong> to trigger a real-time update.</p><h3>Frontend: Angular with SignalR</h3><h3>1 Install SignalR Client</h3><pre>npm install @microsoft/signalr</pre><h3>2 Create SignalR Service</h3><pre>import * as signalR from &#39;@microsoft/signalr&#39;;<br>import { Injectable } from &#39;@angular/core&#39;;</pre><pre>@Injectable({ providedIn: &#39;root&#39; })<br>export class SignalRService {<br>  private hubConnection!: signalR.HubConnection;</pre><pre>  startConnection() {<br>    this.hubConnection = new signalR.HubConnectionBuilder()<br>      .withUrl(&#39;https://localhost:5001/notificationHub&#39;)<br>      .withAutomaticReconnect()<br>      .build();</pre><pre>    this.hubConnection.start()<br>      .catch(err =&gt; console.error(err));<br>  }</pre><pre>  onNotification(callback: (message: string) =&gt; void) {<br>    this.hubConnection.on(&#39;ReceiveNotification&#39;, callback);<br>  }<br>}</pre><h3>3 Use SignalR in Angular Component</h3><pre>export class NotificationComponent implements OnInit {<br>  messages: string[] = [];</pre><pre>  constructor(private signalR: SignalRService) {}</pre><pre>  ngOnInit() {<br>    this.signalR.startConnection();</pre><pre>    this.signalR.onNotification(message =&gt; {<br>      this.messages.unshift(message);<br>    });<br>  }<br>}</pre><h3>4 Display Notifications</h3><pre>&lt;div *ngFor=&quot;let msg of messages&quot; class=&quot;alert alert-info&quot;&gt;<br>  {{ msg }}<br>&lt;/div&gt;</pre><p>Now notifications appear <strong>instantly</strong>, without page refresh.</p><h3>Handling Connection Lifecycle</h3><h3>Automatic Reconnection</h3><p>SignalR automatically reconnects when:</p><ul><li>Network drops</li><li>Server restarts</li></ul><pre>.withAutomaticReconnect()</pre><h3>Best Practices</h3><ul><li>Start connection once (AppComponent or CoreService)</li><li>Avoid reconnecting on every component load</li><li>Handle reconnection events if needed</li></ul><h3>Scaling SignalR Applications</h3><p>For large applications:</p><h3>Options</h3><ul><li>Azure SignalR Service</li><li>Redis backplane</li><li>Load-balanced servers</li></ul><p>This ensures messages are shared across multiple servers.</p><h3>Common Mistakes to Avoid</h3><p>Creating multiple hub connections<br> Starting connection inside multiple components<br> Sending large payloads via SignalR<br> Not handling reconnect logic</p><h3>When to Use SignalR (and When Not To)</h3><h3>Use SignalR When:</h3><ul><li>You need instant UI updates</li><li>Multiple users receive same events</li><li>Live data is critical</li></ul><h3>Avoid SignalR When:</h3><ul><li>Simple polling is sufficient</li><li>Updates are rare</li><li>App complexity must stay minimal</li></ul><h3>Real-World Use Cases</h3><ul><li>Live incident alerts</li><li>System monitoring dashboards</li><li>Collaborative applications</li><li>Chat and messaging platforms</li></ul><h3>Conclusion</h3><p>Angular and ASP.NET Core combined with SignalR provide a <strong>powerful real-time solution</strong> for modern web applications.</p><p>With minimal code, you can:</p><ul><li>Push live updates</li><li>Improve user experience</li><li>Build scalable, event-driven systems</li></ul><p>SignalR is a must-have tool in any <strong>full-stack Angular + .NET developer’s toolbox</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=52abcde75a09" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>