<?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: Kanny Mohamad</title>
    <description>The latest articles on Forem by Kanny Mohamad (@kanny).</description>
    <link>https://forem.com/kanny</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%2F1142477%2F5d883ef0-ecdb-47f6-8257-cd966af09da9.jpeg</url>
      <title>Forem: Kanny Mohamad</title>
      <link>https://forem.com/kanny</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/kanny"/>
    <language>en</language>
    <item>
      <title>KMarket</title>
      <dc:creator>Kanny Mohamad</dc:creator>
      <pubDate>Sun, 04 Aug 2024 17:02:32 +0000</pubDate>
      <link>https://forem.com/kanny/kmarket-1ga8</link>
      <guid>https://forem.com/kanny/kmarket-1ga8</guid>
      <description>&lt;p&gt;Welcome to KMarket, your one-stop destination for a seamless online shopping experience. Whether you are a user looking to browse and purchase items or an admin managing the marketplace, KMarket has got you covered with robust features and an intuitive interface.&lt;/p&gt;

&lt;p&gt;User-Friendly Authentication&lt;/p&gt;

&lt;p&gt;At KMarket, we prioritize security and ease of access. Our platform offers a straightforward login system that allows users to access their accounts effortlessly. If you don’t have an account, creating one is a breeze. Simply sign up with your email and a password, which will be securely hashed to ensure your data remains protected.&lt;/p&gt;

&lt;p&gt;Explore and Select Products&lt;/p&gt;

&lt;p&gt;Once logged in, users are greeted with an array of products displayed with vibrant images, detailed descriptions, and competitive prices. Our user interface is designed to make browsing enjoyable and straightforward. See something you like? Simply select the products you are interested in and add them to your selection.&lt;/p&gt;

&lt;p&gt;Personalized Profile Page&lt;/p&gt;

&lt;p&gt;After selecting your desired products, navigate to your profile page to review your choices. Here, you can view your personal details, including your name, email, and phone number, as well as the images of the products you have selected. The profile page provides a clear and concise summary of your selections, ensuring you have all the information you need before making a purchase.&lt;/p&gt;

&lt;p&gt;Manage Your Selections&lt;/p&gt;

&lt;p&gt;KMarket gives you full control over your selections. If you change your mind about a product, you can easily remove it from your list. This flexibility ensures that you only purchase items you truly want.&lt;/p&gt;

&lt;p&gt;Admin Capabilities&lt;/p&gt;

&lt;p&gt;For users with admin privileges, KMarket offers a comprehensive set of tools to manage the marketplace. Admins can perform full CRUD (Create, Read, Update, Delete) operations on the user table. This means you can add new users, update existing user information, delete users, and view a detailed table of all users.&lt;/p&gt;

&lt;p&gt;Seamless Navigation&lt;/p&gt;

&lt;p&gt;Navigating KMarket is designed to be intuitive and user-friendly. For admins, a convenient back button allows you to return to the home page effortlessly, ensuring you can manage the marketplace without any hassle.&lt;/p&gt;

&lt;p&gt;Technical Overview&lt;/p&gt;

&lt;p&gt;I want to introduce you to my K-Market project. This platform is built with Flask and SQLAlchemy for the backend, featuring many-to-many relationships and models. The frontend uses React Router for client-side routing and Tailwind CSS for styling. It supports full CRUD operations, follows REST conventions, and includes validation and error handling, built with useContext.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here is the structure of my project:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Client Folder: Contains the main components, pages, and useContext.&lt;/li&gt;
&lt;li&gt;Server Folder: Contains the instance (including the database), models (including the tables), config, and seed for seeding the tables with data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Generating a React Application&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To get started, let's spin up our React application using create-react-app:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npx create-react-app client --use-npm&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating the Server Application&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With the environment set up, let's get started on building our Flask application!&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Setting Up the Virtual Environment&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Navigate to the root directory of your project.&lt;br&gt;
Run the following command to create and activate a virtual environment using Pipenv:&lt;br&gt;
&lt;code&gt;pipenv install &amp;amp;&amp;amp; pipenv shell&lt;/code&gt;&lt;br&gt;
$ tree -L 2&lt;br&gt;
$ # the -L argument limits the depth at which we look into the directory structure&lt;br&gt;
.&lt;br&gt;
├── CONTRIBUTING.md&lt;br&gt;
├── LICENSE.md&lt;br&gt;
├── Pipfile&lt;br&gt;
├── README.md&lt;br&gt;
├── client&lt;br&gt;
│   ├── README.md&lt;br&gt;
│   ├── package.json&lt;br&gt;
│   ├── public&lt;br&gt;
│   └── src&lt;br&gt;
└── server&lt;br&gt;
    ├── app.py&lt;br&gt;
    ├── config.py&lt;br&gt;
    ├── models.py&lt;br&gt;
    └── seed.py&lt;br&gt;
Then enter the commands to create the instance and migrations folders and the database app.db file:&lt;br&gt;
&lt;code&gt;flask db init&lt;br&gt;
flask db upgrade head&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Tools that have been used:&lt;br&gt;
react-router-domv6&lt;br&gt;
React Context&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Client side:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Building the Client Side with UseContext to Prevent Prop Drilling&lt;br&gt;
To manage state and prevent prop drilling, we'll use the useContext hook. This allows us to share state across components without having to pass props down through multiple levels.&lt;/p&gt;

&lt;p&gt;Using React Router Dom v6 with Nested Routes&lt;br&gt;
We will use React Router Dom v6 to handle routing in our application. Nested routes can be defined using the children property. To render these nested routes, you need to include the Outlet component in your parent component.&lt;/p&gt;

&lt;p&gt;Using Formik and Yup for Form Validation&lt;br&gt;
To install Formik, run the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install --save formik&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To install Yup, run the following command:&lt;/p&gt;

&lt;p&gt;npm install yup&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Client side:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Run pipenv install to install the dependencies and pipenv shell to enter your virtual environment before running your code.&lt;/p&gt;

&lt;p&gt;pipenv install&lt;br&gt;
pipenv shell&lt;br&gt;
Change into the server directory and configure the FLASK_APP and FLASK_RUN_PORT environment variables:&lt;/p&gt;

&lt;p&gt;cd server&lt;br&gt;
export FLASK_APP=app.py&lt;br&gt;
export FLASK_RUN_PORT=5555&lt;br&gt;
Let's create the database app.db with an empty user table:&lt;/p&gt;

&lt;p&gt;flask db init&lt;br&gt;
flask db migrate -m "Initial migration."&lt;br&gt;
flask db upgrade head&lt;br&gt;
And for delete the db&lt;/p&gt;

&lt;p&gt;rm -rf migrations&lt;/p&gt;

&lt;p&gt;For adding new model we following to perform a migration:&lt;/p&gt;

&lt;p&gt;flask db migrate -m 'add review'&lt;br&gt;
flask db upgrade head&lt;br&gt;
Implement validations and error handling&lt;br&gt;
we can add to the column when we first create a column nullable=False that is mean it can not be no value&lt;/p&gt;

&lt;p&gt;name = db.Column(db.String, nullable=False)&lt;br&gt;
we are going to import validates from sqlalchemy.orm and use validates decorator,&lt;/p&gt;

&lt;p&gt;@validates('email')&lt;br&gt;
def validates_email(self, key, email_input):&lt;br&gt;
    if '@' not in email_input:&lt;br&gt;
        raise ValueError("wrong email format")&lt;br&gt;
    return email_input&lt;br&gt;
we can test that through flask shell&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Werkzeug&lt;/code&gt;&lt;br&gt;
it is WSGi library It includes a number of features that will come in handy as we start to build our first Python web applications:&lt;/p&gt;

&lt;p&gt;An in-browser debugger.&lt;br&gt;
Robust classes for requests and responses.&lt;br&gt;
Routing, auto-generation and management of URLs.&lt;br&gt;
A development server.&lt;br&gt;
A testing framework that does not require a running server.&lt;/p&gt;

&lt;h1&gt;
  
  
  Serializer we import Serializer from SerializerMixin
&lt;/h1&gt;

&lt;p&gt;from sqlalchemy_serializer import SerializerMixin&lt;br&gt;
By using SQLAlchemy-Serializer, programmers can create faster and more efficient programs that can easily share data with others, we can include and not include some key, value pair from json file and also using .to_dict() to make it easier to loop on the data in the table as en example: in model.py&lt;br&gt;
&lt;code&gt;&lt;br&gt;
class Goods(db.Model, SerializerMixin):&lt;br&gt;
    __tablename__ = 'goods'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;in the app.py&lt;/p&gt;

&lt;p&gt;&lt;code&gt;class Goodss(Resource):&lt;br&gt;
    def get(self):&lt;br&gt;
        goods = Goods.query.all()&lt;br&gt;
        goods_list = [good.to_dict() for good in goods]&lt;br&gt;
        return make_response(jsonify(goods_list), 200)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Seeding the database&lt;br&gt;
Here is an example of how to add a user to the database:&lt;/p&gt;

&lt;p&gt;users.append(Admin(name="admin", email="&lt;a href="mailto:admin@gmail.com"&gt;admin@gmail.com&lt;/a&gt;", password="1234"))&lt;br&gt;
db.session.add_all(users)&lt;br&gt;
db.session.commit()&lt;br&gt;
then run&lt;/p&gt;

&lt;p&gt;&lt;code&gt;python seed.py&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One-To-Many Relationships&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A single User can have multiple Login entries. This is indicated by the logins attribute in the User class, which is a list of Login objects associated with the user.&lt;/p&gt;

&lt;p&gt;`class User(db.Model, SerializerMixin):&lt;br&gt;
    &lt;strong&gt;tablename&lt;/strong&gt; = 'users'&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String, nullable=False)
email = db.Column(db.String, unique=True, nullable=False)
_password = db.Column(db.String, nullable=False)
phone_number = db.Column(db.String, nullable=True)
admin = db.Column(db.Boolean, default=False)

logins = relationship('Login', backref='user', lazy=True)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;class Login(db.Model, SerializerMixin):&lt;br&gt;
    &lt;strong&gt;tablename&lt;/strong&gt; = 'logins'&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;id = db.Column(db.Integer, primary_key=True)
email = db.Column(db.String, unique=True, nullable=False)
_password = db.Column(db.String, nullable=False)
user_id = db.Column(db.Integer, db.ForeignKey('users.id'), nullable=False)`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Password:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;import bcrypt in the config and invoke it, and we need to run&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pip install flask-bcrypt&lt;/code&gt;&lt;br&gt;
Session&lt;br&gt;
hold user info for us, allow some information between requests, no need to make query every time&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Secret Key&lt;/strong&gt;&lt;br&gt;
to get the secret ket just run in the terminal&lt;/p&gt;

&lt;p&gt;$ python -c 'import os; print(os.urandom(16))'&lt;br&gt;
then in the config file&lt;/p&gt;

&lt;p&gt;app.secret_key = b'Z\x9e&amp;amp;T\x87\xe5\xc1Q6|\xdaJ\xc7I\x87\xe6'&lt;br&gt;
Tailwindcss&lt;br&gt;
Tailwind CSS&lt;br&gt;
Folder Structure&lt;br&gt;
src/&lt;br&gt;
style.css&lt;br&gt;
public/dist/&lt;br&gt;
style.css&lt;br&gt;
index.html&lt;br&gt;
Setup&lt;br&gt;
npm run build:css&lt;/p&gt;

&lt;p&gt;Step 1: Update package.json&lt;br&gt;
Make sure your package.json includes the following script:&lt;/p&gt;

&lt;p&gt;"scripts": {&lt;br&gt;
  "start": "react-scripts start",&lt;br&gt;
  "build:css": "tailwind build src/style.css -o dist/style.css",&lt;br&gt;
  "test": "react-scripts test",&lt;br&gt;
  "eject": "react-scripts eject"&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;KMarket is more than just an online marketplace; it is a platform designed with the user in mind. From secure authentication to a personalized shopping experience, and powerful admin tools, KMarket ensures that both users and admins have everything they need at their fingertips. Join KMarket today and discover a better way to shop and manage your online marketplace.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>CLI Project</title>
      <dc:creator>Kanny Mohamad</dc:creator>
      <pubDate>Tue, 19 Dec 2023 19:35:25 +0000</pubDate>
      <link>https://forem.com/kanny/cli-project-57j4</link>
      <guid>https://forem.com/kanny/cli-project-57j4</guid>
      <description>&lt;p&gt;Title:  A CLI Project with ORM Integration&lt;br&gt;
Date: Dec 19 2023&lt;br&gt;
Author: Kanny Mohammed&lt;/p&gt;

&lt;p&gt;Introduction:&lt;br&gt;
In the world of software development, efficiency and usability often dictate the success of a project. As a passionate developer, I am thrilled to share my latest project: a Command Line Interface (CLI) application integrated with Object-Relational Mapping (ORM). This project not only showcases my technical skills but also my commitment to creating practical, user-friendly solutions.&lt;/p&gt;

&lt;p&gt;The Genesis of the Project:&lt;br&gt;
The idea for this project stemmed from my desire to streamline database interactions in a way that's both intuitive and powerful. Traditional database management often involves complex SQL queries, which can be both time-consuming and prone to errors. With my CLI project, I aimed to abstract these complexities, allowing users to interact with a database through simple commands and actions.&lt;/p&gt;

&lt;p&gt;Project Highlights:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CLI Simplicity: At its core, the project is a CLI application. This means it operates through a command-line interface, offering a clear, text-based input method. Users can perform various operations by typing commands, making the process straightforward and accessible.&lt;/li&gt;
&lt;li&gt;ORM Integration: One of the project's standout features is its integration with ORM. This approach maps database tables to classes in Python, allowing for more intuitive data handling. It means that users can manage database records as if they were dealing with regular Python objects - no need for complex SQL!&lt;/li&gt;
&lt;li&gt;Efficient Data Handling: With features like create, read, update, and delete, the application efficiently manages data. Whether it's adding new records or modifying existing ones, the process is seamless and user-friendly.&lt;/li&gt;
&lt;li&gt;Robust Database Structure: The project includes two primary models - Parent and Children. These models represent the database structure and are pivotal in handling relational data effectively.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Technical Deep Dive:&lt;br&gt;
The project is structured with a clear separation of concerns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Models Directory: Contains ORM models (children.py and parent.py) that mirror the database structure.&lt;/li&gt;
&lt;li&gt;CLI Interface (cli.py): The heart of the application, where users interact and perform operations.&lt;/li&gt;
&lt;li&gt;Helper Functions (helpers.py): Includes auxiliary functions that support the CLI operations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Challenges and Learnings:&lt;br&gt;
Developing this project was a journey filled with both challenges and learnings. One significant challenge was ensuring the ORM correctly mapped to the database schema, especially when handling relationships between tables. This process taught me the importance of careful planning and testing in database design.&lt;/p&gt;

&lt;p&gt;The Road Ahead:&lt;br&gt;
As I continue to refine and expand this project, my focus will be on enhancing its capabilities and user experience. Future updates might include more complex data models and additional features based on user feedback.&lt;/p&gt;

&lt;p&gt;Conclusion:&lt;br&gt;
This CLI+ORM project is more than just a piece of software; it's a testament to the power of innovative thinking in technology. By bridging the gap between command-line interfaces and database management, it opens up new possibilities for efficient data handling. I invite fellow developers and tech enthusiasts to explore this project and join me on this exciting journey of continuous learning and development.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>tutorial</category>
      <category>python</category>
    </item>
    <item>
      <title>React</title>
      <dc:creator>Kanny Mohamad</dc:creator>
      <pubDate>Sat, 21 Oct 2023 18:25:38 +0000</pubDate>
      <link>https://forem.com/kanny/react-po3</link>
      <guid>https://forem.com/kanny/react-po3</guid>
      <description>&lt;p&gt;&lt;strong&gt;By Kanny Moahmmed&lt;/strong&gt;, Flatiron School Software Engineering Bootcamp Student&lt;/p&gt;

&lt;p&gt;We will dive into one of the most dynamic and vital phases of the curriculum: the React phase. By the end, you'll have an understanding of what React is, why it's vital to modern web development, and how to think in components.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why React?&lt;/strong&gt;&lt;br&gt;
React is, without a doubt, one of the hottest tools in the web development world. Initially developed by Facebook, React has gained immense popularity due to its component-based architecture, performance optimizations, and robust ecosystem.&lt;br&gt;
In the era of dynamic websites and single-page applications, React stands out by allowing developers to build fast and scalable applications without sacrificing usability or maintainability. The reason Flatiron School emphasizes React in its curriculum is to prepare students for the real-world challenges of building modern web applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thinking in React&lt;/strong&gt;&lt;br&gt;
One of the first things you learn in the React phase is the concept of "components." A React component can be thought of as a reusable piece of UI that can have its behavior and appearance. The beauty lies in how these components can be nested, reused, and managed.&lt;br&gt;
For instance, consider a website header. Instead of repeatedly coding the header for every page, you can create a Header component and reuse it everywhere.&lt;/p&gt;

&lt;p&gt;By thinking in components, you start seeing applications as a collection of building blocks that can be orchestrated in harmony.&lt;/p&gt;

&lt;p&gt;React introduces a revolutionary approach to managing state and side effects in functional components using hooks. Two of the primary hooks you delve deep into during this phase are useState and useEffect.&lt;br&gt;
useState allows you to add state management to a functional component, enabling it to remember information between re-renders.&lt;/p&gt;

&lt;p&gt;useEffect, on the other hand, lets you handle side effects. Whether you need to fetch data when a component mounts or clean up listeners when it unmounts, useEffect is your tool.&lt;/p&gt;

&lt;p&gt;useEffect, on the other hand, lets you handle side effects. Whether you need to fetch data when a component mounts or clean up listeners when it unmounts, useEffect is your tool.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Nested Routing&lt;/strong&gt;: Nested routing has become more straightforward. Your components now define their child routes, making the structure of your application clearer.&lt;br&gt;
Use of Hooks: React Router v6 embraces the hooks pattern wholeheartedly. Hooks like useNavigate, useParams, and useLocation make it easier to access the router's API without having to wrangle with props.&lt;br&gt;
Simplified Redirection: Redirecting users has become more intuitive, with the use of the useNavigate hook and the  component.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const navigate = useNavigate();
 if (user) {
      navigate("/product");
    } else {
      alert("Invalid Credentials");
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>To Do List</title>
      <dc:creator>Kanny Mohamad</dc:creator>
      <pubDate>Sun, 20 Aug 2023 16:44:52 +0000</pubDate>
      <link>https://forem.com/kanny/to-do-list-1ef8</link>
      <guid>https://forem.com/kanny/to-do-list-1ef8</guid>
      <description>&lt;p&gt;&lt;strong&gt;Exploring JavaScript Methods and Building a Recipe Tracker web App&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;JavaScript is a dynamic and versatile programming language that powers many interactive features on the web. In this blog post, we'll delve into the world of JavaScript methods and explore how they can be used to create a recipe tracker application. We'll cover the essential concepts and provide an in-depth look at a practical project that demonstrates the power of JavaScript methods.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Understanding JavaScript Methods:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;JavaScript methods are functions that are associated with objects and are designed to perform specific tasks. They can be called on objects to manipulate data, modify properties, or retrieve information. Methods provide a structured way to interact with objects and simplify complex operations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Project Overview: Building a Recipe Tracker:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine you want to create a web application that helps users manage and track their favorite recipes. You want users to be able to add, edit, and delete recipes. Additionally, the application should allow users to change recipe names and view detailed information about each recipe.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Getting Started: Event Listeners and DOM Manipulation:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To begin building our recipe tracker, we use the &lt;code&gt;document.addEventListener('DOMContentLoaded', function () {...}&lt;/code&gt; block. This ensures that our JavaScript code runs after the DOM has fully loaded. Within this block, we set up event listeners and manipulate the DOM to create the user interface.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;document.addEventListener('DOMContentLoaded', function () {
// javaScript code
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;We retrieve elements from the DOM using &lt;code&gt;document.getElementById&lt;/code&gt; and &lt;code&gt;querySelector&lt;/code&gt; to target specific HTML elements.&lt;/li&gt;
&lt;li&gt;We create new HTML elements using &lt;code&gt;document.createElement&lt;/code&gt; to dynamically generate the date picker and other elements needed for our application.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Adding Recipes and Using Fetch:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We implement the functionality to add recipes by listening for the "click" event on the "Add" button. When the button is clicked, a new list item is created with the provided recipe name. We also utilize the Fetch API to make a POST request to our server, storing the new recipe data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Enhancing Recipe Display:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For recipes with the name "cook," we provide additional interactivity. When users click on the "How about Christmas pie?" button, the application fetches recipe data from the server and dynamically creates recipe cards. We use JavaScript methods to iterate through the fetched data and generate HTML elements for each recipe, including ingredients and method steps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Updating Recipe Names:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Users can change the name of a recipe by entering a new name and clicking the "Change Recipe Name" button. We utilize the Fetch API again, this time with a PATCH request, to update the recipe name on the server. JavaScript methods assist in dynamically updating the UI with the new name.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion: Putting JavaScript Methods to Work:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this blog post, we've explored the world of JavaScript methods and applied them to a practical project: a recipe tracker application. From event listeners and DOM manipulation to Fetch API calls and dynamic UI updates, JavaScript methods play a crucial role in creating interactive and user-friendly web applications. By understanding these concepts and applying them creatively, you can build powerful and engaging web experiences that delight users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Call to Action: Try It Yourself!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Feeling inspired? Why not give it a try? Create your own version of the recipe tracker application using the concepts and code provided in this article. Experiment with different methods, explore new features, and expand your JavaScript skills. Don't forget to share your experiences and results in the comments below!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
