<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Swapnil Take</title>
    <description>The latest articles on Forem by Swapnil Take (@swapniltake1).</description>
    <link>https://forem.com/swapniltake1</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1367482%2Fe4815f4f-32ea-4ff7-8aa9-11d7056bc856.jpg</url>
      <title>Forem: Swapnil Take</title>
      <link>https://forem.com/swapniltake1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/swapniltake1"/>
    <language>en</language>
    <item>
      <title>Retrieval-Augmented Generation (RAG) system using LangChain, ChromaDB, and local LLMs.</title>
      <dc:creator>Swapnil Take</dc:creator>
      <pubDate>Fri, 20 Mar 2026 17:17:47 +0000</pubDate>
      <link>https://forem.com/swapniltake1/retrieval-augmented-generation-rag-system-using-langchain-chromadb-and-local-llms-2io7</link>
      <guid>https://forem.com/swapniltake1/retrieval-augmented-generation-rag-system-using-langchain-chromadb-and-local-llms-2io7</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;The Problem: The "Documentation Drain"&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;We’ve all been there: you need a specific sql syntax or a complex join optimization strategy, and you're stuck searching a 200-page PDF. Standard AI models like ChatGPT are great, but they don't know the specifics of your project's internal documentation.&lt;/p&gt;

&lt;h2&gt;
  
  
  The goal was to build a system that:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Reads the entire PDF.&lt;/li&gt;
&lt;li&gt;Indexes it for instant retrieval.&lt;/li&gt;
&lt;li&gt;Answers complex queries using a local model for privacy and speed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;The Tech Stack (2026 Edition)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To keep the project modern and efficient, I used a modular stack:&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Language&lt;/em&gt;&lt;/strong&gt;: Python 3.12+ managed by uv (the fastest package manager).&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Orchestration&lt;/em&gt;&lt;/strong&gt;: LangChain and LangChain-Classic for the RAG pipeline.&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Vector Database&lt;/em&gt;&lt;/strong&gt;: ChromaDB for persistent, local storage.&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Models&lt;/em&gt;&lt;/strong&gt;: Google Gemini 2.5 Flash (for heavy lifting) and Qwen 3: 0.6B-F16 (running locally via Docker).&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Frontend&lt;/em&gt;&lt;/strong&gt;: Streamlit for a clean, browser-based chat interface.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Implementation: Step-by-Step&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Data Ingestion &amp;amp; Chunking&lt;/strong&gt;&lt;br&gt;
A 200-page PDF is too large for an LLM to "read" all at once. We broke the document into smaller, overlapping chunks using the RecursiveCharacterTextSplitter. This ensures that context (like a SQL statement that spans two pages) isn't cut in half.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Python&lt;br&gt;
text_splitter = RecursiveCharacterTextSplitter(chunk_size=1500, chunk_overlap=200)&lt;br&gt;
chunks = text_splitter.split_documents(raw_documents)&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;2. The Search Engine (Vectorization)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;We converted these text chunks into mathematical vectors using Google’s Gemini Embeddings. These vectors are stored in a local ChromaDB folder. The beauty of this is persistence: once you index the document, you never have to do it again. You can simply "load" the database in milliseconds.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;3. Going Local: Docker + Qwen 3&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;For maximum privacy and zero API costs, I integrated a local model. Using Docker Model Runner, I deployed Qwen 3 (0.6B). Even at a small parameter size, it handles SQL generation and technical explanations with impressive accuracy when grounded by the retrieved context.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;4. The User Interface&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;While Jupyter Notebooks are great for development, they aren't for "users." I wrapped the entire logic in a Streamlit application. This converted the Python code into a professional web interface with a chat history, loading spinners, and source attribution (telling the user exactly which page of the PDF the answer came from).&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Key Challenges Overcome&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Rate Limiting: When embedding 200 pages for the first time, I hit Google's "Resource Exhausted" errors. I solved this by implementing Exponential Backoff logic—the script now automatically waits and retries if the API gets overwhelmed.&lt;/p&gt;

&lt;p&gt;Library Shifts: In 2026, LangChain moved to a modular structure. I adapted by using langchain-classic to keep the robust retrieval chains working while staying compatible with the latest updates.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;The Result&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;What started as a static PDF is now a dynamic SQL expert. I can ask, "How do I create a customer table with specific DB2 constraints?" and within seconds, the bot retrieves the correct syntax from the manual and formats the code for me.&lt;/p&gt;

&lt;p&gt;For any software engineer working with heavy documentation, this RAG setup is a game-changer. It moves us from "searching for info" to "acting on info."&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/11Ojxcstnis" rel="noopener noreferrer"&gt;Youtube&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/swapniltake1/rag-implementation-for-own-data" rel="noopener noreferrer"&gt;GitHUb&lt;/a&gt;&lt;/p&gt;

</description>
      <category>rag</category>
      <category>localllm</category>
      <category>aitrends2026</category>
      <category>retrievalaugmentedgeneration</category>
    </item>
    <item>
      <title>Building an AI-Powered Expense Tracker with Spring Boot, Spring AI, and Google Gemini</title>
      <dc:creator>Swapnil Take</dc:creator>
      <pubDate>Sat, 06 Sep 2025 16:52:42 +0000</pubDate>
      <link>https://forem.com/swapniltake1/building-an-ai-powered-expense-tracker-with-spring-boot-spring-ai-and-google-gemini-5f48</link>
      <guid>https://forem.com/swapniltake1/building-an-ai-powered-expense-tracker-with-spring-boot-spring-ai-and-google-gemini-5f48</guid>
      <description>&lt;p&gt;Managing personal finances is one of the most common challenges in today’s world. While traditional expense trackers record spending, they don’t provide actionable insights.&lt;br&gt;
That’s where AI-powered applications step in.&lt;/p&gt;

&lt;p&gt;In this blog, I’ll walk you through a project where I built an Expense Tracker integrated with Google Gemini AI using Spring Boot and Spring AI.&lt;br&gt;
This application not only tracks expenses but also provides real-time cost-saving suggestions and insights powered by Gemini.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🚀 Project Overview&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The AI Expense Tracker is a backend application that:&lt;/p&gt;

&lt;p&gt;Records user expenses (category, amount, description, date).&lt;/p&gt;

&lt;p&gt;Stores data in a relational database (MySQL).&lt;/p&gt;

&lt;p&gt;Provides JWT-secured APIs for expense management.&lt;/p&gt;

&lt;p&gt;Integrates with Google Gemini AI using Spring AI.&lt;/p&gt;

&lt;p&gt;Generates personalized suggestions to help reduce unnecessary spending.&lt;/p&gt;

&lt;p&gt;👉 Imagine logging your food, shopping, and entertainment expenses, and the system automatically tells you:&lt;/p&gt;

&lt;p&gt;“Cut down on shopping and try cooking at home more often — you can save ₹3,000 this month.”&lt;/p&gt;

&lt;p&gt;That’s the power of combining Spring Boot + AI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🛠️ Tech Stack&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Java 17&lt;/p&gt;

&lt;p&gt;Spring Boot 3&lt;/p&gt;

&lt;p&gt;Spring Security + JWT (for authentication)&lt;/p&gt;

&lt;p&gt;Spring AI (to connect Gemini with Spring Boot)&lt;/p&gt;

&lt;p&gt;Google Gemini API (AI model for insights)&lt;/p&gt;

&lt;p&gt;Hibernate + JPA (ORM)&lt;/p&gt;

&lt;p&gt;MySQL (database)&lt;/p&gt;

&lt;p&gt;Postman (API testing)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;⚙️ Architecture&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Expense Entity&lt;/p&gt;

&lt;p&gt;Stores data like amount, category, description, date, and user reference.&lt;/p&gt;

&lt;p&gt;Repository Layer&lt;/p&gt;

&lt;p&gt;Fetches user expenses from the MySQL database.&lt;/p&gt;

&lt;p&gt;Gemini Integration&lt;/p&gt;

&lt;p&gt;Expense data is sent to Gemini API.&lt;/p&gt;

&lt;p&gt;Gemini analyzes patterns and returns actionable suggestions.&lt;/p&gt;

&lt;p&gt;Controller Layer&lt;/p&gt;

&lt;p&gt;REST endpoints expose expense tracking and AI analysis features.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔑 Key Features&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;✔️ Track Expenses – Add, update, and fetch expenses.&lt;br&gt;
✔️ AI-Powered Suggestions – Get real-time insights on saving money.&lt;br&gt;
✔️ JWT Security – Secure access to APIs.&lt;br&gt;
✔️ Postman Testing – Simple interface for testing endpoints.&lt;br&gt;
✔️ Custom Prompts – Tailor AI responses to be short, simple, and actionable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🧩 Example Workflow&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;User adds expenses:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;[&lt;br&gt;
  { "category": "Food", "amount": 12000, "description": "Restaurant &amp;amp; groceries" },&lt;br&gt;
  { "category": "Shopping", "amount": 8000, "description": "Clothes &amp;amp; shoes" },&lt;br&gt;
  { "category": "Transport", "amount": 5000, "description": "Cab &amp;amp; fuel" }&lt;br&gt;
]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;System prepares AI prompt:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here are the user's expenses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Food: 12000&lt;/li&gt;
&lt;li&gt;Shopping: 8000&lt;/li&gt;
&lt;li&gt;Transport: 5000&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Please suggest 3-5 short, simple, actionable tips to save money.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gemini AI Response:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cook at home instead of frequent dining out.
&lt;/li&gt;
&lt;li&gt;Delay non-essential shopping purchases.
&lt;/li&gt;
&lt;li&gt;Use public transport or carpool to reduce travel costs.
&lt;/li&gt;
&lt;li&gt;Cancel unused subscriptions.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;📊 Why This Project Matters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;💡 Traditional expense trackers = record keeping only.&lt;br&gt;
💡 AI Expense Tracker = real-time insights.&lt;/p&gt;

&lt;p&gt;By integrating AI, we shift from “What I spent” → “How I can save.”&lt;/p&gt;

&lt;p&gt;This project is a great example of practical AI integration into real-world apps using Spring Boot.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🎥 Project Demo&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;👉 Watch the full demo on YouTube here:&lt;br&gt;
&lt;a href="https://youtu.be/pPnZXBP2oww" rel="noopener noreferrer"&gt;Youtube Video&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;✅ That’s it! We’ve combined Spring Boot, Spring AI, and Gemini to build something genuinely useful and future-proof.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>springboot</category>
      <category>gemini</category>
      <category>integration</category>
    </item>
    <item>
      <title>Setting Up a CI/CD Pipeline with AWS and Git: A Comprehensive Guide</title>
      <dc:creator>Swapnil Take</dc:creator>
      <pubDate>Sun, 31 Mar 2024 09:12:08 +0000</pubDate>
      <link>https://forem.com/swapniltake1/setting-up-a-cicd-pipeline-with-aws-and-git-a-comprehensive-guide-1b5k</link>
      <guid>https://forem.com/swapniltake1/setting-up-a-cicd-pipeline-with-aws-and-git-a-comprehensive-guide-1b5k</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjnlm9m6jrcupf5dw4hr6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjnlm9m6jrcupf5dw4hr6.png" alt=" " width="800" height="264"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;In this guide, we'll walk through how to create a simple and efficient way to automatically test and deploy your code using AWS (Amazon Web Services) and Git, without using complicated jargon.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Understanding CI/CD:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What it does&lt;/strong&gt;: CI (Continuous Integration) helps you automatically test your code whenever you make changes. CD (Continuous Deployment) automatically sends those changes to your website or app.&lt;br&gt;
&lt;strong&gt;Why it's useful&lt;/strong&gt;: It makes sure your code works well and gets updated quickly without causing problems.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flq4hgc76x7zot7dovbaz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flq4hgc76x7zot7dovbaz.png" alt=" " width="800" height="190"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setting Up a Git Repository:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Choose Git: It's a tool that helps you manage your code and keep track of changes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a Repository: Think of it like a folder where you keep all your project's files. You can do this on websites like GitHub.&lt;br&gt;
Decide on a Workflow: This helps you and your team work together smoothly. You might want to use a simple one like "main" for the main code and "feature" for new ideas.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Configuring AWS Services:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;AWS CodeCommit: It's like a safe place to store your code online, and only you and your team can access it.&lt;br&gt;
AWS CodeBuild: This helps you test your code automatically to make sure it works as expected.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;AWS CodeDeploy: It's like a robot that helps you send your code to your website or app without needing to do it manually.&lt;br&gt;
AWS CodePipeline: It's like a manager that helps all these AWS services work together smoothly.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Building the CI/CD Pipeline:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Make a Plan: Decide what steps your code should go through before it's ready to be shown to the world.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Set Up Triggers: These are like alarms that tell your pipeline to start working whenever you or your team make changes to the code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Write Instructions: Tell AWS how to test and deploy your code using simple instructions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Decide Where to Deploy: Choose where you want your code to go, like a website or an app store.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Integrating Testing and Quality Checks:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Test Your Code: Make sure it works correctly by running tests automatically.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check for Quality: Make sure your code is easy to read and doesn't have mistakes by using special tools that help you check it.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Monitoring and Logging:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Keep an Eye on Things: Make sure everything is running smoothly by checking logs and messages.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Get Notified: Set up messages to tell you if something goes wrong so you can fix it quickly.&lt;br&gt;
Security Best Practices:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Keep Things Safe&lt;/strong&gt;: Make sure only the right people can access your code and your AWS services.&lt;br&gt;
Protect Your Data: Make sure your information stays private and secure by using encryption.&lt;/p&gt;

</description>
      <category>cicd</category>
      <category>aws</category>
      <category>pipelines</category>
      <category>devops</category>
    </item>
    <item>
      <title>Saving Excel Data to SQL and NoSQL Databases with Spring Boot</title>
      <dc:creator>Swapnil Take</dc:creator>
      <pubDate>Thu, 21 Mar 2024 07:27:17 +0000</pubDate>
      <link>https://forem.com/swapniltake1/saving-excel-data-to-sql-and-nosql-databases-with-spring-boot-o4h</link>
      <guid>https://forem.com/swapniltake1/saving-excel-data-to-sql-and-nosql-databases-with-spring-boot-o4h</guid>
      <description>&lt;p&gt;In today's tech-driven landscape, efficient data management is paramount. Saving data from Excel files directly into databases is a common requirement for many applications. In this blog post, we'll explore how to achieve this using a Spring Boot project, offering simplicity and robustness in our solution.&lt;/p&gt;

&lt;p&gt;Introduction:&lt;br&gt;
Spring Boot provides a powerful framework for building Java applications with ease. Leveraging its capabilities, we'll demonstrate how to parse Excel data and save it into both SQL and NoSQL databases, providing flexibility and scalability for various use cases.&lt;/p&gt;

&lt;p&gt;Step 1: Setting Up the Spring Boot Project:&lt;br&gt;
Begin by creating a new Spring Boot project using your favorite IDE or Spring Initializr. Include dependencies for Spring Data JPA and Spring Data MongoDB to facilitate interaction with SQL and NoSQL databases, respectively.&lt;/p&gt;

&lt;p&gt;Step 2: Parsing Excel Data:&lt;br&gt;
Utilize libraries like Apache POI or Apache POI OOXML to read and parse Excel files within your Spring Boot application. Extract the data from the Excel sheets and convert it into Java objects or DTOs (Data Transfer Objects) for further processing.&lt;/p&gt;

&lt;p&gt;Step 3: Saving to SQL Database:&lt;br&gt;
Define JPA entities corresponding to the data structure in your SQL database. Use Spring Data JPA repositories to handle CRUD (Create, Read, Update, Delete) operations. Iterate through the parsed Excel data and save each record into the SQL database using JPA repository methods.&lt;/p&gt;

&lt;p&gt;Step 4: Saving to NoSQL Database:&lt;br&gt;
For NoSQL databases like MongoDB, define MongoDB entities or documents representing the data model. Utilize Spring Data MongoDB repositories to interact with the MongoDB database. Iterate through the parsed Excel data and save each document into the MongoDB collection using MongoDB repository methods.&lt;/p&gt;

&lt;p&gt;Step 5: Error Handling and Transaction Management:&lt;br&gt;
Implement error handling mechanisms to handle exceptions gracefully during the data import process. Utilize Spring's transaction management capabilities to ensure data integrity, rolling back transactions in case of failures.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/swapniltake1/excel-to-db" rel="noopener noreferrer"&gt;Check Source Code&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Conclusion:&lt;br&gt;
By integrating Excel data import functionality into a Spring Boot project, we achieve a robust and efficient solution for saving data into both SQL and NoSQL databases. This approach provides developers with the flexibility to choose the appropriate database technology based on their application requirements.&lt;/p&gt;

&lt;p&gt;Stay Connected:&lt;br&gt;
For more tutorials, tips, and insights on Spring Boot development and database management, stay tuned to our blog. Follow us on social media for the latest updates and announcements.&lt;/p&gt;

&lt;p&gt;Happy coding with Spring Boot! 🌱&lt;/p&gt;

</description>
      <category>savetodatabase</category>
      <category>exceltodb</category>
      <category>api</category>
      <category>springboot</category>
    </item>
    <item>
      <title>Decoding APIs: From Concept to Implementation: API &amp; REST</title>
      <dc:creator>Swapnil Take</dc:creator>
      <pubDate>Thu, 21 Mar 2024 07:07:09 +0000</pubDate>
      <link>https://forem.com/swapniltake1/decoding-apis-from-concept-to-implementation-api-rest-176j</link>
      <guid>https://forem.com/swapniltake1/decoding-apis-from-concept-to-implementation-api-rest-176j</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frgh99h2b7pcgwabcdgvj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frgh99h2b7pcgwabcdgvj.png" alt=" " width="800" height="510"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;API, short for Application Programming Interface, acts as a bridge between different software applications. It establishes rules and tools allowing these applications to communicate with each other. In essence, APIs define how software systems can interact without needing to know the internal workings of one another.&lt;/p&gt;

&lt;p&gt;Types of APIs&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Web APIs (or Web Services): These are accessed over the internet using standard web protocols like HTTP. They facilitate communication between web servers and client applications.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Library APIs: These are sets of functions and procedures that allow developers to create software applications more efficiently by providing pre-written code for common tasks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;OS APIs: Operating System APIs provide functions and procedures for programmers to utilize the capabilities of the underlying operating system.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;RESTful APIs and REST Guidelines&lt;/p&gt;

&lt;p&gt;REST, or Representational State Transfer, is an architectural style for designing networked applications. RESTful APIs adhere to REST principles, using standard HTTP methods (GET, POST, PUT, DELETE) for communication. They are designed to be stateless, scalable, and easy to understand.&lt;/p&gt;

&lt;p&gt;Key Concepts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Resources: These are entities or concepts that can be identified and manipulated over the web, such as students, employees, or products. Each resource is uniquely identified by a URI.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;HTTP Methods: APIs define operations to manipulate resources, including GET (retrieve), POST (create), PUT (update), and DELETE (delete).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;JSON: Representing data in JSON format (key-value pairs) is common in RESTful APIs for data exchange.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Stateless: Each client-server request contains all necessary information, and the server does not store client state between requests.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Designing Action-Centric APIs&lt;/p&gt;

&lt;p&gt;While traditional REST APIs focus on resources, it's possible to design APIs centered around actions or operations. Here are some tips:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Identify Operations: Clearly define the actions you want to expose through your API.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use Nouns for Actions: Represent actions with nouns in your URI paths (e.g., /calculations instead of /calculate).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose HTTP Methods: Decide on appropriate HTTP methods for your actions, considering POST for most operations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Document Clearly: Provide comprehensive documentation specifying available actions, parameters, and response formats.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Consider Security: Implement proper authentication and authorization mechanisms for your API, depending on the nature of actions.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Annotations for Working with APIs&lt;/p&gt;

&lt;p&gt;&lt;code&gt;@Controller&lt;/code&gt;: Marks a class as a controller component in Spring MVC.&lt;br&gt;
&lt;code&gt;@ResponseBody&lt;/code&gt;: Indicates that the return value of a method should be serialized directly to the HTTP response body.&lt;br&gt;
&lt;code&gt;@RestController&lt;/code&gt;: Combines @Controller and @ResponseBody, simplifying RESTful API development.&lt;br&gt;
&lt;code&gt;@RequestParam&lt;/code&gt;: Binds parameters from the request to method parameters in Spring MVC.&lt;br&gt;
&lt;code&gt;@RequestBody&lt;/code&gt;: Binds the body of a web request to method parameters in Spring MVC.&lt;br&gt;
&lt;code&gt;@GetMapping&lt;/code&gt;, &lt;code&gt;@PostMapping&lt;/code&gt;: Maps HTTP GET and POST requests to handler methods.&lt;br&gt;
&lt;code&gt;@RequestMapping&lt;/code&gt;: Maps HTTP requests to handler methods, providing more flexibility in URI mapping.&lt;br&gt;
&lt;code&gt;@PathVariable&lt;/code&gt;: Extracts values from the URI path in Spring MVC.&lt;/p&gt;

</description>
      <category>restapi</category>
      <category>api</category>
      <category>springboot</category>
      <category>backend</category>
    </item>
  </channel>
</rss>
