<?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 Krutarthbhavani on Medium]]></title>
        <description><![CDATA[Stories by Krutarthbhavani on Medium]]></description>
        <link>https://medium.com/@krutarthbhavani786?source=rss-27548a74ad8c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2SZs9YzZ2Y4yFfZpElqMVw.png</url>
            <title>Stories by Krutarthbhavani on Medium</title>
            <link>https://medium.com/@krutarthbhavani786?source=rss-27548a74ad8c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 05:22:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@krutarthbhavani786/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[Java 24: A Practical Introduction for Developers ☕️]]></title>
            <link>https://medium.com/@krutarthbhavani786/java-24-a-practical-introduction-for-developers-%EF%B8%8F-ae815d84f74f?source=rss-27548a74ad8c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae815d84f74f</guid>
            <category><![CDATA[java24]]></category>
            <category><![CDATA[java-new-feature]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[java-memory-management]]></category>
            <category><![CDATA[java2025]]></category>
            <dc:creator><![CDATA[Krutarthbhavani]]></dc:creator>
            <pubDate>Fri, 21 Mar 2025 20:34:02 GMT</pubDate>
            <atom:updated>2025-03-21T20:34:02.319Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>By a Java Developer, for Java Developers</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*kMpwOsUrZWpf7vK3ZlFsgg.png" /><figcaption><a href="https://www.oracle.com/news/announcement/oracle-releases-java-24-2025-03-18/">https://www.oracle.com/news/announcement/oracle-releases-java-24-2025-03-18/</a></figcaption></figure><p><strong>Introduction:</strong> Java 24 is here, arriving with the uncanny coincidence of<strong> </strong><a href="https://foojay.io/today/java-24-rolls-out-today-find-out-why-its-aptly-named/#:~:text=it%27s%20time%20for%20another%20helping,%F0%9F%99%82"><strong>24 new JDK Enhancement Proposals (JEPs)</strong></a> packed into the release. This latest Java version (released in March 2025) might not be a long-term support (LTS) release, but it brings plenty of goodies that are hard to ignore. As someone who’s worked with Java through its recent iterations, I’m excited by the blend of <strong>new language features, performance improvements, and library enhancements</strong> in Java 24. In this post, we’ll explore what’s new, how it improves upon Java 21 (LTS) and Java 23, and why these changes matter in day-to-day development. We’ll keep it conversational and insightful, so grab a coffee and let’s dive in!</p><h3>New Language Features and Enhancements ✨</h3><p>Java’s syntax and language capabilities continue to evolve in version 24, making the language more expressive and convenient. Here are some of the standout language improvements:</p><ul><li><strong>Pattern Matching Embraces Primitive Types:</strong> Pattern matching has been one of Java’s big improvements in recent versions, and Java 24 takes it a step further. You can now use <a href="https://openjdk.org/jeps/488#:~:text=Enhance%20pattern%20matching%20by%20allowing,is%20a%20preview%20language%20feature">primitive types in pattern matching constructs</a> like instanceof and switch​. For example, suppose you have an integer status code and want to handle known values and log unknown ones:</li></ul><pre>switch (x.getStatus()) {<br>    case 0 -&gt; &quot;OK&quot;;<br>    case 1 -&gt; &quot;Warning&quot;;<br>    case 2 -&gt; &quot;Error&quot;;<br>    case int code -&gt; &quot;Unknown status: &quot; + code;<br>}</pre><ul><li><strong>Simpler Java Programs with Less Ceremony :</strong> Previously, all Java applications required the traditional boilerplate of a class with a static main method. Java 24’s preview simplifies this significantly.</li></ul><pre>// Before (Traditional Java):<br>public class HelloWorld {<br>    public static void main(String[] args) {<br>        System.out.println(&quot;Hello, Java 21!&quot;);<br>    }<br>}<br><br>//------------------------------------------------------------//<br><br>// Now in Java 24 (Preview):<br>// You can write Java without explicitly declaring the class or static main. Simply create a file named HelloWorld.java:<br>void main() {<br>    System.out.println(&quot;Hello, Java 24!&quot;);<br>}<br><br>// Or even simpler, without explicitly typing void:<br>main() {<br>    System.out.println(&quot;Hello, Java 24 with less ceremony!&quot;);<br>}</pre><ul><li><strong>Flexible Constructors : </strong>Previously, calling super() or another constructor (this()) had to be the very first line in a constructor, limiting flexibility.</li></ul><pre><br>// Before (Java 21 and earlier):<br>public class User {<br>    private String name;<br><br>    public User(String name) {<br>        super(); // This must be first<br>        this.name = validateName(name); // Validation happens after super call<br>    }<br><br>    private String validateName(String name) {<br>        if (name == null || name.isEmpty()) {<br>            throw new IllegalArgumentException(&quot;Invalid name&quot;);<br>        }<br>        return name;<br>    }<br>}<br><br><br>// Java 24 (Preview) - Flexible Constructors:<br>// Now you can include logic before calling super() or this():<br>public class User {<br>    private String name;<br><br>    public User(String name) {<br>        String validatedName = validateName(name); // Logic BEFORE super call<br>        super(); // Call to superclass constructor after logic<br>        this.name = validatedName;<br>    }<br><br>    private String validateName(String name) {<br>        if (name == null || name.isEmpty()) {<br>            throw new IllegalArgumentException(&quot;Invalid name&quot;);<br>        }<br>        return name;<br>    }<br>}</pre><p>Overall, Java 24’s language updates build on changes from Java 21 and 23. For instance, Java 21 finalized pattern matching for switch and record patterns, and now Java 24 expands that capability to primitives. These enhancements might feel incremental, but together they make Java code more concise and powerful.</p><h3>Evolving Concurrency: Virtual Threads and Structured Concurrency 🚦</h3><p>One of the most exciting recent advances in Java has been <strong>virtual threads</strong> (from Project Loom). Java 21 introduced virtual threads as a final feature, enabling lightweight concurrency where thousands of threads can run without burning through OS resources.</p><ul><li><strong>No More Thread Pinning: </strong>In Java 21, virtual threads could get “pinned” when entering synchronized blocks, temporarily locking the OS thread and losing scalability advantages. Java 24 (JEP 491) resolves this by unmounting virtual threads intelligently, ensuring the carrier OS thread remains available.</li><li><strong>Structured Concurrency : </strong>Java 24 continues previewing Structured Concurrency (JEP 499), enabling clearer, safer multithreaded code. With StructuredTaskScope, tasks execute within a structured block, simplifying error handling and results management.<br>This structured approach significantly reduces the complexity of concurrent programming.</li></ul><pre>try (var scope = new StructuredTaskScope.ShutdownOnFailure()) {<br>    Future&lt;String&gt; resultA = scope.fork(() -&gt; taskA());<br>    Future&lt;String&gt; resultB = scope.fork(() -&gt; taskB());<br>    scope.join().throwIfFailed();  // wait for both, or throw if any failed<br>    // Retrieve results after both tasks complete<br>    String combined = resultA.resultNow() + resultB.resultNow();<br>    System.out.println(&quot;Combined result: &quot; + combined);<br>}<br>// two tasks run in parallel; the scope ensures we wait for both and handle failures consistently.</pre><ul><li><strong>Scoped Values : </strong>Scoped Values (JEP 487, preview) offer a better alternative to ThreadLocal, especially beneficial with virtual threads. Scoped Values efficiently share immutable context data (e.g., request IDs) across threads. Scoped Values simplify context sharing without traditional ThreadLocal pitfalls. These improvements in Java 24 reduce complexity, enhance performance, and simplify concurrency — making developers’ lives noticeably easier.</li></ul><p>These concurrency enhancements all stem from <strong>Project Loom</strong>, and they build on what we got in Java 21. Virtual threads in Java 21 were a game-changer; now Java 24 polishes that gem and adds supporting features around it.</p><h3>Performance Improvements in the JVM ⚡️</h3><p>Performance is a theme that Java 24 takes seriously. Many of the 24 JEPs are aimed at making Java run faster or more efficiently. Here are some key performance and JVM-level improvements:</p><h4>Garbage Collection Optimizations:</h4><ul><li><strong>Generational Shenandoah</strong>: Java 24 introduces generational Shenandoah GC (JEP 404), improving throughput by frequently collecting short-lived objects. Enable experimentally for allocation-intensive workloads.</li><li><strong>ZGC Fully Generational</strong>: Java 24 (JEP 490) makes ZGC purely generational by default, enhancing performance through optimized garbage collection cycles.</li><li><strong>G1 GC Optimization</strong>: <strong>Late Barrier Expansion (JEP 475)</strong> defers GC barriers, allowing JIT compiler optimizations and minor performance gains.</li></ul><h4>Compact Object Headers:</h4><ul><li>Java 24 introduces <strong>Compact Object Headers (JEP 450</strong>) reducing object metadata from 96/128 bits to just 64 bits. This significantly decreases memory usage and improves cache efficiency, ideal for applications managing many objects.</li></ul><h4>Faster Startup with Project Leyden:</h4><ul><li><strong>Ahead-of-Time (AOT) Class Loading</strong> and <strong>Linking (JEP 483)</strong> records classes used during runtime and caches this state. On subsequent startups, the JVM loads from this cache, dramatically speeding up startup times — a valuable improvement for serverless or lightweight applications.</li></ul><h4>Other Performance Tweaks:</h4><ul><li>Dropped support for 32-bit Windows (JEP 479 &amp; 501), streamlining JVM maintenance.</li><li>Enhanced Vector API (incubating), improving support for SIMD operations crucial in computational tasks like ML and cryptography.</li></ul><p>Overall, Java 24’s JVM enhancements deliver faster execution, reduced memory overhead, and quicker startup times without requiring significant code adjustments from developers.</p><h3>Library and Tooling Updates 🛠</h3><p>Java 24 introduces several enhancements to its standard libraries and developer tooling, making everyday Java development easier and more efficient:</p><h4>Stream Gatherers (JEP 485):</h4><ul><li>The Streams API now supports custom intermediate operations, enabling complex stream manipulations directly:</li><li>This feature allows stateful or customized stream transformations without manual collection or workarounds.</li></ul><h4>New Cryptography Features:</h4><p>Java 24 introduces:</p><ul><li><strong>Key Derivation Function (KDF) API (JEP 478, preview)</strong>: Simplifies generating cryptographic keys securely.</li><li><strong>Quantum-Resistant Algorithms (JEP 496 &amp; 497)</strong>: Provides built-in post-quantum cryptography algorithms, preparing Java for future security standards.</li></ul><h4>ClassFile API (JEP 484):</h4><ul><li>A standardized API for inspecting and manipulating .class files:</li><li>This is especially valuable for tooling and frameworks needing direct bytecode interactions.</li></ul><h4>Developer Tooling Improvements:</h4><ul><li><strong>jlink enhancement (JEP 493)</strong>: Create custom runtime images directly from class/module paths without needing intermediate JMOD files:</li><li><strong>Security Manager Disabled (JEP 486)</strong>: Fully disabled, simplifying JVM internals.</li><li><strong>Unsafe API Warnings (JEP 498)</strong>: Developers using unsafe APIs will now receive explicit warnings encouraging safer practices.</li><li><strong>Markdown Support in JavaDoc (JEP 413)</strong>: Write clearer, formatted documentation using Markdown:</li></ul><p>These updates across libraries and tooling significantly improve developer productivity, security readiness, and ease of development.</p><h3>🎉 Wrapping Up: Java 24 🌟</h3><p>Java 24 may not be dominated by one groundbreaking feature, but it beautifully exemplifies Java’s continual evolution. 🚀 This release enriches our toolkit with smoother language features, enhanced performance, and developer-friendly APIs, truly enhancing day-to-day coding.</p><p>What excites me most is how Java 24 thoughtfully prepares us for the future. 🌐 Projects like Leyden (fast startups), Lilliput (memory efficiency), and Loom (concurrency improvements) offer a glimpse of where Java is headed, paving the way towards Java 25 and beyond.</p><p>Personally, integrating Java 24 features such as refined pattern matching and flexible virtual threads into my projects has already made coding simpler and more enjoyable. 💻 Even if your team sticks to LTS releases, exploring Java 24 positions you ahead of the curve, ensuring future-ready and forward-compatible code.</p><p>In short, Java 24 is a thoughtful, robust update — faster, smarter, and more delightful to use. Whether you’re exploring streamlined concurrency, excited about JVM optimizations, or experimenting with powerful new APIs, Java 24 is a worthy adventure. 🌟</p><p>Happy coding, and here’s to Java’s exciting evolution! 🚀☕</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae815d84f74f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Order to Doorstep: A Low-Level Design Approach for Food Delivery Systems]]></title>
            <link>https://medium.com/@krutarthbhavani786/from-order-to-doorstep-a-low-level-design-approach-for-food-delivery-systems-cf752e0d9e40?source=rss-27548a74ad8c------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf752e0d9e40</guid>
            <category><![CDATA[ubereats]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[food-delivery-app]]></category>
            <category><![CDATA[low-level-design]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Krutarthbhavani]]></dc:creator>
            <pubDate>Thu, 13 Mar 2025 23:41:31 GMT</pubDate>
            <atom:updated>2025-03-13T23:41:31.105Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*MAoysZg7NL7oBAZpGLpEBg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@kaip?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Kai Pilger</a> on <a href="https://unsplash.com/s/photos/delivery?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Food delivery applications allow customers to order food online. People can enjoy different varieties of food at home. They can order from the restaurants they wish for. All the available food delivery apps in the market are providing different types of functionalities for the customers. Some are providing discounts, some are providing free delivery, some are providing scheduled delivery.</p><p>Some of the available products for food delivery are <a href="https://www.doordash.com/en-US">DoorDash</a>, <a href="https://www.ubereats.com/">UberEats</a></p><p>Let’s see the <a href="https://en.wikipedia.org/wiki/Low-level_design">Low-Level Design</a> of Food delivery app</p><h3>Requirements</h3><p>A food delivery system requires the interaction of the restaurants, customers and delivery boys with the admin.</p><ol><li>Restaurants can register themselves.</li><li>Users can create, update, delete, get their profiles.</li><li>User can search for the restaurant using a restaurant name, city name.</li><li>Restaurants can add, update the food menu.</li><li>User can see the food menu. User can get the food items based on Meal type or Cuisine type.</li><li>User can add/remove items to/from the cart. User can get all the items of the cart.</li><li>User can place or cancel the order. User can get all the orders ordered by him/her.</li><li>User can apply the coupons. User can get the detailed bill containing tax details.</li><li>User can make a payment using different modes of payment — credit card, wallet, etc.</li><li>Delivery boy can get all the deliveries made by him using his Id.</li><li>User can get the order status anytime. Success, Out for Delivery, Delivered, etc.</li></ol><h3>Services</h3><h3>Restaurant Service</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*y6rXq6ZcfCj8mcdR.png" /><figcaption>Restaurant Service</figcaption></figure><p>All the functionalities related to the restaurants will be handled by the <strong>Restaurant</strong> <strong>Service</strong>. It will interact with <strong>Restaurant</strong> <strong>Data</strong> only. It will render the first page of the application, i.e., the list of all restaurants or the searched restaurants. It will also allow restaurants to register and Admin to manage.</p><blockquote><strong><em>Restaurants</em></strong><em> can register themselves — </em><strong><em>addRestaurant</em></strong></blockquote><blockquote><strong><em>Customers</em></strong><em> can see the list of all the restaurants — </em><strong><em>getAllRestaurants</em></strong></blockquote><blockquote><strong><em>Admin</em></strong><em> can search for the restaurant using Id — </em><strong><em>getRestaurantById</em></strong></blockquote><blockquote><strong><em>Customers</em></strong><em> can search for restaurants using name — </em><strong><em>getRestaurantsByName</em></strong></blockquote><blockquote><strong><em>Customers</em></strong><em> can search for restaurants using city — </em><strong><em>getRestaurantsByCity</em></strong></blockquote><h3>User Service</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*uEtpdTYgxVnPvcKM.png" /><figcaption>User Service</figcaption></figure><p>User profile related features will be provided by <strong>User Service</strong>. It will interact with <strong>User Data</strong> only. It will allow Customers and Delivery boys to register and update their profiles.</p><blockquote><strong><em>Users</em></strong><em> can register themselves — </em><strong><em>addUser</em></strong></blockquote><blockquote><strong><em>Users</em></strong><em> can delete their profiles — </em><strong><em>deleteUser</em></strong></blockquote><blockquote><strong><em>Users</em></strong><em> can update their profiles — </em><strong><em>updateUser</em></strong></blockquote><blockquote><strong><em>Users</em></strong><em> can get info of their profiles — </em><strong><em>getUser</em></strong></blockquote><h3>Food Menu Service</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*S_0Zi0UmAyS9IG-k.png" /><figcaption>Food Menu Service</figcaption></figure><p>Once the customer selected the restaurant, the second page of the application, i.e., the food menu will be rendered by the <strong>Food Menu Service</strong>. It will also allow customers to search for the items on the menu basis on some category. It will interact with <strong>Food Menu Data</strong> only.</p><blockquote><strong><em>Restaurants</em></strong><em> can add the food menu — </em><strong><em>addMenuByRestaurantId</em></strong></blockquote><blockquote><strong><em>Admin</em></strong><em> can search for the food menu using Id — </em><strong><em>getMenuById</em></strong></blockquote><blockquote><strong><em>Customers</em></strong><em> can see the menu — </em><strong><em>getMenuByRestaurantId</em></strong></blockquote><blockquote><strong><em>Admin</em></strong><em> can add more items in the menu — </em><strong><em>addMenuItemsByMenuId</em></strong></blockquote><blockquote><strong><em>Restaurants</em></strong><em> can add more items — </em><strong><em>addMenuItemsByRestaurantId</em></strong></blockquote><blockquote><strong><em>Customers</em></strong><em> can search for the items using cuisine type — </em><strong><em>getMenuItemsByRestaurantIdAndCuisine</em></strong></blockquote><blockquote><strong><em>Customers</em></strong><em> can search for the items using meal type — </em><strong><em>getMenuItemsByRestaurantIdAndMealType</em></strong></blockquote><blockquote><strong><em>Admin</em></strong><em> can search for the item using Id — </em><strong><em>getMenuItemById</em></strong></blockquote><h3>Cart Service</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*ljmaHTeOlyOOm7wZ.png" /><figcaption>Cart Service</figcaption></figure><p>C<strong>art Service</strong> will allow Customers to add or remove the items in or from the cart. It will render the third page of the application, i.e., items in the cart. It will interact with the <strong>Cart Data</strong> and will also call the <strong>Food Menu Service</strong> to get the items using Id. We can use the <strong>Command Pattern</strong> to handle the add or remove commands.</p><blockquote><strong><em>Customers</em></strong><em> can add/remove items — </em><strong><em>updateCart</em></strong></blockquote><blockquote><strong><em>Customers</em></strong><em> can empty the cart — </em><strong><em>clearCart</em></strong></blockquote><blockquote><strong><em>Customers</em></strong><em> can see the cart items — </em><strong><em>getAllItemsOfCart</em></strong></blockquote><h3>Pricing Service</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*H-0XHJa7LxMqiHXt.png" /><figcaption>Pricing Service</figcaption></figure><p>On the cart page, <strong>Pricing Service</strong> will allow Customers to see the bill details. It will call the <strong>Cart Service</strong> to get all the items of the cart to render the bill. We can use a <strong>Strategy Pattern</strong> and have different types of strategies — TwentyPercentOff, FiveHundredOff, etc.</p><blockquote><strong><em>Customers</em></strong><em> can see the bill details — </em><strong><em>getBill</em></strong></blockquote><h3>Order Service</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*sqU0XUS6XIZz3rlW.png" /><figcaption>Order Service</figcaption></figure><p>Customers can place or cancel the order, once the cart is finalized, using <strong>Order Service</strong>. It will interact with <strong>Order Data</strong> only. It will allow customers to see the <strong>order history</strong> also. Customers can select the history based on the restaurant also. We can use the <strong>Command Pattern</strong> to handle place or cancel commands.</p><blockquote><strong><em>Customers</em></strong><em> can place or cancel orders — </em><strong><em>updateOrder</em></strong></blockquote><blockquote><strong><em>Admin</em></strong><em> can search for the order — </em><strong><em>getOrderById</em></strong></blockquote><blockquote><strong><em>Customers</em></strong><em> can see their order history for a restaurant — </em><strong><em>getAllOrdersByRestautantId</em></strong></blockquote><blockquote><strong><em>Customers</em></strong><em> can see their all order history — </em><strong><em>getAllOrders</em></strong></blockquote><h3><strong>Payment Service</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*kxoFKtJqqwcDv80i.png" /><figcaption>Payment Service</figcaption></figure><p>Payments can be made to the restaurants using <strong>Payment Service</strong>. It will interact with the<strong> Payment Data</strong> and also call the <strong>Pricing Service</strong> to validate the payment made &amp; the <strong>Order Service</strong> to update the order status. It will allow Customers to add the Payment against their order.</p><blockquote><strong><em>Customers</em></strong><em> can pay for their orders — </em><strong><em>addPayment</em></strong></blockquote><blockquote><strong><em>Admin</em></strong><em> can search for the payment using Id — </em><strong><em>getPaymentById</em></strong></blockquote><blockquote><strong><em>Customers</em></strong><em> can see the payment made — </em><strong><em>getPaymentByOrderId</em></strong></blockquote><blockquote><strong><em>Payment</em></strong><em> must match the bill — </em><strong><em>validatePayment</em></strong></blockquote><h3><strong>Delivery Service</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*33T8UedC6i85Us_M.png" /><figcaption>Delivery Service</figcaption></figure><p>D<strong>elivery Service</strong> will deal with all the functionalities related to the order delivery. It will interact with the <strong>Delivery Data</strong> and also call the <strong>Order Service</strong> to get the order to be delivered.</p><blockquote><strong><em>Admin/Restaurants</em></strong><em> can add delivery — </em><strong><em>addDelivery</em></strong></blockquote><blockquote><strong><em>Admin</em></strong><em> can get the delivery by Id — </em><strong><em>getDeliveryById</em></strong></blockquote><blockquote><strong><em>Delivery boy</em></strong><em> can see all the deliveries made — </em><strong><em>getDeliveriesByDeliveryBoyId</em></strong></blockquote><blockquote><strong><em>Customers</em></strong><em> can track the order status — </em><strong><em>getOrderStatus</em></strong></blockquote><h3>Model Classes</h3><h3>Restaurant</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/0*wMXp7EAU4jg71t8W.png" /><figcaption>Restaurant Model</figcaption></figure><p>To identify the restaurant, we require the following attributes-</p><ul><li>Restaurant id — <em>unique for each </em>restaurant</li><li>Restaurant name</li><li>Address</li></ul><blockquote><em>We can also add Review, Rating, Open-close timings.</em></blockquote><h3>Address</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/0*MSRORjjuxLNgLs1W.png" /><figcaption>Address Model</figcaption></figure><ul><li>Address id — <em>unique for each</em></li><li>Address</li><li>City</li><li>Zipcode</li><li>Location — can contain google maps link or longitude and latitude values.</li></ul><blockquote><em>There is </em><strong><em>One-to-Many</em></strong><em> mapping from </em><strong><em>Address to Restaurant. </em></strong><em>For eg- restaurants in a mall.</em></blockquote><h3>User</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/0*pFKLoXYlp3HPvUga.png" /><figcaption>User Model</figcaption></figure><ul><li>User id — <em>unique for each</em></li><li>User name</li><li>Phone no</li><li>Address</li></ul><blockquote><em>We can also add First name, Last name, Gender, Bio and some more details related to the user.</em></blockquote><h3>Food Menu</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/0*mxG3aYkjwOxgC9C8.png" /><figcaption>Food Menu Model</figcaption></figure><ul><li>Food menu id — <em>unique for each</em></li><li>Restaurants ids — <em>multiple</em></li><li>Menu Items — <em>multiple</em></li></ul><blockquote><strong><em>One-to-Many</em></strong><em> mapping from </em><strong><em>FoodMenu to Restaurant</em></strong><em>. For eg- Restaurant having franchises in multiple cities.</em></blockquote><h3>Menu Item</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/0*HKa3gQuaaP3xt6kY.png" /><figcaption>Menu Item Model</figcaption></figure><ul><li>Menu Id — <em>unique for each</em></li><li>Name of Item</li><li>Cuisine Type</li><li>Meal Type</li><li>Price</li></ul><blockquote><em>We can also add Rating, Review of items, Number of times ordered a particular item.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/0*2_6S1IFVHQYCEoRj.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/332/0*b1YRO0o0rjlG7oqN.png" /><figcaption>Cuisine Type</figcaption></figure><h3>Order</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/0*wKQYTCBVCaBpqvm8.png" /><figcaption>Order Model</figcaption></figure><ul><li>Order id — <em>unique for each order</em></li><li>User id — <em>who orders</em></li><li>Restaurant id — <em>orders from</em></li><li>Menu Items to be ordered</li><li>Status of Order</li></ul><h3>Bill</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/0*AT1hQ8MJ4BKpELN2.png" /><figcaption>Bill Model</figcaption></figure><ul><li>Bill Id — <em>unique for each bill</em></li><li>Total Cost of the Bill</li><li>Discount applied</li><li>Total tax</li><li>Amount to be paid</li></ul><blockquote><em>We can also add tax bifurcation — CGST, SGST for India. Discount bifurcation — card discount, coupon discount.</em></blockquote><h3>Payment</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/0*LwARWlmoU_8vI_Hz.png" /><figcaption>Payment Model</figcaption></figure><ul><li>Payment Id — <em>unique for each</em></li><li>Order Id — <em>for order details</em></li><li>Amount Paid by user</li><li>Coupon code applied</li><li>Status of Payment</li></ul><h3>Delivery</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/0*s3qFnFQpade8iaIc.png" /><figcaption>Delivery Model</figcaption></figure><ul><li>Delivery Id — <em>unique for each</em></li><li>Delivery boy Id — <em>User model</em></li><li>User Id — <em>for address details</em></li><li>Order Id — <em>for order details</em></li><li>Delivery Time — <em>for a status update</em></li></ul><blockquote><em>We can also add feedback, ratings for the delivery.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/372/0*RGtN1DJ6usHdfyaX.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/0*uT5zK8jnTx-5uQfl.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/374/0*G2M7l3XjE4vPs2SJ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/358/0*NWrhkbZ99qsG9XE9.png" /><figcaption>Order Status, Payment Status, Payment Type and Coupon Code</figcaption></figure><h3>Conclusion</h3><p>Always think of the requirements as</p><blockquote><strong>Customer Point of View</strong></blockquote><p>Almost every one of us has used some food delivery app at least once. So it is easy for us to relate things in that perspective only. Another point that needs to be considered is</p><blockquote><em>Always follow the </em><a href="https://en.wikipedia.org/wiki/SOLID"><em>SOLID</em></a><em> Design Principle</em></blockquote><p>Hope you all enjoyed reading it. Thanks for reading folks.!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf752e0d9e40" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Plant Disease Detection Using Convolutional Neural Networks with PyTorch]]></title>
            <link>https://medium.com/@krutarthbhavani786/plant-disease-detection-using-convolutional-neural-networks-with-pytorch-484c90ec3144?source=rss-27548a74ad8c------2</link>
            <guid isPermaLink="false">https://medium.com/p/484c90ec3144</guid>
            <category><![CDATA[plant-disease-detection]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[ai-in-agriculture]]></category>
            <category><![CDATA[pytorch]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Krutarthbhavani]]></dc:creator>
            <pubDate>Tue, 31 May 2022 04:08:42 GMT</pubDate>
            <atom:updated>2022-05-31T04:08:42.324Z</atom:updated>
            <content:encoded><![CDATA[<p>Machine learning, Deep learning, and Artificial intelligence are the Future. We use these technologies in almost every field. In the Farming sector, we can also use this technology for the Preparation of soil, adding fertilizers, sowing of seed, Irrigation, weed protection, harvesting, disease prediction, etc.</p><p>Read Full Blog <a href="https://www.analyticsvidhya.com/blog/2020/11/artificial-intelligence-in-agriculture-using-modern-day-ai-to-solve-traditional-farming-problems/#:~:text=Precision%20Farming%20and%20Predictive%20Analytics,be%20grown%2C%20optimum%20planting%2C%20pest"><strong>AI In Agriculture</strong></a><strong>.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J3POJlFsCHZJD_5tpWvyIA.jpeg" /><figcaption>Credits: Unsplash</figcaption></figure><blockquote><strong><em>Overview :</em></strong></blockquote><p>We are using Deep Learning for Plant disease detection based on images of a leaf of a plant. We are using deep learning for this task because here we are working with image data. Deep learning has a Convolution neural network that is used to find features from the leaf of the plant.</p><blockquote><strong><em>Prerequisites :</em></strong></blockquote><p>PyTorch</p><p>Convolutional Neural Networks</p><p><strong>Learn PyTorch from Here :</strong></p><p>(1) Aladdin Person Youtube Playlist</p><p>(2) <a href="https://www.youtube.com/watch?v=EMXfZB8FVUA&amp;list=PLqnslRFeH2UrcDBWF5mfPGpqQDSta6VK4">Python Engineer Youtube Playlist</a></p><p><strong>Learn CNN From Here :</strong></p><p>(1) <a href="https://www.youtube.com/watch?v=YRhxdVk_sIs">Convolutional Neural Networks (CNNs) explained by Deeplizard</a></p><p>(2) <a href="https://www.youtube.com/watch?v=zfiSAzpy9NM">Simple Explanation Of Convolutional Neural Network by CodeBasics</a></p><blockquote><strong><em>Dataset :</em></strong></blockquote><p>In this data-set, 39 different classes of plant leaf and background images are available. The data-set containing 61,486 images. We used six different augmentation techniques for increasing the data-set size. The techniques are image flipping, Gamma correction, noise injection, PCA color augmentation, rotation, and Scaling.</p><p>There is a total of 39 Classes that we have to predict using the CNN Model.</p><p><a href="https://data.mendeley.com/datasets/tywbtsjrjv/1"><strong>Download the Dataset.</strong></a><strong> </strong>( <em>Plant Village Dataset</em> )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hz0yGI-jhQRewUGFcO3rMw.png" /><figcaption>credits: <a href="https://www.crowdai.org/challenges/1">https://www.crowdai.org/challenges/1</a></figcaption></figure><blockquote><strong><em>Code Implementation :</em></strong></blockquote><p><strong>Import Dependencies:</strong></p><pre># General<br>import numpy as np<br>import pandas as pd<br>import matplotlib.pyplot as plt# Torch<br>import torch<br>from torchvision import datasets, transforms # datsets  , transforms<br>from torch.utils.data.sampler import SubsetRandomSampler<br>import torch.nn as nn<br>import torch.nn.functional as F<br>from datetime import datetime</pre><p>Transforms are used for Data Augmentation like cropping the image, resize the image, convert the image to tensor, rotate the image, and many more. Transforms work as a filter for all images. We are using the following code to transform the images.</p><pre>transform = transforms.Compose(<br>    [transforms.Resize(255), transforms.CenterCrop(224), transforms.ToTensor()]<br>)</pre><p>datasets class is used to create or import datasets. In datasets, it has many famous datasets like MNIST, CIFAR-10, CIFAR-100, KMNIST, etc.</p><p>Check out all dataset lists <a href="https://pytorch.org/vision/stable/datasets.html">here</a>.</p><p>We use the dataset for making our own dataset from images and for that we are using the ImageFolder method from datasets.</p><p>The folder where I stored all images is named as ‘Dataset’. We also apply our transform to all images.</p><pre>dataset = datasets.ImageFolder(&quot;Dataset&quot;, transform=transform)</pre><p><strong>Train Test Split :</strong></p><pre>indices = list(range(len(dataset)))split = int(np.floor(0.85 * len(dataset)))  # train_sizevalidation = int(np.floor(0.70 * split))  # validationnp.random.shuffle(indices)train_indices, validation_indices, test_indices = (<br>    indices[:validation],<br>    indices[validation:split],<br>    indices[split:],<br>)</pre><p>Here in the above code we first getting indices and then split the data into train , test and validation data. Total 36584 for train , 15679 for validaiton and remaining images for testing.</p><pre>train_sampler = SubsetRandomSampler(train_indices)<br>validation_sampler = SubsetRandomSampler(validation_indices)<br>test_sampler = SubsetRandomSampler(test_indices)</pre><p>SubsetRandomSampler is used to sample our data. Here we are creating an object of SubsetRandomSampler Object and later we will use this sampler in train data loader and test data loader.</p><pre>batch_size = 64train_loader = torch.utils.data.DataLoader(<br>    dataset, batch_size=batch_size, sampler=train_sampler<br>)test_loader = torch.utils.data.DataLoader(<br>    dataset, batch_size=batch_size, sampler=test_sampler<br>)validation_loader = torch.utils.data.DataLoader(<br>    dataset, batch_size=batch_size, sampler=validation_sampler<br>)</pre><p>As we discussed we use train_sampler for train-loader and vice-versa.</p><p>Now our dataset is ready for training and testing…!!</p><p><strong>Model Creation :</strong></p><p>We use a convolutional neural network for model creation. We create model layers as mentioned below the image. We also specified filter size for the Conv layer and Pool layer and the shape on each layer.</p><p>shape = ( channels , height , width )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/0*boqqg1gsCw7RgGPh.jpeg" /></figure><p>In PyTorch shape is not automatically calculated we manually have to take care of shape on each layer. At the First Fully connected layer we have to mention output size as per the shape of the convolutional layer. This calculation is also called <strong>Convolutional Arithmetic.</strong></p><p>Here is Equation for Convolutional Arithmetic:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*-aX-IyxhKKAOoZxj.jpeg" /></figure><p>Here for this project dilation = 0.</p><p>For model code do check out My Github repo <a href="https://github.com/manthan89-py/Plant-Disease-Detection">here</a></p><pre>model = CNN(targets_size) # targets_size = 39</pre><p>Here we have to classify the images into 39 Categories so that’s why we used <strong>categorical cross-entropy</strong> as loss and adam optimizer. In the Model, we are using ReLU as activation but for the last layer, we have to use <strong>Softmax</strong> activation. In PyTorch, we have a cross-entropy loss which is a mixture of softmax and category cross-entropy loss.</p><pre>criterion = nn.CrossEntropyLoss()  <br>optimizer = torch.optim.Adam(model.parameters())</pre><p><strong>Batch Gradient Descent:</strong></p><pre>def batch_gd(model, criterion, train_loader, test_laoder, epochs):<br>    train_losses = np.zeros(epochs)<br>    test_losses = np.zeros(epochs)for e in range(epochs):<br>        t0 = datetime.now()<br>        train_loss = []<br>        for inputs, targets in train_loader:<br>            inputs, targets = inputs.to(device), targets.to(device)optimizer.zero_grad()output = model(inputs)loss = criterion(output, targets)train_loss.append(loss.item())  # torch to numpy worldloss.backward()<br>            optimizer.step()train_loss = np.mean(train_loss)validation_loss = []for inputs, targets in validation_loader:inputs, targets = inputs.to(device), targets.to(device)output = model(inputs)loss = criterion(output, targets)validation_loss.append(loss.item())  # torch to numpy worldvalidation_loss = np.mean(validation_loss)train_losses[e] = train_loss<br>        validation_losses[e] = validation_lossdt = datetime.now() - t0print(<br>            f&quot;Epoch : {e+1}/{epochs} Train_loss:{train_loss:.3f} Test_loss:{validation_loss:.3f} Duration:{dt}&quot;<br>        )return train_losses, validation_losses</pre><p>As you can see above function is used for Batch Gradient Descent. batch_gd() is the function where all the learning happened.</p><pre>def accuracy(loader):<br>    n_correct = 0<br>    n_total = 0for inputs, targets in loader:<br>        inputs, targets = inputs.to(device), targets.to(device)outputs = model(inputs)_, predictions = torch.max(outputs, 1)n_correct += (predictions == targets).sum().item()<br>        n_total += targets.shape[0]acc = n_correct / n_total<br>    return acctrain_acc = accuracy(train_loader)<br>test_acc = accuracy(test_loader)<br>validation_acc = accuracy(validation_loader)</pre><p>The above function is used for finding the accuracy of the model. It is very simple to understand code. You can check the full code at My <a href="https://github.com/manthan89-py/Plant-Disease-Detection">Github</a>.</p><p>By Using this Current Model we are getting accuracy</p><p><strong>87 % </strong>on Train data, <strong>84</strong> <strong>%</strong> On Validation data and <strong>83</strong>% on Test data.</p><p>For this practical we use test data as completely new data. We were not used test data on any phase it was made only for final testing.</p><blockquote><strong><em>Working of Model :</em></strong></blockquote><p>If you know the working of CNN then You get my point about what I do in this project. This section is for those who don’t understand. Basically, First we Resize every image into 224 x 224. After that this image feed into the Convolutional Neural Network. We feed color image so it has 3 channels RGB. First conv layer we apply 32 filter size or output channels. That means 32 different filters apply to the images and try to find features and after that using 32 features, we create a features map that has channels 32. So from 3 x 224 x 224 it will become 32 x 222 x 222. After that we are applying <strong>ReLU</strong> activation function to remove non linearity and after that we are applying <strong>Batch Normalization</strong> to normalize the weights of the neuron. After that this image we feed to the max pool layer which takes only the most relevant features only so that why we get the output image in shape 32 x 112 x 112. After that, we feed this image to the next <strong>convolutional layer </strong>and its process is the same as mentioned above. At last, we flatten the final max pool layer output and feed to the next linear layer which is also called a<strong> fully connected layer</strong>, and finally, as a final layer, we predict 39 categories. So as a model output we get tensor 1x39 size. And from that tensor, we take an index of the maximum value in the tensor. That particular index is our main prediction. That’s how everything works…!!</p><p>Hope you will understand…👍🏻😊</p><blockquote><strong><em>Flask Web App :</em></strong></blockquote><p>After Creating this Model We create on web application on flask and deployed it on heroku cloud sever.</p><blockquote><strong><em>Conclusion :</em></strong></blockquote><p>This model is working great without Transfer learning. But I will use transfer learning and many other methods to improve the accuracy of the model.</p><p>I hope you enjoyed this project 🙏.</p><blockquote><strong><em>More Projects and Blogs :</em></strong></blockquote><ul><li><a href="https://www.krutarthbhavani.com/portfolio">Krutarth Bhavani | Charusat University</a></li><li><a href="https://medium.com/@krutarthbhavani786">Krutarthbhavani - Medium</a></li></ul><blockquote><strong><em>Final Note :</em></strong></blockquote><p><strong>Thanks for reading! If you enjoyed this article, please hit the clap </strong>👏<strong>button as many times as you can. It would mean a lot and encourage me to keep sharing my knowledge. If you like my content follow me on medium I will try to post as many blogs as I can.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=484c90ec3144" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[COVID 19 Detection From Speech Using Deep Learning]]></title>
            <link>https://medium.com/@krutarthbhavani786/covid-19-detection-from-speech-using-deep-learning-3ce5102a28e9?source=rss-27548a74ad8c------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ce5102a28e9</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[covid19]]></category>
            <category><![CDATA[covid-19-detection]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Krutarthbhavani]]></dc:creator>
            <pubDate>Sat, 28 May 2022 08:34:29 GMT</pubDate>
            <atom:updated>2022-05-28T08:34:29.264Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*YJ7NLtE09349XdtozfxKCw.jpeg" /><figcaption>Credits: <a href="https://www.rd.com/article/monday-motivation-quotes/">https://www.rd.com/article/monday-motivation-quotes/</a></figcaption></figure><blockquote><strong><em>Overview:</em></strong></blockquote><p>You know how COVID 19 is dangerous and detection of covid is very critical if you have symptoms of COVID 19 it doesn’t mean that you have COVID 19. First, you have to do an RT PCR test. There are also some university and organization which is providing COVID 19 patient data to researchers. Many Data Scientists work on this problem. You can also find COVID 19 from Chest X-Ray but for final surety give priority to RT CPR or other valid tests of COVID 19.</p><p>IISC Banglore is working on a project called Coswara ( The word is an amalgamation of <strong>Co (from corona)</strong> and <strong>Swara (sound in Sanskrit) </strong>)</p><p>Do check out Full information about <a href="https://coswara.iisc.ac.in/?locale=en-US"><strong>Coswara</strong></a><strong>.</strong></p><p>Under this Project, they are providing the <strong>Speech Data of COVID 19 Patients</strong> for research. Do check out Cosware Github <a href="https://github.com/iiscleap/Coswara-Data"><strong><em>here…</em></strong></a></p><blockquote><strong><em>About Dataset:</em></strong></blockquote><p>The dataset contains approximately 422 Patients data. Each patient must have a total of 9 Audio files and 1 metadata.json file which will give information about the COVID Status of that Particular Patient.</p><h3>Audio Files Information:</h3><p>(1) breathing-deep: Deep breathing voice file of the patient.</p><p>(2) breathing-shallow: Shallow breathing voice file of the patient.</p><p>(3) cough-heavy: Heavy cough voice file of the patient.</p><p>(4) cough-shallow: Shallow cough voice file of the patient.</p><p>(5) count-fast: Count 1 to 20 fast</p><p>(6) count-slow: Count 1 to 20 slow</p><p>(7) vowel-a: The voice file of the patient speaking vowel ‘a’.</p><p>(8) vowel-e: The voice file of the patient speaking vowel ‘e’.</p><p>(9) vowel-o: The voice file of the patient speaking vowel ‘o’.</p><h3>JSON File Information:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*ap-ry0lJJXQc2owvzCFnrQ.png" /></figure><h3>Classes Information:</h3><p>Here we have total of 7classes.</p><p><strong><em>(1) healthy<br>(2) no_resp_illness_exposed:<br>(3) positive_asymp:<br>(4) positive_mild:<br>(5) positive_moderate:<br>(6) recovered_full:<br>(7) resp_illness_not_identified:</em></strong></p><blockquote><strong><em>Coding Strategies:</em></strong></blockquote><p>I have tried 4 strategies for COVID 19 Status Classification.</p><h4>(1) Basic Audio Features Extraction:</h4><p>In this Strategy, I tried Basic Audio Features Extraction like RMSE, Chroma STFT, Spectral Centroid, Spectral Bandwidth, Spectral Rolloff, Zero Crossing Rate.</p><p><a href="https://www.kdnuggets.com/2020/02/audio-data-analysis-deep-learning-python-part-1.html">Information About Audio Features Extraction</a></p><p><a href="https://towardsdatascience.com/extract-features-of-music-75a3f9bc265d">Music Feature Extraction Medium</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MEhO4g6Qd3mPJ6wWvMpOuQ.png" /><figcaption>Feature Extracted</figcaption></figure><p>After making this data frame I reshape the data into 422 x 7 x 9. After this, I make one Deep Learning model which classifies into 7 classes.</p><p><strong>Train Accuracy:</strong> 65.88 %</p><p><strong>Test Accuracy:</strong> 70.59 %</p><h3>(2) MFCCs Feature Extraction:</h3><p>In this Strategy, I tried Basic MFCCs Feature Extraction. I extract 20 MFCCs Coefficient. In this Strategy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*WOUtgkb6HvmDYEy__b-S7A.png" /><figcaption>20 MFCCs Coefficients</figcaption></figure><p>After that, I reshape the data into 422 x 9 x 21. Then I made another Deep learning model which classifies into 7 classes.</p><p><strong>Train Accuracy:</strong> 66.77 %</p><p><strong>Test Accuracy:</strong> 71.76 %</p><h3>(3) Simple Features and MFCCs Feature Extraction:</h3><p>In this Strategy, I combined both the above strategies. So now we have a total of 6 Simple Features and 20 MFCCs Coefficients.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*gyKpqvLiElkJ7yBStvDT1g.png" /><figcaption>6 Simple + 20 MFCCs Features</figcaption></figure><p>After that, I reshape my data into 422 x 9 x 27. Then I made another Deep Learning model which classifies into 7 categories.</p><p><strong>Train Accuracy:</strong> 66.77 %</p><p><strong>Test Accuracy:</strong> 69.41 %</p><h3>(4) MFCCs Features Extraction and CNN:</h3><p>In this Strategy, I have tried to extract MFCCs features and then save them into JSON File and then I applied the Convolution Neural Network model.</p><p><strong>Train Accuracy:</strong> 72.50 %</p><p><strong>Test Accuracy:</strong> 73.77 %</p><blockquote><strong><em>Research Paper:</em></strong></blockquote><p>Do check out the <strong>Official Research Paper Launched by IISC.</strong></p><p>The link is <a href="https://arxiv.org/pdf/2005.10548.pdf"><strong>here…</strong></a></p><blockquote><strong><em>Conclusion:</em></strong></blockquote><p>I hope now you have an idea about how a thing works.</p><p>Try it by Yourself…!!</p><p>If you have new strategies share them with us through comments/responses.</p><p><strong>Thanks for reading! If you enjoyed this article, please hit the clap </strong>👏<strong>button as many times as you can. It would mean a lot and encourage me to keep sharing my knowledge. If you like my content follow me on medium I will try to post as many blogs as I can.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ce5102a28e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jamske : Food Ordering Application in Node JS]]></title>
            <link>https://medium.com/@krutarthbhavani786/jamske-food-ordering-application-in-node-js-93659a2ba584?source=rss-27548a74ad8c------2</link>
            <guid isPermaLink="false">https://medium.com/p/93659a2ba584</guid>
            <category><![CDATA[mern-stack]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Krutarthbhavani]]></dc:creator>
            <pubDate>Sat, 28 May 2022 07:57:56 GMT</pubDate>
            <atom:updated>2022-05-28T07:57:56.003Z</atom:updated>
            <content:encoded><![CDATA[<h3>Jamske : Food Ordering Application in Node JS</h3><h3><strong>| OVERVIEW:</strong></h3><p>Jamske Application is both android and iOS-based application developed in Node JS as a backend and used flutter as a role of frontend. Moreover, this application has already been developed in LOS Angeles as a name of Delpick which is running at a high pace by having huge number of customers, but due to some high requirement of customer this application is now been changed to Jamske with lots of upgraded feature.</p><p>To commence with, this application comprises of four panel namely consumer, vendor, driver, and admin. Among this, in the vendor panel, the particular person has to enter their login credential for the verification purposes which is held by the admin of the application. Moving on to the next page the vendor can display their food items which he want to sell and also he can put the discount price which will be calculated at time of total amount disclosing the bill.</p><p>Apart from this, consumer can also search for the different types of restaurants on the basis of the highly rated and good feedback. Furthermore, consumer can see all the details of their order and can also chat with the vendor and driver of the particular order. Apart from this, consumer can order their food items at any day at any time which he want. Next the driver has the ability to see the latitude and longitude of the consumer so that he can reach out to him as fast as possible.</p><p>Additionally, vendor can also put their address in his profile page with the help of Google Maps so that it will be easy for the consumer to search according to the nearest place from his residence. Lastly, we have also take care of the integrity of the product by scanning the QR code on the packet which will be scanned by the authorised driver.</p><h3>| INTRODUCTION:</h3><p>✔ The “Jamske” is Product Ordering Application has been created to supersede the issues winning in the rehearsing manual framework. This application is upheld to dispose of and sometimes decrease the difficulties looked at by this current framework. Also, this application is intended for the specific need of the organisation to complete activities smoothly and powerfully.</p><p>✔ The application is decreased however much as could be expected to stay away from blunders while entering the information It additionally gives mistake messages while entering invalid information. No conventional information is required for the client to utilise this framework. </p><p>✔ Subsequently, this, demonstrates it is easy to understand Online Food Ordering System, as portrayed above, can prompt blunder free, secure, solid, and quick administration framework. It can help the client to focus on their different exercises rather than focus on the record-keeping. Consequently, it will help the association in better use of assets. </p><p>✔ Each association, whether huge or little, has difficulties surviving and dealing with the data of Category, Food Item, Order, Payment, Confirm Order, Every Online Food Ordering System has different Food thing needs, in this manner we plan selective worker the board frameworks that are adjusted to your administrative necessities. </p><p>✔ This is intended to aid vital preparation and will assist you with guaranteeing that your association is furnished with the right degree of data and subtleties for your future objectives.</p><h3>| Hardware and Software Requirement:</h3><p>➡ <strong><em>Hardware Requirement</em></strong></p><p>Any hardware device which supports Android platform as well as IOS and machine to run the required servers. An Android Smartphone with API level 21 or above and an active internet connection is required. </p><p>Minimum 50MB storage and 512MB RAM required to run the application.</p><p>For development :</p><p>● RAM 4 GB minimum and 8GB recommended</p><p>● 2 GB of available disk space minimum, 4 GB Recommended (500 MB for IDE + 1.5 GB for Android SDK and emulator image)</p><p>➡ <strong><em>Software Requirement</em></strong></p><p>● JDK 1.8 or higher </p><p>● Microsoft Visual Studio Code </p><p>● Postman Collection </p><p>● Technology used Flutter, Node JS </p><p>● Mongoose Database </p><p>● AWS server </p><p>● Figma</p><h3>| System Analysis :</h3><p>➡ <strong><em>Study of Existing System</em></strong></p><p>Basically, before deciding the flow of the application, we have seen some of the applications which were based on the food ordering system. Some of them which are very famous in India are Zomato, Swiggy, Dominos and Country Delight. We observed these application’s flow and chart of the process. And then we listened to some requirements which were given by the Client.</p><p>➡ <strong><em>Limitation of Existing Solution</em></strong></p><p>There are some limitations on those projects which Jamske covers in this application. Those limitations are covered in the forth-coming paragraphs.</p><p>Delivery is one of the most important limitations which was not covered in Zomato, Swiggy. In the existing system, only instant delivery options are available. Like a customer wants food, then he or she orders the food and they will get food within the maximum of one hour. There are some brands who deliver almost every day in the morning. Country Delight is the best instance of it as it gives delivery of milk, milk products everyday in the morning only. No one can combine the delivery schedule. That’s the work that Jamske does. It provides instant delivery and delivery on schedule option. So, customers free-fully order anytime and from anywhere within the radius of vendors. </p><p>Another aspect that cannot be ignored is the bag management. In the already available system, the administrator does not provide bags to vendors for packing purposes. Vendors have to buy their own bag and then they have to seal it in this bag. This obstacle is neglected in Jamske Application as Jamske admins provide bags to every vendor and vendors have to seal the order in these bags. This type of publicity can gain more heights and it will reach the popularity among all kinds of people.</p><p>Furthermore, in every bag Jamske printed QR code and one manual code. So, if the delivery person opens the bag, he or she will catch it. Customer has to scan this code or manually type the code at the time of delivery collection. </p><p>Last but not least in the bucket-list are the target products. Jamske system offers multiple categories wise products such as Restaurants, Flower stores, coffee shops, Sunglasses stores, Lotto, Grocery and liquor stores. So, its management from the backend side is changed according to the Store Categories. For example, if a consumer has to order some food, then order processing, order preparing modules are there in the vendor panel. But these modules are not available in the Flower Stores. Instead of these options, in flower shops, stock management options have to be put.</p><h3>| System Workflow:</h3><p>➡ <strong><em>Vendor Panel</em></strong></p><p>Describing the vendor panel which includes a login page, an attractive dashboard, a scalable menu, and lastly imputable profile features. Now taking deep dive into the login page which consists of two pages i.e., one is the registration page and the other is the sign-in page. One can easily sign in to the application with the help of a mobile number and a password. </p><p>Moreover, it has the feature of forgot password functionality from which he/she can change the old password to the newer one. While registering the user the system stores their data in the mongoose database with the help of the token. So, when a particular user again login into the application he/she will be authenticated with the help of this token, as cookies are not used for the authentication purpose because the CSRF attack can be possible, and to mitigate this issue we have used tokens. </p><p>Moreover, whenever the user enters his/her email address in the forgot password field an email is sent attaching one OTP that he/she used to enter on the next page for verification purposes. Now they can enter their profile details like images, bank details, and many more things. One fantastic feature is added from which the vendor can display his shop location, and this is achieved with the help of geolocation by calculating latitude and longitude. Apart from this, all the back details entered in the profile section are encrypted by a private key and then it is stored in the database to enhance the integrity of the data. </p><p>Secondly, the dashboard contains the statistics of the total order of the vendor. It maintains the record of the new order, upcoming order, accepted order, preparing the order, ready order, the order in transit, completed order, and last canceled order. To be more feasible, we have also provided a graphical representation of the sales of the last month, and the total revenue after deducting the taxes is also shown in the graph. Moving to the next page is for displaying the order details which consist of total rupees including taxes, commission, seller tip, and pick-up details of the parcel.</p><p>Thirdly, in the menu section, all the food items are listed, and their availability is also shown on the right-hand side of the item. To assist the impecunious people, the vendor also kept the discount on the selected item which is deducted from the total price of the item. Also, the user can apply the coupon, and based on the maximum discount is calculated. For the ease of the vendor, we have provided a separate section for selecting the category like fruits, vegetables, cheese, cold cuts, and other stuff. Lastly, in the profile section vendor can see his details like name, address, date of birth, bank account details, and many others. To detect the malicious vendor, we have kept the feature, in which the vendor has to upload his License of Restaurant and within 24 hours our admin will verify and authorise the rights to the vendors. For the safety concern, change password functionality is also added to change the password after a certain period so that no one can steal it and access the account</p><p>➡ <strong><em>Consumer Panel</em></strong></p><p>In the Consumer Panel, Mainly there are plethora of functionality available. To Start with, Customers can see all the details of the restaurants according to their distance, ratings, and by the categories of the vendor. For example, if a customer chooses the restaurant in the categories list, he or she will be redirected to the list of the vendors who belong to the restaurant category. </p><p>Secondly, offer also plays an important role in the customer panel. The offer has primarily two types.</p><p>(1) The offer which is given by the Administrator and its functionality is applicable to all types of users.</p><p>(2) The offer which is given by the vendor and it is applicable on the particular vendor shops. What I mean is this, if a customer can choose products from a particular vendor shop, then they show this offer which was introduced by the vendors.</p><p>If we talk about the Address Module in the Jamske, it is the center topic because we managed location with the node geocoder package which is available in the node js library. It is basically a node library for Geocoding as well as Reverse Geocoding and can be utilised in the NodeJs Library. The Customer can save all types of address such as Home, Office and other. So, customers can choose one of these locations and it will be delivered according to that location. </p><p>The Search API is also built by us. We have used aggregation for this as it is quite speedy as compared to regular Find Method. In Mongo, Aggregation operations process the data, read the data and Return computed data. It is mainly used for Mathematical Operations. We can do many math operations using the aggregation method. </p><p>The Jamske offers Google Map functionality to show the location of vendor, driver and Customer. In simple words, it connects all three types of user in terms of location fetching. </p><p>If a customer chooses one of the vendors, it will be redirected to the Product list of particular vendors according to their categories. Let’s take an example, Macdonald’s. In Macdonald, consumers can see all the products of Macdonald according to its categories such as Burger, Pizza, and Wrapper etc. If a customer can select one of the products, then one pop-up will occur and it will ask for the product’s variants and quantity. And these items go in the cart. So, we managed the cart module for ordering the payment. </p><p>The review and rating are also implemented for vendors and products. The reason behind this is that customers can know which product and vendor is best while purchasing something on the Jamske application. In this, One customer can only write one review and rating of vendor and product.</p><p>If we talk about Checkout and Order Api, there are multiple functions. But among them, the shipping method is one of the most crucial methods. There are mainly three types of shipping methods that Jamske offers.</p><ol><li>Self-Pickup: In this method, the user has to go to the vendor location and collect the order but the user has to pay the price. Users also manually enter the time and date of the pickup and according to that all the orders will be ready.</li><li>Delivery By a specific Time/Date: If the user wants to deliver in the next 12 hours then the user has to select these options. These will add extra price for that particular. And this tax will be added by the percentage which will be added in the Jamske Admin Panel.</li><li>Schedule for Later: If the user wants to deliver after 12 hours, then the user has to select this option. In this section of delivery, additional charges will not be taken by the Jamske service. Users can also choose daily, weekly or monthly delivery in this section with no additional charges of fastest delivery.</li></ol><p>Another thing which we believe is absolutely pivotal is the Tax management. As we mentioned above, Jamske service is basically from the USA. So, we have to manage tax according to state and city preferences. For example, in the USA, New York and California State have 12% tax and while on the other side Texas has 6% tax.So, the Jamske administrator has to put these all data in the admin panel. We also manage tips for the driver and vendor in the consumer panel. These are calculated by the percentage of the final amount of order. </p><p>Users can also get promo codes while ordering some items. This promo code is two types.</p><p>(a) Public : in the Public promo code, every user can access and gain a discount.</p><p>(b) Private : in this type of promo code, Jamske provides voucher code to an individual user. This is valid only one time. </p><p>For the payment method, we used Stripe Platform. Stripe is an instalment specialist organisation that entrepreneurs can use to acknowledge many instalment strategies, from Visas to purchase presently, pay later administrations. It charges an expense on every exchange. Stripe works best if you have any desire to acknowledge online installments. The Stripe node package provides appropriate access to the Stripe API from apps written in Server-Side Javascript. </p><p>In this application, Bag management functionality is unique as Jamske administrators provide bags to the vendor and the vendor should package their food in those bags. In the vendor panel, jamske offers all the functionality related to the bags. Like Stock management, Sized wise bags, QR Code printing on bags and request of new bags according to size. </p><p>So, if the delivery boy will go to the vendor location, QR code is available. After reaching the destination of the consumer, the customer has to scan that QR code which was printed on the bag or customer manually put code. The main reason behind doing all this process is that the customer can know if the bag is opened or not in between delivery. </p><p>We also manage Chat functionality to communicate with driver and customer as well as vendor and customer. So, customers can know each and every detail regarding the order. This chat was implemented by Socket Programming. Customers can also give a rating of the driver. And based on the reviews and rating, drivers can gain more orders.</p><p>Profile management option available in Jamske Application. In this customer can edit their profile such as Profile Pic, Name, Email, Phone Number etc. He or she can also add a credit card in the setting-&gt;Add a New Card option. We provide the best security to Jamske users because credit cards are very private things that we cannot share publicly. The track order method is also in the My Order. Users can also see the Past Orders.</p><p>➡ <strong><em>Driver Panel</em></strong></p><p>Drivers can register by themselves by providing Mobile Number, Name, Driving License and Driving Home Location. After registering, he or she has to wait for 24 hours to have his or her account verified by the Jamske Administrator. After the confirmation by the Jamske admin, drivers can login into account. There are many functions available in the driver panel. This will be depicted in the upcoming paragraphs. </p><p>To kick off, all types of orders are shown in the driver panel. To elaborate, New Order Requests, Order Processing, Ready for Delivery, In transit, Delivered Order and Canceled Order are shown with the proper numbers in the driver panel. </p><p>Apart from this, drivers can also get the location of the vendor and consumer, so he or she can get the idea about the path to collect the order and reach the customer’s destination. By doing that, drivers can get to know the location of both and utilise their time and burn less fuel. </p><p>Furthermore, Drivers can also chat with the vendor to get know about order timing and other information. He also chats with the customer, so in terms of emergency situations like Bike Puncture, Bike Repairing , customers know about the status of the Orders. </p><p>Last but not least, there are other functionality also available such as Profile management, Contact Us, Change Password, Bag Scanning options are also available.</p><h3>| Conventional Approach</h3><p>➡ <strong><em>ER Diagram</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JeG5LIlNoOdcK7k46CUyvA.png" /><figcaption>ER Diagram</figcaption></figure><p>➡ <strong><em>Data Flow Diagram</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*U4imEHhE6OFHZE2cDZ6kmA.png" /><figcaption>DFD — 0 level</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EU5QI0sErztqO_OyTvfvbA.png" /><figcaption>DFD — 1 level</figcaption></figure><p>➡ <strong><em>Use Case Diagram</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*82Fa5L9HdfMrU61obguM9w.png" /><figcaption>Use Case Diagram</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CVV0Nvs5VvF0hNrZnG6kyQ.png" /></figure><p>For Screenshots and More Information, Here I Attached Report..</p><p><a href="https://drive.google.com/file/d/1uM1d5HjZtYurJaiZuABpyJFrJ31Q0GPS/view?usp=sharing">Final Report.pdf</a></p><p><strong>Thanks for reading! If you enjoyed this article, please hit the clap </strong>👏<strong>button as many times as you can. It would mean a lot and encourage me to keep sharing my knowledge. If you like my content follow me on medium I will try to post as many blogs as I can.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93659a2ba584" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>