<?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: shravan jain</title>
    <description>The latest articles on DEV Community by shravan jain (@shravanjain).</description>
    <link>https://dev.to/shravanjain</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3163022%2F23659411-5a43-44ac-905d-3c040b8e90d3.jpg</url>
      <title>DEV Community: shravan jain</title>
      <link>https://dev.to/shravanjain</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shravanjain"/>
    <language>en</language>
    <item>
      <title>what's all this hype about "loop engineering"</title>
      <dc:creator>shravan jain</dc:creator>
      <pubDate>Sun, 05 Jul 2026 09:20:33 +0000</pubDate>
      <link>https://dev.to/shravanjain/whats-all-this-hype-about-loop-engineering-3elh</link>
      <guid>https://dev.to/shravanjain/whats-all-this-hype-about-loop-engineering-3elh</guid>
      <description>&lt;p&gt;Honestly it's not a new concept. this feature already existed in models before. problem was the models were just weak.&lt;/p&gt;

&lt;p&gt;Looping only works if each attempt gets the agent closer to the correct solution. Earlier models weren't consistent enough for that. They often misunderstood feedback, repeated the same mistakes, or got stuck in an infinite loop. Instead of improving with each iteration, they frequently failed to make meaningful progress, eventually consuming large numbers of tokens without solving the problem.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Context Window Limitation
&lt;/h3&gt;

&lt;p&gt;Earlier language models had much smaller context windows. As the agent went through more iterations, the conversation history and reasoning gradually filled the available context. Once the context window was exceeded, older messages had to be dropped or compressed into summaries. As a result, the agent could forget previous failed attempts, lose important clues or reasoning, and sometimes repeat the same mistakes it had already made.&lt;/p&gt;

&lt;h3&gt;
  
  
  So what did modern models actually fix?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Bigger context windows&lt;/strong&gt;  Models can now hold way more of the conversation/history without forgetting, so the agent doesn't need to spin up a fresh session every few iterations. it can just keep looping with the full history of what failed and why.&lt;/p&gt;

&lt;p&gt;modern models also got way more &lt;strong&gt;consistent&lt;/strong&gt;  earlier if you asked a model to fix the same bug 5 times you'd get 5 different half-baked answers, now it actually converges toward the real fix. and tool use got better too . Old models could write code but couldn't run it and read the actual error, now they call a test runner, see the real failure, and fix that exact thing which is literally what makes the "verify" step possible.&lt;/p&gt;

&lt;p&gt;And then there's &lt;strong&gt;inference&lt;/strong&gt; it is simply the process of a model generating an answer. like when you type "write a java binary search," the model reads your prompt, thinks, and generates code that whole process is inference. every time the model generates text, that's one inference. now here's the thing  inference has gotten way faster and cheaper. running a loop means multiple inferences back to back (generate, verify, retry, repeat), and earlier that would've been slow and expensive enough that nobody did it casually. now it's cheap and fast enough to just run 10 iterations without thinking twice.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I tested this myself&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;instead of just reading, I tried the smallest version of this loop on a palindrome checker. first attempt used basic &lt;code&gt;s == s[::-1]&lt;/code&gt;  it worked on simple cases but failed on anything with spaces, punctuation, or mixed case, stuff like "A man a plan a canal Panama." fed that exact failure back in, nothing extra. second attempt cleaned the string first, then compared it passed.&lt;/p&gt;

&lt;p&gt;two iterations, one test suite as the verify step. that's the entire loop  generate → verify → retry → stop.&lt;/p&gt;

&lt;p&gt;try it yourself with literally any model . Ask it to write something small, run it, let it fail on some edge case, copy that exact error and paste it back asking it to fix that specific thing, run it again. watch it fix itself.&lt;/p&gt;

&lt;p&gt;that's the whole "loop" everyone's hyping  except you're the one doing the looping manually. tools like claude code, openClaw etc just automate this exact cycle so nobody has to copy-paste errors back and forth themselves.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;So, going back to my original doubt&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;why couldn't we just loop an agent till it solves the problem, back in 2022-23? turns out we could, technically. the loop itself was never the hard part it's a while loop.&lt;/p&gt;

&lt;p&gt;what was actually hard, and what's finally solved now, is knowing when to stop. bigger context so it doesn't forget, consistency so each attempt gets closer instead of randomly different, real tool use so it can verify instead of guess.&lt;/p&gt;

&lt;p&gt;so when people say "loop engineering," they're not describing some new AI capability. they're describing the fact that the boring infrastructure problems finally got solved, so a decade-old idea finally works.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>loopengineering</category>
      <category>llm</category>
    </item>
    <item>
      <title>WebSocket in Spring Boot, Explained Simply</title>
      <dc:creator>shravan jain</dc:creator>
      <pubDate>Fri, 03 Jul 2026 14:00:09 +0000</pubDate>
      <link>https://dev.to/shravanjain/websocket-in-spring-boot-explained-simply-4pel</link>
      <guid>https://dev.to/shravanjain/websocket-in-spring-boot-explained-simply-4pel</guid>
      <description>&lt;h3&gt;
  
  
  What Problem Does WebSocket Solve?
&lt;/h3&gt;

&lt;p&gt;My always go-to learning technique is asking "what problem does this solve?"&lt;/p&gt;

&lt;p&gt;I think this is the best method to learn any new topic  when we learn this way, we eventually get the curiosity to dig deeper into that topic and explore more.&lt;/p&gt;

&lt;p&gt;So, what problem does WebSocket solve?&lt;/p&gt;

&lt;p&gt;In a traditional website, if a client wants to get information from the server, the client sends an HTTP request asking for that specific thing. Upon receiving the request, the server processes it (this may include querying the database, performing business logic, etc.) and sends back an HTTP response containing the requested data along with an appropriate status code.&lt;/p&gt;

&lt;p&gt;Here's the catch HTTP is stateless, meaning the server doesn't remember the previous request. So every single request must carry all the information the server needs to process it.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Chat App Example
&lt;/h3&gt;

&lt;p&gt;Imagine there are two users chatting with each other. Client 1 sends a message, and the server stores it. But the problem here is Client 2 currently cannot see the message. Instead, Client 2 has to keep sending requests at fixed intervals, asking "Do I have any new messages?" This technique of repeatedly sending requests to check for new data is called &lt;strong&gt;Polling&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Now imagine there are thousands of users online, all continuously sending requests just to check if there's a new message  even when there isn't one. This puts unnecessary load on the server.&lt;/p&gt;

&lt;p&gt;This is where &lt;strong&gt;WebSockets&lt;/strong&gt; provide a much better solution.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Is a WebSocket?
&lt;/h3&gt;

&lt;p&gt;WebSockets are a different protocol that starts with an &lt;strong&gt;HTTP&lt;/strong&gt; request. Once the connection is established, it remains open until either the client or the server closes it. Since the connection stays open, there's no need to create a new connection for every request.&lt;/p&gt;

&lt;p&gt;Think of it like having a door between two houses. Once the door is unlocked and opened, both people can walk through it whenever they want, without having to knock every single time.&lt;/p&gt;

&lt;p&gt;I won't go too deep into WebSockets because that's not the goal of this article  we're here to build one with Spring Boot. If you're curious how WebSockets work behind the scenes, I'd recommend giving the &lt;strong&gt;WebSocket Handbook&lt;/strong&gt; by Ably a read:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pages.ably.com/hubfs/the-websocket-handbook.pdf" rel="noopener noreferrer"&gt;https://pages.ably.com/hubfs/the-websocket-handbook.pdf&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With that out of the way, let's jump into the implementation.&lt;/p&gt;




&lt;h2&gt;
  
  
  Setting Up WebSocket in Spring Boot
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Add the Dependency
&lt;/h3&gt;

&lt;p&gt;Tbh, this is one of the best parts about using Spring Boot  it handles most of the heavy lifting for us, so we don't have to implement the core WebSocket functionality from scratch.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;dependency&amp;gt;&lt;/span&gt;  
    &lt;span class="nt"&gt;&amp;lt;groupId&amp;gt;&lt;/span&gt;org.springframework.boot&lt;span class="nt"&gt;&amp;lt;/groupId&amp;gt;&lt;/span&gt;  
    &lt;span class="nt"&gt;&amp;lt;artifactId&amp;gt;&lt;/span&gt;spring-boot-starter-websocket&lt;span class="nt"&gt;&amp;lt;/artifactId&amp;gt;&lt;/span&gt;  
&lt;span class="nt"&gt;&amp;lt;/dependency&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you created your project using Spring Initializr, you can simply select the WebSocket dependency while creating the project. If you already have an existing project, just add this to your &lt;code&gt;pom.xml&lt;/code&gt; and run &lt;code&gt;mvn clean install&lt;/code&gt; (or let your IDE reload the Maven project).&lt;/p&gt;

&lt;h3&gt;
  
  
  What We're Building
&lt;/h3&gt;

&lt;p&gt;For this tutorial, let's build a simple dashboard where multiple users can post something. The goal: once &lt;strong&gt;User 1&lt;/strong&gt; posts something, it should automatically reflect in &lt;strong&gt;User 2's&lt;/strong&gt; browser without refreshing the page.&lt;/p&gt;

&lt;p&gt;To make this work, we obviously need to set up WebSocket communication in our Spring Boot app. And that starts with configuration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why We Need a WebSocketConfig Class
&lt;/h3&gt;

&lt;p&gt;By default, Spring Boot automatically configures REST APIs. That's why we can simply declare REST endpoints using annotations like &lt;code&gt;@RequestMapping()&lt;/code&gt; or &lt;code&gt;@GetMapping()&lt;/code&gt; without any additional setup when the application starts, Spring Boot starts the embedded Tomcat server and configures HTTP request handling automatically.&lt;/p&gt;

&lt;p&gt;However, Spring does &lt;strong&gt;not&lt;/strong&gt; know how we want to configure WebSockets. We need to specify things like the WebSocket endpoint, the message broker, and the destination prefixes ourselves. That's why we create a separate &lt;code&gt;WebSocketConfig&lt;/code&gt; class. When the application starts, Spring scans this configuration class, recognizes that the application uses WebSockets, and sets up the WebSocket infrastructure based on the settings we provide.&lt;/p&gt;

&lt;p&gt;Here's what that class looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;
&lt;span class="nd"&gt;@Configuration&lt;/span&gt;
&lt;span class="nd"&gt;@EnableWebSocketMessageBroker&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;WebSocketConfig&lt;/span&gt; &lt;span class="kd"&gt;implements&lt;/span&gt; &lt;span class="nc"&gt;WebSocketMessageBrokerConfigurer&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="nd"&gt;@Override&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;registerStompEndpoints&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;StompEndpointRegistry&lt;/span&gt; &lt;span class="n"&gt;registry&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;registry&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;addEndpoint&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/ws"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
                &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setAllowedOriginPatterns&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"http://localhost:5173"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
                &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;withSockJS&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt; 
            &lt;span class="c1"&gt;// .withSockJS() is for compatibility , if the browser doesn't support web socket,&lt;/span&gt;
               &lt;span class="c1"&gt;// then roll back to default polling or streaming method .&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;

    &lt;span class="nd"&gt;@Override&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;configureMessageBroker&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;MessageBrokerRegistry&lt;/span&gt; &lt;span class="n"&gt;registry&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;registry&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;enableSimpleBroker&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/topic"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;registry&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setApplicationDestinationPrefixes&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/app"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  What is registerStompEndpoints()?
&lt;/h3&gt;

&lt;p&gt;This method is used to define the endpoint for WebSocket communication. But you might wonder "why do we need a separate endpoint for WebSockets?", Why can't we just use &lt;code&gt;@RequestMapping&lt;/code&gt; like we do for REST APIs?&lt;/p&gt;

&lt;p&gt;The reason is simple. &lt;code&gt;@RequestMapping&lt;/code&gt; is designed only for HTTP which is a request-response protocol. The client asks, the server answers, and the connection closes. That's it. It's one-directional per request.&lt;/p&gt;

&lt;p&gt;WebSockets are different. Once the connection is established, both the client and the server can send messages to each other at any time without waiting for a request. That's bi-directional communication and HTTP simply wasn't designed for that. So we need a separate endpoint that upgrades the HTTP connection into a WebSocket connection.&lt;/p&gt;

&lt;p&gt;You might also wonder about the &lt;code&gt;registry&lt;/code&gt; argument this method receives — it's of type &lt;code&gt;StompEndpointRegistry&lt;/code&gt;. Here's what's happening behind the scenes: when Spring starts up, it sees the &lt;code&gt;@EnableWebSocketMessageBroker&lt;/code&gt; annotation, builds the entire WebSocket infrastructure internally, and then passes that &lt;code&gt;registry&lt;/code&gt; object into your method. Think of it like Spring handing you a blank blueprint and saying &lt;em&gt;"here, fill in the details."&lt;/em&gt; You then use methods like &lt;code&gt;addEndpoint()&lt;/code&gt; to define where clients can connect — building the configuration piece by piece. That's exactly what &lt;code&gt;registerStompEndpoints()&lt;/code&gt; does it tells Spring "this is the URL where clients can connect to open a WebSocket connection."&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;What is &lt;code&gt;configureMessageBroker()&lt;/code&gt;?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Now that we've defined where clients connect, we need to tell Spring how to route messages once they're inside. That's exactly what &lt;code&gt;configureMessageBroker()&lt;/code&gt; does.&lt;/p&gt;

&lt;p&gt;Think of it like a post office. When a message arrives, the post office needs rules  which messages go where, and how to deliver them. &lt;code&gt;configureMessageBroker()&lt;/code&gt; defines those rules.&lt;/p&gt;

&lt;p&gt;Similar to &lt;code&gt;registerStompEndpoints()&lt;/code&gt;, Spring builds the &lt;code&gt;MessageBrokerRegistry&lt;/code&gt; internally and hands it to you same idea, you just fill in the details.&lt;/p&gt;

&lt;p&gt;Now let's look at the two lines inside:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;registry&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;enableSimpleBroker&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/topic"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This enables Spring's built-in message broker and tells it to handle any destination that starts with &lt;code&gt;/topic&lt;/code&gt;. Think of &lt;code&gt;/topic/activities&lt;/code&gt; like a YouTube channel  any client can subscribe to it, and whenever a message is sent to that channel, all subscribers receive it instantly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;registry&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setApplicationDestinationPrefixes&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/app"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This defines the prefix for messages that are sent FROM the client TO the server. So if a client sends a message to &lt;code&gt;/app/activity&lt;/code&gt;, Spring knows to route it to a controller method annotated with &lt;code&gt;@MessageMapping("/activity")&lt;/code&gt;. Without this prefix, Spring wouldn't know whether an incoming message is meant for the broker or for your controller.&lt;/p&gt;

&lt;p&gt;In short &lt;code&gt;/topic&lt;/code&gt; is for server-to-client delivery, &lt;code&gt;/app&lt;/code&gt; is for client-to-server routing.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;What is STOMP?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;We already know what WebSockets do they maintain a persistent connection between the client and the server, allowing both sides to send data to each other at any time.&lt;/p&gt;

&lt;p&gt;But raw WebSockets are just an open pipe. You can put anything in that pipe there's no structure, no rules, no way to say "this message goes to this person" or "this is a chat message vs a notification." It's just raw data flying back and forth.&lt;/p&gt;

&lt;p&gt;That's where &lt;strong&gt;STOMP&lt;/strong&gt; (Simple Text Oriented Messaging Protocol) comes in. STOMP works on top of WebSockets and adds structure to the flow of data. It introduces three simple concepts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Destinations&lt;/strong&gt; — like addresses, e.g. &lt;code&gt;/topic/activities&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Subscribe&lt;/strong&gt; — a client says "I want messages sent to this destination"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Send&lt;/strong&gt; — the server or client pushes a message to a destination&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think of it like this WebSocket is the road, STOMP is the traffic rules. Without traffic rules, cars go everywhere and crash into each other. With rules, everyone knows where to go.&lt;/p&gt;

&lt;p&gt;In Spring Boot, when you use &lt;code&gt;@EnableWebSocketMessageBroker&lt;/code&gt;, you're enabling STOMP support on top of WebSockets. That's why your endpoints and broker configuration use STOMP concepts like destinations and prefixes.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Broadcasting from the Server &lt;code&gt;SimpMessagingTemplate&lt;/code&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Okay so we've set up WebSockets, configured STOMP, defined our endpoints and broker. But here's the question how does our Spring controller actually &lt;em&gt;push&lt;/em&gt; a message to all the connected clients? Like who does the actual sending?&lt;/p&gt;

&lt;p&gt;That's where &lt;code&gt;SimpMessagingTemplate&lt;/code&gt; comes in.&lt;/p&gt;

&lt;p&gt;Spring gives you this object out of the box you don't need to create it, you don't need to configure it. Just autowire it like any other bean and it's ready to use.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Autowired&lt;/span&gt;
&lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;SimpMessagingTemplate&lt;/span&gt; &lt;span class="n"&gt;smt&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now whenever you want to push something to all subscribers, you just call one method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;smt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;convertAndSend&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/topic/activities"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;savedActivity&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. One line. Here's what it does under the hood:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Takes your Java object (&lt;code&gt;savedActivity&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Converts it to JSON automatically&lt;/li&gt;
&lt;li&gt;Pushes it to everyone currently subscribed to &lt;code&gt;/topic/activities&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now let's see it in context. Here's what the full controller method looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@PostMapping&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;Activity&lt;/span&gt; &lt;span class="nf"&gt;insertActivity&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nd"&gt;@RequestBody&lt;/span&gt; &lt;span class="nc"&gt;Activity&lt;/span&gt; &lt;span class="n"&gt;activity&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;Activity&lt;/span&gt; &lt;span class="n"&gt;savedActivity&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;activityRepository&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;save&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;activity&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;smt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;convertAndSend&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/topic/activities"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;savedActivity&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;savedActivity&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two things are happening here. First, the activity gets saved to the database. Second, that same activity gets broadcast to all connected clients instantly over WebSocket. The person who made the POST request gets a normal HTTP response back. Everyone else watching the dashboard gets it pushed to them in real time.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Testing It The HTML Client&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;So after configuring everything, let's look at how we can test it. Just a heads up I'm not really focused on JS or frontend right now, so I won't go deep into how this code works internally. I know it at a high level, and that's good enough for this test.&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="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;WebSocket Test&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://cdn.jsdelivr.net/npm/stompjs@2.3.3/lib/stomp.min.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;WebSocket Test&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;id=&lt;/span&gt;&lt;span class="s"&gt;"messages"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;socket&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;SockJS&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;http://localhost:8080/ws&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;stompClient&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Stomp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;over&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;stompClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;({},&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;frame&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Connected: &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;frame&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;stompClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;subscribe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/topic/activities&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;messages&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class="dl"&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;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is just a small HTML page that connects to our &lt;code&gt;/ws&lt;/code&gt; endpoint, subscribes to &lt;code&gt;/topic/activities&lt;/code&gt;, and displays whatever comes through. That's it nothing fancy, just enough to prove the WebSocket connection actually works end to end.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;The test:&lt;/strong&gt;
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Open this HTML file in the browser.&lt;/li&gt;
&lt;li&gt;Hit the &lt;code&gt;POST /activity&lt;/code&gt; endpoint with some activity data.&lt;/li&gt;
&lt;li&gt;Watch the page  the new activity shows up instantly, no refresh needed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That confirms the full flow save to DB, broadcast over WebSocket, client receives it live.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;And that's it that's a full WebSocket setup with Spring Boot, from the problem it solves all the way to seeing it work live in the browser.&lt;/p&gt;

&lt;p&gt;To recap what we built: we configured a WebSocket endpoint, set up STOMP for structured messaging, used &lt;code&gt;SimpMessagingTemplate&lt;/code&gt; to broadcast from the server, and tested it with a simple HTML client all to get one thing working: &lt;strong&gt;when User 1 posts something, User 2 sees it instantly, without refreshing.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is the exact same foundation used for things like chat apps, live notifications, live dashboards, and real-time tracking apps so once you're comfortable with this, you can build a lot on top of it.&lt;/p&gt;

</description>
      <category>springboot</category>
      <category>websocket</category>
      <category>java</category>
      <category>backend</category>
    </item>
    <item>
      <title>Monitoring a Server with Prometheus and Grafana: A Beginner’s Guide</title>
      <dc:creator>shravan jain</dc:creator>
      <pubDate>Fri, 23 May 2025 08:52:46 +0000</pubDate>
      <link>https://dev.to/shravanjain/monitoring-a-server-with-prometheus-and-grafana-a-beginners-guide-3mf6</link>
      <guid>https://dev.to/shravanjain/monitoring-a-server-with-prometheus-and-grafana-a-beginners-guide-3mf6</guid>
      <description>&lt;p&gt;Monitoring a website is super important for developers. It helps you figure out what’s causing issues like why your website is down, why requests are taking too long, or what might be slowing things down in general.&lt;/p&gt;

&lt;p&gt;That’s where Prometheus and Grafana come in.&lt;/p&gt;

&lt;p&gt;Prometheus is used to collect metrics from endpoints that you define (like your server or apps).&lt;br&gt;
Grafana takes those metrics from Prometheus and turns them into easy-to-understand graphs and dashboards, so you can actually see what’s going on behind the scenes.&lt;/p&gt;

&lt;p&gt;What This Guide Covers and Prerequisites&lt;/p&gt;

&lt;p&gt;This guide is intended for beginners who want to learn the basics of setting up Prometheus and Grafana for monitoring their website.&lt;br&gt;
I'll cover how to write a YAML configuration file for the Prometheus server, how to containerize it using Docker, and how to pull the Grafana image and use its dashboard.&lt;br&gt;
Prerequisites&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Basic knowledge of Linux/command line

Docker (for containerization)

Basic understanding of YAML

Familiarity with any backend language (I'm using Flask in this guide)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Setting Up Prometheus
&lt;/h2&gt;

&lt;p&gt;Creating an flask server&lt;br&gt;
&lt;/p&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;flask&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Flask&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;prometheus_flask_exporter&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;PrometheusMetrics&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;Flask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;__name__&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;metrics&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nc"&gt;PrometheusMetrics&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nd"&gt;@app.route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;/&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;test&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;hello world&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;0.0.0.0&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;debug&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above program, I have created a PrometheusMetrics instance and passed the app object as an argument.&lt;br&gt;
This automatically sets up an endpoint (/metrics) that exposes application metrics, which Prometheus can scrape.&lt;/p&gt;

&lt;p&gt;Now, if you open the website and go to endpoint /metrics you would now see this.&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%2F4lbn5d67igr5vvwl0kov.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%2F4lbn5d67igr5vvwl0kov.png" alt="an image that shows the metrices from the website" width="800" height="362"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;if you find any problem or get error 404 turn off the debug mode or run &lt;code&gt;export DEBUG_METRICS=1&lt;/code&gt; then run the application.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;prometheus server

&lt;ul&gt;
&lt;li&gt;Create a prometheus-config.yml to put the prometheus configuration.
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt; &lt;span class="na"&gt;global&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;scrape_interval&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;4s&lt;/span&gt; &lt;span class="c1"&gt;# it'll scrape the metrics from the end point every 4s&lt;/span&gt;

&lt;span class="na"&gt;scrape_configs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;job_name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;prometheus&lt;/span&gt;
    &lt;span class="na"&gt;static_configs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;targets&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;&amp;lt;you-target-address&amp;gt;"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt; &lt;span class="c1"&gt;# put you private address here to make that as your end-point&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;creating a docker container for prometheus server
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;3"&lt;/span&gt;

&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;prom-server&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;prom/prometheus&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;9090:9090&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;./prometheus-config.yml:/etc/prometheus/prometheus.yml&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This container pulls the &lt;code&gt;prom/prometheus&lt;/code&gt; image and listens on port 9090 on my machine (host), forwarding it to port 9090 inside the container. It uses Docker volumes to bind &lt;code&gt;./prometheus-config.yml&lt;/code&gt; (on the host) to &lt;code&gt;/etc/prometheus/prometheus.yml&lt;/code&gt; (inside the container), so any changes made to the config file on the host will be reflected in the container at runtime.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary of Prometheus Setup
&lt;/h2&gt;

&lt;p&gt;I created a Flask app and used PrometheusMetrics to integrate Prometheus with it by passing the Flask app instance. This setup automatically exposed a /metrics endpoint, where all the raw data is available. Then, I used a Prometheus Docker container and specified a prometheus.yml file inside it to define which address to scrape the metrics from. Now, Prometheus collects the metrics from my Flask app and stores the data so it can be used for monitoring and visualization.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up Grafana
&lt;/h2&gt;

&lt;p&gt;Setting up Grafana is simple — just run it in a Docker container:&lt;br&gt;
&lt;code&gt;docker run -d -p 3000:3000 --name=grafana grafana/grafana-oss&lt;/code&gt;&lt;br&gt;
There are two versions of Grafana:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Grafana OSS (Open Source Software) — free and open to use (this is the one we’re using)

Grafana Enterprise — has extra features for businesses
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After running the container, open your browser and go to:&lt;br&gt;
&lt;code&gt;http://localhost:3000&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
You’ll see the Grafana login page. Use the default credentials:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Username: admin

Password: admin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Grafana will ask you to set a new password — choose anything you like.&lt;br&gt;
Connect Grafana to Prometheus&lt;/p&gt;

&lt;p&gt;Once you’re logged in:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Click on “Add your first data source”

Choose Prometheus

In the URL box, enter the address of your Prometheus server, for example:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;For example, if your Prometheus server is running at 172.20.54.207 on port 5000, enter:&lt;br&gt;
&lt;a href="http://172.20.54.207:5000" rel="noopener noreferrer"&gt;http://172.20.54.207:5000&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scroll down and click “Save &amp;amp; Test”&lt;br&gt;
You should see a green success message that says Grafana is connected to Prometheus.&lt;/p&gt;

&lt;p&gt;That’s it — you're all set! &lt;/p&gt;

&lt;p&gt;Here's what the raw metrics look like in Prometheus. Grafana takes this data and turns it into easy-to-understand visual dashboards.&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%2Fr2q4oroqpk40tsjl6qdo.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%2Fr2q4oroqpk40tsjl6qdo.png" alt="Prometheus raw metrics displayed in browser" width="800" height="391"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>prometheus</category>
      <category>docker</category>
      <category>grafana</category>
      <category>monitoring</category>
    </item>
    <item>
      <title>Write Less, Reuse More: Template Inheritance in Flask Explained</title>
      <dc:creator>shravan jain</dc:creator>
      <pubDate>Sat, 17 May 2025 07:57:15 +0000</pubDate>
      <link>https://dev.to/shravanjain/write-less-reuse-more-template-inheritance-in-flask-explained-4ll7</link>
      <guid>https://dev.to/shravanjain/write-less-reuse-more-template-inheritance-in-flask-explained-4ll7</guid>
      <description>&lt;p&gt;This turned out to be a pretty cool concept. While working on my site monitoring app, I had around three or four services like uptime checks, DNS lookups, pinging, and a few others. Since I’m not much of a UI designer, I ended up creating separate files for each service, even though they all shared the same layout.&lt;/p&gt;

&lt;p&gt;That’s when I discovered Flask’s template inheritance. Instead of repeating the same code over and over, you can create a base layout and reuse it wherever you want. It really helped clean things up and made everything way easier to manage. Here’s how you can set it up.&lt;/p&gt;

&lt;h2&gt;
  
  
  Inheriting from base to child:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;!&lt;/span&gt;&lt;span class="n"&gt;DOCTYPE&lt;/span&gt; &lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt; &lt;span class="n"&gt;lang&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;en&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;head&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;meta&lt;/span&gt; &lt;span class="n"&gt;charset&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;UTF-8&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;meta&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;viewport&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;width=device-width, initial-scale=1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;template&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;inheritance&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;head&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;header&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;nav&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ul&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;home&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;home&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;about&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;about&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;contact&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;contact&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;ul&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;nav&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;header&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;block&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;}{&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;endblock&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;footer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;copy&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="mi"&gt;2025&lt;/span&gt; &lt;span class="n"&gt;My&lt;/span&gt; &lt;span class="n"&gt;Site&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;footer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Simply put, if you want to use the same template like reusing the same navigation bar across multiple pages, you can just extend the base file. The whole layout gets reused automatically.&lt;/p&gt;

&lt;p&gt;And if you want to change something specific on a page, you define blocks in the base file that let you override those sections whenever you need to. For example, if you want to override content inside the  tag, you would define a block like this in the base:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;block&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;}{&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;endblock&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
 &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, in your child template, you extend the base and override that block:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;extends&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;base.html&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;block&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt; &lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="n"&gt;hello&lt;/span&gt; &lt;span class="n"&gt;world&lt;/span&gt;&lt;span class="err"&gt;!!&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;endblock&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;That way, you get the shared layout and can customize parts of the page without repeating your code.&lt;/p&gt;

</description>
      <category>flask</category>
      <category>programming</category>
      <category>webdev</category>
      <category>python</category>
    </item>
    <item>
      <title>Mastering Flask Blueprints: The First Step to Scalable Web Apps</title>
      <dc:creator>shravan jain</dc:creator>
      <pubDate>Thu, 15 May 2025 16:08:37 +0000</pubDate>
      <link>https://dev.to/shravanjain/mastering-flask-blueprints-the-first-step-to-scalable-web-apps-1fg4</link>
      <guid>https://dev.to/shravanjain/mastering-flask-blueprints-the-first-step-to-scalable-web-apps-1fg4</guid>
      <description>&lt;p&gt;As I started learning Flask, I was building simple apps just to understand the basics and get comfortable with it. Once I felt a bit more confident, I decided to start a project, a site monitoring tool. Since I knew the project would grow and include more functionality, I realized that things should be organized better. That’s when I came across Flask Blueprints. A Blueprint is a modular way to organize code and routes into separate components. Today, I set up my first Blueprint in Flask and here’s how it went.&lt;/p&gt;

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



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;blueprint-example/
├── run.py
└── app/
    └── routes.py
    └── __init__.py
    └── templates/
        └── index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 1: Creating  a simple Blueprint
&lt;/h2&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;flask&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Blueprint&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;render_template&lt;/span&gt;
&lt;span class="c1"&gt;#creating a flask blueprint called 'main_route'
&lt;/span&gt;&lt;span class="n"&gt;main_route&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nc"&gt;Blueprint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;main_route&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;__name__&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;#define a route on this blueprint
&lt;/span&gt;&lt;span class="nd"&gt;@main_route.route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;/&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;blue_example&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;render_template&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;index.html&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;h2&gt;
  
  
  Step 2: Register the blueprint
&lt;/h2&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;flask&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Flask&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;Flask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;__name__&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;blue_example&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;.routes&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;main_route&lt;/span&gt;
    &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;register_blueprint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;main_route&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="c1"&gt;#registering my blueprint to my flask app instance
&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;app&lt;/span&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: Run the app
&lt;/h2&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;app&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;blue_example&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;blue_example&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="c1"&gt;#Calling a function to get flask app instance
&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;debug&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;#run the app in debug mode
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What i found use full?
&lt;/h2&gt;

&lt;p&gt;I basically had an idea of how this works because I had learned about MVC (Model, View, and Controller) in Java. The working process of both is quite similar, so I was able to grasp it a bit quicker.&lt;/p&gt;

&lt;p&gt;Here are a few things I found helpful about using Blueprints:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It's a clean way to split the code logically. For example, separating routes and the dashboard into components makes the structure much easier to work with.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It's much easier to manage as the app grows and more features are added.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It makes the project more organized and scalable, which is especially useful when working in teams or revisiting the project later.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>flask</category>
      <category>programming</category>
      <category>python</category>
    </item>
    <item>
      <title>My Journey into Python and DevOps Begins</title>
      <dc:creator>shravan jain</dc:creator>
      <pubDate>Wed, 14 May 2025 14:46:38 +0000</pubDate>
      <link>https://dev.to/shravanjain/my-journey-into-python-and-devops-begins-mp6</link>
      <guid>https://dev.to/shravanjain/my-journey-into-python-and-devops-begins-mp6</guid>
      <description>&lt;p&gt;Hey everyone! 👋&lt;/p&gt;

&lt;p&gt;I'm &lt;strong&gt;Shravan Jain&lt;/strong&gt;, a student who recently found a niche in coding.&lt;/p&gt;

&lt;p&gt;I’ve always been fascinated by the terminal. That childhood excitement of using a black screen with white text never really left me. Over time, I started exploring fun and nerdy things—like configuring servers in &lt;strong&gt;Cisco Packet Tracer&lt;/strong&gt; and tweaking &lt;strong&gt;Firefox CSS&lt;/strong&gt; just to see what I could do.&lt;/p&gt;

&lt;p&gt;For a while, I was doing these small, non-productive (but oddly satisfying) things that sparked my curiosity. But now, I’ve decided to channel that curiosity into something more focused and practical.&lt;/p&gt;

&lt;p&gt;I’ve started learning &lt;strong&gt;Python scripting&lt;/strong&gt; to automate tasks and understand how things work behind the scenes. I'm drawn to Python because of how versatile it is—it's like a multitool for developers. Whether it's scripting, automation, DevOps, or backend systems, Python is everywhere.&lt;/p&gt;

&lt;p&gt;This is my first step into something more structured and skill-driven, and I'm excited to share what I learn along the way!&lt;/p&gt;

&lt;p&gt;Thanks for reading, and feel free to connect if you're also on a similar journey. 🙌&lt;/p&gt;

&lt;h1&gt;
  
  
  Python #DevOps #StudentDev #LearningJourney #Automation
&lt;/h1&gt;

</description>
      <category>devops</category>
      <category>python</category>
      <category>flask</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
