<?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: RajarshiG</title>
    <description>The latest articles on DEV Community by RajarshiG (@rajg98).</description>
    <link>https://dev.to/rajg98</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%2F3271282%2Fafc44d94-2018-4968-9dd9-3c8d2cc09b01.jpeg</url>
      <title>DEV Community: RajarshiG</title>
      <link>https://dev.to/rajg98</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rajg98"/>
    <language>en</language>
    <item>
      <title>🚀 Deploying to Multiple Tomcat Instances on Windows with Jenkins — Batch Pitfalls &amp; Service Fixes</title>
      <dc:creator>RajarshiG</dc:creator>
      <pubDate>Sat, 21 Jun 2025 19:00:18 +0000</pubDate>
      <link>https://dev.to/rajg98/deploying-to-multiple-tomcat-instances-on-windows-with-jenkins-batch-pitfalls-service-fixes-1k51</link>
      <guid>https://dev.to/rajg98/deploying-to-multiple-tomcat-instances-on-windows-with-jenkins-batch-pitfalls-service-fixes-1k51</guid>
      <description>&lt;h2&gt;
  
  
  🎯 Goal
&lt;/h2&gt;

&lt;p&gt;To set up a local CI/CD pipeline using &lt;strong&gt;Jenkins&lt;/strong&gt;, deploying a &lt;strong&gt;Spring Boot WAR&lt;/strong&gt; to two separate &lt;strong&gt;Tomcat 11 instances&lt;/strong&gt; (DEV and QA) on a &lt;strong&gt;Windows system&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  😓 Initial Issues Faced
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Tomcat auto-shutdown after Jenkins build&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Jenkins would invoke &lt;code&gt;startup.bat&lt;/code&gt;, but as soon as the job finished, Tomcat shut down.&lt;/li&gt;
&lt;li&gt;This was due to &lt;code&gt;startup.bat&lt;/code&gt; running inside the Jenkins process and getting killed after.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Port Conflicts&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Both Tomcat instances used the same default ports (&lt;code&gt;8080&lt;/code&gt;, &lt;code&gt;8005&lt;/code&gt;, &lt;code&gt;8009&lt;/code&gt;), which prevented them from running simultaneously.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Environment variables not picked up by Spring Boot&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;I needed a way to inject environment-specific values (like &lt;code&gt;env=DEV/QA&lt;/code&gt;) into Spring's &lt;code&gt;@Value&lt;/code&gt; annotations.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧠 Key Learnings &amp;amp; Fixes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ✅ 1. &lt;strong&gt;Use Tomcat as a Windows Service&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Instead of relying on &lt;code&gt;startup.bat&lt;/code&gt;, I:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Installed &lt;strong&gt;TomcatDev&lt;/strong&gt; and &lt;strong&gt;TomcatQA&lt;/strong&gt; as &lt;strong&gt;Windows services&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight batchfile"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="s2"&gt;"C:\apache-tomcat-11.0.8-DEV\bin"&lt;/span&gt;
&lt;span class="kd"&gt;service&lt;/span&gt;.bat &lt;span class="kd"&gt;install&lt;/span&gt; &lt;span class="kd"&gt;TomcatDev&lt;/span&gt;

&lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="s2"&gt;"C:\apache-tomcat-11.0.8-QA\bin"&lt;/span&gt;
&lt;span class="kd"&gt;service&lt;/span&gt;.bat &lt;span class="kd"&gt;install&lt;/span&gt; &lt;span class="kd"&gt;TomcatQA&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Used &lt;code&gt;sc&lt;/code&gt; to control services from Jenkins:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight groovy"&gt;&lt;code&gt;&lt;span class="n"&gt;bat&lt;/span&gt; &lt;span class="s1"&gt;'sc stop TomcatDev &amp;amp;&amp;amp; timeout /t 5 &amp;gt;nul &amp;amp;&amp;amp; sc start TomcatDev'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This prevents Jenkins from terminating the server.&lt;/p&gt;




&lt;h3&gt;
  
  
  ✅ 2. &lt;strong&gt;Customize server.xml for Each Instance&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Modified these ports in &lt;code&gt;conf/server.xml&lt;/code&gt; for both instances:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Port Type&lt;/th&gt;
&lt;th&gt;DEV&lt;/th&gt;
&lt;th&gt;QA&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;HTTP&lt;/td&gt;
&lt;td&gt;8081&lt;/td&gt;
&lt;td&gt;8082&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Shutdown Port&lt;/td&gt;
&lt;td&gt;8006&lt;/td&gt;
&lt;td&gt;8007&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AJP&lt;/td&gt;
&lt;td&gt;8009&lt;/td&gt;
&lt;td&gt;8010&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Ensure they &lt;strong&gt;don't overlap&lt;/strong&gt;, or services will fail silently or crash.&lt;/p&gt;




&lt;h3&gt;
  
  
  ✅ 3. &lt;strong&gt;Set Environment-Specific Flags&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Created a &lt;code&gt;setenv.bat&lt;/code&gt; inside each &lt;code&gt;bin/&lt;/code&gt; folder:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight batchfile"&gt;&lt;code&gt;&lt;span class="kd"&gt;set&lt;/span&gt; &lt;span class="kd"&gt;JAVA_OPTS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="na"&gt;-Denv&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kd"&gt;DEV&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Spring Boot picks this up with:&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;@Value&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"${env}"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;environment&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🔧 Jenkinsfile: Deploy to Tomcat Services
&lt;/h2&gt;

&lt;p&gt;Here’s a simplified Jenkins pipeline excerpt:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight groovy"&gt;&lt;code&gt;&lt;span class="n"&gt;stage&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Deploy to DEV'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;steps&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;bat&lt;/span&gt; &lt;span class="s2"&gt;"""
        sc stop TomcatDev
        timeout /t 5 &amp;gt;nul
        copy target\\app.war "C:\\apache-tomcat-11.0.8-DEV\\webapps\\app.war"
        sc start TomcatDev
        """&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;Same pattern for QA.&lt;/p&gt;




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

&lt;p&gt;This debugging session taught me a lot about how &lt;strong&gt;Jenkins&lt;/strong&gt;, &lt;strong&gt;Windows&lt;/strong&gt;, and &lt;strong&gt;Tomcat&lt;/strong&gt; interact.&lt;br&gt;
If you're running Tomcat on Windows and see it die after Jenkins runs, it's probably due to how you're starting it. Using &lt;strong&gt;services + &lt;code&gt;sc&lt;/code&gt;&lt;/strong&gt; is the safest and most robust way.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔗 LinkedIn Recap Post
&lt;/h2&gt;

&lt;p&gt;If you're short on time, I shared a quick summary of this battle on LinkedIn:&lt;br&gt;
👉 &lt;a href="https://www.linkedin.com/posts/rajarshig007_weekend-troubleshooting-jenkins-tomcat-activity-7342264068495261698-aMNh?utm_source=share&amp;amp;utm_medium=member_desktop&amp;amp;rcm=ACoAADVMKvwBKb3tN4KU0Ti47Qe8b_u1rblpA9k" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/rajarshig007/post&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>💻 CI/CD Pipeline with Jenkins, Spring Boot &amp; Docker on Windows — No Git Bash Required</title>
      <dc:creator>RajarshiG</dc:creator>
      <pubDate>Thu, 19 Jun 2025 17:40:07 +0000</pubDate>
      <link>https://dev.to/rajg98/cicd-pipeline-with-jenkins-spring-boot-docker-on-windows-no-git-bash-required-1hj</link>
      <guid>https://dev.to/rajg98/cicd-pipeline-with-jenkins-spring-boot-docker-on-windows-no-git-bash-required-1hj</guid>
      <description>&lt;p&gt;I recently built a local CI/CD pipeline using Jenkins to deploy a Spring Boot application with Docker, simulating dev and QA environments. The twist? I did it &lt;strong&gt;entirely on Windows&lt;/strong&gt;, using the &lt;code&gt;bat&lt;/code&gt; command — no Git Bash or Linux dependencies!&lt;/p&gt;




&lt;h3&gt;
  
  
  🛠️ Stack &amp;amp; Tools
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Jenkins&lt;/strong&gt; (installed via Windows installer)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spring Boot&lt;/strong&gt; (Maven project)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker Compose&lt;/strong&gt; (for dev &amp;amp; qa services)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub&lt;/strong&gt; (source control with PAT for authentication)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Windows batch scripts (&lt;code&gt;bat&lt;/code&gt;)&lt;/strong&gt; for Jenkins steps&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔄 Pipeline Overview
&lt;/h3&gt;

&lt;p&gt;My Jenkins pipeline does the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Pulls code&lt;/strong&gt; from GitHub (set to &lt;code&gt;main&lt;/code&gt; branch manually)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Builds&lt;/strong&gt; the Spring Boot app using:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight groovy"&gt;&lt;code&gt;   &lt;span class="n"&gt;dir&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'backend'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
     &lt;span class="n"&gt;bat&lt;/span&gt; &lt;span class="s1"&gt;'mvnw.cmd clean package -DskipTests'&lt;/span&gt;
   &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Builds Docker images&lt;/strong&gt; for both dev and QA&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deploys the dev container&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Adds a &lt;strong&gt;manual input step&lt;/strong&gt; before proceeding to QA deployment&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  🧪 Environments Setup with Docker Compose
&lt;/h3&gt;

&lt;p&gt;Here’s a snapshot from my &lt;code&gt;docker-compose.yml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;backend-dev&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;./backend&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="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;8082:8080"&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;SPRING_PROFILES_ACTIVE=dev&lt;/span&gt;

  &lt;span class="na"&gt;backend-qa&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;./backend&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="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;8083:8080"&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;SPRING_PROFILES_ACTIVE=qa&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each profile (&lt;code&gt;application-dev.properties&lt;/code&gt;, &lt;code&gt;application-qa.properties&lt;/code&gt;) gets picked up based on &lt;code&gt;SPRING_PROFILES_ACTIVE&lt;/code&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  ⚠️ What I Learned
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Jenkins on Windows uses &lt;code&gt;bat&lt;/code&gt;, not &lt;code&gt;sh&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;mvnw.cmd&lt;/code&gt; instead of &lt;code&gt;./mvnw&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Make sure the &lt;code&gt;backend&lt;/code&gt; directory exists in your GitHub repo, or Jenkins will break&lt;/li&gt;
&lt;li&gt;GitHub no longer supports password auth — use a &lt;strong&gt;Personal Access Token&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Docker &lt;code&gt;COPY target/*.jar&lt;/code&gt; fails if the app isn’t built first!&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  ✅ Next Goals
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Add frontend (React)&lt;/li&gt;
&lt;li&gt;Push images to GitHub Container Registry&lt;/li&gt;
&lt;li&gt;Setup GitHub webhook to auto-trigger Jenkins&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  💬 Final Thoughts
&lt;/h3&gt;

&lt;p&gt;This was my first fully local pipeline and it’s taught me more than any tutorial could. If you’re starting with Jenkins, don’t be afraid to break things — just &lt;strong&gt;read the logs carefully&lt;/strong&gt; and keep experimenting.&lt;/p&gt;

&lt;p&gt;Feel free to connect if you're working on something similar!&lt;/p&gt;

&lt;p&gt;#Jenkins #SpringBoot #DevOps #Docker #CI_CD #Java #WindowsDeveloper #Tutorial #BuildInPublic&lt;/p&gt;

</description>
    </item>
    <item>
      <title>From Chaos to Deployment: Fixing Cross-Origin Auth in React + Spring Boot (My 3-Day 401 Debug Story)</title>
      <dc:creator>RajarshiG</dc:creator>
      <pubDate>Tue, 17 Jun 2025 17:46:29 +0000</pubDate>
      <link>https://dev.to/rajg98/from-chaos-to-deployment-fixing-cross-origin-auth-in-react-spring-boot-my-3-day-401-debug-story-5365</link>
      <guid>https://dev.to/rajg98/from-chaos-to-deployment-fixing-cross-origin-auth-in-react-spring-boot-my-3-day-401-debug-story-5365</guid>
      <description>&lt;p&gt;I recently finished building a full-stack &lt;strong&gt;Library Management System&lt;/strong&gt;, with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🖥️ Frontend in &lt;strong&gt;React&lt;/strong&gt;, deployed on Vercel
&lt;/li&gt;
&lt;li&gt;🔧 Backend in &lt;strong&gt;Spring Boot&lt;/strong&gt;, deployed on Railway&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At the start, I was excited. But then... deployment hit me like a wall.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧩 The Struggles
&lt;/h2&gt;

&lt;p&gt;I didn't know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How to deploy the backend and frontend separately&lt;/li&gt;
&lt;li&gt;How to set up CORS and cookies properly&lt;/li&gt;
&lt;li&gt;Why my app worked in Firefox, but &lt;strong&gt;failed with 401 errors in Chrome&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I tried debugging:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Spring Security&lt;/li&gt;
&lt;li&gt;Session management&lt;/li&gt;
&lt;li&gt;Axios headers and cookies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I even rewrote parts of my code, thinking the problem was in my auth flow…&lt;/p&gt;

&lt;p&gt;Turns out, &lt;strong&gt;Chrome had third-party cookies disabled.&lt;/strong&gt; 😤&lt;br&gt;&lt;br&gt;
Three. Days. Gone.&lt;/p&gt;


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

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Spring Security from Scratch&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
I learned how to create a &lt;code&gt;SecurityFilterChain&lt;/code&gt; and handle login with session-based auth using a custom success handler.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Backend over LocalStorage&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Initially, I was storing the user in &lt;code&gt;localStorage&lt;/code&gt; and using it for validation.&lt;br&gt;&lt;br&gt;
I later replaced this with a backend call to &lt;code&gt;/check-auth&lt;/code&gt;, making it more secure and reliable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;CORS + Cookie Configuration&lt;/strong&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 java"&gt;&lt;code&gt;   &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;allowedOrigins&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"https://my-frontend.vercel.app"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
   &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;allowCredentials&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Axios:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;withCredentials&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Cookie Headers&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;SameSite=None&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Secure&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;HttpOnly&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All crucial for cross-origin session persistence.&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ Final Setup
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🌐 &lt;strong&gt;Frontend&lt;/strong&gt;: React + Vercel&lt;/li&gt;
&lt;li&gt;🔧 &lt;strong&gt;Backend&lt;/strong&gt;: Spring Boot + Railway&lt;/li&gt;
&lt;li&gt;🔐 &lt;strong&gt;Auth&lt;/strong&gt;: Session-based, cookie-secured&lt;/li&gt;
&lt;li&gt;🧠 &lt;strong&gt;Learned&lt;/strong&gt;: Spring Security, Session Auth, CORS, Deployment practices&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🎯 Next Goal
&lt;/h2&gt;

&lt;p&gt;Now that it’s stable, I’m planning to &lt;strong&gt;migrate the backend to AWS EC2&lt;/strong&gt; for a more production-like deployment.&lt;/p&gt;

&lt;p&gt;Wish me luck 🤞&lt;/p&gt;




&lt;p&gt;If you’ve ever been stuck debugging for days over something silly — you’re not alone. Keep going. It clicks eventually ✨&lt;/p&gt;

&lt;p&gt;#SpringBoot #ReactJS #WebDev #FullStack #SpringSecurity #Debugging #AWS #DevJourney&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
