<?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 Mohit Rawal on Medium]]></title>
        <description><![CDATA[Stories by Mohit Rawal on Medium]]></description>
        <link>https://medium.com/@rawalmohit12?source=rss-4c36ea7600b8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*89NDLKIysTsBYJBq2KDIqA.jpeg</url>
            <title>Stories by Mohit Rawal on Medium</title>
            <link>https://medium.com/@rawalmohit12?source=rss-4c36ea7600b8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 01:39:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rawalmohit12/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[Building a Local PDF RAG Application with Python, PostgreSQL, and Ollama]]></title>
            <link>https://medium.com/@rawalmohit12/building-a-local-pdf-rag-application-with-python-postgresql-and-ollama-67c1eff2c484?source=rss-4c36ea7600b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/67c1eff2c484</guid>
            <dc:creator><![CDATA[Mohit Rawal]]></dc:creator>
            <pubDate>Sat, 17 Oct 2026 04:12:20 GMT</pubDate>
            <atom:updated>2026-10-17T04:12:20.833Z</atom:updated>
            <content:encoded><![CDATA[<p><em>My experience building Personal RAG v1.0.0 as a BSc CSIT student.</em></p><h3>Introduction</h3><p>I wanted to understand how an application could answer questions about PDF documents without relying entirely on a language model’s general knowledge.</p><p>That curiosity led me to build Personal RAG, a local PDF question-answering application.</p><p>The first version allows users to upload PDFs, ask questions through a Streamlit interface, and receive generated answers with source filenames and page numbers.</p><p>The project combines Python, Sentence Transformers, PostgreSQL with pgvector, hybrid retrieval, and Ollama.</p><p>The most interesting part of this project is not simply generating answers. It is understanding how the application finds information before asking a model to use it.</p><h3>Why retrieval matters</h3><p>A language model can generate fluent text without having direct access to the document a user wants to ask about.</p><p>Retrieval-augmented generation, or RAG, addresses this by finding relevant external information and providing it as context to a language model.</p><p>A typical workflow involves document processing, retrieval, and generation.</p><p>The document is processed and indexed in advance. When a question arrives, the application searches for relevant passages and supplies them to the model.</p><p>The model then generates a response based on the question and retrieved context.</p><p>This separates two responsibilities: finding evidence and generating an answer.</p><h3>The architecture</h3><p>Personal RAG uses the following components:</p><ul><li>PyMuPDF for PDF text extraction</li><li>Python for application logic and processing</li><li>Sentence Transformers for local text embeddings</li><li>PostgreSQL with pgvector for persistent storage and vector search</li><li>Keyword search and vector similarity search for retrieval</li><li>Reciprocal Rank Fusion for combining retrieval rankings</li><li>Ollama for local answer generation</li><li>Streamlit for the user interface</li></ul><p>The architecture has two main workflows: indexing PDFs and answering questions.</p><h3>Processing PDFs into chunks</h3><p>The first step is extracting text from a PDF.</p><p>Extracted text is divided into smaller chunks so that the application can retrieve focused passages rather than treating the entire document as one unit.</p><p>This stage introduces an important trade-off.</p><p>Small chunks can provide focused information but may lose context. Large chunks preserve more surrounding text but can include unrelated material.</p><p>PDF extraction also affects quality. If a document contains scanned pages or complex layouts, the extracted text may not preserve all the original structure.</p><p>This is why document processing should be treated as part of the retrieval problem, not merely as preparation work.</p><h3>Creating and storing embeddings</h3><p>Personal RAG uses Sentence Transformers to convert chunks into numerical representations called embeddings.</p><p>These representations make semantic similarity search possible.</p><p>A query can be compared with stored chunk embeddings to identify passages that may be relevant even when their wording differs from the question.</p><p>The application stores document chunks and embeddings in PostgreSQL with pgvector.</p><p>This provides persistent storage for indexed documents across application sessions.</p><p>It is important to distinguish this from chat history, which is currently temporary and limited to the active session.</p><h3>Hybrid retrieval</h3><p>Personal RAG combines keyword search with vector similarity search.</p><p>Keyword search can be useful for specific terms, names, and identifiers. Vector search can help when a question uses different wording from the source material.</p><p>The application combines the rankings using Reciprocal Rank Fusion, or RRF.</p><p>RRF uses the positions of results in ranked lists rather than requiring raw scores from different search methods to be directly comparable.</p><p>This is a practical way to combine retrieval signals. However, hybrid retrieval is not automatically correct for every query. If the relevant evidence is missing from both result lists, rank fusion cannot recover it.</p><h3>Generating answers locally</h3><p>After retrieval, the application passes the question and retrieved context to Ollama for answer generation.</p><p>Using a local model makes the project useful for learning about local inference and the integration between retrieval and generation.</p><p>Local inference also introduces practical constraints, including memory usage and response time. Those should be measured on the target machine rather than assumed to be negligible.</p><p>The application presents the generated answer through Streamlit and includes source filenames and page numbers.</p><p>These references make it possible to inspect the source material, although they do not guarantee that every claim in an answer is supported.</p><h3>The challenge I want to investigate: retrieval quality</h3><p>One of the most important questions in this project is whether the application retrieves the right passages.</p><p>A generated answer can sound reasonable even if the retrieved context is incomplete or only loosely related to the question.</p><p>To investigate this, I want to create a small dataset of questions with known answers and relevant source passages.</p><p>I can then compare keyword search, vector search, and hybrid retrieval using the same documents and questions.</p><p>I also want to inspect cases where the relevant evidence is not retrieved among the top results.</p><p>This is planned evaluation work, not a claim that one retrieval method has already been proven superior in this project.</p><h3>What Version 1.0.0 includes</h3><p>The first release includes PDF upload, text extraction, chunking, embeddings, persistent PostgreSQL storage, hybrid retrieval, RRF, local answer generation, source references, and a Streamlit interface.</p><p>It also has clear limitations:</p><ul><li>Retrieval searches the entire indexed database.</li><li>Chat history is not permanently saved.</li><li>A complete document-management library is not available.</li><li>Retrieval quality has not yet been established through a dedicated benchmark.</li></ul><p>Document management, more extensive testing, and retrieval evaluation are planned improvements.</p><h3>What comes next</h3><p>My immediate priority is to establish a retrieval baseline.</p><p>After that, I want to investigate chunking settings, improve document management, and expand integration testing.</p><p>I want future changes to be driven by observed behavior rather than assumptions about which technique should work best.</p><h3>Conclusion</h3><p>Building Personal RAG has helped me connect concepts from Python development, database systems, embeddings, information retrieval, and local language models.</p><p>The main lesson is that a RAG application is a pipeline. The quality of the final answer depends partly on whether the right information was extracted, indexed, retrieved, and supplied to the model.</p><p>Version 1.0.0 establishes that pipeline. My next goal is to evaluate it more systematically and use those findings to guide improvements.</p><p><strong>Source code:</strong> <a href="https://github.com/Mohitrawal7/personal-rag">https://github.com/Mohitrawal7/personal-rag</a></p><p>I’m continuing to learn AI engineering by building applications, investigating their limitations, and improving them step by step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fppA94hCBH8LmdfQihjD8g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qjPDbyhf7VfL03CnJ_X33w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T5NELuyXeZhtsUQ5UNqw8A.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67c1eff2c484" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What i learned during the Oboe Learn-a-Thon]]></title>
            <link>https://medium.com/@rawalmohit12/what-i-learned-during-the-oboe-learn-a-thon-b5eea60d29de?source=rss-4c36ea7600b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5eea60d29de</guid>
            <dc:creator><![CDATA[Mohit Rawal]]></dc:creator>
            <pubDate>Thu, 03 Sep 2026 03:14:39 GMT</pubDate>
            <atom:updated>2026-09-03T03:14:39.608Z</atom:updated>
            <content:encoded><![CDATA[<p>Over the past few weeks, I spent a lot of time learning and experimenting with concepts that connect closely to the kind of software and AI systems I want to build.</p><p>One of the biggest areas I focused on was <strong>Prompt Engineering</strong>. I learned how prompt structure, few-shot examples, reasoning approaches, input sanitization, and evaluation can significantly affect the quality and reliability of AI outputs.</p><p>On the software architecture side, I went deeper into <strong>Microservices, Caching Strategies, Saga Pattern, Event-Driven Architecture, and API Gateway</strong>. Instead of learning these concepts separately, I started understanding how they work together when designing distributed systems.</p><p>I also explored topics such as:</p><p>🔹 Data consistency and distributed systems</p><p>🔹 Prompt injection and AI security</p><p>🔹 LLM evaluation</p><p>🔹 Kafka and message queues</p><p>🔹 Fault tolerance and distributed tracing</p><p>🔹 AI agents and agentic architecture</p><p>What made the experience particularly useful was actually <strong>using these concepts while working on technical problems and projects</strong>, rather than only reading about them.</p><p>The Learn-a-Thon also pushed me to be more consistent with learning. Seeing my progress reflected in different skill areas gave me a clear picture of where I was improving and where I still have more to learn.</p><p>A few weeks ago, these topics felt like separate concepts. Now I can see much clearer connections between <strong>AI, backend engineering, distributed systems, and software architecture</strong>.</p><p>A big thank you to the <strong>Oboe and Aspire team</strong> for creating an environment that made learning interactive and engaging. 🙌</p><p>This is definitely not the end of the learning journey — just a stronger starting point for what comes next.</p><p>#Learning #AI #GenerativeAI #PromptEngineering #Microservices #SoftwareArchitecture #BackendDevelopment #DistributedSystems #Oboe #LearningJourney</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5eea60d29de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One Year, Different Real Projects: What Actually Changed, What I Still Haven’t Fixed]]></title>
            <link>https://medium.com/@rawalmohit12/one-year-different-real-projects-what-actually-changed-what-i-still-havent-fixed-20cac48192fb?source=rss-4c36ea7600b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/20cac48192fb</guid>
            <dc:creator><![CDATA[Mohit Rawal]]></dc:creator>
            <pubDate>Fri, 31 Jul 2026 08:44:24 GMT</pubDate>
            <atom:updated>2026-07-31T08:44:24.350Z</atom:updated>
            <content:encoded><![CDATA[<p>A year ago, my Medium posts were about learning HTML, CSS, JavaScript, and React as a beginner. Since then, I’ve built full-stack projects — Adhikari-marg, TourGO, and LearningApp — using Java, Spring Boot, React, PostgreSQL, and Spring Security. I’ve written about most of them individually over the last few weeks: the architecture, the auth systems, the deployments.</p><p>This post is different. It’s the step back. Instead of walking through one more project, I want to look across all four and be honest about two things: what actually changed in how I build software, and what still hasn’t.</p><h3>What Actually Changed</h3><p>The clearest evidence of growth isn’t any single feature — it’s watching the same problem get solved differently, and better, across four separate projects.</p><p>My first real authorization system, in Adhikari-marg, was a simple two-role check: Admin or User. That was enough for what the project needed, but it was also the limit of what I understood at the time. By the time I built TourGO, I’d hit a problem two roles couldn’t solve — users needed to manage <em>their own</em> data specifically, not just data gated by role. So TourGO’s authorization checks ownership <em>and</em> role together: is this your resource, or are you an admin? And by LearningApp, the requirement had grown again — three distinct roles (Admin, Teacher, Student), each with a genuinely different set of permissions, not just “more” or “less” access.</p><p>Looking at those three side by side is, honestly, the most useful artifact from this whole year: <strong>simple RBAC → ownership-aware auth → three-tier RBAC.</strong> Each one exists because the previous pattern genuinely wasn’t enough for the next project’s real requirement — not because I was showing off. That’s the kind of progression I don’t think you can fake or shortcut. It only comes from actually hitting the limits of what you built before.</p><p>The other thing that changed is less about a specific pattern and more about a habit: every one of my last four projects has a self-written production checklist in its README before I ever “finish” it. Move secrets to environment variables. Switch the database schema mode from update to validate before anything resembling real traffic. Restrict CORS to actual production origins instead of allowing everything. None of these are dramatic engineering feats. But writing that checklist for myself, unprompted, every single time, is a habit I didn&#39;t have a year ago — and it matters more to me now than any individual line of code, because it means I&#39;m thinking about what happens <em>after</em> the demo, not just during it.</p><p>That shift — from “does it work” to “will it hold up” — is, if I’m honest, the real difference between where I was a year ago and where I am now.</p><h3>Five Security Mistakes I Made and Fixed</h3><p>I want to be specific here rather than vague, because “I learned about security” doesn’t mean much on its own. These are mistakes I actually made, across actual projects, and fixed:</p><ol><li><strong>Hardcoding the JWT secret directly in </strong><strong>application.properties.</strong> Worked fine locally, and would have been a real problem the moment that file&#39;s history touched a shared repository. Fixed by moving every secret to environment variables, in every project, from day one now.</li><li><strong>Leaving </strong><strong>ddl-auto set to </strong><strong>update.</strong> Convenient during development, genuinely risky once real data exists, since it lets the schema shift unexpectedly. My checklist now always includes switching this to validate before anything resembling production.</li><li><strong>Allowing CORS from anywhere during development and forgetting to tighten it.</strong> Fine for localhost, not fine once the frontend is deployed and the backend needs to trust specific origins only.</li><li><strong>Only testing the “happy path” on my JWT filter.</strong> I spent far longer debugging invalid, expired, and malformed tokens than I ever spent on the case where everything works — and that’s exactly backwards from where the actual security risk lives.</li><li><strong>Not rate-limiting the login endpoint.</strong> Especially once TourGO’s authorization became ownership-based, a compromised login became a bigger problem than in a simpler role-only system. This one’s still on my active checklist, not yet fully solved.</li></ol><p>None of these are exotic vulnerabilities. They’re the ordinary mistakes almost everyone makes once, and the fact that I can list them specifically — rather than just saying “I care about security now” — is itself the point.</p><h3>The Gap I Haven’t Closed Yet</h3><p>Here’s the honest part, and I’d rather say it directly than hope nobody notices: <strong>I haven’t written automated tests for any of these projects.</strong> Every single README has “add tests” sitting in its future-improvements list, and it’s been sitting there across all four projects, not just one.</p><p>I don’t think that’s disqualifying, but I do think pretending otherwise would be worse than just saying it. The grading-and-report logic in LearningApp, the ownership checks in TourGO, the JWT filter across every project — these are exactly the places where a quiet regression during a future refactor would matter most, and right now the only thing catching that is my own manual testing in Postman. That’s not nothing, but it’s not enough either, and it’s the single most consistent gap across everything I’ve built this year.</p><p>I’m not writing this as a “here’s my plan to fix it” post yet, because I’d rather actually do it first and write about that honestly once it’s real, instead of promising something in advance. But I wanted this reflection to include the gap as clearly as it includes the progress, because a year-in-review that only lists wins isn’t a very useful one.</p><h3>Where That Leaves Me</h3><p>A year ago, I was writing about learning HTML and CSS. Today, I can design an authorization model that fits the actual shape of a problem instead of forcing every project into the same two-role pattern, I’ve built something for a real organization with real requirements, and I can name my own mistakes specifically enough to actually fix them.</p><p>I still have a real, unclosed gap in testing. I’d rather tell you that directly than let four project write-ups speak for themselves and leave it unsaid.</p><p><em>This closes out the series I’ve been writing since coming back to Medium. If there’s one thing I’d want a reader to take from all of it, it’s this: the projects aren’t the interesting part on their own — the pattern of what got harder, what got fixed, and what’s still unresolved is the actual story.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20cac48192fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Structure My React Apps: Auth Context, Protected Routes, and a Setup I Don’t Have to Rethink…]]></title>
            <link>https://medium.com/@rawalmohit12/how-i-structure-my-react-apps-auth-context-protected-routes-and-a-setup-i-dont-have-to-rethink-3acf21d3a2f9?source=rss-4c36ea7600b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/3acf21d3a2f9</guid>
            <dc:creator><![CDATA[Mohit Rawal]]></dc:creator>
            <pubDate>Wed, 29 Jul 2026 13:11:01 GMT</pubDate>
            <atom:updated>2026-07-29T13:11:01.665Z</atom:updated>
            <content:encoded><![CDATA[<h4>How I Structure My React Apps: Auth Context, Protected Routes, and a Setup I Don’t Have to Rethink Every Time</h4><p>Most of my recent writing has been about the backend — Spring Boot, JWT, authorization. But the backend is only half of any of my projects. On the frontend side, across learningApp-frontendand other projects, I’ve settled into a set of patterns I now reuse by default: how I manage auth state, how I guard routes that shouldn’t be accessible without logging in, how I organize a project so it doesn’t turn into a pile of components that all fetch data differently, and — most recently — how I set up Tailwind with React 19.</p><p>This post is a walkthrough of that setup, project by project, in the order I actually built it.</p><h3>Managing Auth State with React Context</h3><p>The first real frontend problem I ran into was: once a user logs in, how does the rest of the app know? Passing the logged-in user down through props from the top of the app to every component that needs it gets messy fast, especially once you have a Navbar, protected pages, and conditional UI all needing the same information.</p><p>I solved these projects with a dedicated AuthContext. The idea is simple: instead of every component asking its parent for the current user, any component can just ask the Context directly — &quot;who&#39;s logged in right now, and are they an admin?&quot; The Context wraps the whole app, holds the current user and their role, and exposes login/logout functions that update that shared state in one place.</p><p>The alternative I didn’t want was scattering localStorage.getItem(&#39;user&#39;) calls across random components whenever they needed to check something about the logged-in user. Centralizing that in Context meant there&#39;s exactly one source of truth for &quot;who is logged in,&quot; and if I ever need to change how that&#39;s determined, I change it in one file, not in twelve.</p><h3>Guarding Routes: Building a PrivateRoute Component (learningApp-frontend)</h3><p>Knowing who’s logged in is only useful if you actually do something with that information — specifically, keeping logged-out users away from pages they shouldn’t see, and keeping students away from teacher-only dashboards.</p><p>In learningApp-frontend, I built this as a PrivateRoute component that wraps around any route that needs protection. It checks the auth state (from the same kind of Context pattern as above), and if there&#39;s no valid logged-in user, it redirects to the login page instead of rendering the protected content. Since learningApp-frontend has role-specific dashboards — Admin, Teacher, and a general dashboard — the same pattern extends naturally to role checks too: not just &quot;are you logged in,&quot; but &quot;are you allowed to be here specifically.&quot;</p><p>The thing I appreciate about this pattern in hindsight is how little it asks of the rest of the app. Any page that needs protecting just gets wrapped in PrivateRoute — the page itself doesn&#39;t need to know anything about auth logic at all. That separation made adding new protected pages later almost mechanical, instead of something I had to reason through from scratch each time.</p><h3>Structuring the Project So It Doesn’t Fall Apart</h3><p>The pattern I’ve settled on, across both projects, is a folder structure that separates four concerns clearly:</p><ul><li>api/ — a single place where the base Axios instance and its configuration live (base URL, headers, interceptors)</li><li>services/ — functions that actually call the API (e.g. authServices.jsx), so components never call Axios directly</li><li>components/ — reusable UI pieces</li><li>pages/ — the actual routed views, built out of components and services together</li></ul><p>The reason this matters more than it sounds like it should: without it, it’s very easy to end up with Axios calls copy-pasted inside individual components, each one slightly different, each one repeating the base URL. The first time I had to change an API endpoint and found it hardcoded in six different components, I decided that was never going to happen again. Now, if an endpoint changes, or I need to add an auth header to every request, there’s exactly one file to touch.</p><p>It’s a small discipline, but it’s the difference between a project that’s easy to extend six months later and one that requires re-reading every component before you dare touch anything.</p><h3>Keeping Up with Tooling: Moving to Tailwind’s Vite Plugin</h3><p>The most recent change in my setup was smaller but still worth mentioning: switching from the older Tailwind + PostCSS configuration to the newer @tailwindcss/vite plugin, alongside React 19.</p><p>The practical difference is mostly about setup simplicity — fewer config files, faster builds, and one less place for version mismatches between Tailwind, PostCSS, and Autoprefixer to quietly break something. It’s not a dramatic architectural decision, but it’s the kind of thing I think is worth actually doing rather than leaving an older setup in place just because it still technically works. Frontend tooling moves fast, and I’d rather adopt the current recommended approach on a new project than carry forward a config I picked up from an older tutorial.</p><h3>What’s Still Missing</h3><p>Being honest here the same way I have been in every other post: none of my frontend projects currently have proper loading or error states around every API call, and form validation on the frontend side is thinner than I’d like — mostly relying on whatever the backend rejects. Responsive polish for smaller screens is also something I’ve flagged in my own project notes as needing more attention. These aren’t hidden from me; they’re just not done yet, and they’re next on my list specifically for the frontend side of things.</p><h3>Why This Setup Matters to Me</h3><p>None of these four things — Context for auth, PrivateRoute for guarding, a clean service-layer structure, and staying current on tooling — are individually complicated. But together, they’re the difference between a React project that works today and one I can actually keep building on without dreading it. That’s been the real shift in how I think about frontend work: less “does this feature work,” more “will I regret how I built this in three months.”</p><p>This is a slightly different post than my recent backend-focused pieces — same series, but a look at how the other half of my stack is put together. If you’re building your first role-aware React app, the PrivateRoute + Context combination here is the simplest version of that pattern I’d recommend starting with.</p><p>In Background of publishing my work from previous gap, i am still progressing and learning things to further better myself and place myself in better position everyday.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3acf21d3a2f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TourGO: Ownership-Aware Auth, Free Deployment, and the Small Details That Make a Backend Feel…]]></title>
            <link>https://medium.com/@rawalmohit12/tourgo-ownership-aware-auth-free-deployment-and-the-small-details-that-make-a-backend-feel-a6c8c7699407?source=rss-4c36ea7600b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6c8c7699407</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Mohit Rawal]]></dc:creator>
            <pubDate>Sat, 25 Jul 2026 05:36:17 GMT</pubDate>
            <atom:updated>2026-07-25T05:36:17.236Z</atom:updated>
            <content:encoded><![CDATA[<h4>TourGO: Ownership-Aware Auth, Free Deployment, and the Small Details That Make a Backend Feel Production-Ready</h4><p>In my last post, I broke down how authentication and role-based access work in Adhikari-marg. That project taught me the basics of “who are you” and “what’s your role.” But my next project, <strong>TourGO</strong> — a travel tour management dashboard — pushed me one step further, into a problem tutorials rarely cover: what happens when “Admin vs. User” isn’t a fine-grained enough answer.</p><p>This post covers four things I built into TourGO that, together, took it from “a backend that works” to something closer to “a backend I’d actually trust with real users”: ownership-aware authorization, real cloud deployment, pagination on a public endpoint, and password hashing done properly instead of assumed.</p><h4>The Problem Two Roles Couldn’t Solve</h4><p>In Adhikari-marg, my role check was simple: is this person an Admin, or a regular User? That’s enough when actions are cleanly split by role. But TourGO has a different requirement — users can create and manage their own tours, and they should be able to edit or delete <em>those specific tours</em>, but not anyone else’s. An Admin, meanwhile, needs to manage <em>all</em> tours, regardless of who created them.</p><p>That’s not a role check anymore. That’s an <strong>ownership check</strong> layered on top of a role check. The actual logic looks like this: when a request comes in to edit or delete a tour, the backend checks whether the currently authenticated user is the one who created it, <em>or</em> whether they’re an Admin. Either condition passes; neither, and the request gets rejected.</p><p>It’s a small conceptual shift, but it changes how you write the check. Instead of asking “what role does this user have,” you’re asking “does this user have a legitimate claim to <em>this specific resource</em>.” That distinction shows up constantly in real applications — think of any app where users manage their own posts, orders, or profiles — and it’s the first time I had to actually reason about it instead of copying a role check from a previous project.</p><h4>Public vs. Authenticated: Designing the Endpoints on Purpose</h4><p>TourGO also needed a genuinely public-facing side — anyone browsing tours shouldn’t need an account. So the API splits cleanly: a public endpoint returns tour listings with no authentication required, while creating, editing, or deleting a tour requires a valid JWT and passes through the ownership check above.</p><p>That split had a second consequence worth designing around properly: <strong>pagination</strong>. A public endpoint that returns every tour in the database, unbounded, is a problem waiting to happen — slow responses as the data grows, and an easy target for anyone hammering the endpoint. So the public listing endpoint returns paginated results instead of the full table every time. It’s not a complicated feature on its own, but it’s the kind of detail that separates “a demo that works with 10 rows of test data” from “an API that still behaves reasonably with 10,000 rows.”</p><h4>Password Hashing: Trusting the Framework, But Understanding Why</h4><p>I also want to be honest about something simple that’s easy to get subtly wrong: password storage. TourGO uses Spring Security’s built-in PasswordEncoder to hash passwords before they&#39;re ever stored, and to verify them on login without ever comparing plaintext.</p><p>The reason I’m including this in a post about “advanced” backend decisions is that it’s not actually advanced — and that’s the point. Getting this right isn’t about writing clever code; it’s about <em>not</em> writing your own hashing logic, not storing anything in plaintext even temporarily, and trusting a well-reviewed library over anything I could write myself. The mistake here isn’t usually a bug — it’s overconfidence.</p><h4>Getting Off Localhost: Deploying TourGO for Free</h4><p>The last piece, and honestly the one I was most proud of, was deployment. It’s one thing to have a project that runs correctly on my own machine. It’s a different thing entirely to have it running live, for anyone, at all times.</p><p>TourGO’s backend is deployed on <strong>Render</strong>, the frontend on <strong>Vercel</strong>, and the database is a managed <strong>PostgreSQL instance on Neon</strong> — three separate platforms, all free at this scale, all talking to each other in production. Getting this working meant dealing with real deployment concerns I hadn’t faced before: environment variables configured per-platform instead of in a local .env file, CORS rules that actually needed to restrict which origins could call the API instead of allowing everything during local development, and making sure the database connection string worked from Render&#39;s servers, not just my laptop.</p><p>None of these are individually difficult, but there’s a real gap between knowing a concept and having actually pushed something through it. This was the project where “deployment” stopped being an abstract idea and became a checklist I now run through every time.</p><h4>What I’d Still Improve</h4><p>Same honesty as last time: TourGO’s production checklist isn’t fully checked off. I still want to add rate limiting on the login endpoint specifically, since ownership-based auth means a compromised login is a bigger deal than in a simpler system. And — the running theme across every project I’ve built — automated tests around the ownership-check logic are still missing. That specific logic is exactly the kind of thing that’s easy to get right once and quietly break later during a refactor, which is precisely why it needs a test guarding it, not just my own manual Postman checks.</p><h4>Why This One Mattered</h4><p>Adhikari-marg taught me authentication and roles. TourGO taught me that real authorization problems are rarely as clean as “role A vs. role B” — and that a backend only really counts as done once it’s live somewhere other than your own machine. Those two lessons, together, felt like the point where my projects stopped being practice and started being things I’d actually be comfortable pointing someone to.</p><p><em>This is the third post in a series breaking down the real projects I’ve built since my last Medium post. If you’re building anything where users manage their own data — not just role-based permissions — the ownership-check pattern here is worth stealing and if u like to collaborate on anything contact me anytime .</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6c8c7699407" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Inside Adhikari-marg: How I Built Authentication and Role-Based Access for a Full-Stack Job…]]></title>
            <link>https://medium.com/@rawalmohit12/inside-adhikari-marg-how-i-built-authentication-and-role-based-access-for-a-full-stack-job-5bfdc972f326?source=rss-4c36ea7600b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/5bfdc972f326</guid>
            <dc:creator><![CDATA[Mohit Rawal]]></dc:creator>
            <pubDate>Mon, 20 Jul 2026 15:12:11 GMT</pubDate>
            <atom:updated>2026-07-20T15:16:41.456Z</atom:updated>
            <content:encoded><![CDATA[<h4>Inside Adhikari-marg: How I Built Authentication and Role-Based Access for a Full-Stack Job Platform</h4><p>A few months ago, I wanted to create something more meaningful than another simple CRUD tutorial project. My goal was to combine everything I was learning — Spring Boot, React, PostgreSQL — into a real, working application. This project became Adhikari-marg, a full-stack platform that connects course and institution discovery with job listings and job matching.</p><p>This isn’t just a “look what I built” post. It’s about how I built the parts that matter — specifically, how I designed the architecture, how authentication works behind the scenes, and how I managed the differences between what an admin can do versus a regular user. If you’re somewhere between finishing a Spring Boot tutorial and wanting to create something real, this is the article I wish I had.</p><p>What Adhikari-marg Actually Does</p><p>At its core, Adhikari-marg links three areas that are typically handled separately: learning (courses and institutions), work (job listings), and the gap between them (job matching based on user preferences). Additionally, there is a notification system.</p><p>The stack includes Java, Spring Boot, Spring Data JPA, Spring Security with JWT, PostgreSQL on the backend, and React with Tailwind CSS on the frontend.</p><p><strong>The Architecture: Why I Split It the Way I Did</strong></p><p>The backend follows a standard layered structure: <strong>controller, service, repository, model, dto, config, and exception</strong>. The reasoning behind this structure is worth explaining because it wasn’t clear to me the first time I built something of this size.</p><p>Each domain — Course, Institution, Job, Notification, User Preference — has its own controller, service, and repository. This separation means the controller layer only handles HTTP concerns — reading requests and returning responses — while the service layer holds the business logic. The repository layer is the only one that communicates with the database. When something fails, I can quickly identify which layer is responsible because each layer has a specific function.</p><p>The <strong>dto</strong> package exists for a specific reason: I never want to send my database entities directly to the frontend. Entities may contain internal fields, relationships, and sometimes sensitive data that shouldn’t be in an API response. Therefore, every entity has a corresponding DTO. I use ModelMapper to convert between them instead of manually writing mapping code for every field each time. This may seem like a small decision, but it helps me avoid specific bugs, like accidentally exposing a field that I forgot was part of the entity.</p><p><strong>Authentication: How JWT Actually Works in This Project</strong></p><p>Here’s the part that most tutorials overlook: JWT authentication involves a series of decisions that need to work together correctly.</p><p>When a user logs in, the backend validates their credentials against the database. If they’re valid, it generates a signed JWT containing the user’s identity and role. That token is sent back to the frontend, which stores it and attaches it to every subsequent request as an Authorization: Bearer &lt;token&gt; header.</p><p>On the backend, every incoming request goes through a JWT filter before it reaches any controller. The filter’s job is to check if there is a token, if it’s valid, and if it has expired. If everything checks out, it extracts the user’s identity and role from the token and sets up the security context for that request. If any check fails, the request gets rejected before it reaches the business logic.</p><p>This part took me the longest to get right. The failure modes are often quiet. A misconfigured filter doesn’t throw an obvious error; it just lets the wrong requests through or blocks the correct ones. The lesson I learned from debugging this is to test your auth filter with invalid tokens just as carefully as you test it with valid ones. It’s tempting to focus only on the happy path, but the real security issues often lie in the unhappy paths.</p><p>I also learned — often the hard way — not to hardcode the JWT signing secret directly in application.properties. It works fine locally, but it becomes a serious problem if that file gets anywhere near version control. Now, every project I create pulls that secret from an environment variable from the start. It’s just part of how I set up any new backend.</p><p><strong>Role-Based Access: Admin vs. User</strong></p><p>Authentication answers “who are you?” while authorization answers “what are you allowed to do?” In Adhikari-marg, this comes down to two roles: Admin and User.</p><p>The role gets included in the JWT at login. By the time a request reaches a controller, Spring Security already knows whether the caller is an Admin or a User, so I don’t have to check again. From there, I use Spring Security’s method-level and endpoint-level authorization to restrict specific actions. For instance, creating or deleting a Course or Institution is limited to Admins. Browsing listings, applying for jobs, and setting job preferences can be done by any authenticated User.</p><p>The pattern I follow is to default to the most restrictive access and then explicitly allow what needs to be open. It’s much easier to manage a system where everything is locked down except for specific endpoints. When I first started, I did it the other way around — open by default and restricted only where I remembered to add a check. This is risky since it relies on me never forgetting to add a check, rather than making the check the default.</p><p>I should mention that Adhikari-marg’s role system is intentionally simple — it has just two roles. It’s not designed for a scenario with overlapping permission levels. This is a real limitation, and I encountered a situation in a different project where two roles weren’t sufficient. However, for Adhikari-marg’s needs, having two roles done correctly is better than having five roles done poorly.</p><p><strong>Handling What Goes Wrong</strong></p><p>The last aspect I want to mention is exception handling. Instead of scattering try/catch blocks throughout every controller method, I use a custom ResourceNotFoundException for the common case where someone requests a Course, Job, or Institution that doesn’t exist. This exception bubbles up to be handled in one central place. It’s a small change, but it ensures that every “not found” response across the entire API looks and behaves consistently, rather than each controller having its own version of “oops, that doesn’t exist.”</p><p><strong>What I’d Still Change</strong></p><p>I strive to be honest about this in every project, and Adhikari-marg is no different. My production checklist includes moving any remaining hardcoded configurations into environment variables, switching the database schema mode from update to validate before real production traffic, and adding automated tests specifically for the authentication and payment flows, since those are the most critical areas where a silent bug could cause major issues.</p><p><strong>Why This Project Mattered</strong></p><p>Adhikari-marg was the project where JWT authentication and role-based access shifted from being something I copied from a tutorial to something I understood well enough to explain, debug, and rebuild differently in future projects. That journey — from “I followed the steps” to “I know why each step exists” — is the true story behind this post, surpassing any individual feature.</p><p>If you’re building your first real authenticated backend, my genuine advice is to focus on getting the unhappy paths right before addressing anything else. The entire system relies on authentication and authorization working correctly without fail every single time.</p><p>This is the second post in a series where I’m breaking down the real projects I’ve built since my last Medium post. Next up: TourGO — I’m combining four things into one piece: ownership-aware authorization, deploying for free across Render, Vercel, and Neon, pagination on a public API, and password hashing done properly. If you’ve ever wondered what it actually takes to get a Spring Boot + React app past localhost, that one’s for you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5bfdc972f326" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Back to Writing: Two Years Later]]></title>
            <link>https://medium.com/@rawalmohit12/back-to-writing-two-years-later-2d1e8e9f333c?source=rss-4c36ea7600b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d1e8e9f333c</guid>
            <dc:creator><![CDATA[Mohit Rawal]]></dc:creator>
            <pubDate>Sat, 11 Jul 2026 12:15:53 GMT</pubDate>
            <atom:updated>2026-07-11T12:15:53.255Z</atom:updated>
            <content:encoded><![CDATA[<p>Nearly two years ago, I published my last Medium article. At the time, I had just finished learning HTML, CSS, and JavaScript, and I was struggling to learn React. Like many beginners, I was excited, a little overwhelmed, and trying to figure out where my journey in software development would take me.</p><p>Then I stopped writing.</p><p>What I didn’t stop was learning.</p><p>Over the past two years, I spent far more time building than documenting. I worked on projects, explored new technologies, solved bugs that took hours (and sometimes days), and gradually became more comfortable turning ideas into working applications.</p><p>During that time, I expanded my skills beyond the frontend and found myself drawn to backend development. I started working with Java, Spring Boot, Spring Security, JWT authentication, REST APIs, and PostgreSQL, while continuing to build user interfaces with React, Tailwind CSS, Ant Design, and responsive design principles.</p><p>Looking back at my old post makes me smile. I was searching for the “perfect” resource to learn React. Today, I realize there isn’t one. The best teacher has been building projects, reading documentation, making mistakes, and learning from them.</p><p>One of the biggest lessons I’ve learned is that progress isn’t always visible. Sometimes it feels like you’re stuck because you’re focused on the next thing to learn. But when you pause and look back, you realize how much you’ve grown.</p><p>So why am I writing again?</p><p>Because I don’t want to just build software — I want to document what I learn along the way.</p><p>This blog will become a place where I share practical knowledge from projects I’ve actually built. I’ll write about topics I’ve worked on, challenges I’ve faced, and lessons I’ve learned, with the hope that they help someone else on a similar path.</p><p>Some of the topics I plan to cover include:</p><ul><li>Building REST APIs with Spring Boot</li><li>Spring Security and JWT Authentication</li><li>Java concepts with practical examples</li><li>React applications and frontend architecture</li><li>Tailwind CSS and responsive UI design</li><li>PostgreSQL and database design</li><li>Full-stack development with React and Spring Boot</li><li>Lessons learned from real-world projects</li></ul><p>I’m still learning, and I expect that won’t change anytime soon. But this time, I want to bring others along for the journey.</p><p>Here’s to building, learning, and writing consistently.</p><p>Thanks for reading, and welcome back.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d1e8e9f333c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Frontend development]]></title>
            <link>https://medium.com/@rawalmohit12/frontend-development-dace2753bdce?source=rss-4c36ea7600b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/dace2753bdce</guid>
            <dc:creator><![CDATA[Mohit Rawal]]></dc:creator>
            <pubDate>Mon, 15 Jul 2024 15:39:07 GMT</pubDate>
            <atom:updated>2024-07-15T15:39:07.989Z</atom:updated>
            <content:encoded><![CDATA[<p>I as everyone started from HTML &amp; CSS and did some projects on portfolio, amazon ,spotify ,etc . Some turned out fine and some doomed. Well everything went well &amp; i entered javascript .</p><p>It took me whole 3 weeks to do in essentially and i learned it quite good now i am stuck in react.js and can’t find good resource to complete it .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dace2753bdce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My coding journey]]></title>
            <link>https://medium.com/@rawalmohit12/my-coding-journey-8c69c185b5ee?source=rss-4c36ea7600b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c69c185b5ee</guid>
            <dc:creator><![CDATA[Mohit Rawal]]></dc:creator>
            <pubDate>Mon, 15 Jul 2024 06:56:22 GMT</pubDate>
            <atom:updated>2024-07-15T06:56:22.520Z</atom:updated>
            <content:encoded><![CDATA[<p>I started my coding journey before 28th January 2024 .I was hesitant and couldn’t write about it from begginning.I will be writing it from today &amp; i hope u all support me .</p><p>I will try to publish everything , i have learned . I will be learning from all of you so, plz guide me towards better opportunities &amp; programming skills.</p><p>I have started my journey by learning C language first,then i tilted towards Web development and currenting studying react.js which will be end of front end web development.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c69c185b5ee" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>