<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Hardik Jariwala</title>
    <description>The latest articles on Forem by Hardik Jariwala (@hardik_jariwala_748c4a032).</description>
    <link>https://forem.com/hardik_jariwala_748c4a032</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3056047%2Ff75afb86-1f92-4c11-a05f-5f328e693775.webp</url>
      <title>Forem: Hardik Jariwala</title>
      <link>https://forem.com/hardik_jariwala_748c4a032</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/hardik_jariwala_748c4a032"/>
    <language>en</language>
    <item>
      <title>🚀 Redis Caching in .NET (Memurai on Windows + Docker Recommended)</title>
      <dc:creator>Hardik Jariwala</dc:creator>
      <pubDate>Tue, 24 Mar 2026 16:55:43 +0000</pubDate>
      <link>https://forem.com/hardik_jariwala_748c4a032/redis-caching-in-net-memurai-on-windows-docker-recommended-39g5</link>
      <guid>https://forem.com/hardik_jariwala_748c4a032/redis-caching-in-net-memurai-on-windows-docker-recommended-39g5</guid>
      <description>&lt;p&gt;Caching is essential for improving performance and scalability in modern applications. This guide shows how to use Redis caching in .NET, including how to run it on Windows using Memurai (without Docker).&lt;/p&gt;

&lt;h2&gt;
  
  
  🔴 What is Redis?
&lt;/h2&gt;

&lt;p&gt;Redis is an in-memory data store used to cache frequently accessed data, making applications faster by reducing database calls. It serves data instantly on a cache hit and stores new data on a cache miss, improving performance and scalability.&lt;/p&gt;

&lt;p&gt;Why use it?&lt;br&gt;
⚡ Fast (RAM-based)&lt;br&gt;
📉 Reduces DB load&lt;br&gt;
🌍 Works across multiple servers&lt;br&gt;
⏱ Supports expiration (TTL)&lt;/p&gt;
&lt;h2&gt;
  
  
  🧠 How It Works (Cache Aside Pattern)
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Request → Check Cache → Return (if found) 
                     ↓ 
                  DB → Save in Cache → Return
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  📦 Required Packages (.NET)
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet add package Microsoft.Extensions.Caching.StackExchangeRedis 
dotnet add package Newtonsoft.Json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  ⚙️ Redis Configuration
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddStackExchangeRedisCache&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; 
&lt;span class="p"&gt;{&lt;/span&gt; 
     &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Configuration&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"localhost:6379"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
     &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;InstanceName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt;  &lt;span class="s"&gt;"MyApp:"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;🔥 Caching Implementation (Service Layer)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ProductService&lt;/span&gt; 
&lt;span class="p"&gt;{&lt;/span&gt; 
     &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="n"&gt;IDistributedCache&lt;/span&gt; &lt;span class="n"&gt;_cache&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
     &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;ProductService&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IDistributedCache&lt;/span&gt; &lt;span class="n"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
     &lt;span class="p"&gt;{&lt;/span&gt; 
          &lt;span class="n"&gt;_cache&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
     &lt;span class="p"&gt;}&lt;/span&gt; 
     &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Product&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;GetProducts&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; 
     &lt;span class="p"&gt;{&lt;/span&gt; 
         &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;cacheKey&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"product_list"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
         &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;cacheData&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;_cache&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GetStringAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cacheKey&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
         &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cacheData&lt;/span&gt; &lt;span class="p"&gt;!=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
         &lt;span class="p"&gt;{&lt;/span&gt; 
             &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Data from Redis"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
             &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;JsonConvert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DeserializeObject&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Product&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;gt;&lt;/span&gt;   
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cacheData&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
         &lt;span class="p"&gt;}&lt;/span&gt; 
         &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Data from DB"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
         &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;FakeDb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GetProducts&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Replace with real DB &lt;/span&gt;
         &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;DistributedCacheEntryOptions&lt;/span&gt; 
         &lt;span class="p"&gt;{&lt;/span&gt; 
             &lt;span class="n"&gt;AbsoluteExpirationRelativeToNow&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;TimeSpan&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;FromMinutes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
         &lt;span class="p"&gt;};&lt;/span&gt; 
         &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;_cache&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SetStringAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;cacheKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;JsonConvert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SerializeObject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt; 
          &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
     &lt;span class="p"&gt;}&lt;/span&gt; 
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Run Redis WITHOUT Docker (Windows)
&lt;/h2&gt;

&lt;p&gt;Use Memurai:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install Memurai&lt;/li&gt;
&lt;li&gt;Start service:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;Win + R → services.msc → Start "Memurai"&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Verify:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;memurai-cli ping
Output: `PONG`
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Runs on:localhost:6379&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🐳 Recommended: Use Docker
&lt;/h2&gt;

&lt;p&gt;Docker (best for production)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;docker run -d -p 6379:6379 redis

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🔄 Cache Invalidation (Important)
&lt;/h2&gt;

&lt;p&gt;Remove cache manually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;_cache&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;RemoveAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"product_list"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use expiration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;AbsoluteExpirationRelativeToNow&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;TimeSpan&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;FromMinutes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Clear all cache (dev):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;memurai-cli flushall
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🧠 Best Practices With...
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Always set expiry&lt;/li&gt;
&lt;li&gt;Use meaningful keys (product_101)&lt;/li&gt;
&lt;li&gt;Invalidate cache on update/delete&lt;/li&gt;
&lt;li&gt;Avoid caching sensitive data&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>redis</category>
      <category>docker</category>
      <category>webdev</category>
      <category>dotnetcore</category>
    </item>
    <item>
      <title>📡 Real-Time Communication with SignalR in ASP.NET Core Complete Setup Guide</title>
      <dc:creator>Hardik Jariwala</dc:creator>
      <pubDate>Tue, 27 May 2025 18:06:14 +0000</pubDate>
      <link>https://forem.com/hardik_jariwala_748c4a032/real-time-communication-with-signalr-in-aspnet-core-complete-setup-guide-22bb</link>
      <guid>https://forem.com/hardik_jariwala_748c4a032/real-time-communication-with-signalr-in-aspnet-core-complete-setup-guide-22bb</guid>
      <description>&lt;p&gt;Want to build a real-time chat app or push live notifications? In this blog, I’ll walk you through setting up SignalR from scratch using ASP.NET Core and a .NET console client. Perfect for beginners or those revisiting SignalR.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  🔧 Step 1: Create the SignalR Server Project
&lt;/h2&gt;

&lt;p&gt;Create an ASP.NET Core Web API project and add package&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet add package Microsoft.AspNetCore.SignalR
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🧠 Step 2: Create a SignalR Hub
&lt;/h2&gt;

&lt;p&gt;Create a new class &lt;code&gt;ChatHub.cs&lt;/code&gt; inside the project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;using Microsoft.AspNetCore.SignalR;

public class ChatHub : Hub
{
    public async Task SendMessage(string user, string message)
    {
        await Clients.All.SendAsync("ReceiveMessage", user, message);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h2&gt;
  
  
  🌐 Step 3: Configure the SignalR Hub in &lt;code&gt;Program.cs&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Update &lt;code&gt;Program.cs&lt;/code&gt; to register the SignalR service and endpoint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSignalR();
builder.Services.AddControllers();
var app = builder.Build();

app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();

// Add this line to map the hub
app.MapHub&amp;lt;ChatHub&amp;gt;("/chatHub");

app.Run();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h2&gt;
  
  
  🧪 Step 4: Run the Server
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dotnet run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h2&gt;
  
  
  📥 Step 5: Create a .NET Console Client
&lt;/h2&gt;

&lt;p&gt;Create a new console app and add SignalR client package&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dotnet add package Microsoft.AspNetCore.SignalR.Client
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h2&gt;
  
  
  🧑‍💻 Step 6: Build the Client Logic
&lt;/h2&gt;

&lt;p&gt;Replace &lt;code&gt;Program.cs&lt;/code&gt; content with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;using Microsoft.AspNetCore.SignalR.Client;

var connection = new HubConnectionBuilder()
    .WithUrl("https://&amp;lt;your localhost&amp;gt;/chatHub") your server
    .WithAutomaticReconnect()
    .Build();

// Receive messages
connection.On&amp;lt;string, string&amp;gt;("ReceiveMessage", (user, message) =&amp;gt;
{
    Console.WriteLine($"{user}: {message}");
});

try
{
    await connection.StartAsync();
    Console.WriteLine("Connected to SignalR Hub.");
}
catch (Exception ex)
{
    Console.WriteLine($"Connection failed: {ex.Message}");
    return;
}

// Sending messages
while (true)
{
    Console.Write("Enter your name: ");
    var user = Console.ReadLine();

    Console.Write("Enter your message: ");
    var message = Console.ReadLine();

    try
    {
        await connection.InvokeAsync("SendMessage", user, message);
    }
    catch (Exception ex)
    {
        Console.WriteLine($"Error sending message: {ex.Message}");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h2&gt;
  
  
  ✅ Step 7: Test the Communication
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Run the server project:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd ../SignalRServer
dotnet run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Run the client project in a new terminal:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd ../SignalRClient
dotnet run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Type your name and message in the console. If everything is set up correctly, you’ll see the message echoed back from the hub.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧪 Test Multiple Clients
&lt;/h2&gt;

&lt;p&gt;Open two terminals and run the client in each. You’ll see real-time communication between both.&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>webdev</category>
      <category>signalr</category>
      <category>beginners</category>
    </item>
    <item>
      <title>🐳 Dockerize Your Angular App: A Beginner’s Guide</title>
      <dc:creator>Hardik Jariwala</dc:creator>
      <pubDate>Sun, 20 Apr 2025 07:24:35 +0000</pubDate>
      <link>https://forem.com/hardik_jariwala_748c4a032/dockerize-your-angular-17-app-a-beginners-guide-4pjn</link>
      <guid>https://forem.com/hardik_jariwala_748c4a032/dockerize-your-angular-17-app-a-beginners-guide-4pjn</guid>
      <description>&lt;h2&gt;
  
  
  What is Docker?🧠
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Imagine shipping your entire application including its OS, environment, dependencies, and code as one neatly packaged box. That’s Docker in a nutshell.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Docker is a platform that allows you to create, deploy, and run applications in isolated environments called containers. These containers ensure your app works the same across development, testing, staging, and production regardless of the host OS.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Docker for Angular?📦
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;No more “but it works on my machine!” bugs&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Clean, reproducible dev environments&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Easy deployment to cloud platforms&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lightweight and fast compared to VMs(Virtual Machines)&lt;br&gt;
&lt;br&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Getting Started with Docker🚀
&lt;/h2&gt;

&lt;p&gt;✅ Install Docker&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Make sure Docker is installed and running on your machine.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.docker.com/products/docker-desktop/" rel="noopener noreferrer"&gt;Install Docker Desktop&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Verify via terminal:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h3&gt;
  
  
  Essential Docker Commands🛠️
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker build -t your-app-name .
docker run -p 3000:3000 your-app-name
docker ps        # list running containers
docker stop &amp;lt;container-id&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h2&gt;
  
  
  Dockerizing an Angular 17+ Project 🧑‍💻
&lt;/h2&gt;



&lt;h3&gt;
  
  
  Step 1: Build Your Angular App 🏗️
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ng build --configuration production
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Output will go to: &lt;code&gt;dist/your-app-name/browser&lt;/code&gt;

&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 2: Create a Dockerfile 📁
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Build stage
FROM node:18 AS build

WORKDIR /app

# Copy package.json and package-lock.json to leverage Docker cache
COPY package*.json ./

# Install dependencies
RUN npm install --legacy-peer-deps 

# Install additional dependencies
RUN npm install ngx-bootstrap google-libphonenumber --legacy-peer-deps

# Copy project files
COPY . .

# Build the Angular application with production configuration
RUN npm run build -- --configuration production

# Serve stage
FROM node:18-slim

# Install a lightweight static server
RUN npm install -g serve

WORKDIR /app/dist/your-app-name/browser

# Copy the built Angular app from the previous stage
COPY --from=build /app/dist/your-app-name/browser .

# Expose the default serve port
EXPOSE 3000

# Run the app with serve
CMD ["serve", "-s", ".", "-l", "3000"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔁 Replace your-app-name with the actual folder name inside dist.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Build and Run the Container 🚀
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Build the Docker image
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker build -t angular-demo .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Run the container
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run -p 3000:3000 angular-demo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Open in browser&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Go to 👉 &lt;a href="http://localhost:3000" rel="noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Bonus: Docker for Development (Optional) 🎁
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Want live-reloading while developing?&lt;/li&gt;
&lt;li&gt;Mount your project folder as a volume&lt;/li&gt;
&lt;li&gt;Use Angular CLI inside the container&lt;/li&gt;
&lt;li&gt;Use ng serve --host 0.0.0.0

&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion 🧾
&lt;/h2&gt;

&lt;p&gt;Docker and Angular make a powerful combo for modern web development. Whether you're deploying to the cloud or just keeping your local dev environment tidy, containers are the way to go. With Angular 17’s new standalone module system and enhanced performance, it's the perfect time to containerize your app and scale your skills.&lt;/p&gt;

</description>
      <category>angular</category>
      <category>docker</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>🚀 Mastering Angular 17+ Fundamentals : A Dev’s Guide to Modern Angular</title>
      <dc:creator>Hardik Jariwala</dc:creator>
      <pubDate>Wed, 16 Apr 2025 17:18:39 +0000</pubDate>
      <link>https://forem.com/hardik_jariwala_748c4a032/mastering-angular-17-fundamentals-a-devs-guide-to-modern-angular-54k7</link>
      <guid>https://forem.com/hardik_jariwala_748c4a032/mastering-angular-17-fundamentals-a-devs-guide-to-modern-angular-54k7</guid>
      <description>&lt;p&gt;Angular has evolved into a powerful and modern framework for building scalable web applications. With the advent of standalone components, reactive primitives, and deferrable views, Angular is more streamlined than ever.&lt;/p&gt;

&lt;p&gt;In this post, we’ll walk through core Angular concepts every modern developer should know, complete with theory and code examples. Whether you’re a beginner or brushing up, this guide is your Angular fundamentals crash course.&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of Contents📚
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Routing&lt;/li&gt;
&lt;li&gt;Standalone Components&lt;/li&gt;
&lt;li&gt;Forms&lt;/li&gt;
&lt;li&gt;Property Binding&lt;/li&gt;
&lt;li&gt;Event Handling&lt;/li&gt;
&lt;li&gt;Conditional Rendering&lt;/li&gt;
&lt;li&gt;For Loops in Angular&lt;/li&gt;
&lt;li&gt;Passing Data Between Components&lt;/li&gt;
&lt;li&gt;Deferrable Views&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Routing🧭
&lt;/h2&gt;

&lt;p&gt;Routing lets you navigate between views and components in Angular apps.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// app.routes.ts
import { Routes } from '@angular/router';
import { HomeComponent } from './home.component';
import { AboutComponent } from './about.component';

export const routes: Routes = [
  { path: '', component: HomeComponent },
  { path: 'about', component: AboutComponent },
];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// main.ts
bootstrapApplication(AppComponent, {
  providers: [provideRouter(routes)],
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Standalone Components🧩
&lt;/h2&gt;

&lt;p&gt;Standalone components don’t need an NgModule. They promote simpler architecture.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Component({
  standalone: true,
  selector: 'app-hello',
  template: `&amp;lt;h1&amp;gt;Hello, Angular!&amp;lt;/h1&amp;gt;`,
})
export class HelloComponent {}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Forms📝
&lt;/h2&gt;

&lt;p&gt;Angular supports template-driven and reactive forms.&lt;br&gt;
Template-driven Form:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;form #form="ngForm" (ngSubmit)="submit(form.value)"&amp;gt;
  &amp;lt;input name="username" ngModel /&amp;gt;
  &amp;lt;button type="submit"&amp;gt;Submit&amp;lt;/button&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Property Binding🔗
&lt;/h2&gt;

&lt;p&gt;Bind values from component to template using [property].&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;img [src]="imageUrl" alt="Dynamic Image" /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Event Handling🖱️
&lt;/h2&gt;

&lt;p&gt;Use (event) to listen for DOM events&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;button (click)="handleClick()"&amp;gt;Click Me&amp;lt;/button&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;handleClick() {
  console.log('Button clicked!');
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conditional Rendering🔄
&lt;/h2&gt;

&lt;p&gt;Show/hide elements with *ngIf.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;p *ngIf="isLoggedIn"&amp;gt;Welcome back!&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;isLoggedIn = true;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  For Loops in Angular🔁
&lt;/h2&gt;

&lt;p&gt;Use *ngFor to loop through lists.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;ul&amp;gt;
  &amp;lt;li *ngFor="let user of users"&amp;gt;{{ user.name }}&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;users = [{ name: 'Alice' }, { name: 'Bob' }];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Passing Data Between Components🔄
&lt;/h2&gt;

&lt;p&gt;Use @Input and @Output to communicate.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Parent to Child:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;app-user [name]="userName"&amp;gt;&amp;lt;/app-user&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Input() name!: string;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Child to Parent:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;app-user (notify)="onNotify()"&amp;gt;&amp;lt;/app-user&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Output() notify = new EventEmitter&amp;lt;void&amp;gt;();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Deferrable Views💤
&lt;/h2&gt;

&lt;p&gt;Optimize performance by deferring part of the UI until needed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;ng-container *ngIf="isLoaded(); else loading"&amp;gt;
  &amp;lt;app-heavy-component /&amp;gt;
&amp;lt;/ng-container&amp;gt;
&amp;lt;ng-template #loading&amp;gt;
  &amp;lt;p&amp;gt;Loading...&amp;lt;/p&amp;gt;
&amp;lt;/ng-template&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Final Thoughts🧠
&lt;/h2&gt;

&lt;p&gt;Angular’s modernization journey with features like standalone components and signals makes it more intuitive, reactive, and leaner than ever. Mastering these fundamentals sets you up for building robust, scalable applications.&lt;/p&gt;

&lt;p&gt;Feel free to share your thoughts or ask questions in the comments. Happy coding! 🔥&lt;/p&gt;

</description>
      <category>angular</category>
      <category>typescript</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
