<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Manjunath Dudam on Medium]]></title>
        <description><![CDATA[Stories by Manjunath Dudam on Medium]]></description>
        <link>https://medium.com/@manjududam84?source=rss-e205ce52d58c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*KBT4Zya_jHve3Rs8</url>
            <title>Stories by Manjunath Dudam on Medium</title>
            <link>https://medium.com/@manjududam84?source=rss-e205ce52d58c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 17 May 2026 19:16:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@manjududam84/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Implementing PKCE with Angular, Spring Boot, and Okta]]></title>
            <link>https://medium.com/@manjududam84/implementing-pkce-with-angular-spring-boot-and-okta-4dafd18910f0?source=rss-e205ce52d58c------2</link>
            <guid isPermaLink="false">https://medium.com/p/4dafd18910f0</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[angularjs]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[okta]]></category>
            <dc:creator><![CDATA[Manjunath Dudam]]></dc:creator>
            <pubDate>Sat, 09 May 2026 16:04:49 GMT</pubDate>
            <atom:updated>2026-05-09T16:04:49.512Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7zC2N5uER669rcjHWWt4Ig.png" /><figcaption>Generated using AI tool(ChatGPT)</figcaption></figure><h3>Securing Modern SPA Applications with OAuth 2.0 Authorization Code Flow</h3><p>A few years ago, authentication was much simpler in most enterprise applications.</p><p>Most applications were server-rendered, where both frontend and backend lived together in the same application. The backend handled authentication completely — managing user sessions, storing client secrets securely, and communicating directly with authentication providers. Since everything sensitive stayed on the server side, traditional OAuth Authorization Code Flow worked without many concerns.</p><p>But application architecture has changed a lot over the years.</p><p>Modern web applications are no longer simple server-rendered systems. Today’s frontend applications are usually built using frameworks like Angular or React and communicate with backend APIs independently. This architecture gives us better scalability, cleaner separation between frontend and backend, and a much smoother user experience.</p><p>At the same time, it also introduces new security challenges around authentication and token handling.</p><p>Unlike backend applications, frontend SPA applications run entirely inside the browser. That means we can no longer safely store sensitive credentials like client secrets inside the application because browser code is publicly accessible.</p><p>This became a major concern in OAuth-based authentication flows.</p><p>Earlier, applications commonly used the OAuth Implicit Flow for browser applications, but over time it became clear that exposing tokens directly in the browser was not the safest approach. Authorization codes could potentially be intercepted, and frontend applications had no secure way to protect secrets like backend servers do.</p><p>That is exactly why PKCE was introduced.</p><h3>What is PKCE?</h3><p>PKCE (Proof Key for Code Exchange) is a security extension added to the OAuth 2.0 Authorization Code Flow.</p><p>It was introduced to secure public client applications such as:</p><ul><li>Angular applications</li><li>React applications</li><li>Mobile applications</li><li>Single Page Applications (SPAs)</li></ul><p>Unlike backend applications, frontend applications cannot securely store client secrets because all code is accessible in the browser. PKCE solves this problem by introducing a temporary secret generated during login.</p><h3>Why PKCE is Important in Modern Applications</h3><p>Traditional OAuth flows were vulnerable to authorization code interception attacks.</p><p>Without PKCE:</p><ol><li>User logs in</li><li>Authorization server returns authorization code</li><li>Frontend exchanges code for access token</li></ol><p>If an attacker intercepts the authorization code, they may generate valid tokens.</p><p>PKCE prevents this by adding two important values:</p><p>ValuePurposecode_verifierRandom secret generated by frontendcode_challengeSHA-256 hashed version of verifier</p><p>The authorization server validates both values before issuing tokens.</p><p>Even if the authorization code is intercepted, it cannot be used without the original verifier.</p><h3>High-Level Architecture</h3><p>Our implementation includes:</p><p>ComponentTechnologyFrontend SPAAngular / ReactAuthorization ServerOktaBackend APISpring BootAuthentication ProtocolOAuth 2.0 with PKCE</p><h3>PKCE Authentication Flow</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JBdE3eacuq4c-2_gBT3Wjw.png" /><figcaption>Generated using AI tool(ChatGPT)</figcaption></figure><h3>Step 1 — Configure Okta Application</h3><p>First, create an application in Okta.</p><h3>Create SPA Application</h3><p>Inside Okta:</p><ol><li>Go to <strong>Applications</strong></li><li>Click <strong>Create App Integration</strong></li><li>Choose:</li></ol><ul><li>Sign-in method → <strong>OIDC</strong></li><li>Application type → <strong>Single Page Application (SPA)</strong></li></ul><h3>Configure Redirect URIs</h3><p>Add your frontend redirect URLs:</p><p>For Angular:</p><pre>http://localhost:4200/login/callback</pre><p>For React:</p><pre>http://localhost:3000/login/callback</pre><h3>Enable PKCE</h3><p>Okta automatically enables PKCE for SPA applications.</p><p>After creation, note down:</p><ul><li>Client ID</li><li>Issuer URL</li></ul><p>Example:</p><pre>Issuer: https://dev-123456.okta.com/oauth2/default<br>Client ID: 0oa123example</pre><h3>Step 2 — Configure Angular / React Application</h3><p>Frontend applications use Okta SDKs to simplify authentication handling.</p><h3>Angular Configuration</h3><h3>Install Okta SDK</h3><pre>npm install @okta/okta-angular @okta/okta-auth-js</pre><h3>Configure Okta</h3><p>Create okta.config.ts:</p><pre>import { OktaAuth } from &#39;@okta/okta-auth-js&#39;;</pre><pre>export const oktaConfig = new OktaAuth({<br>  issuer: &#39;https://dev-123456.okta.com/oauth2/default&#39;,<br>  clientId: &#39;0oa123example&#39;,<br>  redirectUri: window.location.origin + &#39;/login/callback&#39;,<br>  scopes: [&#39;openid&#39;, &#39;profile&#39;, &#39;email&#39;],<br>  pkce: true<br>});</pre><h3>What Each Property Does</h3><p>PropertyPurposeissuerOkta authorization server URLclientIdUnique application identifierredirectUriURL Okta redirects to after loginscopesDefines user information accesspkceEnables PKCE Authorization Flow</p><h3>React Configuration</h3><h3>Install Dependencies</h3><pre>npm install @okta/okta-react @okta/okta-auth-js</pre><h3>Configure Okta</h3><pre>const oktaConfig = {<br>  issuer: &#39;https://dev-123456.okta.com/oauth2/default&#39;,<br>  clientId: &#39;0oa123example&#39;,<br>  redirectUri: window.location.origin + &#39;/login/callback&#39;,<br>  scopes: [&#39;openid&#39;, &#39;profile&#39;, &#39;email&#39;],<br>  pkce: true<br>};</pre><h3>What Happens During Login?</h3><p>When the user clicks Login:</p><ol><li>Angular/React generates:</li></ol><ul><li>code_verifier</li><li>code_challenge</li></ul><ol><li>User is redirected to Okta /authorize endpoint</li><li>User authenticates successfully</li><li>Okta returns an authorization code</li><li>Frontend sends:</li></ol><ul><li>authorization code</li><li>code verifier</li></ul><ol><li>Okta validates both values</li><li>Okta returns JWT tokens</li></ol><h3>Understanding JWT Tokens</h3><p>After successful authentication, Okta returns:</p><p>TokenPurposeAccess TokenUsed to call backend APIsID TokenContains user identity informationRefresh TokenUsed to obtain new access tokens</p><p>JWT (JSON Web Token) contains encoded user claims such as:</p><pre>{<br>  &quot;sub&quot;: &quot;user123&quot;,<br>  &quot;email&quot;: &quot;user@example.com&quot;,<br>  &quot;roles&quot;: [&quot;USER&quot;],<br>  &quot;exp&quot;: 1712345678<br>}</pre><p>JWT tokens are digitally signed by Okta, allowing backend APIs to verify authenticity.</p><h3>Step 3 — Configure Spring Boot Backend</h3><p>The backend acts as a <strong>Resource Server</strong> and validates JWT tokens issued by Okta.</p><h3>Add Dependencies</h3><h3>Gradle</h3><pre>implementation &#39;org.springframework.boot:spring-boot-starter-security&#39;<br>implementation &#39;org.springframework.boot:spring-boot-starter-oauth2-resource-server&#39;</pre><h3>Configure Application Properties</h3><pre>spring:<br>  security:<br>    oauth2:<br>      resourceserver:<br>        jwt:<br>          issuer-uri: https://dev-123456.okta.com/oauth2/default</pre><p>Spring Security automatically downloads Okta’s public keys and validates JWT signatures.</p><h3>Spring Security Configuration</h3><pre>@Configuration<br>@EnableWebSecurity<br>public class SecurityConfig {    <br>@Bean<br>    public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {<br>        http<br>            .authorizeHttpRequests(auth -&gt; auth<br>                .requestMatchers(&quot;/actuator/**&quot;).permitAll()<br>                .anyRequest().authenticated()<br>            )<br>            .oauth2ResourceServer(oauth2 -&gt;<br>                oauth2.jwt()<br>            );<br>        return http.build();<br>    }<br>}</pre><h3>How JWT Validation Works in Spring Boot</h3><p>When the frontend calls a secured API:</p><pre>Authorization: Bearer eyJhbGciOi...</pre><p>Spring Security performs:</p><ol><li>JWT signature verification</li><li>Expiration validation</li><li>Issuer validation</li><li>Claim extraction</li><li>User authentication setup</li></ol><p>Only valid tokens are allowed to access protected APIs.</p><h3>Why PKCE is the Recommended Standard Today</h3><p>PKCE is now considered the recommended OAuth flow for browser-based applications because:</p><p>No client secret required<br>More secure than implicit flow<br>Prevents authorization code theft<br>Supported by Okta and modern OAuth providers<br>Works seamlessly with Angular, React, and Spring Boot</p><h3>Final Thoughts</h3><p>As frontend applications continue moving toward SPA architectures, securing authentication flows becomes critical.</p><p>Using PKCE with Angular or React, Okta as the identity provider, and Spring Boot as the secured backend creates a modern and secure authentication architecture.</p><p>With minimal configuration, developers can implement enterprise-grade OAuth security while protecting users and APIs from common attack vectors.</p><h3>References</h3><ul><li><a href="https://auth0.com/docs/get-started/authentication-and-authorization-flow/authorization-code-flow-with-pkce?utm_source=chatgpt.com">OAuth 2.0 PKCE Flow Documentation</a></li><li><a href="https://developer.okta.com/docs/?utm_source=chatgpt.com">Okta Developer Documentation</a></li><li><a href="https://docs.spring.io/spring-security/reference/servlet/oauth2/resource-server/index.html?utm_source=chatgpt.com">Spring Security OAuth2 Resource Server</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4dafd18910f0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Elevate Your Code Quality: Integrating SonarQube with a Spring Boot Project using Gradle]]></title>
            <link>https://medium.com/tech-at-core/elevate-your-code-quality-integrating-sonarqube-with-a-spring-boot-project-using-gradle-43c1932d4c1d?source=rss-e205ce52d58c------2</link>
            <guid isPermaLink="false">https://medium.com/p/43c1932d4c1d</guid>
            <category><![CDATA[sonarqube]]></category>
            <category><![CDATA[gradle]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[Manjunath Dudam]]></dc:creator>
            <pubDate>Tue, 16 Dec 2025 05:01:58 GMT</pubDate>
            <atom:updated>2025-12-16T06:59:19.246Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cETNcAl03CJhrfnYWozEEw.png" /></figure><p>Integrating SonarQube with a Spring Boot project using Gradle primarily involves <strong>installing the SonarQube server</strong>, <strong>adding the necessary Gradle plugins</strong>, and <strong>configuring the analysis properties</strong>. Maintaining clean, reliable, and secure code is a cornerstone of modern software development. As applications scale, manually tracking issues, code smells, or test coverage becomes nearly impossible. That’s where SonarQube comes in as a powerful, open-source platform designed for continuous code quality inspection and automated static analysis.</p><p>In this blog post, we’ll explore how SonarQube helps developers write better code and walk through the process of integrating it into a Spring Boot project using Gradle.</p><h3><strong>What is SonarQube?</strong></h3><p>SonarQube is an open-source code quality management platform that continuously analyzes your source code, providing insights into bugs, vulnerabilities, and maintainability issues.</p><p>Here’s what makes SonarQube so valuable:</p><ul><li><strong>Code Analysis:</strong> Performs in-depth analysis for multiple programming languages like Java, Kotlin, Python, C/C++, and JavaScript.</li><li><strong>Code Quality Metrics:</strong> Measures code duplication, complexity, and test coverage while offering recommendations to improve maintainability.</li><li><strong>Issue Detection:</strong> Identifies bugs, security vulnerabilities, and code smells before they reach production.</li><li><strong>CI/CD Integration:</strong> Seamlessly integrates into your existing CI/CD pipeline to automate quality checks.</li></ul><h3><strong>Why SonarQube, SpringBoot &amp; Gradle?</strong></h3><p>The combination of <strong>SonarQube</strong>, <strong>Spring Boot</strong>, and <strong>Gradle</strong> is popular because they each fulfill crucial roles in the modern Java development lifecycle, creating an efficient and high-quality build and release pipeline.</p><h3><strong>Step 1: Set Up SonarQube Locally</strong></h3><p>You can quickly get started with SonarQube in one of two ways:</p><p><strong>Option 1</strong>: Using Docker</p><blockquote>docker run -d — name sonarqube -p 9000:9000 sonarqube</blockquote><p><strong>Option 2:</strong> Manual Download <br> Download from the <a href="https://www.sonarqube.org/downloads/">official SonarQube website</a> and start the server.</p><blockquote>Once running, access the web dashboard: <br><strong> </strong><a href="http://localhost:9000/"><strong>http://localhost:9000</strong></a></blockquote><h3><strong>Step 2: Integrate SonarQube into Your Spring Boot Project (Gradle)</strong></h3><p>In your Spring Boot project, you can easily add SonarQube integration using the Gradle SonarQube Plugin.</p><p>Add the SonarQube Plugin</p><p>In your build.gradle, include the SonarQube plugin under the plugins block:</p><pre>plugins { <br> id &#39;java&#39; <br> id &#39;jacoco&#39; // for test coverage <br> id &#39;org.sonarqube&#39; version &#39;5.0.0.4638&#39; <br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vzOyqJ2W_taXA8qXCxRY4w.png" /><figcaption>Image from Intellj IDE</figcaption></figure><p>Configure SonarQube Task Dependencies</p><p>Ensure that the SonarQube analysis runs after the tests are completed:</p><pre>tasks.named(&#39;sonarqube&#39;). configure { <br> dependsOn test <br>}</pre><h3><strong>Step 3: Add a SonarQube Configuration File</strong></h3><p>If your project doesn’t already have one, create a file named sonarqube.gradle inside the gradle/ directory.</p><ul><li>The test task is finalized by jacocoTestReport.</li><li>The jacocoTestReport task ensures <strong>XML reporting is required</strong>:</li></ul><p>Here’s a sample configuration:</p><pre>tasks.named(&#39;test&#39;) { <br> useJUnitPlatform() <br> finalizedBy jacocoTestReport <br>} <br> <br>jacoco { <br> toolVersion = &#39;0.8.13&#39; <br>} <br> <br>jacocoTestReport { <br> dependsOn test <br> reports { <br> xml.required = true <br> html.required = true <br> } <br>} <br> <br>sonarqube { <br> properties { <br> property &quot;sonar.coverage.jacoco.xmlReportPath&quot;, &quot;$build/reports/jacoco/test/jacocoTestReport.xml&quot; <br> property &quot;sonar.junit.reportPaths&quot;, &quot;$build/test-results/test&quot; <br> property &quot;sonar.verbose&quot;, true <br> property &quot;sonar.sources&quot;, &quot;src/main&quot; <br> property &quot;sonar.tests&quot;, &quot;src/test&quot; <br> property &quot;sonar.host.url&quot;, &quot;http://localhost:9000&quot; <br> property &quot;sonar.projectName&quot;, &quot;demo&quot; <br> property &quot;sonar.projectKey&quot;, &quot;demo&quot; <br> property &quot;sonar.login&quot;, &quot;&quot; --replace sonar token here <br> } <br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wg0gow8xyvyAb49RcUQGzA.jpeg" /><figcaption>Image from Intellj IDE</figcaption></figure><p><strong>Explanation of Each Property</strong></p><ul><li>sonar.coverage.jacoco.xmlReportPath → Points SonarQube to the JaCoCo XML coverage report so test coverage data can be included in analysis.</li><li>sonar.junit.reportPaths → Specifies the path to JUnit test result reports for detailed test execution tracking.</li><li>sonar.verbose → Enables detailed logging during the analysis process.</li><li>sonar.sources → Defines the directory that contains the main application source code.</li><li>sonar.tests → Identifies where the unit or integration test code resides.</li><li>sonar.host.url → The URL where your SonarQube server is running (default <a href="http://localhost:9000/">http://localhost:9000</a>).</li><li>sonar.projectName → Friendly name of your project as it appears in the SonarQube dashboard.</li><li>sonar.projectKey → A unique identifier used by SonarQube to reference your project.</li><li>sonar.login → Authentication token for securely uploading analysis results (token-based authentication is required in modern SonarQube versions).</li></ul><p><strong>Apply the Configuration in Your Build</strong></p><p>In your main build.gradle, include this line at the end to apply the custom configuration:</p><pre>apply from: &quot;gradle/sonarqube.gradle&quot;</pre><h3><strong>Step 4: Running SonarQube Analysis</strong></h3><p>To trigger a SonarQube scan, execute the following Gradle command:</p><pre>./gradlew sonar</pre><p>This command compiles your code, runs tests, generates JaCoCo coverage reports, and sends the analysis results to the configured SonarQube server.</p><h3><strong>Step 5: Viewing the Reports</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_feM2Qd1wZG6uZJ2VWLkvg.png" /></figure><p>Once the build completes successfully, open your browser and go to:</p><blockquote><a href="http://localhost:9000/"><strong>http://localhost:9000</strong></a></blockquote><p>You’ll be able to view:</p><ul><li>Code coverage percentages</li><li>Bugs, vulnerabilities, and code smells</li><li>Maintainability and reliability ratings</li><li>Test results and duplication metrics</li></ul><p>SonarQube presents these insights in an interactive dashboard, helping teams visualize code quality trends over time.</p><h3><strong>Conclusion</strong></h3><p>Integrating SonarQube into your Spring Boot project using Gradle is a simple yet highly effective step toward maintaining a healthy, maintainable codebase.</p><p>With SonarQube and JaCoCo combined, you’ll gain actionable insights into code coverage, potential issues, and technical debt all before deployment.</p><p>By automating this analysis as part of your build process, you ensure continuous improvement in code quality, security, and reliability.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43c1932d4c1d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-at-core/elevate-your-code-quality-integrating-sonarqube-with-a-spring-boot-project-using-gradle-43c1932d4c1d">Elevate Your Code Quality: Integrating SonarQube with a Spring Boot Project using Gradle</a> was originally published in <a href="https://medium.com/tech-at-core">tech.at.core</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Husky and Lint-Staged: Enforce Code Quality in Angular Using Pre-Commit Hooks]]></title>
            <link>https://medium.com/tech-at-core/using-husky-and-lint-staged-enforce-code-quality-in-angular-using-pre-commit-hooks-4f7bf6238e38?source=rss-e205ce52d58c------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f7bf6238e38</guid>
            <category><![CDATA[pre-commit-hook]]></category>
            <category><![CDATA[lint-staged]]></category>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[husky]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Manjunath Dudam]]></dc:creator>
            <pubDate>Fri, 07 Nov 2025 11:50:42 GMT</pubDate>
            <atom:updated>2025-11-17T07:17:41.908Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i_eJGG6yRo7YurRL-vM_BQ.png" /></figure><h3><strong>Introduction:</strong></h3><p>Imagine you’re part of a fast-paced Angular project, collaborating with multiple developers who are constantly pushing code, fixing bugs, and rolling out new features. In such a dynamic environment, even the smallest oversight can snowball into major slowdowns. A developer might forget to format their code, a linting error could sneak past unnoticed, or a test might fail after a seemingly harmless commit. Individually, these issues may appear minor, but once they hit the CI/CD pipeline, they can derail progress, forcing the team to waste valuable time addressing problems that could’ve been caught much earlier.</p><p>That’s where <strong>pre-commit hooks</strong> come to the rescue. Think of them as tiny, automated guards standing at the door of your Git repository. Every time you try to commit code, these guards quickly check, “Is this code clean? Is it properly formatted? Did it pass all the basic checks?” If something’s off, they stop the commit right there before bad code ever gets in.</p><p>Now, tools like <strong>Husky</strong>, <strong>lint-staged</strong>, and <strong>Prettier</strong> make this process seamless. Husky links your Git workflow to custom scripts. Lint-staged checks only the files you changed. Prettier keeps your code looking consistent for the whole team. Together, they automate code quality, so you don’t have to think about it every time.</p><p>In this blog post, we will explore how to <strong>set up and configure pre-commit hooks in an Angular project</strong></p><h3><strong>What is a Pre-Commit Hook in Angular?</strong></h3><p>A pre-commit hook in Angular, or any Git project, is an automatic check. It runs before you commit your code.</p><p>Think of it like a final “code check gatekeeper.” When you run git commit, the pre-commit hook checks your code. It makes sure your code follows standards. This includes <strong>formatting</strong>, passing<strong> lint rules</strong>, and <strong>running tests</strong> successfully. Only after these checks can the commit go through.</p><p>If everything looks good, the commit happens. If not, it stops you right there so you can fix the problem first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tfAUtFgNJt03BCakzscs6Q.png" /></figure><h3><strong>Why It’s Important in Angular Projects</strong></h3><p>Angular projects often have <strong>multiple developers</strong> working together. Everyone might use different code editors or have slightly different formatting habits. Over time, this can lead to messy code. Small issues, like missing semicolons, unused imports, or failed tests, can slip into the repository.</p><p>Pre-commit hooks prevent that from happening. They automate the important checks, so you won’t accidentally commit broken or poorly formatted code. This keeps your Angular project:</p><ul><li><strong>Clean</strong> (consistent formatting and structure)</li><li><strong>Stable</strong> (no broken tests or linting errors)</li><li><strong>Collaborative</strong> (everyone follows the same rules automatically)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YlTa7_OqLGDpQMjneuee3Q.png" /></figure><h3><strong>Setting Up Pre-Commit Hooks with Husky</strong></h3><p>There are multiple ways to configure Git hooks, but one of the most convenient approaches for JavaScript/TypeScript projects is using the <strong>Husky</strong> library. Husky makes it easy to manage hooks and share the setup across your team.</p><p>Let’s walk through the setup for a React (or any Node-based frontend) application.</p><h4><strong>Step 1: Install Husky</strong></h4><p>Install Husky as a dev dependency:</p><pre>npm install husky - save-dev</pre><h4><strong>Step 2: Enable Husky in Your Repository</strong></h4><p>Run the following command to initialize Husky:</p><pre>npx husky install</pre><p>This creates a .husky/ directory in your project root and sets up Git hooks.</p><p>To make sure Husky is automatically enabled for all contributors, add this script in your package.json:</p><pre>&quot;scripts&quot;: {&quot;prepare&quot;: &quot;husky install&quot; }</pre><h4><strong>Step 3: Add a Pre-Commit Hook</strong></h4><p>Now, let’s create a <strong>pre-commit</strong> hook that runs your tests and lint checks before committing. Run:</p><p>npx husky add .husky/pre-commit “npm run test:ci &amp;&amp; npx lint-staged”</p><p>This generates a file .husky/pre-commit with the following content:</p><pre>#!/usr/bin/env sh. &quot;$(dirname - &quot;$0&quot;)/_/husky.sh&quot; <br># Exit immediately if a command fails set -e <br># Run frontend tests in CI mode (exit on success/failure)npm run test:ci <br># Run lint checks on staged filesnpx lint-staged</pre><h4><strong>Step 4: Understanding the Hook Script</strong></h4><p>Here’s a quick breakdown of what each line does:</p><ul><li><strong>#!/usr/bin/env sh</strong> → Tells the system to execute the script using sh.</li><li><strong>. “$(dirname — “$0”)/_/husky.sh” </strong>→ Loads Husky’s internal helper functions.</li><li><strong>set -e</strong> → Ensures the script stops immediately if any command fails.</li><li><strong>npm run test: ci</strong> → Runs frontend tests in continuous integration mode.</li><li><strong>npx lint-staged </strong>→ Runs linting on only the staged files, ensuring faster feedback.</li></ul><h4><strong>Step 5: Verify the Setup</strong></h4><p>Try committing some code:</p><pre>git add . <br>git commit -m &quot;test commit&quot;</pre><p>If tests or linting fail, the commit will be blocked until the issues are fixed.</p><h4><strong>Skipping Hooks (If needed)</strong></h4><p>If you want to bypass the pre-commit checks (for example, in temporary WIP commits), you can use the — no-verify flag:</p><pre>git commit - no-verify -m &quot;quick commit&quot;</pre><p>Use this sparingly — skipping validations defeats the purpose of clean, consistent code.</p><h3><strong>Conclusion</strong></h3><p>By adding Husky pre-commit hooks to your frontend workflow, you:</p><ul><li>Catch linting and test issues <strong>before</strong> they reach the pipeline.</li><li>Eliminate unnecessary “fix build” commits from Git history.</li><li>Improve code quality and maintain consistency across your team.</li></ul><p>With just a few steps, you can ensure that every commit meets your project’s coding and testing standards.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f7bf6238e38" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-at-core/using-husky-and-lint-staged-enforce-code-quality-in-angular-using-pre-commit-hooks-4f7bf6238e38">Using Husky and Lint-Staged: Enforce Code Quality in Angular Using Pre-Commit Hooks</a> was originally published in <a href="https://medium.com/tech-at-core">tech.at.core</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Prevent Bad Commits Before They Happen: Automate Code Quality in Spring Boot with Pre-Commit Hooks]]></title>
            <link>https://medium.com/tech-at-core/prevent-bad-commits-before-they-happen-automate-code-quality-in-spring-boot-with-pre-commit-hooks-7b5b1ee6b2a7?source=rss-e205ce52d58c------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b5b1ee6b2a7</guid>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[improve-code-quality]]></category>
            <category><![CDATA[gradle]]></category>
            <category><![CDATA[pre-commit-hook]]></category>
            <dc:creator><![CDATA[Manjunath Dudam]]></dc:creator>
            <pubDate>Thu, 06 Nov 2025 16:51:14 GMT</pubDate>
            <atom:updated>2025-11-17T07:18:21.917Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ePOZsPQbWSgmllq2Qjleeg.png" /></figure><h3><strong>Introduction:</strong></h3><p>Imagine you’re building a new project based on code. You write your code, everything looks great on your device, and you push it up to the shared repository. Immediately, you get that dreaded notification: <strong>“CI/CD Pipeline Failed. </strong>Developers push code that <em>looks</em> fine locally but breaks an automated check (like formatting rules, missing tests, or static analysis) in the central <strong>Continuous Integration/Continuous Delivery (CI/CD)</strong> pipeline.</p><p>Fixing these problems often results in “noise commits” like <strong>Build fixes</strong> or <strong>Fix formatting</strong>, which clutters the Git history. A pre-commit hook is a script that runs before you complete a git commit action, allowing you to inspect the code that’s about to be committed. When integrating this with a Spring Boot Gradle project, the hook is typically used to automatically enforce quality checks, code formatting, and running tests against the staged files, ensuring that only high-quality, compliant code makes it into the repository.</p><p>In this blog post, we will discuss the Pre-Commit hook and how it works with Spring Boot for automating code quality.</p><h3><strong>What Is a Pre-Commit Hook?</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*clTu9-FaAIaz2_O1G3sHvw.png" /></figure><p>A <strong>pre-commit hook</strong> is a small script that runs automatically before you make a Git commit. <br>Think of it as your <strong>local quality gatekeeper</strong> checks your code before it leaves your device.</p><p>With a pre-commit hook, you can:</p><ul><li>Run <strong>static code analysis and</strong> <strong>formatting</strong> checks.</li><li>Execute <strong>unit tests.</strong></li><li>Enforce <strong>coding standards.</strong></li><li>Prevent <strong>sensitive files</strong> (like .env or secrets) from being committed.</li></ul><h3><strong>Why Use Pre-Commit Hooks in a Spring Boot + Gradle Project?</strong></h3><p>Spring Boot projects often rely heavily on <strong>Gradle tasks</strong> for building and testing. <br>By combining Gradle with pre-commit hooks, you can automate essential checks before every commit without slowing down your workflow.</p><p>Here are a few common checks to automate:</p><ul><li><strong>Code formatting</strong> using <a href="https://github.com/diffplug/spotless">Spotless</a>.</li><li><strong>Static analysis</strong> with <a href="https://checkstyle.sourceforge.io/">Checkstyle</a>.</li><li><strong>Running unit tests</strong> using./gradlew test.</li><li><strong>Verifying build integrity</strong> using./gradlew build — dry-run.</li><li><strong>Preventing sensitive data</strong> from being committed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NCQ31S7jWTt56iWOIScMYQ.png" /></figure><p><strong>Step 1: Create a Pre-Commit Script</strong></p><p>First, add a &#39;scripts&#39; folder (if it&#39;s not already present) at the root of your project. Inside it, create a file named pre-commit with the following content:</p><p><strong>Example hook adding-</strong></p><pre>#!/bin/bash echo &quot;Running pre-commit checks...&quot;#  <br># Run unit tests./gradlew test || { <br>  echo &quot;Unit tests failed. Fix test failures before committing.&quot;exit 1 <br>} <br># If everything succeedsgit add .echo &quot; All checks passed. Proceeding with commit.&quot; exit 0 </pre><p>This script ensures that all tests succeed before the commit is created. If any step fails, the commit will be blocked until the issues are fixed.</p><p><strong>Step 2: Automate Hook Installation</strong></p><p>To make sure every developer has the hook in place, we can automate its installation via Gradle.</p><p>Create a new file pre-commit-hook. gradle inside the gradle folder with the following content:</p><pre>tasks.register(&#39;installLocalGitHook&#39;, Copy) { <br>    from new File(rootProject.rootDir, &#39;scripts/pre-commit&#39;) <br>    into new File(rootProject.rootDir, &#39;.git/hooks&#39;) <br>    fileMode = 0775 <br>} </pre><p>This task copies the pre-commit script from the scripts folder into .git/hooks so that Git will execute it before every commit.</p><p><strong>Step 3: Apply the Hook in build.gradle</strong></p><p>In your project’s build. gradle, include the hook configuration so that it’s automatically set up:</p><pre>apply from: &#39;gradle/pre-commit-hook.gradle&#39; </pre><p>OR</p><p>Add this set of code directly in build .gradle</p><pre>tasks.register(&#39;installLocalGitHook&#39;, Copy) { <br>    from new File(rootProject.rootDir, &#39;scripts/pre-commit&#39;) <br>    into new File(rootProject.rootDir, &#39;.git/hooks&#39;) <br>    fileMode = 0775 <br>}</pre><p><strong>And run the command below</strong></p><p>Now, whenever you run the following command, the pre-commit hook will be installed:</p><pre>./gradlew installLocalGitHook</pre><p><strong>Step 4: Verifying the Setup</strong></p><p>Once installed, you can confirm that the hook is correctly placed by checking:</p><pre>cat .git/hooks/pre-commit</pre><p>If the contents match your script, the setup is successful. From this point onward, Git will run your checks before allowing a commit.</p><p><strong>Skipping Hooks (When Needed)</strong></p><p>There may be times when you want to bypass the pre-commit checks (e.g., for WIP commits). Git provides an option to skip hooks:</p><pre>git commit - no-verify -m &quot;Temporary commit&quot;</pre><p>However, it’s best to use this sparingly to maintain a clean and reliable history.</p><h3><strong>Benefits</strong></h3><ul><li><strong>Cleaner Git history</strong>: eliminates “fix build” commits.</li><li><strong>Improved code quality</strong>: ensures formatting, and tests always pass locally.</li><li><strong>Team consistency</strong>: all developers follow the same rules automatically.</li><li><strong>Faster feedback</strong>: errors are caught before they even reach CI/CD pipelines.</li></ul><h3><strong>Final Thoughts</strong></h3><p>Implementing pre-commit hooks in your Spring Boot Gradle project may seem like a small change, but it has a big impact on maintaining project quality. By automating checks at the source, you eliminate noisy commits, enforce consistent standards, and ensure that every piece of code merged into the repository meets your team’s expectations. It’s a proactive step toward cleaner collaboration and a more reliable CI/CD workflow.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b5b1ee6b2a7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-at-core/prevent-bad-commits-before-they-happen-automate-code-quality-in-spring-boot-with-pre-commit-hooks-7b5b1ee6b2a7">Prevent Bad Commits Before They Happen: Automate Code Quality in Spring Boot with Pre-Commit Hooks</a> was originally published in <a href="https://medium.com/tech-at-core">tech.at.core</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simplifying Spring Boot Setup: Step-by-Step Process to Spring Initializer]]></title>
            <link>https://medium.com/tech-at-core/simplifying-spring-boot-setup-step-by-step-process-to-spring-initializer-a2a25715df02?source=rss-e205ce52d58c------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2a25715df02</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[maven]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[gradle]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[Manjunath Dudam]]></dc:creator>
            <pubDate>Wed, 24 Sep 2025 14:06:01 GMT</pubDate>
            <atom:updated>2025-09-25T11:21:17.114Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*Qvbooa51gILcX83mIPyLAQ.jpeg" /></figure><p><strong>Introduction:</strong></p><p>Let’s start with an example, when creating a web application, the development process must be as fast and efficient as possible, and the configuration must be minimal. Setting up a Spring-based project has traditionally been a problem because it often requires extensive XML configuration, dependency management, and boilerplate code, which slows down development time and increases complexity.</p><p>However, Spring Boot simplifies this process, allowing you to quickly generate production-ready Spring applications with minimal configuration.</p><p>In this blog, we will walk you through setting up Spring Boot using Maven and Gradle, covering the installation process and system requirements. Let’s get started!</p><p><strong>Getting Started with Spring Boot: Essential Prerequisites</strong></p><p>Before getting started with Spring Boot, make sure you have the following in place:</p><ol><li><strong>Java</strong> <br> Spring Boot applications are written in Java, so you must have Java installed on your system. Spring Boot is compatible with Java <strong>8, 11, 16, and 17</strong>. Ensure your environment variables are properly configured.</li><li><strong>Integrated Development Environment (IDE)</strong></li></ol><p>You can use any Java IDE of your choice for Spring Boot development. Popular options include <strong>Eclipse, IntelliJ IDEA, Visual Studio Code.</strong> Among these, I personally recommend <strong>IntelliJ IDEA</strong>, as it provides powerful features, seamless integration with Spring Boot, and an overall smooth developer experience. IntelliJ’s intelligent code assistance, built-in Spring support, and wide range of plugins make it an excellent choice for both beginners and experienced developers.</p><p><strong>3. Installing Spring Boot</strong></p><p>You can use Spring Boot with standard Java tools (STS) or as a command-line tool. Either way, Java SDK 17 or higher is required. Check your version using:</p><p><strong>$ java -version</strong></p><p>If you’re new to Java or want to experiment quickly, start with the Spring Boot CLI. Otherwise, follow the traditional setup instructions below.</p><p><strong>4. Step-by-Step Guide: Spring Boot Setup via Spring Initializr</strong></p><p><strong>Step 1: Go to Spring Initializr</strong></p><p>Open your browser and visit: <a href="https://start.spring.io/"><strong>https://start.spring.io</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xEAR57TzJdipFE-DXW4D8A.png" /><figcaption>Screenshot from official Spring Boot <a href="https://start.spring.io/">Site</a></figcaption></figure><p><strong>Step 2: Fill Project Details<br> </strong>You’ll see a form where you can configure your project:</p><ul><li>Project: Choose Maven or Gradle</li><li>Language: Select Java</li><li>Spring Boot version: Use the latest stable version</li></ul><p>(e.g., 4.0.0 (SNAP SHOT), 4.0.0 (M1), 3.5.5 (SNAP SHOT), 3.4.9 (SNAP SHOT) 3.4.8 etc..)</p><p><strong>Project Metadata:</strong></p><ul><li><strong>Group </strong>: e.g. com.example</li><li><strong>Artifact </strong>: e.g. demo</li><li><strong>Name </strong>: demo</li><li><strong>Description </strong>: Simple Spring Boot project</li><li><strong>Package</strong> <strong>Name </strong>: auto-filled</li><li><strong>Packaging </strong>: Jar</li><li><strong>Java </strong>: 24, 21, 17 or (based on your JDK)</li></ul><p><strong>Step 3: Add Dependencies<br> </strong>Dependencies are modules or libraries that add functionality to your project like connecting to a database, creating REST APIs, handling security, or rendering web pages. Spring Boot makes this easy by offering a wide range of pre-packaged starters.</p><p>When you use Spring Initializr, you simply select the features you need, and it adds the appropriate dependencies to your project’s build file (pom.xml for Maven or build.gradle for Gradle).</p><p>Click “<strong>Add Dependencies</strong>” and search what dependencies we need:</p><ul><li>Spring Web (for REST APIs)</li><li>Spring Boot Dev Tools (for auto-reload during development)</li><li>Spring Data JPA (for database access)</li><li>H2 Database (for in-memory DB testing)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q3bfdL-7mfy52wi0pTmWgg.png" /><figcaption>Screenshot from official Spring Boot <a href="https://start.spring.io/">Site</a></figcaption></figure><p><strong>Step 4: Generate Project</strong></p><ul><li>Click the “<strong>Generate</strong>” button.</li><li>A <strong>.zip</strong> file will be downloaded with your project structure.</li></ul><p><strong>Step 5: Unzip &amp; Open in IDE</strong></p><ul><li>Unzip the file</li><li>Open the folder using IntelliJ IDEA, Eclipse, or VS Code</li><li>If you’re using IntelliJ IDEA:</li><li>Choose File &gt; Open &gt; Select the folder</li><li>Let it import Maven/Gradle dependencies</li><li>Now all the dependencies are loaded successfully</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9TydZqm-4MboFPiNuMXr9A.png" /><figcaption>Screenshot from official Spring Boot <a href="https://start.spring.io/">Site</a></figcaption></figure><p><strong>Step 6: Run the Application</strong></p><ul><li>Navigate to the main class DemoApplication.java (inside src/main/java/…)</li></ul><p><strong>5. Go to Main Class : </strong>The main class will look like below</p><pre>import org.springframework.boot.SpringApplication; <br>import org.springframework.boot.autoconfigure.SpringBootApplication; <br> <br>@SpringBootApplication <br>public class DemoApplication { <br> <br>    public static void main(String[] args) { <br>        SpringApplication.run(DemoApplication.class, args); <br>    } <br>}</pre><p>@SpringBootApplication annotation tells Spring Boot that this is the entry point for your application.</p><p><strong>6. Write Your First Controller:</strong> Create a simple controller class that handles HTTP requests. Use annotations like @RestController and @RequestMapping to define your endpoints and methods. Your main class will look like this now.</p><pre>import org.springframework.boot.SpringApplication; <br>import org.springframework.boot.autoconfigure.SpringBootApplication; <br>import org.springframework.web.bind.annotation.GetMapping; <br>import org.springframework.web.bind.annotation.RestController; <br> <br>@SpringBootApplication <br>@RestController <br>public class DemoApplication { <br> <br>    public static void main(String[] args) { <br>        SpringApplication.run(DemoApplication.class, args); <br>    } <br><br>    @GetMapping(&quot;/hello&quot;) <br>    public String sayHello() { <br>        return &quot;Hello, Spring Boot!&quot;; <br>    } <br>}</pre><p><strong>7. Run Your Application:</strong> Run the main class (typically named Application) in your IDE or use terminal commands (./mvnw spring-boot:run for Maven, ./gradlew bootRun for Gradle). In IDE right-click on your project select run as spring boot app.</p><p><strong>8. Access Your App:</strong> Open a web browser and go to <a href="http://localhost:8080/hello">http://localhost:8080/hello</a> to see your Spring Boot application in action and you will get “Hello, Spring Boot!”.<br>Your Spring Boot app is now up and running at Tomcat Server (Apache tomcat) with certain port (http://localhost:8080)</p><p><strong>Another Scenario:</strong></p><ul><li>Explore Zip</li><li>Click on “Build Gradle”</li><li>Select dependencies from build Gradle and then copy.</li></ul><p><strong>Search &amp; Copy Dependency for Maven/Gradle</strong></p><p>1. Open browser in your PC/Laptop</p><p>2. Search Mavan Repository or Copy and paste to search the link <a href="https://mvnrepository.com/">https://mvnrepository.com/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h-otCguXgIKQ4OGqeG9-Fg.png" /><figcaption>Screenshot from official Maven Repository <a href="https://mvnrepository.com/">Site</a></figcaption></figure><p>3. Search for the dependency (e.g., spring-boot-starter-web)</p><p>4. Click on the correct library and version</p><p>5. Scroll down to find dependency code like this:</p><p><strong>For Maven (pom.xml):</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IB3QBnrTr6Oris5_BI01mw.png" /><figcaption>Screenshot from official Maven Repository <a href="https://mvnrepository.com/">Site</a></figcaption></figure><p><strong>Gradle :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TbkZLRT0yxXEHsxS8E7CGg.png" /><figcaption>Screenshot from official Maven Repository <a href="https://mvnrepository.com/">Site</a></figcaption></figure><p><strong>Conclusion<br></strong>Spring Boot makes it simple to build, run, and manage Java applications. It helps developers start projects faster with very little setup, thanks to built-in support for tools like Maven and Gradle. Features like automatic configuration, built-in servers, and helpful developer tools save time and effort.</p><p>Whether you’re building something small with the Spring Boot CLI or adding it to a bigger project, Spring Boot gives you a strong, easy-to-use foundation for apps that can grow and are easy to maintain.</p><blockquote>“In today’s fast-paced tech world, <strong>efficiency is essential</strong>. Spring Boot offers a streamlined development approach that <strong>saves time, minimizes errors, and makes building applications faster and smoother</strong>.”</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2a25715df02" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-at-core/simplifying-spring-boot-setup-step-by-step-process-to-spring-initializer-a2a25715df02">Simplifying Spring Boot Setup: Step-by-Step Process to Spring Initializer</a> was originally published in <a href="https://medium.com/tech-at-core">tech.at.core</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>