<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Bharath Kumar J N</title>
    <description>The latest articles on Forem by Bharath Kumar J N (@bharathdhana).</description>
    <link>https://forem.com/bharathdhana</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%2F3854381%2F8b8373c5-6338-4a30-8a1b-13675fbaa28c.jpg</url>
      <title>Forem: Bharath Kumar J N</title>
      <link>https://forem.com/bharathdhana</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/bharathdhana"/>
    <language>en</language>
    <item>
      <title>Day 3 - Added Security, Authentication and Jwt Tokens in REST API Project</title>
      <dc:creator>Bharath Kumar J N</dc:creator>
      <pubDate>Sat, 04 Apr 2026 14:28:18 +0000</pubDate>
      <link>https://forem.com/bharathdhana/day-3-added-security-authentication-and-jwt-tokens-in-rest-api-project-3kal</link>
      <guid>https://forem.com/bharathdhana/day-3-added-security-authentication-and-jwt-tokens-in-rest-api-project-3kal</guid>
      <description>&lt;p&gt;I restarted my coding journey with a simple rule:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Improve 1% every day.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The features I worked on today include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pagination
&lt;/li&gt;
&lt;li&gt;Request Validation
&lt;/li&gt;
&lt;li&gt;Spring Security
&lt;/li&gt;
&lt;li&gt;JWT Authentication
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Pagination in the Task API
&lt;/h2&gt;

&lt;p&gt;Earlier, my API returned all tasks at once. That works when the data is small, but in real applications the database can contain thousands of records.&lt;/p&gt;

&lt;p&gt;So I added &lt;strong&gt;pagination&lt;/strong&gt; to the API.&lt;/p&gt;

&lt;p&gt;Now tasks can be fetched page by page instead of loading everything in one response. This improves performance and makes the API much easier for the frontend to handle.&lt;/p&gt;




&lt;h2&gt;
  
  
  Request Validation
&lt;/h2&gt;

&lt;p&gt;I also implemented &lt;strong&gt;request validation&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Before this, the API would accept requests even if important fields like the title or description were missing. Now the API validates the input and returns an error if required fields are not provided.&lt;/p&gt;




&lt;h2&gt;
  
  
  Spring Security Integration
&lt;/h2&gt;

&lt;p&gt;Another major step today was adding &lt;strong&gt;Spring Security&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This allows the application to protect certain endpoints and control who can access them. Authentication-related routes remain public, while task-related endpoints now require authentication.&lt;/p&gt;




&lt;h2&gt;
  
  
  JWT Authentication
&lt;/h2&gt;

&lt;p&gt;To handle authentication, I implemented &lt;strong&gt;JWT (JSON Web Token)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Instead of storing sessions on the server, the application now uses token-based authentication. When a user logs in, the server generates a token. The client then sends that token with every request to access protected endpoints.&lt;/p&gt;




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

&lt;p&gt;Today helped me understand several important backend concepts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why pagination is important for performance
&lt;/li&gt;
&lt;li&gt;How validation helps maintain data integrity
&lt;/li&gt;
&lt;li&gt;How Spring Security protects API endpoints
&lt;/li&gt;
&lt;li&gt;How JWT enables stateless authentication
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>programming</category>
      <category>career</category>
      <category>java</category>
    </item>
    <item>
      <title>Day 2 - Updated the REST API Project using ResponseEntity</title>
      <dc:creator>Bharath Kumar J N</dc:creator>
      <pubDate>Thu, 02 Apr 2026 23:18:13 +0000</pubDate>
      <link>https://forem.com/bharathdhana/day-2-updated-the-rest-api-project-using-responseentity-l3d</link>
      <guid>https://forem.com/bharathdhana/day-2-updated-the-rest-api-project-using-responseentity-l3d</guid>
      <description>&lt;h2&gt;
  
  
  Refactoring the Controller Response
&lt;/h2&gt;

&lt;p&gt;While building the API, I made a small improvement to the controller response handling.&lt;/p&gt;

&lt;p&gt;Initially, the controller returned the data directly. Later, I updated it to use &lt;code&gt;ResponseEntity&lt;/code&gt; to have better control over the HTTP response.&lt;/p&gt;

&lt;h3&gt;
  
  
  Before
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@GetMapping&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Task&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;getAllTasks&lt;/span&gt;&lt;span class="o"&gt;()&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;taskService&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getAllTasks&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;&lt;strong&gt;What happens here&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Spring automatically returns &lt;code&gt;200 OK&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Response body contains the list of tasks&lt;/li&gt;
&lt;li&gt;No direct control over HTTP response structure&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  After
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@GetMapping&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;ResponseEntity&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Task&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;getAllTasks&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Task&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;tasks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;taskService&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getAllTasks&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;ResponseEntity&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ok&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tasks&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;&lt;strong&gt;What improved&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The method now returns a &lt;strong&gt;complete HTTP response&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;The HTTP status code is explicitly defined&lt;/li&gt;
&lt;li&gt;Easier to handle different scenarios like errors or empty responses&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Why This Matters
&lt;/h3&gt;

&lt;p&gt;Using &lt;code&gt;ResponseEntity&lt;/code&gt; makes the API more &lt;strong&gt;flexible and REST-friendly&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For example, we can now easily return different responses:&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="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;ResponseEntity&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ok&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tasks&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;          &lt;span class="c1"&gt;// 200 OK&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;ResponseEntity&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;notFound&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// 404 Not Found&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;ResponseEntity&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;noContent&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;&lt;span class="c1"&gt;// 204 No Content&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This small change improves &lt;strong&gt;API clarity, maintainability, and error handling&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>api</category>
      <category>devjournal</category>
      <category>java</category>
      <category>springboot</category>
    </item>
    <item>
      <title>Day 1 - Restart Coding | Built a REST API Project using Spring Boot Fundamentals</title>
      <dc:creator>Bharath Kumar J N</dc:creator>
      <pubDate>Thu, 02 Apr 2026 02:24:08 +0000</pubDate>
      <link>https://forem.com/bharathdhana/day-1-restart-coding-built-a-rest-api-project-using-spring-boot-fundamentals-fo3</link>
      <guid>https://forem.com/bharathdhana/day-1-restart-coding-built-a-rest-api-project-using-spring-boot-fundamentals-fo3</guid>
      <description>&lt;p&gt;For months, my coding routine looked like this:&lt;/p&gt;

&lt;p&gt;Learn → Lose consistency → Stop → Restart again.&lt;/p&gt;

&lt;p&gt;So today I decided to &lt;strong&gt;restart properly&lt;/strong&gt; — and document everything I build &lt;strong&gt;in public&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This is &lt;strong&gt;Day 1&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Progress
&lt;/h2&gt;

&lt;p&gt;I built a simple REST API using Spring Boot to refresh my backend fundamentals.&lt;/p&gt;

&lt;p&gt;Instead of jumping into complex projects, I wanted to rebuild the basics properly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Concepts
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;@RestController&lt;/li&gt;
&lt;li&gt;@RequestMapping&lt;/li&gt;
&lt;li&gt;Dependency Injection&lt;/li&gt;
&lt;li&gt;Basic service layer structure&lt;/li&gt;
&lt;li&gt;MVC architecture&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Lesson
&lt;/h2&gt;

&lt;p&gt;Trying to learn too many things at once is the fastest way to burn out.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mindset
&lt;/h2&gt;

&lt;p&gt;Not Trying to become an expert - Just Improving 1% Everyday&lt;/p&gt;

</description>
      <category>programming</category>
      <category>career</category>
      <category>java</category>
    </item>
    <item>
      <title>Starting My Coding Journey - From Confusion to Consistency</title>
      <dc:creator>Bharath Kumar J N</dc:creator>
      <pubDate>Wed, 01 Apr 2026 01:09:08 +0000</pubDate>
      <link>https://forem.com/bharathdhana/starting-my-coding-journey-from-confusion-to-consistency-55o2</link>
      <guid>https://forem.com/bharathdhana/starting-my-coding-journey-from-confusion-to-consistency-55o2</guid>
      <description>&lt;h2&gt;
  
  
  Beginning My Coding Journey
&lt;/h2&gt;

&lt;p&gt;Before starting, a small introduction.&lt;/p&gt;

&lt;p&gt;My name is &lt;strong&gt;Bharath&lt;/strong&gt;, and I'm a &lt;strong&gt;final-year Computer Science student&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For a long time, my coding journey looked like this:&lt;/p&gt;

&lt;p&gt;Start learning → Lose consistency → Stop → Restart again.&lt;/p&gt;

&lt;p&gt;I would learn something, get motivated for a few days, then slowly fall out of the routine. Eventually I realized that the biggest problem wasn't ability — it was &lt;strong&gt;consistency&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So this time I'm doing something different.&lt;/p&gt;

&lt;p&gt;I decided to &lt;strong&gt;learn in public and document my journey&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'm Focusing On
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Data Structures &amp;amp; Algorithms&lt;/li&gt;
&lt;li&gt;Backend development with Spring Boot&lt;/li&gt;
&lt;li&gt;Full-stack development&lt;/li&gt;
&lt;li&gt;Building real projects instead of just watching tutorials&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I Will Share Here
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Daily or Weekly coding progress&lt;/li&gt;
&lt;li&gt;DSA problems I solve and what I learn from them&lt;/li&gt;
&lt;li&gt;Projects I'm building&lt;/li&gt;
&lt;li&gt;Mistakes, struggles, and lessons along the way&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Current Goal
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Become job-ready as a developer by&lt;/li&gt;
&lt;li&gt;Building strong projects&lt;/li&gt;
&lt;li&gt;Improving problem-solving skills&lt;/li&gt;
&lt;li&gt;Stay Consistent&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why I'm Doing This
&lt;/h2&gt;

&lt;p&gt;Posting publicly helps create accountability.&lt;/p&gt;

&lt;p&gt;When you share your progress openly, it's harder to quit.&lt;/p&gt;

&lt;p&gt;Also, I hope this journey can help or motivate someone else who is trying to learn programming.&lt;/p&gt;

&lt;p&gt;If you're also learning to code, feel free to follow along.&lt;/p&gt;

&lt;p&gt;Let's grow together. &lt;/p&gt;

&lt;p&gt;Thanks for reading 🙌&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>webdev</category>
      <category>career</category>
    </item>
  </channel>
</rss>
