<?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>DEV Community: Ali Hamza</title>
    <description>The latest articles on DEV Community by Ali Hamza (@ali_hamza_589ec7b3eb6688d).</description>
    <link>https://dev.to/ali_hamza_589ec7b3eb6688d</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3939488%2Fffc69754-c900-4599-b972-2a8d900525dd.png</url>
      <title>DEV Community: Ali Hamza</title>
      <link>https://dev.to/ali_hamza_589ec7b3eb6688d</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ali_hamza_589ec7b3eb6688d"/>
    <language>en</language>
    <item>
      <title>Day 171 of Learning MERN Stack</title>
      <dc:creator>Ali Hamza</dc:creator>
      <pubDate>Sat, 01 Aug 2026 07:49:22 +0000</pubDate>
      <link>https://dev.to/ali_hamza_589ec7b3eb6688d/day-171-of-learning-mern-stack-3jkc</link>
      <guid>https://dev.to/ali_hamza_589ec7b3eb6688d/day-171-of-learning-mern-stack-3jkc</guid>
      <description>&lt;p&gt;Hello Dev Community! 👋&lt;/p&gt;

&lt;p&gt;It is officially &lt;strong&gt;Day 171&lt;/strong&gt; of my full-stack web development journey, and I am thrilled to announce that &lt;strong&gt;QuickChat (MERN Stack Real-Time Chat App)&lt;/strong&gt; is officially complete! 🎉🚀&lt;/p&gt;

&lt;p&gt;Today, I finalized the last key security layer: &lt;strong&gt;JWT Authentication &amp;amp; Route Protection Middleware&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Technical Breakdown: JWT Route Security
&lt;/h2&gt;

&lt;p&gt;As captured in my implementation snapshots (&lt;strong&gt;&lt;code&gt;auth.js&lt;/code&gt; &amp;amp; &lt;code&gt;utils.js&lt;/code&gt;&lt;/strong&gt;):&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Token Signature Utility (&lt;code&gt;utils.js&lt;/code&gt;)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Configured a centralized token generator helper signing payload &lt;code&gt;userId&lt;/code&gt; parameters using environment secrets:&lt;/li&gt;
&lt;/ul&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
javascript
  const generateToken = (userId) =&amp;gt; {
    return jwt.sign({ userId }, process.env.JWT_SECRET);
  };
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>node</category>
      <category>express</category>
      <category>mongodb</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Day 170 of Learning MERN Stack</title>
      <dc:creator>Ali Hamza</dc:creator>
      <pubDate>Sat, 01 Aug 2026 07:34:21 +0000</pubDate>
      <link>https://dev.to/ali_hamza_589ec7b3eb6688d/day-170-of-learning-mern-stack-53ck</link>
      <guid>https://dev.to/ali_hamza_589ec7b3eb6688d/day-170-of-learning-mern-stack-53ck</guid>
      <description>&lt;p&gt;Hello Dev Community! 👋&lt;/p&gt;

&lt;p&gt;It is officially &lt;strong&gt;Day 170&lt;/strong&gt; of my full-stack engineering track! Today, I designed and implemented the backend message retrieval and chat history processing endpoints (&lt;strong&gt;&lt;code&gt;getUserforSidebar&lt;/code&gt;&lt;/strong&gt; &amp;amp; &lt;strong&gt;&lt;code&gt;getMessages&lt;/code&gt;&lt;/strong&gt;) for &lt;strong&gt;QuickChat&lt;/strong&gt; using &lt;strong&gt;Node.js, Express, and MongoDB&lt;/strong&gt;! ⚙️💬&lt;/p&gt;

&lt;p&gt;Here is how I structured the database queries for chat retrieval and read receipts.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Technical Breakdown: Message Fetching &amp;amp; Unseen Counters
&lt;/h2&gt;

&lt;p&gt;As captured in my implementation snapshots (&lt;strong&gt;&lt;code&gt;messageController.js&lt;/code&gt;&lt;/strong&gt;):&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Dynamic User Discovery &amp;amp; Parallel Unseen Counting
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Filtered out the currently logged-in user using Mongoose &lt;code&gt;$ne&lt;/code&gt; operator while stripping out password projections.&lt;/li&gt;
&lt;li&gt;Used &lt;code&gt;Promise.all&lt;/code&gt; alongside &lt;code&gt;map&lt;/code&gt; iterations to asynchronously gather unread message counts per user card:&lt;/li&gt;
&lt;/ul&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
javascript
  const filteredUser = await user.find({ _id: { $ne: userId } }).select("-password");

  const promise = filteredUser.map(async (user) =&amp;gt; {
    const messages = await message.find({ senderId: user._id, receiverId: userId, seen: false });
    if (messages.length &amp;gt; 0) {
      unseenMessages[user._id] = messages.length;
    }
  });
  await Promise.all(promise);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>node</category>
      <category>express</category>
      <category>mongodb</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Day 169 of Learning MERN Stack</title>
      <dc:creator>Ali Hamza</dc:creator>
      <pubDate>Sat, 01 Aug 2026 07:30:31 +0000</pubDate>
      <link>https://dev.to/ali_hamza_589ec7b3eb6688d/day-169-of-learning-mern-stack-le2</link>
      <guid>https://dev.to/ali_hamza_589ec7b3eb6688d/day-169-of-learning-mern-stack-le2</guid>
      <description>&lt;p&gt;Hello Dev Community! 👋&lt;/p&gt;

&lt;p&gt;It is officially &lt;strong&gt;Day 169&lt;/strong&gt; of my full-stack engineering track! Today, I built the core messaging dispatch engine (&lt;strong&gt;&lt;code&gt;sendMessage&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;markMessagesAsSeen&lt;/code&gt;&lt;/strong&gt;) for my real-time chat application, &lt;strong&gt;QuickChat&lt;/strong&gt;! 💬⚡&lt;/p&gt;

&lt;p&gt;This module ties together database persistence, media hosting, and WebSocket streaming into a single controller execution flow.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Technical Breakdown: Messaging Controller Architecture
&lt;/h2&gt;

&lt;p&gt;As captured in my implementation snapshots (&lt;strong&gt;&lt;code&gt;messageController.js&lt;/code&gt;&lt;/strong&gt;):&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Cloudinary Integration &amp;amp; Mongoose Persistence
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Checked incoming payloads for image attachments to upload directly via Cloudinary SDK before persisting document records into MongoDB:&lt;/li&gt;
&lt;/ul&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
javascript
  if (image) {
    const uploadResponse = await cloudinary.uploader.upload(image);
    imageURL = uploadResponse.secure_url;
  }
  const newMessage = await message.create({
    senderId,
    receiverId,
    text,
    image: imageURL
  }); const receiverSocketId = getReceiverSocketId(receiverId);
if (receiverSocketId) {
  getIO().to(receiverSocketId).emit('newMessage', newMessage);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>node</category>
      <category>express</category>
      <category>mongodb</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Day 168 of Learning MERN Stack</title>
      <dc:creator>Ali Hamza</dc:creator>
      <pubDate>Sat, 01 Aug 2026 07:24:13 +0000</pubDate>
      <link>https://dev.to/ali_hamza_589ec7b3eb6688d/day-168-of-learning-mern-stack-3ng0</link>
      <guid>https://dev.to/ali_hamza_589ec7b3eb6688d/day-168-of-learning-mern-stack-3ng0</guid>
      <description>&lt;p&gt;Hello Dev Community! 👋&lt;/p&gt;

&lt;p&gt;It is officially &lt;strong&gt;Day 168&lt;/strong&gt; of my full-stack web development journey! Today, I established the real-time websocket foundation and cloud storage helper utilities for &lt;strong&gt;QuickChat&lt;/strong&gt; using &lt;strong&gt;Socket.io, Express, and Cloudinary&lt;/strong&gt;! ⚡⚙️&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Technical Breakdown: Sockets &amp;amp; Cloud Infrastructure
&lt;/h2&gt;

&lt;p&gt;As captured in my implementation snapshots (&lt;strong&gt;Screenshots 411 &amp;amp; 412&lt;/strong&gt;):&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Real-time Socket Server Module (&lt;code&gt;socket.js&lt;/code&gt;)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Configured Socket.io server instance with CORS origin wildcarding.&lt;/li&gt;
&lt;li&gt;Maintained an in-memory &lt;code&gt;userSocketMap&lt;/code&gt; object linking authenticated &lt;code&gt;userId&lt;/code&gt; instances to active socket session identifiers (&lt;code&gt;socket.id&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Implemented live online user broadcasting (&lt;code&gt;getOnlineUser&lt;/code&gt;) across client connections:&lt;/li&gt;
&lt;/ul&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
javascript
  io.on('connection', (socket) =&amp;gt; {
    const userId = socket.handshake.query.userId;
    if (userId) userSocketMap[userId] = socket.id;

    io.emit('getOnlineUser', Object.keys(userSocketMap));

    socket.on('disconnect', () =&amp;gt; {
      delete userSocketMap[userId];
      io.emit('getOnlineUser', Object.keys(userSocketMap));
    });
  });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>node</category>
      <category>express</category>
      <category>mongodb</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Day 167 of Learning MERN Stack</title>
      <dc:creator>Ali Hamza</dc:creator>
      <pubDate>Sat, 01 Aug 2026 07:14:36 +0000</pubDate>
      <link>https://dev.to/ali_hamza_589ec7b3eb6688d/day-167-of-learning-mern-stack-3d87</link>
      <guid>https://dev.to/ali_hamza_589ec7b3eb6688d/day-167-of-learning-mern-stack-3d87</guid>
      <description>&lt;p&gt;Hello Dev Community! 👋&lt;/p&gt;

&lt;p&gt;It is officially &lt;strong&gt;Day 167&lt;/strong&gt; of my full-stack development journey! Today, I shifted focus to the backend of &lt;strong&gt;QuickChat&lt;/strong&gt;, engineering the user authentication, verification middleware, and profile update endpoints using &lt;strong&gt;Node.js, Express, MongoDB, and Cloudinary&lt;/strong&gt;! ⚙️🔑&lt;/p&gt;

&lt;p&gt;Here is the breakdown of the backend architecture developed today.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Technical Breakdown: Authentication &amp;amp; Profile Controllers
&lt;/h2&gt;

&lt;p&gt;As shown in my implementation snapshots (&lt;strong&gt;Screenshots 407 to 410&lt;/strong&gt;):&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Express Routing &amp;amp; Protection Middleware
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Encapsulated routing under &lt;code&gt;userRouter.js&lt;/code&gt; and protected endpoints using custom &lt;code&gt;protectRoute&lt;/code&gt; JWT middleware:&lt;/li&gt;
&lt;/ul&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
javascript
  userRouter.post('/signup', signup);
  userRouter.post('/login', Login);
  userRouter.put('/update-profile', protectRuote, updateProfile);
  userRouter.put('/check', protectRuote, checkAuth);
  **if (!profilePic) {
  updatedUser = await user.findByIdAndUpdate(userId, { bio, fullName }, { new: true });
} else {
  const upload = await cloudinary.uploader.upload(profilePic);
  updatedUser = await user.findByIdAndUpdate(
    userId, 
    { profilePic: upload.secure_url, bio, fullName }, 
    { new: true }
  ).select("-password");
}**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>webdev</category>
      <category>backend</category>
      <category>authjs</category>
      <category>middlewares</category>
    </item>
    <item>
      <title>Day 166 of Learning MERN Stack</title>
      <dc:creator>Ali Hamza</dc:creator>
      <pubDate>Sat, 01 Aug 2026 06:50:46 +0000</pubDate>
      <link>https://dev.to/ali_hamza_589ec7b3eb6688d/day-166-of-learning-mern-stack-2c05</link>
      <guid>https://dev.to/ali_hamza_589ec7b3eb6688d/day-166-of-learning-mern-stack-2c05</guid>
      <description>&lt;p&gt;Hello Dev Community! 👋&lt;/p&gt;

&lt;p&gt;It is officially &lt;strong&gt;Day 166&lt;/strong&gt; of my full-stack engineering track! Today, I designed and implemented the active messaging canvas component (&lt;strong&gt;&lt;code&gt;ChatContainer.jsx&lt;/code&gt;&lt;/strong&gt;) for my messaging app, &lt;strong&gt;QuickChat&lt;/strong&gt;! 💬📷⚡&lt;/p&gt;

&lt;p&gt;Focusing on dynamic chat alignment, text bubble rendering, image attachments, and input controls was today's core milestone. Here is how I structured the component.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Technical Breakdown: ChatContainer &amp;amp; Attachment Pipeline
&lt;/h2&gt;

&lt;p&gt;As captured in my UI and VS Code setup (&lt;strong&gt;Screenshots&lt;/strong&gt;):&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Dynamic Alignment &amp;amp; Sender Detection
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Conditioned flexbox directions based on authentication state so sender messages lock to the right while recipient messages render on the left:
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;javascript&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

</description>
      <category>react</category>
      <category>tailwindcss</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Day 165 of Learning MERN Stack</title>
      <dc:creator>Ali Hamza</dc:creator>
      <pubDate>Sat, 01 Aug 2026 06:45:29 +0000</pubDate>
      <link>https://dev.to/ali_hamza_589ec7b3eb6688d/day-165-of-learning-mern-stack-77e</link>
      <guid>https://dev.to/ali_hamza_589ec7b3eb6688d/day-165-of-learning-mern-stack-77e</guid>
      <description>&lt;p&gt;Hello Dev Community! 👋&lt;/p&gt;

&lt;p&gt;It is officially &lt;strong&gt;Day 165&lt;/strong&gt; of my full-stack engineering journey! Today, I built the &lt;strong&gt;Profile Update Module&lt;/strong&gt; for my real-time messaging application, &lt;strong&gt;QuickChat&lt;/strong&gt;! 👤✨&lt;/p&gt;

&lt;p&gt;Managing user identity and profile customization is a cornerstone of any chat platform. Today's focus was on secure image processing and seamless state updates.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Technical Breakdown: Profile Update Architecture
&lt;/h2&gt;

&lt;p&gt;As captured in my UI and implementation logic (&lt;strong&gt;Screenshots&lt;/strong&gt;):&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Client-Side Image Processing
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Implemented the &lt;code&gt;FileReader&lt;/code&gt; API to read local image files and convert them into Base64 strings before sending them to the backend API.&lt;/li&gt;
&lt;li&gt;Used &lt;code&gt;URL.createObjectURL&lt;/code&gt; to provide an instant, high-performance visual preview of the selected profile picture before the user even hits "Save."&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Centralized Profile Management
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Integrated &lt;code&gt;updateProfile&lt;/code&gt; within the &lt;code&gt;AuthContext&lt;/code&gt; provider, ensuring that user identity changes propagate instantly across the entire application state.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Glassmorphism UI
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Leveraged Tailwind's &lt;code&gt;backdrop-blur&lt;/code&gt; and custom border utilities to maintain visual consistency with the rest of the QuickChat design language.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💡 Technical Takeaway: Why FileReader for Profile Pics?
&lt;/h2&gt;

&lt;p&gt;For smaller profile images, Base64 conversion via &lt;code&gt;FileReader&lt;/code&gt; simplifies the request structure significantly compared to multipart/form-data for simple profile updates, though both methods have their place in production systems.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 Target Milestones for Tomorrow (Day 166)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Connecting the backend controller to handle Base64 image storage in MongoDB.&lt;/li&gt;
&lt;li&gt;Preparing for real-time socket message synchronization.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  💬 Let's Connect!
&lt;/h2&gt;

&lt;p&gt;To my fellow MERN developers: How do you handle file uploads? Do you prefer Base64 strings or AWS S3/Cloudinary buckets for profile images? Let's discuss in the comments below!&lt;/p&gt;

&lt;p&gt;My active repository updates daily on GitHub!&lt;br&gt;
[Links in the Comments]&lt;/p&gt;

&lt;p&gt;Day 165 completed! QuickChat's profile management is live! 🚀👤&lt;/p&gt;

</description>
      <category>react</category>
      <category>tailwindcss</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Day 164 of Learning MERN Stack</title>
      <dc:creator>Ali Hamza</dc:creator>
      <pubDate>Wed, 22 Jul 2026 10:09:39 +0000</pubDate>
      <link>https://dev.to/ali_hamza_589ec7b3eb6688d/day-164-of-learning-mern-stack-4285</link>
      <guid>https://dev.to/ali_hamza_589ec7b3eb6688d/day-164-of-learning-mern-stack-4285</guid>
      <description>&lt;p&gt;Hello Dev Community! 👋&lt;/p&gt;

&lt;p&gt;It is officially &lt;strong&gt;Day 164&lt;/strong&gt; of my full-stack engineering journey! Today, I designed and built the main &lt;strong&gt;Chat Dashboard Sidebar (&lt;code&gt;Sidebar.jsx&lt;/code&gt;)&lt;/strong&gt; for my real-time messaging application, &lt;strong&gt;QuickChat&lt;/strong&gt;! 💬⚡&lt;/p&gt;

&lt;p&gt;Focusing on scalable user discovery, online presence indicators, and clean state management was today's priority. Here is how I structured the component.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Technical Breakdown: QuickChat Sidebar Component
&lt;/h2&gt;

&lt;p&gt;As captured in my dashboard layout and VS Code views (&lt;strong&gt;Screenshots 395, 396, &amp;amp; 397&lt;/strong&gt;):&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Instant User Filtering Logic
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Implemented client-side array filtering to allow instantaneous search queries across active users:&lt;/li&gt;
&lt;/ul&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
javascript
  const filterUsers = input
    ? users.filter((user) =&amp;gt;
        user.fullName.toLowerCase().includes(input.toLowerCase())
      )
    : users; {onlineUsers?.includes(user._id) ? (
  &amp;lt;span className="text-green-600 text-xs"&amp;gt;Online&amp;lt;/span&amp;gt;
) : (
  &amp;lt;span className="text-neutral-400 text-xs"&amp;gt;Offline&amp;lt;/span&amp;gt;
)}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>buildinpublic</category>
      <category>frontend</category>
      <category>javascript</category>
      <category>react</category>
    </item>
    <item>
      <title>Day 163 of Learning MERN Stack</title>
      <dc:creator>Ali Hamza</dc:creator>
      <pubDate>Wed, 22 Jul 2026 10:00:30 +0000</pubDate>
      <link>https://dev.to/ali_hamza_589ec7b3eb6688d/day-163-of-learning-mern-stack-1f99</link>
      <guid>https://dev.to/ali_hamza_589ec7b3eb6688d/day-163-of-learning-mern-stack-1f99</guid>
      <description>&lt;p&gt;Hello Dev Community! 👋&lt;/p&gt;

&lt;p&gt;It is officially &lt;strong&gt;Day 163&lt;/strong&gt; of my full-stack engineering track! Fresh off wrapping up my full-stack e-commerce platform, today I officially kicked off my next major full-stack venture: &lt;strong&gt;QuickChat&lt;/strong&gt; — a real-time messaging web application! 💬⚡&lt;/p&gt;

&lt;p&gt;I focused on crafting a sleek, modern &lt;strong&gt;Dark-Themed Authentication Page (&lt;code&gt;Login.jsx&lt;/code&gt;)&lt;/strong&gt; and managing multi-step onboarding state. Here is a technical breakdown of today's progress.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Deconstructing the Day 163 Onboarding Architecture
&lt;/h2&gt;

&lt;p&gt;As shown in my UI layout and VS Code implementation (&lt;strong&gt;Screenshots 392, 393, &amp;amp; 394&lt;/strong&gt;):&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Multi-Step Onboarding Form Logic
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Rather than overcrowding users with a long registration form, I designed a conditional state stepper using &lt;code&gt;isDataSubmit&lt;/code&gt; and &lt;code&gt;currState&lt;/code&gt;:&lt;/li&gt;
&lt;/ul&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
javascript
  const onSubmitHandler = async (event) =&amp;gt; {
    event.preventDefault();
    if (currState === "signup" &amp;amp;&amp;amp; !isDataSubmit) {
      setIsDataSubmit(true);
      return;
    }
    // Context-driven authentication triggers
    Login(currState === "signup" ? "signup" : "Login", {
      fullName, email, password, bio
    });
  };const [currState, setCurrState] = useState("signup");
const [fullName, setFullName] = useState("");
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [bio, setBio] = useState("");
const [isDataSubmit, setIsDataSubmit] = useState(false);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>react</category>
      <category>tailwindcss</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Day 162 of Learning MERN Stack</title>
      <dc:creator>Ali Hamza</dc:creator>
      <pubDate>Wed, 22 Jul 2026 09:52:48 +0000</pubDate>
      <link>https://dev.to/ali_hamza_589ec7b3eb6688d/day-162-of-learning-mern-stack-58k4</link>
      <guid>https://dev.to/ali_hamza_589ec7b3eb6688d/day-162-of-learning-mern-stack-58k4</guid>
      <description>&lt;p&gt;Hello Dev Community! 👋&lt;/p&gt;

&lt;p&gt;It is officially &lt;strong&gt;Day 162&lt;/strong&gt; of my full-stack engineering track! Today, I engineered the &lt;strong&gt;Admin Order Dashboard (&lt;code&gt;Orders.jsx&lt;/code&gt;)&lt;/strong&gt; for my food delivery platform, &lt;strong&gt;Tomato&lt;/strong&gt;! 📦🚚⚡&lt;/p&gt;

&lt;p&gt;With this implementation, the entire full-stack lifecycle—from customer cart checkout and Stripe payments to admin order fulfillment and status tracking—is officially 100% complete! Here is how I structured the admin management module today.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Deconstructing the Day 162 Admin Order Dashboard
&lt;/h2&gt;

&lt;p&gt;As captured in my admin UI and VS Code views (&lt;strong&gt;Screenshots 389, 390, &amp;amp; 391&lt;/strong&gt;):&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Centralized Order Pipeline Retrieval
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Integrated an asynchronous &lt;code&gt;fetchAllOrders()&lt;/code&gt; function fetching all database transactions via &lt;code&gt;/api/order/list&lt;/code&gt;:&lt;/li&gt;
&lt;/ul&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
javascript
  const fetchAllOrders = async () =&amp;gt; {
    const response = await axios.get(backendURL + "/api/order/list");
    if (response.data.success) setOrder(response.data.data);
  }; const fetchAllOrders = async () =&amp;gt; {
  try {
    const response = await axios.get(backendURL + "/api/order/list");
    if (response.data.success) {
      setOrder(response.data.data);
    } else {
      toast.error(response.data.message);
    }
  } catch (error) { ... }
}; &amp;lt;select value={odr.status}&amp;gt;
  &amp;lt;option value="Food Processing"&amp;gt;Food Processing&amp;lt;/option&amp;gt;
  &amp;lt;option value="Out for delivery"&amp;gt;Out for delivery&amp;lt;/option&amp;gt;
  &amp;lt;option value="Delivered"&amp;gt;Delivered&amp;lt;/option&amp;gt;
&amp;lt;/select&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>react</category>
      <category>mern</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Day 161 of Learning MERN Stack</title>
      <dc:creator>Ali Hamza</dc:creator>
      <pubDate>Wed, 22 Jul 2026 09:46:11 +0000</pubDate>
      <link>https://dev.to/ali_hamza_589ec7b3eb6688d/day-161-of-learning-mern-stack-51j6</link>
      <guid>https://dev.to/ali_hamza_589ec7b3eb6688d/day-161-of-learning-mern-stack-51j6</guid>
      <description>&lt;p&gt;Hello Dev Community! 👋&lt;/p&gt;

&lt;p&gt;It is officially &lt;strong&gt;Day 161&lt;/strong&gt; of my full-stack engineering track! Today, I built the &lt;strong&gt;Payment Verification &amp;amp; User Order History Module (&lt;code&gt;MyOrders.jsx&lt;/code&gt;)&lt;/strong&gt; for my food delivery app, &lt;strong&gt;Tomato&lt;/strong&gt;! 💳📦🚀&lt;/p&gt;

&lt;p&gt;Handling Stripe payment callbacks and displaying dynamic order histories securely based on user authentication tokens was the primary goal today. Here is how I structured it.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Deconstructing the Day 161 Order Management System
&lt;/h2&gt;

&lt;p&gt;As shown in my UI toast popups and VS Code editor (&lt;strong&gt;Screenshots 387 &amp;amp; 388&lt;/strong&gt;):&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Token-Authenticated Order Fetching
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Built &lt;code&gt;fetchOrder()&lt;/code&gt; targeting the endpoint &lt;code&gt;/api/order/userorders&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Passed the JWT stored in context directly through authorization headers (&lt;code&gt;{ headers: { token } }&lt;/code&gt;) so the Express backend can decode the user ID and return only their specific transaction history.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Intelligent Item String Formatting
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Handled array parsing for ordered items inside the table view so dishes and quantities are formatted dynamically with proper comma placement:&lt;/li&gt;
&lt;/ul&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
javascript
  {order.items.map((item, index) =&amp;gt; {
    if (index === order.items.length - 1) {
      return item.name + " x " + item.quantity;
    } else {
      return item.name + " x " + item.quantity + ", ";
    }
  })} {order.items.map((item, index) =&amp;gt; {
  if (index === order.items.length - 1) {
    return item.name + " x " + item.quantity;
  } else {
    return item.name + " x " + item.quantity + ", ";
  }
})} const fetchOrder = async () =&amp;gt; {
  try {
    const response = await axios.post(
      backendURL + "/api/order/userorders",
      {},
      { headers: { token } }
    );
    if (response.data.success) {
      setData(response.data.data);
    }
  } catch (error) { ... }
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>react</category>
      <category>express</category>
      <category>stripe</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Day 160 of Learning MERN Stack</title>
      <dc:creator>Ali Hamza</dc:creator>
      <pubDate>Wed, 22 Jul 2026 09:36:55 +0000</pubDate>
      <link>https://dev.to/ali_hamza_589ec7b3eb6688d/day-160-of-learning-mern-stack-4224</link>
      <guid>https://dev.to/ali_hamza_589ec7b3eb6688d/day-160-of-learning-mern-stack-4224</guid>
      <description>&lt;p&gt;Hello Dev Community! 👋&lt;/p&gt;

&lt;p&gt;It is officially &lt;strong&gt;Day 160&lt;/strong&gt; of my full-stack engineering journey! Today, I engineered the &lt;strong&gt;Checkout / Delivery Information Module (&lt;code&gt;PlaceOrder.jsx&lt;/code&gt;)&lt;/strong&gt; for my food delivery platform, &lt;strong&gt;Tomato&lt;/strong&gt;! 📦🚚💳&lt;/p&gt;

&lt;p&gt;Connecting shipping address inputs directly to Stripe hosted checkout sessions requires strict route guards and dynamic state handling. Here is a breakdown of how I structured this workflow today.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Deconstructing the Day 160 Checkout Engine
&lt;/h2&gt;

&lt;p&gt;As captured in my code editor and active app screens (&lt;strong&gt;Screenshots 384, 385, &amp;amp; 386&lt;/strong&gt;):&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Unified State for Delivery Information
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Implemented a single &lt;code&gt;onChangeHandler&lt;/code&gt; updating controlled inputs (&lt;code&gt;firstName&lt;/code&gt;, &lt;code&gt;email&lt;/code&gt;, &lt;code&gt;street&lt;/code&gt;, &lt;code&gt;phone&lt;/code&gt;, etc.) dynamically via object computed property keys:&lt;/li&gt;
&lt;/ul&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
javascript
  const onChangeHandler = (event) =&amp;gt; {
    const name = event.target.name;
    const value = event.target.value;
    setData(data =&amp;gt; ({ ...data, [name]: value }));
  }; const [data, setData] = useState({
  firstName: "", lastName: "", email: "", street: "",
  city: "", state: "", zipcode: "", country: "", phone: ""
});

const onChangeHandler = (event) =&amp;gt; {
  const name = event.target.name;
  const value = event.target.value;
  setData(data =&amp;gt; ({ ...data, [name]: value })); useEffect(() =&amp;gt; {
  if (!token) {
    navigate('/cart');
  } else if (getTotalCartAmount() === 0) {
    navigate('/cart');
  }
}, [token]);
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>react</category>
      <category>express</category>
      <category>stripe</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
