<?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>DEV Community: Sumeet Dugg</title>
    <description>The latest articles on DEV Community by Sumeet Dugg (@practical_tech_notes).</description>
    <link>https://dev.to/practical_tech_notes</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%2F3532217%2F16e311ee-4871-42cb-beb2-c16052b9c25b.jpg</url>
      <title>DEV Community: Sumeet Dugg</title>
      <link>https://dev.to/practical_tech_notes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/practical_tech_notes"/>
    <language>en</language>
    <item>
      <title>Fake Developer Dashboard That Roasts You While You Work 💀</title>
      <dc:creator>Sumeet Dugg</dc:creator>
      <pubDate>Sun, 12 Apr 2026 14:43:11 +0000</pubDate>
      <link>https://dev.to/practical_tech_notes/fake-developer-dashboard-that-roasts-you-while-you-work-2go</link>
      <guid>https://dev.to/practical_tech_notes/fake-developer-dashboard-that-roasts-you-while-you-work-2go</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/aprilfools-2026"&gt;DEV April Fools Challenge&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;I built &lt;strong&gt;FakeDevDashboard&lt;/strong&gt; — a satirical, real-time developer dashboard that looks completely serious but shows 100% fake (and painfully relatable) metrics written in Csharp programming.&lt;/p&gt;

&lt;p&gt;It includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fake system metrics (CPU always dying 🔥)&lt;/li&gt;
&lt;li&gt;Developer “mental state” tracking (highly questionable accuracy)&lt;/li&gt;
&lt;li&gt;AI-generated chaos predictions using Google Gemini&lt;/li&gt;
&lt;li&gt;Fake commit history (aka Wall of Shame)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal was simple:&lt;br&gt;&lt;br&gt;
👉 Make something that &lt;em&gt;looks enterprise-level… but do silly things to  developers.&lt;/em&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  Project
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/sumeetpypi" rel="noopener noreferrer"&gt;
        sumeetpypi
      &lt;/a&gt; / &lt;a href="https://github.com/sumeetpypi/dev-Challenges-projects" rel="noopener noreferrer"&gt;
        dev-Challenges-projects
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;⚡ FakeDevDashboard&lt;/h1&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;A completely fake, hilariously over-engineered developer monitoring dashboard that looks very serious and roasts you while you work.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/90e3d76d1b04383bb8b36b76a0af851bcf19dd9e7fbb598867e5bcf96ccf7a0c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2e4e45542d382e302d3531324244343f7374796c653d666c61742d737175617265266c6f676f3d646f746e6574"&gt;&lt;img src="https://camo.githubusercontent.com/90e3d76d1b04383bb8b36b76a0af851bcf19dd9e7fbb598867e5bcf96ccf7a0c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2e4e45542d382e302d3531324244343f7374796c653d666c61742d737175617265266c6f676f3d646f746e6574" alt=".NET"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/83ee84f52bc6222237d462736694dc4e7b2e46222897308a8c6177e8f87a7d95/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f432532332d4d56432d3233393132303f7374796c653d666c61742d737175617265266c6f676f3d637368617270"&gt;&lt;img src="https://camo.githubusercontent.com/83ee84f52bc6222237d462736694dc4e7b2e46222897308a8c6177e8f87a7d95/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f432532332d4d56432d3233393132303f7374796c653d666c61742d737175617265266c6f676f3d637368617270" alt="C#"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/9aab05cf443840d949e9c1e43c7e16ddb00acc449a159752c60bb3beedcc0f21/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f47656d696e692d322e30253230466c6173682d3432383546343f7374796c653d666c61742d737175617265266c6f676f3d676f6f676c65"&gt;&lt;img src="https://camo.githubusercontent.com/9aab05cf443840d949e9c1e43c7e16ddb00acc449a159752c60bb3beedcc0f21/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f47656d696e692d322e30253230466c6173682d3432383546343f7374796c653d666c61742d737175617265266c6f676f3d676f6f676c65" alt="Gemini AI"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/422db9fd40f5831c765cf6530b6750c081b696bd18d904cf89554df98c676277/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e3f7374796c653d666c61742d737175617265"&gt;&lt;img src="https://camo.githubusercontent.com/422db9fd40f5831c765cf6530b6750c081b696bd18d904cf89554df98c676277/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e3f7374796c653d666c61742d737175617265" alt="License"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/e9c16cd1182f759a49d0325a407674c7ab6a81a13ce768e49a9b6dee507477a5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73616e6974792d31322532352d7265643f7374796c653d666c61742d737175617265"&gt;&lt;img src="https://camo.githubusercontent.com/e9c16cd1182f759a49d0325a407674c7ab6a81a13ce768e49a9b6dee507477a5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73616e6974792d31322532352d7265643f7374796c653d666c61742d737175617265" alt="Sanity"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;⚡ FAKEDEV DASHBOARD ONLINE
All metrics are completely fake. Your prediction is 100% real
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;📸 What It Looks Like&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;A dark terminal-aesthetic dashboard with four main panels:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;System Metrics&lt;/strong&gt; — CPU always screaming, RAM holding on for dear life&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mental State Monitor&lt;/strong&gt; — Imposter syndrome at 94%, sanity at 12%&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI Chaos Engine&lt;/strong&gt; — Gemini AI predicting your production outages&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wall of Shame&lt;/strong&gt; — Your fake (but accurate) commit history&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;✨ Features&lt;/h2&gt;

&lt;/div&gt;
&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;🖥️ Fake System Metrics&lt;/td&gt;
&lt;td&gt;CPU/RAM/Disk/Network bars that auto-refresh every 8 seconds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🧠 Mental State Monitor&lt;/td&gt;
&lt;td&gt;Tracks sanity, confidence, imposter syndrome &amp;amp; reddit time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🤖 AI Chaos Engine&lt;/td&gt;
&lt;td&gt;Google Gemini generates prophecies, horoscopes &amp;amp; chaos warnings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;💬 Live AI Chat&lt;/td&gt;
&lt;td&gt;Full conversation with the Chaos Engine in the dashboard&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🚨 Random Alerts&lt;/td&gt;
&lt;td&gt;Rotating panel of darkly humorous&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;…&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/sumeetpypi/dev-Challenges-projects" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;





&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🏗️ Tech Stack
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;ASP.NET Core MVC (.NET 8)&lt;/li&gt;
&lt;li&gt;C#&lt;/li&gt;
&lt;li&gt;Google Gemini 2.0 Flash API&lt;/li&gt;
&lt;li&gt;HTML + CSS Grid + JavaScript (fetch + setInterval)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  ⚙️ Architecture
&lt;/h3&gt;

&lt;p&gt;The project follows clean MVC architecture:&lt;/p&gt;

&lt;h3&gt;
  
  
  🔌 Key Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Live updates&lt;/strong&gt; using polling (no SignalR)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dependency Injection&lt;/strong&gt; with Singleton services&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI integration&lt;/strong&gt; with fallback handling&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Graceful degradation&lt;/strong&gt; (works even without API key)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🤖 AI Chaos Engine
&lt;/h3&gt;

&lt;p&gt;Uses Google Gemini API to generate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Developer horoscope&lt;/li&gt;
&lt;li&gt;Daily prophecy&lt;/li&gt;
&lt;li&gt;Deployment risk&lt;/li&gt;
&lt;li&gt;Chaos probability&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Fallback system ensures:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;App never crashes&lt;/li&gt;
&lt;li&gt;Always returns something funny&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧩 Features
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🖥️ System Metrics
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;CPU always above 90%&lt;/li&gt;
&lt;li&gt;Chrome using entire RAM&lt;/li&gt;
&lt;li&gt;Node modules consuming reality&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🧠 Developer Metrics
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Confidence: low&lt;/li&gt;
&lt;li&gt;Bugs: increasing&lt;/li&gt;
&lt;li&gt;Google searches: questionable&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🤖 AI Chat
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Ask AI if you should deploy&lt;/li&gt;
&lt;li&gt;Get roasted professionally&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  📝 Wall of Shame
&lt;/h3&gt;

&lt;h2&gt;
  
  
  Example commits:
&lt;/h2&gt;

&lt;h2&gt;
  
  
  ⚡ Fun Elements
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Random chaos alerts every ~25 seconds&lt;/li&gt;
&lt;li&gt;“Trigger Chaos” button&lt;/li&gt;
&lt;li&gt;Konami Code Easter Egg 🎮&lt;/li&gt;
&lt;li&gt;DevTools console surprise&lt;/li&gt;
&lt;li&gt;Fake but realistic alerts&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💡 What I Learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Clean dependency injection in ASP.NET Core&lt;/li&gt;
&lt;li&gt;Using IHttpClientFactory properly&lt;/li&gt;
&lt;li&gt;Async/await patterns in real APIs&lt;/li&gt;
&lt;li&gt;Strongly typed ViewModels&lt;/li&gt;
&lt;li&gt;Designing resilient systems with fallbacks&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚀 Try It Yourself
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Clone the repo
&lt;/li&gt;
&lt;li&gt;Open in Visual Studio 2022
&lt;/li&gt;
&lt;li&gt;Add Gemini API key in &lt;code&gt;appsettings.json&lt;/code&gt; (optional)
&lt;/li&gt;
&lt;li&gt;Run the app
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;No API key?&lt;br&gt;&lt;br&gt;
👉 No problem — it still works with built-in chaos 😄&lt;/p&gt;




&lt;h2&gt;
  
  
  Prize Category
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Best Google AI Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Integrated Gemini API into a real app&lt;/li&gt;
&lt;li&gt;Built fallback-safe AI system&lt;/li&gt;
&lt;li&gt;Used AI creatively (not just “generate text”)&lt;/li&gt;
&lt;li&gt;Turned AI into a &lt;em&gt;chaos engine&lt;/em&gt; 😈&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Final Thought
&lt;/h2&gt;

&lt;p&gt;We spend so much time building serious software.&lt;/p&gt;

&lt;p&gt;Sometimes…&lt;br&gt;&lt;br&gt;
you need a dashboard that tells you:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Deployment successful. Consequences unknown.”&lt;/p&gt;
&lt;/blockquote&gt;




</description>
      <category>devchallenge</category>
      <category>418challenge</category>
      <category>dotnet</category>
      <category>csharp</category>
    </item>
    <item>
      <title>ASP.NET Core MVC Explained — Step-by-Step with Real Code &amp; Best Practices</title>
      <dc:creator>Sumeet Dugg</dc:creator>
      <pubDate>Tue, 07 Apr 2026 10:45:25 +0000</pubDate>
      <link>https://dev.to/practical_tech_notes/aspnet-core-mvc-explained-step-by-step-with-real-code-best-practices-3km0</link>
      <guid>https://dev.to/practical_tech_notes/aspnet-core-mvc-explained-step-by-step-with-real-code-best-practices-3km0</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Understand models, views, controllers and why you should use MVC for scalable, testable applications.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Model-View-Controller (MVC) is the standard architectural pattern for building modern web applications in ASP.NET Core. It is a design pattern that separates an application into three main logical components: the &lt;strong&gt;Model&lt;/strong&gt;, the &lt;strong&gt;View&lt;/strong&gt;, and the &lt;strong&gt;Controller&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This separation helps manage complexity when building applications, allowing you to focus on one aspect of the implementation at a time.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;During my college days, I built a &lt;em&gt;Banking System&lt;/em&gt; project as part of my academic curriculum. You can check it out here: &lt;a href="https://github.com/sumeetpypi/bankingProject-c-.net-" rel="noopener noreferrer"&gt;bankingProject-c-.net&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Challenges &amp;amp; Limitations I Faced Without MVC&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Building the project without MVC introduced several problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No Separation of Concerns&lt;/strong&gt; — All HTML, business logic, and data handling lived together.
&lt;strong&gt;How MVC Solves These Problems&lt;/strong&gt;
In contrast, MVC provides:&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Models&lt;/strong&gt; for data and business logic&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Views&lt;/strong&gt; for UI&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Controllers&lt;/strong&gt; to handle user interaction and route requests&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;This separation makes the code easier to maintain, easier to test, and cleaner and scalable.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The Core Components
&lt;/h2&gt;

&lt;p&gt;Each component has a distinct responsibility. Understanding the boundaries between them is key to writing clean code.&lt;/p&gt;

&lt;h3&gt;
  
  
  M — The Model
&lt;/h3&gt;

&lt;p&gt;The Model represents the shape of your data and the business logic. It is the "truth" of your application.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Responsibilities:&lt;/strong&gt; Manages the state of the application and handles data logic (e.g., interacting with the database, validating data rules).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;In ASP.NET Core:&lt;/strong&gt; These are typically plain C# classes (POCOs).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Domain Models:&lt;/strong&gt; Represent database tables (e.g. &lt;code&gt;Product&lt;/code&gt;, &lt;code&gt;User&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;View Models:&lt;/strong&gt; Data specifically shaped for display on a screen (e.g. &lt;code&gt;ProductSummaryViewModel&lt;/code&gt; that combines data from multiple tables).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  V — The View
&lt;/h3&gt;

&lt;p&gt;The View is the User Interface (UI). Its only job is to display information to the user.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Responsibilities:&lt;/strong&gt; Renders the user interface elements (HTML, CSS) using data provided by the Controller. Ideally, a View should not contain complex logic — only presentation logic (e.g., loops to display a list, if-statements to show/hide buttons).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;In ASP.NET Core:&lt;/strong&gt; These are &lt;code&gt;.cshtml&lt;/code&gt; files using the Razor view engine. Razor allows you to embed C# code directly into HTML to generate dynamic content.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  C — The Controller
&lt;/h3&gt;

&lt;p&gt;The Controller is the &lt;strong&gt;coordinator&lt;/strong&gt;. It handles user input and interaction.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Responsibilities:&lt;/strong&gt; Receives the user's request, figures out what to do with it (usually by calling services or the Model), and then selects which View to return to the user.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;In ASP.NET Core:&lt;/strong&gt; Controllers are C# classes that inherit from &lt;code&gt;Controller&lt;/code&gt;. They contain public methods called Actions (e.g., &lt;code&gt;Index()&lt;/code&gt;, &lt;code&gt;Details(id)&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. The Request Lifecycle
&lt;/h2&gt;

&lt;p&gt;To understand MVC, you must follow the path of a web request (e.g., a user clicking a link).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Routing:&lt;/strong&gt; A user navigates to a URL like &lt;code&gt;Books/Details/2&lt;/code&gt;. The ASP.NET Core Routing engine determines it needs the &lt;code&gt;BooksController&lt;/code&gt; and the &lt;code&gt;Details&lt;/code&gt; action method.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Controller Action:&lt;/strong&gt; The &lt;code&gt;Details&lt;/code&gt; method in the Controller executes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model Retrieval:&lt;/strong&gt; The Model retrieves the data (perhaps from a SQL database).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;View Selection:&lt;/strong&gt; The Controller receives the data, decides which View to use (usually &lt;code&gt;Details.cshtml&lt;/code&gt;), and passes the data (the Model) to it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rendering:&lt;/strong&gt; The Razor View Engine takes the HTML template and merges it with the Model data to produce a standard HTML page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Response:&lt;/strong&gt; The final HTML is sent back to the user's browser.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  3. Key Advantages of MVC Architecture
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Separation of Concerns (SoC):&lt;/strong&gt; By decoupling the UI (View), Data (Model), and Application Logic (Controller), the application becomes easier to manage. Front-end developers can modify HTML/CSS without breaking backend logic, and vice versa.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enhanced Testability:&lt;/strong&gt; Since Controllers and Models are standard C# classes independent of the UI, you can easily write unit tests for them without simulating a browser.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Full Control Over HTML:&lt;/strong&gt; Unlike ASP.NET Web Forms which auto-generated complex HTML, MVC gives you absolute control over rendered markup — critical for modern CSS frameworks like Bootstrap or Tailwind.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Asynchronous Support:&lt;/strong&gt; ASP.NET Core MVC is built to handle &lt;code&gt;async&lt;/code&gt;/&lt;code&gt;await&lt;/code&gt; efficiently, allowing applications to handle more concurrent requests without blocking the server.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  4. MVC Project Structure in ASP.NET Core
&lt;/h2&gt;

&lt;p&gt;When you create a new MVC project via Visual Studio or CLI (&lt;code&gt;dotnet new mvc&lt;/code&gt;), you get this standard folder structure:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb84lb1281cwx84m59a5j.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb84lb1281cwx84m59a5j.PNG" alt=" " width="356" height="637"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; If you want to learn how to download and install Visual Studio, check out this guide: &lt;a href="https://medium.com/@sumeetdugg022/getting-started-with-c-programming-a-beginners-guide-a4acf914b0aa" rel="noopener noreferrer"&gt;Getting Started with C# Programming&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Create Your First ASP.NET Core MVC Project
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1 — Open Visual Studio and Create a New Project
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Open Visual Studio&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create a new project&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg5tqd4edqik6umte8s1y.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg5tqd4edqik6umte8s1y.PNG" alt=" " width="800" height="517"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2 — Select Project Template
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Choose &lt;strong&gt;ASP.NET Core Web App (Model-View-Controller)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Language: &lt;strong&gt;C#&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Platform: &lt;strong&gt;Windows / .NET&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Next&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyk3nhthmyv01lq8nrk4e.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyk3nhthmyv01lq8nrk4e.PNG" alt=" " width="800" height="517"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3 — Configure the Project
&lt;/h3&gt;

&lt;p&gt;Fill in the following details:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Project name:&lt;/strong&gt; &lt;code&gt;BooksLibrary&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Location:&lt;/strong&gt; Default (or your preferred path)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Solution name:&lt;/strong&gt; &lt;code&gt;BooksLibrary&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: You can choose your desired location to store project files. I recommend keep default location as it is now.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz3v04bgfybid0hirjm3d.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz3v04bgfybid0hirjm3d.PNG" alt=" " width="800" height="516"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4 — Choose .NET Version
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Select the latest available version: &lt;strong&gt;.NET 9 / .NET 10 (LTS)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Set Authentication type to &lt;strong&gt;None&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4sp7a1s2czgzgye3lm3o.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4sp7a1s2czgzgye3lm3o.PNG" alt=" " width="800" height="517"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Visual Studio will scaffold the project and open the default MVC structure.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpcllyj6uxfnjjpezamvd.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpcllyj6uxfnjjpezamvd.PNG" alt=" " width="800" height="467"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Understanding MVC Through Code Examples
&lt;/h2&gt;

&lt;h3&gt;
  
  
  M — The Model
&lt;/h3&gt;

&lt;p&gt;In MVC architecture, the Model carries the heaviest responsibility. It represents real-world entities, business logic, and domain rules that form the foundation of your application.&lt;/p&gt;

&lt;p&gt;For the BooksLibrary project, we need one class — &lt;code&gt;Book.cs&lt;/code&gt; — to hold core information about each library book.&lt;/p&gt;

&lt;p&gt;Right-click the &lt;strong&gt;Models&lt;/strong&gt; folder in Solution Explorer → &lt;strong&gt;Add&lt;/strong&gt; → &lt;strong&gt;Class&lt;/strong&gt; → name it &lt;code&gt;Book.cs&lt;/code&gt; → click &lt;strong&gt;Add&lt;/strong&gt;.&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;namespace&lt;/span&gt; &lt;span class="nn"&gt;BooksLibrary.Models&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;class&lt;/span&gt; &lt;span class="nc"&gt;Book&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Id&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&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="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;Title&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&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="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;Author&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&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="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;Genre&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&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="kt"&gt;decimal&lt;/span&gt; &lt;span class="n"&gt;Price&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&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;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; A namespace is a container that groups related classes in C#. It prevents naming conflicts and keeps your code maintainable.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  V — The View
&lt;/h3&gt;

&lt;p&gt;Views are the visual layer of your MVC application. They receive data from Controllers and render it as HTML. Views should &lt;strong&gt;not&lt;/strong&gt; contain business logic — only presentation logic.&lt;/p&gt;

&lt;p&gt;Views use &lt;strong&gt;Razor syntax&lt;/strong&gt; (&lt;code&gt;.cshtml&lt;/code&gt; files) that blends HTML with C# code.&lt;/p&gt;

&lt;h4&gt;
  
  
  Folder Structure for Views
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Views/
  ├── Books/
  │   ├── Index.cshtml
  │   └── Details.cshtml
  ├── Shared/
  │   └── _Layout.cshtml
  └── _ViewStart.cshtml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Index.cshtml — Book List View
&lt;/h4&gt;

&lt;p&gt;Right-click &lt;code&gt;Views/Books&lt;/code&gt; → &lt;strong&gt;Add View&lt;/strong&gt; → name it &lt;code&gt;Index.cshtml&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;@model IEnumerable&lt;span class="nt"&gt;&amp;lt;BooksLibrary.Models.Book&amp;gt;&lt;/span&gt;
@{
    ViewData["Title"] = "Books Library";
}

&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container mt-4"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Our Book Collections&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;table&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"table table-striped table-hover"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;thead&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;Title&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;Author&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;Genre&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;Price&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;Actions&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/thead&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;tbody&amp;gt;&lt;/span&gt;
            @foreach (var book in Model)
            {
                &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;@book.Title&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;@book.Author&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;@book.Genre&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;$@book.Price.ToString("F2")&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;
                        &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;asp-action=&lt;/span&gt;&lt;span class="s"&gt;"Details"&lt;/span&gt; &lt;span class="na"&gt;asp-route-id=&lt;/span&gt;&lt;span class="s"&gt;"@book.Id"&lt;/span&gt;
                           &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"btn btn-sm btn-info"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Details&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
            }
        &lt;span class="nt"&gt;&amp;lt;/tbody&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Breaking Down the Razor Syntax
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;The &lt;code&gt;@model&lt;/code&gt; Directive&lt;/strong&gt; — tells the view what type of data to expect. Must be the first line.&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;@model&lt;/span&gt; &lt;span class="n"&gt;IEnumerable&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;BooksLibrary&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Models&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Book&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Setting View Metadata&lt;/strong&gt; — &lt;code&gt;@{ }&lt;/code&gt; blocks let you write C# code. &lt;code&gt;ViewData&lt;/code&gt; passes info like the page title to the layout.&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="err"&gt;@&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;ViewData&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"Title"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Books Library"&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;&lt;strong&gt;Outputting Variables&lt;/strong&gt; — the &lt;code&gt;@&lt;/code&gt; symbol switches from HTML to C#.&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;@book&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Title&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;C# Control Structures&lt;/strong&gt; — use &lt;code&gt;foreach&lt;/code&gt;, &lt;code&gt;if&lt;/code&gt;, &lt;code&gt;while&lt;/code&gt; inside Razor views.&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="nf"&gt;@foreach&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;book&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;Model&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;tr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;td&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;@book&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Title&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;td&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;tr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Tag Helpers&lt;/strong&gt; — &lt;code&gt;asp-action&lt;/code&gt; generates the correct route URL; &lt;code&gt;asp-route-id&lt;/code&gt; passes the book ID as a parameter.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;asp-action=&lt;/span&gt;&lt;span class="s"&gt;"Details"&lt;/span&gt; &lt;span class="na"&gt;asp-route-id=&lt;/span&gt;&lt;span class="s"&gt;"@book.Id"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"btn btn-sm btn-info"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Details&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Details.cshtml — Single Book View
&lt;/h4&gt;

&lt;p&gt;Create &lt;code&gt;Details.cshtml&lt;/code&gt; in the &lt;code&gt;Views/Books&lt;/code&gt; folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;@model BooksLibrary.Models.Book
@{
    ViewData["Title"] = "Book Details";
}

&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container mt-4"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Book Details&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"card"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"card-body"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;h4&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"card-title"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;@Model.Title&lt;span class="nt"&gt;&amp;lt;/h4&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;dl&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"row"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;dt&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"col-sm-3"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Author&lt;span class="nt"&gt;&amp;lt;/dt&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;dd&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"col-sm-9"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;@Model.Author&lt;span class="nt"&gt;&amp;lt;/dd&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;dt&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"col-sm-3"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Genre&lt;span class="nt"&gt;&amp;lt;/dt&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;dd&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"col-sm-9"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;@Model.Genre&lt;span class="nt"&gt;&amp;lt;/dd&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;dt&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"col-sm-3"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Price&lt;span class="nt"&gt;&amp;lt;/dt&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;dd&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"col-sm-9"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;$@Model.Price.ToString("F2")&lt;span class="nt"&gt;&amp;lt;/dd&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;/dl&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"mt-3"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;asp-action=&lt;/span&gt;&lt;span class="s"&gt;"Index"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"btn btn-secondary"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Back to List&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This view expects a single &lt;code&gt;Book&lt;/code&gt; object rather than a collection — note the &lt;code&gt;@model&lt;/code&gt; directive reflects that.&lt;/p&gt;




&lt;h3&gt;
  
  
  C — The Controller
&lt;/h3&gt;

&lt;p&gt;Controllers are the traffic cops of your MVC application. They handle incoming requests, coordinate between Models and Views, and decide what response to send back.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When a user clicks a link or submits a form, the Controller:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Processes the incoming request&lt;/li&gt;
&lt;li&gt;Interacts with the Model (retrieves or updates data)&lt;/li&gt;
&lt;li&gt;Selects the appropriate View&lt;/li&gt;
&lt;li&gt;Passes data to that View&lt;/li&gt;
&lt;li&gt;Returns the rendered result to the user&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Creating the Books Controller
&lt;/h4&gt;

&lt;p&gt;Right-click &lt;strong&gt;Controllers&lt;/strong&gt; → &lt;strong&gt;Add Controller&lt;/strong&gt; → choose &lt;strong&gt;MVC Controller - Empty&lt;/strong&gt; → name it &lt;code&gt;BooksController.cs&lt;/code&gt;.&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;using&lt;/span&gt; &lt;span class="nn"&gt;System.Diagnostics&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;BooksLibrary.Models&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Microsoft.AspNetCore.Mvc&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;BooksLibrary.Controllers&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;class&lt;/span&gt; &lt;span class="nc"&gt;BooksController&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Controller&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;static&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;Book&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;_books&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;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Book&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&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;Book&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;Id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;Title&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"The Alchemist"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;Author&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Paulo Coelho"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;Genre&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Fantasy/Adventure"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;Price&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;12.99m&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;Book&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;Id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;Title&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Harry Potter and the Philosopher's Stone"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;Author&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"J.K. Rowling"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;Genre&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Fantasy"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;Price&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;14.99m&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;Book&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;Id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;Title&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"1984"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;Author&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"George Orwell"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;Genre&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Dystopian"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;Price&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;13.99m&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="n"&gt;IActionResult&lt;/span&gt; &lt;span class="nf"&gt;Index&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;View&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_books&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="n"&gt;IActionResult&lt;/span&gt; &lt;span class="nf"&gt;Details&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&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;book&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;_books&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;FirstOrDefault&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Id&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;id&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;book&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="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;NotFound&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;

            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;View&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;book&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;span class="nf"&gt;ResponseCache&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Duration&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Location&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ResponseCacheLocation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;NoStore&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;IActionResult&lt;/span&gt; &lt;span class="nf"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;View&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;ErrorViewModel&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;RequestId&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Activity&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Current&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="n"&gt;Id&lt;/span&gt; &lt;span class="p"&gt;??&lt;/span&gt; &lt;span class="n"&gt;HttpContext&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TraceIdentifier&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;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Breaking Down the Controller
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Controller Inheritance&lt;/strong&gt;&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;BooksController&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Controller&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every controller inherits from the &lt;code&gt;Controller&lt;/code&gt; base class, which provides &lt;code&gt;View()&lt;/code&gt;, &lt;code&gt;RedirectToAction()&lt;/code&gt;, and &lt;code&gt;NotFound()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Action Methods&lt;/strong&gt;&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="n"&gt;IActionResult&lt;/span&gt; &lt;span class="nf"&gt;Index&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;View&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_books&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;Action methods return &lt;code&gt;IActionResult&lt;/code&gt; — typically a view, redirect, or HTTP status code. &lt;code&gt;View(_books)&lt;/code&gt; passes the book collection to the Index view.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Route Parameters&lt;/strong&gt;&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="n"&gt;IActionResult&lt;/span&gt; &lt;span class="nf"&gt;Details&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Parameters are automatically populated from the URL. For &lt;code&gt;/Books/Details/3&lt;/code&gt;, the &lt;code&gt;id&lt;/code&gt; parameter receives the value &lt;code&gt;3&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Running the Application
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;In Visual Studio, find the green &lt;strong&gt;▶ Play&lt;/strong&gt; button in the top toolbar (labelled "IIS Express" or your project name)&lt;/li&gt;
&lt;li&gt;Click it or press &lt;strong&gt;F5&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The browser will open showing your books list. Click the &lt;strong&gt;Details&lt;/strong&gt; button on any book to see its individual details page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frxqm11oo45ktox749saf.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frxqm11oo45ktox749saf.PNG" alt=" " width="800" height="149"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What We Accomplished
&lt;/h2&gt;

&lt;p&gt;We built a complete MVC application from the ground up, covering all three core components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Model&lt;/strong&gt; — The &lt;code&gt;Book&lt;/code&gt; class defines the data structure with properties like &lt;code&gt;Title&lt;/code&gt;, &lt;code&gt;Author&lt;/code&gt;, &lt;code&gt;Genre&lt;/code&gt;, and &lt;code&gt;Price&lt;/code&gt;. It is the foundation everything else is built on.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Views&lt;/strong&gt; — Two Razor views handle the presentation layer: &lt;code&gt;Index.cshtml&lt;/code&gt; lists all books in a table, and &lt;code&gt;Details.cshtml&lt;/code&gt; displays information for a single book.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Controller&lt;/strong&gt; — &lt;code&gt;BooksController&lt;/code&gt; orchestrates everything. It handles incoming requests, manages the book collection, and coordinates between the Model and Views to deliver the right content.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the essence of MVC — clean separation of concerns that makes your application easier to maintain, test, and scale.&lt;/p&gt;




&lt;h2&gt;
  
  
  Found This Helpful?
&lt;/h2&gt;

&lt;p&gt;Leave a comment below sharing what you learned, what challenges you faced, or what you're planning to build next!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Related links:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/sumeetpypi/bankingProject-c-.net-" rel="noopener noreferrer"&gt;GitHub — Banking System Project&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@sumeetdugg022/getting-started-with-c-programming-a-beginners-guide-a4acf914b0aa" rel="noopener noreferrer"&gt;Getting Started with C# Programming&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aspnetmvc</category>
      <category>csharp</category>
      <category>dotnet</category>
      <category>webdev</category>
    </item>
    <item>
      <title>I moved our Python interpreter into Docker. Full story + setup guide: 👇

https://dev.to/practical_tech_notes/my-local-python-setup-was-quietly-destroying-our-teams-productivity-docker-fixed-it-1647

#Python #Docker #VSCode</title>
      <dc:creator>Sumeet Dugg</dc:creator>
      <pubDate>Fri, 03 Apr 2026 15:59:13 +0000</pubDate>
      <link>https://dev.to/practical_tech_notes/i-moved-our-python-interpreter-into-docker-full-story-setup-guide-5gei</link>
      <guid>https://dev.to/practical_tech_notes/i-moved-our-python-interpreter-into-docker-full-story-setup-guide-5gei</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/practical_tech_notes/my-local-python-setup-was-quietly-destroying-our-teams-productivity-docker-fixed-it-1647" class="crayons-story__hidden-navigation-link"&gt;My Local Python Setup Was Quietly Destroying Our Team's Productivity. Docker Fixed It.&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/practical_tech_notes" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3532217%2F16e311ee-4871-42cb-beb2-c16052b9c25b.jpg" alt="practical_tech_notes profile" class="crayons-avatar__image" width="714" height="954"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/practical_tech_notes" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Sumeet Dugg
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Sumeet Dugg
                
              
              &lt;div id="story-author-preview-content-3450429" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/practical_tech_notes" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3532217%2F16e311ee-4871-42cb-beb2-c16052b9c25b.jpg" class="crayons-avatar__image" alt="" width="714" height="954"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Sumeet Dugg&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/practical_tech_notes/my-local-python-setup-was-quietly-destroying-our-teams-productivity-docker-fixed-it-1647" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Apr 3&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/practical_tech_notes/my-local-python-setup-was-quietly-destroying-our-teams-productivity-docker-fixed-it-1647" id="article-link-3450429"&gt;
          My Local Python Setup Was Quietly Destroying Our Team's Productivity. Docker Fixed It.
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/docker"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;docker&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/cicd"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;cicd&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/python"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;python&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/kubernetes"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;kubernetes&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/practical_tech_notes/my-local-python-setup-was-quietly-destroying-our-teams-productivity-docker-fixed-it-1647" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;1&lt;span class="hidden s:inline"&gt; reaction&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/practical_tech_notes/my-local-python-setup-was-quietly-destroying-our-teams-productivity-docker-fixed-it-1647#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              2&lt;span class="hidden s:inline"&gt; comments&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            6 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
    </item>
    <item>
      <title>My Local Python Setup Was Quietly Destroying Our Team's Productivity. Docker Fixed It.</title>
      <dc:creator>Sumeet Dugg</dc:creator>
      <pubDate>Fri, 03 Apr 2026 15:50:29 +0000</pubDate>
      <link>https://dev.to/practical_tech_notes/my-local-python-setup-was-quietly-destroying-our-teams-productivity-docker-fixed-it-1647</link>
      <guid>https://dev.to/practical_tech_notes/my-local-python-setup-was-quietly-destroying-our-teams-productivity-docker-fixed-it-1647</guid>
      <description>&lt;p&gt;&lt;strong&gt;How I moved our Python interpreter into a Docker container, wired it into VS Code, and never looked back.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwof5jkz7o69axxpjryhj.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwof5jkz7o69axxpjryhj.PNG" alt=" " width="638" height="362"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let me be upfront with you, I didn't want to write this article.&lt;/p&gt;

&lt;p&gt;Not because the topic isn't worth it — it absolutely is — but because writing it means admitting that I let a fixable problem drag on for almost five months before I actually fixed it. Five months of "works on my machine." Five months of onboarding friction. Five months of my team losing hours to an issue that, once solved, took an afternoon.&lt;/p&gt;

&lt;p&gt;So consider this both a technical walkthrough and a cautionary tale from someone who waited too long.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Environment That Slowly Ate Our Standup
&lt;/h2&gt;

&lt;p&gt;Picture this: three developers, one Python codebase, and a Monday morning that starts with a Slack message at 9:04 AM.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"Hey, the pipeline script is throwing a ModuleNotFoundError. Did something change?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Nothing changed. Nothing ever changed. That was the whole problem.&lt;/p&gt;

&lt;p&gt;We had a &lt;strong&gt;requirements.txt&lt;/strong&gt;. We had virtual environments. We had a well-intentioned README with setup instructions that were already six weeks out of date. What we did not have was any guarantee whatsoever that the Python interpreter running on my Windows machine was looking at the same world as the one running on my colleague's MacBook or our third teammate's Ubuntu workstation.&lt;/p&gt;

&lt;p&gt;Every developer's local machine is an ecosystem — years of installs, PATH entries, conflicting system packages, half-removed tools that left ghosts behind. You don't notice the weight of it until it starts affecting other people.&lt;/p&gt;

&lt;p&gt;The final straw came on a Wednesday afternoon. We were two days from a demo. I'd spent the morning writing a data transformation function that worked perfectly. I pushed it. Twenty minutes later I got a message: &lt;em&gt;"This is crashing for me immediately."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Same code. Different machine. Different Python minor version — 3.10.4 vs 3.10.11 — and a single library that handled a deprecation differently between them.&lt;/p&gt;

&lt;p&gt;I spent three hours on that. Three hours, two days before a demo, on an environment problem.&lt;/p&gt;

&lt;p&gt;That evening I opened a new branch and set up Docker.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Docker and Why VS Code Dev Containers Specifically
&lt;/h2&gt;

&lt;p&gt;The idea is not complicated once you accept it: stop treating your interpreter as something that lives on your machine, and start treating it as something that lives in your project.&lt;/p&gt;

&lt;p&gt;Docker lets you write a &lt;strong&gt;Dockerfile&lt;/strong&gt; — essentially a recipe — that describes an environment precisely. Operating system, Python version, every dependency, every configuration detail. Docker builds that recipe into a container: an isolated, reproducible box. Your code runs inside that box. It runs the same way on every machine. It runs the same way in six months when someone dusts off the repo.&lt;/p&gt;

&lt;p&gt;VS Code's &lt;strong&gt;Dev Containers&lt;/strong&gt; extension is what makes this actually pleasant to work in. Instead of running Docker separately and juggling a local editor alongside it, VS Code connects directly into the container. Your terminal, your debugger, your IntelliSense, your interpreter — everything operates from inside the container. From the outside it feels exactly like working locally. From the inside, every single person on the team is running identical environments.&lt;/p&gt;

&lt;p&gt;That's the shift that mattered to us: the environment stops being invisible infrastructure that lives on individual laptops and becomes an explicit, version-controlled part of the project. When the environment breaks, you fix the &lt;strong&gt;Dockerfile&lt;/strong&gt; and you commit the fix. Everyone gets it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Setup, Done Properly
&lt;/h2&gt;

&lt;p&gt;Let me walk through exactly what I built. I'll explain the reasoning behind each piece rather than just dropping files at you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Project structure when we were done:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my-project/
├── .devcontainer/
│   └── devcontainer.json
├── Dockerfile
├── requirements.txt
└── main.py

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The Dockerfile&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="c"&gt;#Use an official Python runtime as a base image&lt;/span&gt;

&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; python:3.14.3-slim&lt;/span&gt;

&lt;span class="c"&gt;#Optional: tools you may want during development&lt;/span&gt;

&lt;span class="k"&gt;RUN &lt;/span&gt;apt-get update 
&amp;amp;&amp;amp; apt-get install -y --no-install-recommends git curl 
&amp;amp;&amp;amp; rm -rf /var/lib/apt/lists/*

#Set the working directory in the container

&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /app&lt;/span&gt;

&lt;span class="c"&gt;#Copy the requirements file into the container (if you have one)&lt;/span&gt;

&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; requirements.txt ./&lt;/span&gt;

&lt;span class="c"&gt;#Install any needed Python packages specified in requirements.txt&lt;/span&gt;

&lt;span class="k"&gt;RUN &lt;/span&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--no-cache-dir&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt

&lt;span class="c"&gt;#Copy code last (better layer caching)&lt;/span&gt;

&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; . .&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few deliberate choices here worth explaining.&lt;/p&gt;

&lt;p&gt;I used python:3.14.3-slim rather than python:3.14.3. The slim variant strips out things like documentation files and build tools that we don't need at runtime. It keeps the image smaller and faster to pull, which matters when someone is spinning this up for the first time on a slow connection.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;WORKDIR /app&lt;/strong&gt; appline sets the working directory inside the container to a clean, predictable path. When VS Code mounts your project into the container, it maps to this location. No path confusion, no surprises.&lt;/p&gt;

&lt;p&gt;Copying &lt;strong&gt;requirements.txt&lt;/strong&gt; before anything else is intentional. Docker builds in layers, and it caches each layer. If your requirements haven't changed but your code has, Docker doesn't re-run &lt;strong&gt;pip install&lt;/strong&gt; on every rebuild — it uses the cached layer. This makes iteration fast.&lt;/p&gt;

&lt;h3&gt;
  
  
  Requirements File
&lt;/h3&gt;

&lt;p&gt;I added list of libraries, i was willing to use&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fastapi
uvicorn
pydantic
numpy
pandas
scikit-learn
langchain
openai
requests
python-dotenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Building docker image&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Open cmd or visual code terminal .&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Go to project files where it have &lt;strong&gt;Dockerfile&lt;/strong&gt; from cmd for example &lt;strong&gt;cd .&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Write command as shown below:&lt;br&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;

&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker build -t my-python-interpreter:3.14.3 . 

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What above Command Does ??&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; It builds a Docker image from your project files and gives name to it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step-by-Step Explaination&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;docker build&lt;/strong&gt; - Create an image using the Dockerfile in this directory.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;-t&lt;/strong&gt; - It lets you name your image &lt;strong&gt;.&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;In our case my-python-interpreter is the name of image and 3.14.3 is the version(tag)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Running Docker python interpreter image from VScode&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let start adding docker image interpreter to VScode&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open VS Code and open the project folder containing your Dockerfile.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hit &lt;code&gt;Ctrl + Shift + P&lt;/code&gt; and type &lt;strong&gt;Dev Containers: Add Dev Container&lt;/strong&gt; into the text box.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgloygsi46tlybzn76q8m.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgloygsi46tlybzn76q8m.PNG" alt=" " width="800" height="504"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on &lt;strong&gt;Dev Containers: Add Dev Container Configuration Files...&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fybg5pbkuce21amvdsn44.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fybg5pbkuce21amvdsn44.PNG" alt=" " width="610" height="160"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on &lt;strong&gt;Add configuration to workspace&lt;/strong&gt; and press Enter.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It will create the configuration files in your project.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Next Step run container&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Running container in VScode terminal code&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;open terminal in VScode from Menu → Terminal → New Terminal&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Write command as shown below:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run -it my-python-interpreter:3.14.3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;docker run&lt;/strong&gt; - Create + start a new container from an image&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;-i&lt;/strong&gt; - Interactive , keeps STDIN open and allow to type commands inside container&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;-t&lt;/strong&gt; - Create + start a new container from an image&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;my-python-interpreter&lt;/strong&gt; - Image name&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;3.14.3&lt;/strong&gt; - Version name (Tag)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;3. Press Ctrl + Shift + P&lt;/p&gt;

&lt;p&gt;4 . Write Dev Containers: Attach to Running Container...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkl8274a2e76j101rw7cv.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkl8274a2e76j101rw7cv.PNG" alt=" " width="800" height="269"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;5. Press Enter .&lt;/p&gt;

&lt;p&gt;6. New window will open , now you can check you added interpreter from ternimal and check python interpreter&lt;/p&gt;

&lt;p&gt;7. Write command- which python and which pip, you should see something like below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsprflhfwtxhz79j88t09.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsprflhfwtxhz79j88t09.PNG" alt=" " width="537" height="198"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Congratulation! Interpreter added successfully&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you want to understand about docker images and containers you can follow article: &lt;a href="https://medium.com/@sumeetdugg022/how-i-solved-a-deployment-nightmare-using-docker-and-fastapi-abc9dda33f16" rel="noopener noreferrer"&gt;Understand docker images and containers&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  What Changed for the Team
&lt;/h3&gt;

&lt;p&gt;I rolled this out on a Thursday. By Friday morning, every developer had pulled the branch, reopened in the Dev Container, and was running code.&lt;/p&gt;

&lt;p&gt;Here's the before and after that actually mattered:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Onboarding a new developer, before:&lt;/strong&gt; roughly four hours. Install Python, set up a virtual environment, install dependencies, hit a conflict, debug the conflict, realise a system package was interfering, fix that, update the README with the step we'd missed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Onboarding a new developer, after:&lt;/strong&gt; clone the repo, open in VS Code, click "Reopen in Container," wait three minutes for the image to build, done. The fourth developer we brought on set herself up entirely independently without asking anyone a single question.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Debugging environment issues, before:&lt;/strong&gt; a ritual of sharing Python versions, pip list outputs, PATH variables, and educated guesses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Debugging environment issues, after:&lt;/strong&gt; there are no environment issues. If the code runs in the container on my machine, it runs in the container on yours. When we do find a configuration problem, we fix the Dockerfile, push it, and everyone rebuilds. One fix, universally applied.&lt;/p&gt;

&lt;p&gt;The most underrated change was what disappeared from our standups. We used to start every session with at least one throwaway exchange about someone's environment. That's gone. We talk about actual work now.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;The Honest Takeaway&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The environment is now a first-class part of the project. It lives in the repository. It's reviewed in pull requests. When someone joins the project in eight months, they don't inherit our laptop histories — they get a clean, defined, reproducible box. That's what professional software development should look like.&lt;/p&gt;

&lt;p&gt;If you're still fighting your local Python setup — if your standup has a regular guest appearance from "it works on my machine" — this is the fix. It costs an afternoon. It pays back immediately.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If this article saved you debugging time or helped your team, — Questions about the setup? Leave a comment and I'll answer every one.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>docker</category>
      <category>cicd</category>
      <category>python</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>Echoes of Experience: From Writing Code to Writing Myself</title>
      <dc:creator>Sumeet Dugg</dc:creator>
      <pubDate>Mon, 23 Mar 2026 16:00:35 +0000</pubDate>
      <link>https://dev.to/practical_tech_notes/echoes-of-experience-from-writing-code-to-writing-myself-5cio</link>
      <guid>https://dev.to/practical_tech_notes/echoes-of-experience-from-writing-code-to-writing-myself-5cio</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/wecoded-2026"&gt;2026 WeCoded Challenge&lt;/a&gt;: Echoes of Experience&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This is a submission for the 2026 WeCoded Challenge: &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Echoes of Experience&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There is a strange kind of silence that comes with staring at a blank screen.&lt;/p&gt;

&lt;p&gt;Not the peaceful silence you enjoy after solving a bug.&lt;br&gt;
Not the satisfying quiet after a long day of coding.&lt;/p&gt;

&lt;p&gt;This one feels different.It feels like doubt.&lt;/p&gt;

&lt;p&gt;That was me a few months ago — not as a developer, but as a writer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Developer Who Couldn’t Write&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I’ve been a Python developer for over four years now. I’ve built APIs, handled backend logic, worked with databases, and debugged problems that once felt impossible. In code, I was confident.&lt;/p&gt;

&lt;p&gt;But writing?&lt;/p&gt;

&lt;p&gt;That was a completely different story.&lt;/p&gt;

&lt;p&gt;I remember opening my first article draft. The cursor blinked at me like it was asking a question I couldn’t answer:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;“What do you even have to say?”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I closed the tab.&lt;br&gt;
That became a habit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Journey Didn’t Start With Confidence&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Like many developers, my journey wasn’t a straight line.&lt;/p&gt;

&lt;p&gt;I didn’t wake up one day knowing Python. I didn’t walk into my first job feeling like an expert. I struggled. A lot.&lt;/p&gt;

&lt;p&gt;I come from a background where opportunities weren’t always obvious. I had to figure things out step by step. Learning programming wasn’t glamorous—it was confusing, frustrating, and sometimes lonely.&lt;/p&gt;

&lt;p&gt;I still remember spending hours trying to understand why a simple loop wasn’t working. Or why an API call failed without any clear error.&lt;/p&gt;

&lt;p&gt;There were no mentors guiding me daily. No perfect roadmap. Just curiosity… and persistence.&lt;/p&gt;

&lt;p&gt;And somehow, that was enough._&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Silent Growth No One Sees&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In tech, growth is rarely loud.&lt;/p&gt;

&lt;p&gt;No one applauds when you finally understand asynchronous programming.&lt;br&gt;
No one celebrates when you debug something after three hours.&lt;/p&gt;

&lt;p&gt;But those moments change you.&lt;/p&gt;

&lt;p&gt;They build something deeper than skills — they build resilience.&lt;/p&gt;

&lt;p&gt;Over the years, I became someone who could break down problems, think logically, and keep going even when nothing made sense.&lt;/p&gt;

&lt;p&gt;But here’s what I didn’t realize:&lt;/p&gt;

&lt;p&gt;Those struggles were stories.&lt;/p&gt;

&lt;p&gt;And I wasn’t telling them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why I Started Writing (Even When I Wasn’t Ready)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The idea of writing didn’t come from confidence. It came from frustration.&lt;/p&gt;

&lt;p&gt;I wanted to earn something extra. I wanted to share knowledge. I wanted to grow beyond just coding.&lt;/p&gt;

&lt;p&gt;But more than that… I wanted to be seen.&lt;/p&gt;

&lt;p&gt;Not in a loud, attention-seeking way. But in a real way.&lt;/p&gt;

&lt;p&gt;I realized something important:&lt;/p&gt;

&lt;p&gt;There are thousands of developers like me — learning quietly, struggling silently, improving slowly.&lt;/p&gt;

&lt;p&gt;And most of them never share their journey.&lt;/p&gt;

&lt;p&gt;So I decided to try.&lt;/p&gt;

&lt;p&gt;Even if I wasn’t perfect.&lt;/p&gt;

&lt;p&gt;Even if my writing wasn’t “professional.”&lt;/p&gt;

&lt;p&gt;Even if no one read it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The First Attempt (And the Fear That Came With It)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My first article wasn’t great.&lt;/p&gt;

&lt;p&gt;I overthought every sentence. I kept editing. Deleting. Rewriting.&lt;/p&gt;

&lt;p&gt;It didn’t sound like me.&lt;/p&gt;

&lt;p&gt;It sounded like someone trying to sound smart.&lt;/p&gt;

&lt;p&gt;And that’s when I understood something important:&lt;/p&gt;

&lt;p&gt;Writing is not about sounding intelligent. It’s about sounding honest.&lt;/p&gt;

&lt;p&gt;So I started again.&lt;/p&gt;

&lt;p&gt;This time, I wrote like I speak.&lt;/p&gt;

&lt;p&gt;Simple. Direct. Real.&lt;/p&gt;

&lt;p&gt;And suddenly, it felt easier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Reality No One Talks About&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let me be honest.&lt;/p&gt;

&lt;p&gt;Writing articles is hard.&lt;/p&gt;

&lt;p&gt;Not technically hard — emotionally hard.&lt;/p&gt;

&lt;p&gt;You start questioning everything:&lt;/p&gt;

&lt;p&gt;“Is this useful?”&lt;br&gt;
“Will anyone read this?”&lt;br&gt;
“Am I wasting my time?”&lt;/p&gt;

&lt;p&gt;And when results don’t come quickly — no views, no earnings, no recognition — it hits even harder.&lt;/p&gt;

&lt;p&gt;I applied to programs. I waited for responses. Days turned into weeks.&lt;/p&gt;

&lt;p&gt;Nothing.&lt;/p&gt;

&lt;p&gt;And that silence felt heavier than any rejection.&lt;/p&gt;

&lt;p&gt;Because at least rejection gives you closure.&lt;/p&gt;

&lt;p&gt;Waiting doesn’t.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;But Something Changed&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Even though I wasn’t earning yet… something else was happening.&lt;/p&gt;

&lt;p&gt;I was thinking differently.&lt;/p&gt;

&lt;p&gt;When I solved a problem, I didn’t just move on. I asked:&lt;/p&gt;

&lt;p&gt;“How would I explain this to someone else?”&lt;/p&gt;

&lt;p&gt;When I learned something new, I thought:&lt;/p&gt;

&lt;p&gt;“Is this worth sharing?”&lt;/p&gt;

&lt;p&gt;And slowly, I started noticing something:&lt;/p&gt;

&lt;p&gt;I wasn’t just consuming knowledge anymore.&lt;/p&gt;

&lt;p&gt;I was shaping it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Writing Made Me a Better Developer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This was unexpected.&lt;/p&gt;

&lt;p&gt;Writing didn’t just improve my communication — it improved my thinking.&lt;/p&gt;

&lt;p&gt;Because when you write:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You simplify complex ideas&lt;/li&gt;
&lt;li&gt;You organize your thoughts&lt;/li&gt;
&lt;li&gt;You identify gaps in your understanding&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There were times I thought I understood something… until I tried explaining it.&lt;/p&gt;

&lt;p&gt;That’s when the real learning began.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Invisible Struggle of Many Developers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There’s a truth we don’t talk about enough:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Many developers feel invisible.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;They work hard. They learn. They grow.&lt;/p&gt;

&lt;p&gt;But they don’t share.&lt;/p&gt;

&lt;p&gt;Not because they don’t have value — but because they think they don’t.&lt;/p&gt;

&lt;p&gt;They think:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“I’m not experienced enough”&lt;/li&gt;
&lt;li&gt;“Others know more than me”&lt;/li&gt;
&lt;li&gt;“My story isn’t special”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I used to think the same.&lt;/p&gt;

&lt;p&gt;But here’s what I’ve learned:&lt;/p&gt;

&lt;p&gt;Your story doesn’t need to be extraordinary to be meaningful.&lt;/p&gt;

&lt;p&gt;It just needs to be real.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Experience Is Not Unique — And That’s the Point&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I’m not someone who built a startup.&lt;br&gt;
I’m not someone who went viral overnight.&lt;br&gt;
I’m just a developer who kept going.&lt;/p&gt;

&lt;p&gt;And that’s exactly why my story matters.&lt;/p&gt;

&lt;p&gt;Because it’s relatable.&lt;/p&gt;

&lt;p&gt;There are people right now:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Learning their first programming language&lt;/li&gt;
&lt;li&gt;Struggling with self-doubt&lt;/li&gt;
&lt;li&gt;Trying to find their place in tech&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And they don’t need perfect success stories.&lt;/p&gt;

&lt;p&gt;They need real ones.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Turning Point: Accepting Imperfection&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At some point, I stopped trying to be perfect.&lt;/p&gt;

&lt;p&gt;I stopped chasing the idea of writing “the best article.”&lt;/p&gt;

&lt;p&gt;Instead, I focused on writing an honest one.&lt;/p&gt;

&lt;p&gt;And that changed everything.&lt;/p&gt;

&lt;p&gt;Because perfection delays action.&lt;/p&gt;

&lt;p&gt;But honesty creates connection.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I’ve Learned So Far&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If I had to summarize my journey into a few lessons, it would be this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You Don’t Need Permission to Start&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;No one will tell you, “Now you’re ready to write.”&lt;/p&gt;

&lt;p&gt;You just begin.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Your Early Work Won’t Be Great — And That’s Okay&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Growth comes from doing, not waiting.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Consistency Matters More Than Motivation&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You won’t feel inspired every day. Show up anyway.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Sharing Is a Skill&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Just like coding, writing improves with practice.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Value Comes Before Results&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Focus on helping, not earning. Results follow.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Where I Am Today&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I’m still learning.&lt;/p&gt;

&lt;p&gt;Still writing.&lt;/p&gt;

&lt;p&gt;Still figuring things out.&lt;/p&gt;

&lt;p&gt;I haven’t “made it” yet. I’m not where I want to be.&lt;/p&gt;

&lt;p&gt;But I’m not where I used to be either.&lt;/p&gt;

&lt;p&gt;And that matters.&lt;/p&gt;

&lt;p&gt;Because progress isn’t always visible.&lt;/p&gt;

&lt;p&gt;But it’s always happening.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why I’m Still Writing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I’m not writing because I’ve achieved everything.&lt;/p&gt;

&lt;p&gt;I’m writing because I’m still on the journey.&lt;/p&gt;

&lt;p&gt;And maybe that’s the most honest place to write from.&lt;/p&gt;

&lt;p&gt;If even one person reads my story and thinks:&lt;/p&gt;

&lt;p&gt;“I’m not alone in this.”&lt;/p&gt;

&lt;p&gt;Then it’s worth it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To Anyone Reading This&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you’re a developer who’s thinking about writing… start.&lt;/p&gt;

&lt;p&gt;Not when you feel ready.&lt;/p&gt;

&lt;p&gt;Not when you feel confident.&lt;/p&gt;

&lt;p&gt;Start now.&lt;/p&gt;

&lt;p&gt;Write about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What you learned today&lt;/li&gt;
&lt;li&gt;What confused you&lt;/li&gt;
&lt;li&gt;What you struggled with&lt;/li&gt;
&lt;li&gt;What you finally understood&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because someone out there is exactly where you were yesterday.&lt;/p&gt;

&lt;p&gt;And your words might help them move forward.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Echo That Stays&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We often think impact comes from big achievements.&lt;/p&gt;

&lt;p&gt;But sometimes, it comes from small, honest stories.&lt;/p&gt;

&lt;p&gt;Stories that echo.&lt;/p&gt;

&lt;p&gt;Stories that stay.&lt;/p&gt;

&lt;p&gt;Stories that remind someone that progress is possible — even when it’s slow, even when it’s messy.&lt;/p&gt;

&lt;p&gt;This is mine.&lt;/p&gt;

&lt;p&gt;And I’m just getting started.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>wecoded</category>
      <category>dei</category>
      <category>career</category>
    </item>
    <item>
      <title>How I Solved a Deployment Nightmare Using Docker and FastAPI</title>
      <dc:creator>Sumeet Dugg</dc:creator>
      <pubDate>Mon, 23 Mar 2026 05:37:52 +0000</pubDate>
      <link>https://dev.to/practical_tech_notes/how-i-solved-a-deployment-nightmare-using-docker-and-fastapi-3bch</link>
      <guid>https://dev.to/practical_tech_notes/how-i-solved-a-deployment-nightmare-using-docker-and-fastapi-3bch</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F032f7a70n2cnjmsbb2p1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F032f7a70n2cnjmsbb2p1.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Problem I Faced&lt;/strong&gt;&lt;br&gt;
I was working at a Python development company where we had to deploy applications on every client machine. Each time a new feature was added or a bug was fixed, we had to manually install or update the application on multiple systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This process was:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Time-consuming&lt;/li&gt;
&lt;li&gt;Error-prone&lt;/li&gt;
&lt;li&gt;Difficult to maintain&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every deployment felt like repeating the same exhausting cycle.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Idea That Changed Everything&lt;/strong&gt;&lt;br&gt;
One day, I suggested a simple but powerful idea to my team:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“What if we install Docker on a central server and allow all clients to access the application from there?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Instead of installing applications on every machine, we could:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Run the application once on a server&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Allow clients to access it via a browser using an IP address&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://&amp;lt;server-ip&amp;gt;:8000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The Result&lt;/strong&gt;&lt;br&gt;
This approach completely transformed our workflow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No need to install software on every client machine&lt;/li&gt;
&lt;li&gt;Centralized updates (update once, reflect everywhere)&lt;/li&gt;
&lt;li&gt;Easy access through browsers&lt;/li&gt;
&lt;li&gt;Clean and scalable architecture&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, every client had separate access to the application just by visiting the server address.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Docker Made This Possible&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Before Docker:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Applications were installed individually&lt;/li&gt;
&lt;li&gt;Dependencies conflicted&lt;/li&gt;
&lt;li&gt;Environment issues were common&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;After Docker:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Everything runs inside containers&lt;/li&gt;
&lt;li&gt;Applications become portable&lt;/li&gt;
&lt;li&gt;Same setup works anywhere in the world&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What is FastAPI (Quick Overview)&lt;/strong&gt;&lt;br&gt;
FastAPI is a Python-based framework built on top of Starlette. It leverages the Asynchronous Server Gateway Interface (ASGI) technology to perform asynchronous tasks efficiently. FastAPI also validates data using Pydantic, ensuring that incoming requests meet the required schema, as illustrated in the diagram below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvrgezai3h99p8jecz850.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvrgezai3h99p8jecz850.jpg" alt=" " width="800" height="927"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;FastAPI runs on the Uvicorn server, which is an asynchronous web server that uses the ASGI standard to run Starlette applications. Uvicorn acts as a handler — it receives HTTP requests and forwards them to Starlette for processing. FastAPI further enhances Starlette’s routing system by adding built-in data validation and automatic API documentation features.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“When I first started learning FastAPI, it was a bit challenging for me to understand its functionalities, especially since I came from a Java programming background. However, as I spent more time working with it, writing code in FastAPI gradually became easier and more intuitive.&lt;br&gt;
What I found most impressive was its asynchronous nature, which allows it to handle multiple HTTP requests at the same time efficiently. It also performs automatic data validation — if the incoming data is invalid, it immediately raises clear exceptions, which makes debugging much simpler.&lt;br&gt;
Another feature that stood out to me was how easy FastAPI makes it to explore and test application endpoints. It comes with a built-in Swagger UI, where you can view and interact with all your APIs. For example, by visiting http: localhost:8000/docs, you can see a complete list of endpoints available in your application and test them directly from the browser.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Building a Simple FastAPI Application&lt;/strong&gt;&lt;br&gt;
Let’s create a basic CRUD API.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create main.py
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;fastapi&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;FastAPI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;HTTPException&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;pydantic&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;BaseModel&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;typing&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FastAPI&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# -----------------------------
# Data Model
# -----------------------------
&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BaseModel&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;
    &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;
    &lt;span class="n"&gt;completed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;bool&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;

&lt;span class="c1"&gt;# Fake in-memory database
&lt;/span&gt;&lt;span class="n"&gt;tasks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;

&lt;span class="c1"&gt;# -----------------------------
# CREATE (POST)
# -----------------------------
&lt;/span&gt;&lt;span class="nd"&gt;@app.post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/tasks&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;response_model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;create_task&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;tasks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;HTTPException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;detail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Task already exists&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;tasks&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&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;task&lt;/span&gt;

&lt;span class="c1"&gt;# -----------------------------
# READ (GET ALL)
# -----------------------------
&lt;/span&gt;&lt;span class="nd"&gt;@app.get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/tasks&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;response_model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_tasks&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;tasks&lt;/span&gt;

&lt;span class="c1"&gt;# -----------------------------
# READ (GET ONE)
# -----------------------------
&lt;/span&gt;&lt;span class="nd"&gt;@app.get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/tasks/{task_id}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;response_model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_task&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;tasks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;task_id&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;task&lt;/span&gt;
    &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;HTTPException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;404&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;detail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Task not found&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# -----------------------------
# UPDATE (PUT)
# -----------------------------
&lt;/span&gt;&lt;span class="nd"&gt;@app.put&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/tasks/{task_id}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;response_model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;update_task&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_task&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;enumerate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tasks&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;task_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;tasks&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;updated_task&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;updated_task&lt;/span&gt;
    &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;HTTPException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;404&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;detail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Task not found&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# -----------------------------
# DELETE
# -----------------------------
&lt;/span&gt;&lt;span class="nd"&gt;@app.delete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/tasks/{task_id}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;delete_task&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;enumerate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tasks&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;task_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;tasks&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pop&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;message&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Task deleted&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;HTTPException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;404&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;detail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Task not found&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Understanding Docker&lt;/strong&gt;&lt;br&gt;
Consider Docker as a warehouse robot. Before Docker, workers (like traditional “dockers”) had to carry and manage each package separately, which was time-consuming and inefficient. After the introduction of Docker, every package is packed into standardized containers, making transportation and management much easier and reducing manual effort.&lt;/p&gt;

&lt;p&gt;Docker is based on two key concepts: images and containers. To understand this, think of an image as a blueprint of a house, and a container as the actual house built from that blueprint. You can create as many containers (houses) as you want from a single image (blueprint), ensuring consistency across all environments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now, let’s create the project file structure.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq0kkbznyo32jps7vz7fe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq0kkbznyo32jps7vz7fe.png" alt=" " width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;_&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: The .gitignore and README.md files are not essential for this setup, so you can skip creating them.&lt;br&gt;
_&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;How I Added a FastAPI Application to Docker&lt;/strong&gt;&lt;br&gt;
If your system does not have Docker pre-installed, you can install it from the official documentation here:&lt;br&gt;
&lt;a href="https://docs.docker.com/desktop/setup/install/windows-install/" rel="noopener noreferrer"&gt;https://docs.docker.com/desktop/setup/install/windows-install/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For now, I am installing Docker on my local system. However, you can follow the same procedure to install it on a central server as well.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating a Dockerfile&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a file named Dockerfile or dockerFile(no extension):
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. Base image (Python)&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; python:3.10-slim&lt;/span&gt;

&lt;span class="c"&gt;# 2. Set working directory&lt;/span&gt;
&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /app&lt;/span&gt;

&lt;span class="c"&gt;# 3. Copy requirements file&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; requirements.txt .&lt;/span&gt;

&lt;span class="c"&gt;# 4. Install dependencies&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--no-cache-dir&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt

&lt;span class="c"&gt;# 5. Copy project files&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; . .&lt;/span&gt;

&lt;span class="c"&gt;# 6. Expose port&lt;/span&gt;
&lt;span class="k"&gt;EXPOSE&lt;/span&gt;&lt;span class="s"&gt; 8000&lt;/span&gt;

&lt;span class="c"&gt;# 7. Run FastAPI app&lt;/span&gt;
&lt;span class="k"&gt;CMD&lt;/span&gt;&lt;span class="s"&gt; ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Requirements File
Create requirements.txt:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fastapi
uvicorn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Build and Run the Docker Container&lt;/strong&gt;&lt;br&gt;
Step 1: Build Image&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker build &lt;span class="nt"&gt;-t&lt;/span&gt; fastapi-app &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, open the Docker Desktop UI. You will see the image you created listed in the “Images” section, as shown below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnj8jgkb5bw7237e54rou.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnj8jgkb5bw7237e54rou.PNG" alt=" " width="800" height="173"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 2: Run Container&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; 8000:8000 fastapi-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open your browser and go to &lt;a href="http://localhost:8000/docs/" rel="noopener noreferrer"&gt;http://localhost:8000/docs/&lt;/a&gt; . You will see the output as shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy7bvcvw3wvzy7ldo2dpf.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy7bvcvw3wvzy7ldo2dpf.PNG" alt=" " width="800" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;br&gt;
What started as a small idea turned into a major improvement for our team.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Takeaways:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Docker eliminates repetitive installations&lt;/li&gt;
&lt;li&gt;FastAPI makes backend development fast and efficient&lt;/li&gt;
&lt;li&gt;Centralized deployment saves time and effort&lt;/li&gt;
&lt;li&gt;Clients can access applications easily via browser&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Closing Note&lt;/strong&gt;&lt;br&gt;
Sometimes, the best solutions are not complex — they just require a shift in thinking.&lt;/p&gt;

&lt;p&gt;Instead of asking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“How do we install this everywhere?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“How can we run this once and access it everywhere?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That question changed everything for me — and it might do the same for you.&lt;/p&gt;

</description>
      <category>backend</category>
      <category>devops</category>
      <category>docker</category>
      <category>python</category>
    </item>
  </channel>
</rss>
