<?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 Vipin Singh Inkiya on Medium]]></title>
        <description><![CDATA[Stories by Vipin Singh Inkiya on Medium]]></description>
        <link>https://medium.com/@vipinnation?source=rss-c54d20fb76cf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*YlcI7a38_H2GZkJ-</url>
            <title>Stories by Vipin Singh Inkiya on Medium</title>
            <link>https://medium.com/@vipinnation?source=rss-c54d20fb76cf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 09:47:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vipinnation/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[Face Swap & Upscale: Enhance Your Images with AI using ComfyUI]]></title>
            <link>https://medium.com/@vipinnation/face-swap-upscale-enhance-your-images-with-ai-using-comfyui-420921b5187d?source=rss-c54d20fb76cf------2</link>
            <guid isPermaLink="false">https://medium.com/p/420921b5187d</guid>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[comfy-ui]]></category>
            <dc:creator><![CDATA[Vipin Singh Inkiya]]></dc:creator>
            <pubDate>Sat, 02 May 2026 12:32:56 GMT</pubDate>
            <atom:updated>2026-06-25T15:53:53.964Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Xs4C2oppDPrvdtdhq-sTg.png" /></figure><p>In the ever-evolving world of AI-powered image processing, two exciting techniques have gained immense popularity — <strong>Face Swapping</strong> and <strong>Image Upscaling</strong>. Face swapping allows you to seamlessly replace a face in an image with another, while upscaling enhances image resolution without losing quality. In this blog, we’ll walk through the process using <strong>ComfyUI</strong>, a powerful node-based workflow for AI image generation.</p><h3>Step 1: Load the Image Node</h3><p>To begin, load an image into <strong>ComfyUI</strong> using the <strong>Load Image</strong> node. This will be the target image where the face swap will take place.</p><ol><li>Open ComfyUI.</li><li>Add the <strong>Load Image</strong> node.</li><li>Select the image you want to modify.</li></ol><h3>Step 2: Load the ReActor Face Swap Model Node</h3><p>Next, use the <strong>ReActor Face Swap</strong> node to swap faces. This node takes in a <strong>source</strong> (the face you want to swap in) and a <strong>target</strong> (the original image).</p><ol><li>Add the <strong>ReActor Face Swap</strong> node.</li><li>Connect the <strong>target image</strong> (from Step 1) and the <strong>source face</strong>.</li><li>Adjust parameters as needed.</li></ol><h3>Step 3: Preview the Swapped Image</h3><p>Once the face swap is complete, preview the image by adding a <strong>Preview Image</strong> node.</p><ol><li>Add a <strong>Preview Image</strong> node.</li><li>Connect it to the output of the Face Swap node.</li></ol><h3>Step 4: Load the Upscale Model</h3><p>To enhance the image quality, add an <strong>Upscale Model</strong> node. ComfyUI supports various upscaling models like <strong>ESRGAN</strong> or <strong>Real-ESRGAN</strong>.</p><ol><li>Add an <strong>Upscale Model</strong> node.</li><li>Select the model (e.g., ESRGAN) and set the desired <strong>scale factor</strong>.</li></ol><h3>Step 5: Upscale the Image</h3><p>Now, upscale the swapped image to improve its resolution.</p><ol><li>Connect the <strong>Face Swap output</strong> to the <strong>Upscale Model</strong> node.</li><li>Adjust settings for optimal enhancement.</li></ol><h3>Step 6: Preview the Final Image</h3><p>Finally, preview the upscaled image using another <strong>Preview Image</strong> node.</p><ol><li>Add a <strong>Preview Image</strong> node.</li><li>Connect it to the output of the <strong>Upscale Model</strong> node.</li></ol><h3>Conclusion</h3><p>ComfyUI provides a flexible and intuitive way to perform face swaps and image upscaling using its node-based system. By leveraging <strong>ReActor Face Swap</strong> and <strong>ESRGAN</strong>, you can achieve high-quality, AI-enhanced images with ease.</p><p>Try it out and elevate your image editing workflow!</p><p>Thanks for reading!</p><p>If you’re a founder, startup, or business looking to build a web application, mobile app, AI solution, or automate your business processes, <strong>Arahita Labs</strong> can help turn your ideas into production-ready products.</p><p>We specialize in:</p><ul><li>Custom Web &amp; Mobile App Development</li><li>AI Applications &amp; Automations</li><li>MVP Development for Startups</li><li>UI/UX Design</li><li>Backend Systems &amp; APIs</li></ul><p>Learn more at <a href="https://arahita.com/"><strong>https://arahita.com</strong></a> or connect with us to discuss your project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=420921b5187d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Video Calling Apps: A Simple Guide]]></title>
            <link>https://medium.com/@vipinnation/understanding-video-calling-apps-a-simple-guide-02dbde53f50c?source=rss-c54d20fb76cf------2</link>
            <guid isPermaLink="false">https://medium.com/p/02dbde53f50c</guid>
            <category><![CDATA[socketio]]></category>
            <category><![CDATA[video-call-app]]></category>
            <category><![CDATA[video-conferencing]]></category>
            <category><![CDATA[video-call]]></category>
            <category><![CDATA[webrtc]]></category>
            <dc:creator><![CDATA[Vipin Singh Inkiya]]></dc:creator>
            <pubDate>Wed, 31 Dec 2025 09:24:25 GMT</pubDate>
            <atom:updated>2026-06-25T15:54:15.826Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tM5-HPCRZNdUSXo93IF9kA.png" /></figure><h3>Introduction</h3><p>Ever wondered how video calling apps like Zoom or Google Meet actually work? In this blog, I’ll explain the core concepts, technologies, and flow of a video calling application in simple terms.</p><h3>The Core Technologies</h3><h3>1. WebRTC (Web Real-Time Communication)</h3><p><strong>What is it?</strong> WebRTC is the technology that allows browsers to share video, audio, and data directly between users without needing plugins.</p><p><strong>What it does:</strong></p><ul><li>Captures video from your camera</li><li>Captures audio from your microphone</li><li>Sends this media to other users</li><li>Receives media from other users</li><li>All in real-time with minimal delay</li></ul><p><strong>Think of it as:</strong> A direct phone line between two browsers where video and audio can flow instantly.</p><h3>2. Socket.IO (Real-Time Communication)</h3><p><strong>What is it?</strong> Socket.IO enables real-time, two-way communication between your browser and the server.</p><p><strong>What it does:</strong></p><ul><li>Sends instant messages between users and server</li><li>Notifies when someone joins or leaves</li><li>Helps coordinate WebRTC connections</li><li>Sends chat messages in real-time</li></ul><p><strong>Think of it as:</strong> A messenger that instantly delivers notes between users through the server.</p><h3>3. Signaling Server (Node.js + Express)</h3><p><strong>What is it?</strong> A server that helps users find each other and exchange information needed to connect.</p><p><strong>What it does:</strong></p><ul><li>Manages rooms (who’s in which meeting)</li><li>Passes connection information between users</li><li>Tracks participants</li><li>Handles authentication</li></ul><p><strong>Think of it as:</strong> A matchmaker that introduces people so they can talk directly.</p><h3>Key Concepts Explained</h3><h3>STUN Servers (Session Traversal Utilities for NAT)</h3><p><strong>The Problem:</strong> Your computer sits behind a router with a private IP address (like 192.168.1.5). Other users on the internet can’t directly reach this address.</p><p><strong>The Solution:</strong> STUN servers tell you your <strong>public IP address</strong> and <strong>port number</strong> that others can use to reach you.</p><p><strong>Example:</strong></p><ul><li>Your private IP: 192.168.1.5</li><li>STUN server tells you: “Your public address is 203.45.67.89:12345”</li><li>You share this public address with others so they can connect</li></ul><p><strong>Think of it as:</strong> A mirror that shows you how others see you from the outside.</p><h3>TURN Servers (Traversal Using Relays around NAT)</h3><p><strong>The Problem:</strong> Sometimes firewalls or strict routers block direct connections, even after using STUN.</p><p><strong>The Solution:</strong> TURN servers act as a relay. Your video goes to the TURN server, which forwards it to the other user.</p><p><strong>When you need it:</strong></p><ul><li>Corporate networks with strict firewalls</li><li>Symmetric NATs (very restrictive routers)</li><li>About 8–10% of connections need TURN</li></ul><p><strong>Trade-off:</strong></p><ul><li>More reliable connections</li><li>But uses more server bandwidth and costs money</li></ul><p><strong>Think of it as:</strong> A post office that forwards packages when direct delivery isn’t possible.</p><h3>ICE Candidates (Interactive Connectivity Establishment)</h3><p><strong>What are they?</strong> ICE candidates are potential network routes through which two users can connect.</p><p><strong>Types of candidates:</strong></p><ol><li><strong>Host candidate</strong> — Direct connection through local network</li><li><strong>Server reflexive candidate</strong> — Connection through STUN server</li><li><strong>Relay candidate</strong> — Connection through TURN server</li></ol><p><strong>The Process:</strong></p><ol><li>Each user gathers all possible ways they can be reached</li><li>They exchange these possibilities</li><li>They test which route works best</li><li>They use the fastest, most direct route available</li></ol><p><strong>Think of it as:</strong> Testing multiple roads to find the fastest route between two cities.</p><h3>The Complete Flow: How Users Connect</h3><p>Let me walk you through what happens when users join a video call.</p><h3>Scenario: Alice Creates a Room, Bob and Charlie Join</h3><h4>Step 1: Alice Creates a Room</h4><ol><li>Alice opens the app and clicks “Create Room”</li><li>Frontend sends request to server: “Create a new room”</li><li>Server generates unique Room ID (e.g., “room-abc123”)</li><li>Server stores: Room “room-abc123” exists, Alice is the host</li><li>Server sends back: “Room created, your ID is room-abc123”</li><li>Alice’s browser requests camera/microphone access</li><li>Browser shows: “Allow camera and microphone?”</li><li>Alice clicks “Allow”</li><li>WebRTC creates local media stream</li><li>Alice sees her own video preview</li><li>Alice is now in the room, waiting for others</li></ol><p><strong>Server State:</strong></p><pre>Room: room-abc123<br>Participants: [Alice]<br>Host: Alice</pre><h4>Step 2: Bob Joins the Room</h4><ol><li>Bob receives room link: “yourapp.com/room/room-abc123”</li><li>Bob opens link and clicks “Join Room”</li><li>Bob’s browser requests camera/microphone</li><li>Bob allows access</li><li>Bob’s browser connects to server via Socket.IO</li><li>Bob sends: “I want to join room-abc123”</li></ol><p><strong>Now the complex part begins…</strong></p><ol><li><strong>Server notifies Alice:</strong> “Bob wants to join”</li><li><strong>Server notifies Bob:</strong> “Alice is already in the room”</li><li><strong>Alice’s browser:</strong></li></ol><ul><li>Creates RTCPeerConnection for Bob</li><li>Gathers ICE candidates (network routes)</li><li>Sends “offer” to Bob through server</li></ul><p><strong>4. Bob’s browser receives offer:</strong></p><ul><li>Creates RTCPeerConnection for Alice</li><li>Sets Alice’s offer as remote description</li><li>Gathers his own ICE candidates</li><li>Sends “answer” to Alice through server</li></ul><p><strong>5. ICE Candidate Exchange:</strong></p><ul><li>Alice finds route: “I can be reached at 203.45.67.89:12345”</li><li>Alice sends this candidate to Bob through server</li><li>Bob finds route: “I can be reached at 198.51.100.22:54321”</li><li>Bob sends this candidate to Alice through server</li><li>Both test which route works best</li></ul><p><strong>6. Connection Established:</strong></p><ul><li>Direct peer-to-peer connection opens</li><li>Video and audio start flowing</li><li>Alice sees Bob’s video, Bob sees Alice’s video</li></ul><p><strong>Server State:</strong></p><pre>Room: room-abc123<br>Participants: [Alice, Bob]<br>Host: Alice<br>Active Connections: Alice ←→ Bob</pre><h4>Step 3: Charlie Joins the Room</h4><ol><li>Charlie clicks join room</li><li>Charlie connects to server via Socket.IO</li><li>Server notifies: “Alice and Bob are in the room”</li><li>Server notifies Alice and Bob: “Charlie wants to join”</li></ol><p><strong>Now Charlie needs to connect to BOTH Alice and Bob:</strong></p><ol><li><strong>Charlie ←→ Alice Connection:</strong></li></ol><ul><li>Alice creates peer connection for Charlie</li><li>Alice sends offer to Charlie</li><li>Charlie sends answer to Alice</li><li>They exchange ICE candidates</li><li>Direct connection established</li></ul><p><strong>2. Charlie ←→ Bob Connection:</strong></p><ul><li>Bob creates peer connection for Charlie</li><li>Bob sends offer to Charlie</li><li>Charlie sends answer to Bob</li><li>They exchange ICE candidates</li><li>Direct connection established</li></ul><p><strong>3. Final State:</strong></p><ul><li>Charlie sees Alice’s video</li><li>Charlie sees Bob’s video</li><li>Alice sees Bob and Charlie’s videos</li><li>Bob sees Alice and Charlie’s videos</li></ul><p><strong>Server State:</strong></p><pre>Room: room-abc123<br>Participants: [Alice, Bob, Charlie]<br>Host: Alice<br>Active Connections: <br>  - Alice ←→ Bob<br>  - Alice ←→ Charlie<br>  - Bob ←→ Charlie</pre><h3>Visual Flow Diagram</h3><pre>Alice&#39;s Browser          Server          Bob&#39;s Browser<br>     |                     |                    |<br>     |--Create Room-------&gt;|                    |<br>     |&lt;--Room ID-----------|                    |<br>     |                     |                    |<br>     |                     |&lt;--Join Room--------|<br>     |&lt;--Bob Joined--------|                    |<br>     |                     |----Alice Exists---&gt;|<br>     |                     |                    |<br>     |--Offer-------------&gt;|--Offer------------&gt;|<br>     |                     |                    |<br>     |&lt;--Answer------------|&lt;--Answer-----------|<br>     |                     |                    |<br>     |--ICE Candidate-----&gt;|--ICE Candidate----&gt;|<br>     |&lt;--ICE Candidate-----|&lt;--ICE Candidate----|<br>     |                     |                    |<br>     |&lt;=====WebRTC P2P Connection Established===&gt;|<br>     |        (Video/Audio flows directly)       |</pre><h3>Why We Need Multiple Pieces</h3><h3>Why Socket.IO?</h3><p>WebRTC cannot establish connections alone. Users need to exchange information first:</p><ul><li>“Here’s my offer to connect”</li><li>“Here’s my answer to your offer”</li><li>“Here are the routes you can reach me”</li></ul><p>Socket.IO helps pass these messages through the server.</p><h3>Why STUN?</h3><p>Most users are behind routers. STUN helps discover their public address so others can connect.</p><h3>Why TURN?</h3><p>When direct connections fail (strict firewalls), TURN relays the video/audio to ensure everyone can connect.</p><h3>Why a Signaling Server?</h3><p>Someone needs to:</p><ul><li>Keep track of who’s in which room</li><li>Pass connection messages between users</li><li>Manage authentication and permissions</li></ul><h3>The Challenge of Multiple Users</h3><h3>In Peer-to-Peer Architecture:</h3><p><strong>With 3 people:</strong></p><ul><li>3 connections total (Alice-Bob, Alice-Charlie, Bob-Charlie)</li></ul><p><strong>With 5 people:</strong></p><ul><li>10 connections total</li></ul><p><strong>With 10 people:</strong></p><ul><li>45 connections total</li></ul><p><strong>The Problem:</strong> Each user must maintain N-1 connections (where N is number of people). This means:</p><ul><li>More bandwidth usage</li><li>More CPU usage</li><li>More battery drain</li><li>Practical limit: 10–15 people</li></ul><h3>Solution for Large Groups: SFU (Selective Forwarding Unit)</h3><p>Instead of peer-to-peer, everyone connects to a server:</p><p><strong>With 100 people:</strong></p><ul><li>Each person sends 1 stream to server</li><li>Server forwards to everyone else</li><li>Each person maintains only 2 connections (send + receive)</li><li>Server handles the distribution</li></ul><h3>Common Questions</h3><h3>Q: Is the server recording my video?</h3><p><strong>A:</strong> No. In peer-to-peer mode, video goes directly between users. The server only helps set up the connection.</p><h3>Q: Why does connection sometimes fail?</h3><p><strong>A:</strong> Usually due to:</p><ul><li>Strict firewalls blocking connections</li><li>No TURN server configured</li><li>Network issues</li></ul><h3>Q: Can others see my private IP address?</h3><p><strong>A:</strong> They can see your public IP address (which is shared by everyone on your network), but not your private IP.</p><h3>Q: What happens if someone’s internet is slow?</h3><p><strong>A:</strong> WebRTC automatically adjusts video quality based on available bandwidth. Poor connections get lower quality video.</p><h3>Technologies Summary</h3><p>Technology Purpose Example <strong>WebRTC</strong> Transmit video/audio Browser to browser media <strong>Socket.IO</strong> Real-time messaging “Bob joined the room” <strong>Express</strong> HTTP server Host the application <strong>STUN</strong> Find public address “You are 203.45.67.89” <strong>TURN</strong> Relay when needed Backup for strict firewalls <strong>ICE</strong> Test best route Find fastest connection path</p><h3>Conclusion</h3><p>Video calling apps are complex systems that combine multiple technologies:</p><ol><li><strong>WebRTC</strong> handles the actual video/audio transmission</li><li><strong>Socket.IO</strong> coordinates everything through the server</li><li><strong>STUN servers</strong> help users discover their public addresses</li><li><strong>TURN servers</strong> provide backup when direct connections fail</li><li><strong>ICE candidates</strong> represent different ways users can connect</li><li><strong>Signaling server</strong> manages rooms and passes messages</li></ol><p>The magic happens when all these pieces work together seamlessly to create a smooth video calling experience.</p><p><strong>The beauty:</strong> Once the connection is established, video flows directly between users without going through the server, making calls fast and private.</p><p><strong>The challenge:</strong> Coordinating all these moving parts reliably across different networks, devices, and conditions.</p><p>Thanks for reading!</p><p>If you’re a founder, startup, or business looking to build a web application, mobile app, AI solution, or automate your business processes, <strong>Arahita Labs</strong> can help turn your ideas into production-ready products.</p><p>We specialize in:</p><ul><li>Custom Web &amp; Mobile App Development</li><li>AI Applications &amp; Automations</li><li>MVP Development for Startups</li><li>UI/UX Design</li><li>Backend Systems &amp; APIs</li></ul><p>Learn more at <a href="https://arahita.com/"><strong>https://arahita.com</strong></a> or connect with us to discuss your project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=02dbde53f50c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Your Own Email Server: A Complete Guide to Postfix and Dovecot]]></title>
            <link>https://medium.com/@vipinnation/building-your-own-email-server-a-complete-guide-to-postfix-and-dovecot-6e0547c0d089?source=rss-c54d20fb76cf------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e0547c0d089</guid>
            <category><![CDATA[email]]></category>
            <category><![CDATA[imap]]></category>
            <category><![CDATA[smtp]]></category>
            <category><![CDATA[mail]]></category>
            <category><![CDATA[smtp-server]]></category>
            <dc:creator><![CDATA[Vipin Singh Inkiya]]></dc:creator>
            <pubDate>Mon, 29 Dec 2025 10:33:57 GMT</pubDate>
            <atom:updated>2026-06-25T15:54:30.222Z</atom:updated>
            <content:encoded><![CDATA[<p>Running your own email server gives you complete control over your communications, enhanced privacy, and the ability to use custom domain names for professional correspondence. In this comprehensive guide, we’ll walk through setting up a fully functional email server using Postfix for sending emails (SMTP) and Dovecot for receiving them (IMAP/POP3).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-c5GJxzm0hQFwCTezMey1Q.png" /></figure><h3>Prerequisites</h3><p>Before we begin, you’ll need:</p><ul><li>A VPS or dedicated server running Ubuntu 22.04 or Debian 11 (minimum 1GB RAM)</li><li>A registered domain name (e.g., yourdomain.com)</li><li>Root or sudo access to your server</li><li>Basic understanding of Linux command line</li><li>Port 25, 587, 993, and 465 open on your firewall</li></ul><h3>Understanding the Components</h3><p><strong>Postfix</strong> is a Mail Transfer Agent (MTA) that handles sending and receiving emails via SMTP. It’s robust, secure, and widely used in production environments.</p><p><strong>Dovecot</strong> is an IMAP and POP3 server that allows email clients to retrieve messages from the server. It handles user authentication and mailbox management.</p><h3>Step 1: DNS Configuration</h3><p>Before installing anything, configure your domain’s DNS records. These are crucial for email delivery and authentication.</p><h3>Required DNS Records</h3><p>Add these records in your domain registrar’s DNS panel:</p><pre># A Record - Points your mail server to your IP<br>mail.yourdomain.com    A    YOUR_SERVER_IP</pre><pre># MX Record - Tells other servers where to send emails<br>yourdomain.com    MX    10 mail.yourdomain.com</pre><pre># PTR Record (Reverse DNS) - Set this through your VPS provider<br>YOUR_SERVER_IP    PTR    mail.yourdomain.com</pre><pre># SPF Record - Prevents email spoofing<br>yourdomain.com    TXT    &quot;v=spf1 mx ~all&quot;</pre><pre># DMARC Record - Email authentication policy<br>_dmarc.yourdomain.com    TXT    &quot;v=DMARC1; p=quarantine; rua=mailto:postmaster@yourdomain.com&quot;</pre><p>Wait 24–48 hours for DNS propagation, though it often happens faster.</p><h3>Step 2: Update Your System and Set Hostname</h3><pre># Update package lists<br>sudo apt update &amp;&amp; sudo apt upgrade -y</pre><pre># Set your hostname<br>sudo hostnamectl set-hostname mail.yourdomain.com</pre><pre># Update /etc/hosts<br>echo &quot;YOUR_SERVER_IP mail.yourdomain.com mail&quot; | sudo tee -a /etc/hosts</pre><h3>Step 3: Install Postfix</h3><pre># Install Postfix<br>sudo apt install postfix -y</pre><p>During installation, you’ll be prompted:</p><ol><li><strong>General type</strong>: Select “Internet Site”</li><li><strong>System mail name</strong>: Enter yourdomain.com</li></ol><h3>Step 4: Configure Postfix</h3><p>Edit the main Postfix configuration file:</p><pre>sudo nano /etc/postfix/main.cf</pre><p>Replace or add these configurations:</p><pre># Basic Settings<br>myhostname = mail.yourdomain.com<br>mydomain = yourdomain.com<br>myorigin = $mydomain<br>mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain<br>relayhost =<br>mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128<br>mailbox_size_limit = 0<br>recipient_delimiter = +<br>inet_interfaces = all<br>inet_protocols = all</pre><pre># Virtual mailbox settings<br>home_mailbox = Maildir/<br>virtual_mailbox_domains = /etc/postfix/virtual_domains<br>virtual_mailbox_maps = hash:/etc/postfix/vmailbox<br>virtual_alias_maps = hash:/etc/postfix/virtual</pre><pre># SMTP Authentication<br>smtpd_sasl_type = dovecot<br>smtpd_sasl_path = private/auth<br>smtpd_sasl_auth_enable = yes<br>smtpd_sasl_security_options = noanonymous<br>smtpd_sasl_local_domain = $myhostname<br>broken_sasl_auth_clients = yes</pre><pre># TLS Configuration<br>smtpd_tls_cert_file = /etc/ssl/certs/mailcert.pem<br>smtpd_tls_key_file = /etc/ssl/private/mailkey.pem<br>smtpd_tls_security_level = may<br>smtpd_tls_auth_only = yes<br>smtpd_tls_loglevel = 1<br>smtpd_tls_received_header = yes<br>smtpd_tls_session_cache_timeout = 3600s<br>smtp_tls_security_level = may</pre><pre># Restrictions<br>smtpd_helo_required = yes<br>smtpd_helo_restrictions = permit_mynetworks,<br>    permit_sasl_authenticated,<br>    reject_invalid_helo_hostname,<br>    reject_non_fqdn_helo_hostname,<br>    reject_unknown_helo_hostname</pre><pre>smtpd_recipient_restrictions = permit_mynetworks,<br>    permit_sasl_authenticated,<br>    reject_non_fqdn_recipient,<br>    reject_unknown_recipient_domain,<br>    reject_unauth_destination,<br>    reject_rbl_client zen.spamhaus.org,<br>    reject_rbl_client bl.spamcop.net,<br>    permit</pre><h3>Step 5: Configure SSL/TLS Certificates</h3><p>For production, use Let’s Encrypt for free SSL certificates:</p><pre># Install Certbot<br>sudo apt install certbot -y</pre><pre># Generate certificate<br>sudo certbot certonly --standalone -d mail.yourdomain.com</pre><pre># Link certificates for Postfix<br>sudo ln -s /etc/letsencrypt/live/mail.yourdomain.com/fullchain.pem /etc/ssl/certs/mailcert.pem<br>sudo ln -s /etc/letsencrypt/live/mail.yourdomain.com/privkey.pem /etc/ssl/private/mailkey.pem</pre><p>For testing, you can generate self-signed certificates:</p><pre>sudo openssl req -new -x509 -days 365 -nodes \<br>  -out /etc/ssl/certs/mailcert.pem \<br>  -keyout /etc/ssl/private/mailkey.pem</pre><h3>Step 6: Configure Virtual Domains and Mailboxes</h3><p>Create virtual domain file:</p><pre>echo &quot;yourdomain.com&quot; | sudo tee /etc/postfix/virtual_domains</pre><p>Create virtual mailbox file:</p><pre>sudo nano /etc/postfix/vmailbox</pre><p>Add your email addresses (format: email address, then directory):</p><pre>user@yourdomain.com    yourdomain.com/user/<br>admin@yourdomain.com   yourdomain.com/admin/</pre><p>Create virtual alias file for forwarding:</p><pre>sudo nano /etc/postfix/virtual</pre><p>Add aliases if needed:</p><pre>postmaster@yourdomain.com    admin@yourdomain.com<br>info@yourdomain.com          user@yourdomain.com</pre><p>Generate hash databases:</p><pre>sudo postmap /etc/postfix/vmailbox<br>sudo postmap /etc/postfix/virtual</pre><h3>Step 7: Configure Postfix Master Process</h3><p>Edit the master configuration:</p><pre>sudo nano /etc/postfix/master.cf</pre><p>Ensure these lines are uncommented and configured:</p><pre>submission inet n       -       y       -       -       smtpd<br>  -o syslog_name=postfix/submission<br>  -o smtpd_tls_security_level=encrypt<br>  -o smtpd_sasl_auth_enable=yes<br>  -o smtpd_tls_auth_only=yes<br>  -o smtpd_reject_unlisted_recipient=no<br>  -o smtpd_client_restrictions=permit_sasl_authenticated,reject<br>  -o smtpd_helo_restrictions=<br>  -o smtpd_sender_restrictions=<br>  -o smtpd_recipient_restrictions=<br>  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject<br>  -o milter_macro_daemon_name=ORIGINATING</pre><pre>smtps     inet  n       -       y       -       -       smtpd<br>  -o syslog_name=postfix/smtps<br>  -o smtpd_tls_wrappermode=yes<br>  -o smtpd_sasl_auth_enable=yes<br>  -o smtpd_reject_unlisted_recipient=no<br>  -o smtpd_client_restrictions=permit_sasl_authenticated,reject<br>  -o smtpd_recipient_restrictions=<br>  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject<br>  -o milter_macro_daemon_name=ORIGINATING</pre><h3>Step 8: Install and Configure Dovecot</h3><pre># Install Dovecot<br>sudo apt install dovecot-core dovecot-imapd dovecot-pop3d -y</pre><h3>Configure Dovecot Mail Location</h3><pre>sudo nano /etc/dovecot/conf.d/10-mail.conf</pre><p>Set the mail location:</p><pre>mail_location = maildir:~/Maildir<br>mail_privileged_group = mail</pre><h3>Configure Dovecot Authentication</h3><pre>sudo nano /etc/dovecot/conf.d/10-auth.conf</pre><p>Modify these settings:</p><pre>disable_plaintext_auth = yes<br>auth_mechanisms = plain login</pre><p>At the bottom, ensure this line is included:</p><pre>!include auth-system.conf.ext</pre><h3>Configure Dovecot Master Settings</h3><pre>sudo nano /etc/dovecot/conf.d/10-master.conf</pre><p>Find the service auth section and modify it:</p><pre>service auth {<br>  unix_listener /var/spool/postfix/private/auth {<br>    mode = 0660<br>    user = postfix<br>    group = postfix<br>  }<br>}</pre><h3>Configure SSL for Dovecot</h3><pre>sudo nano /etc/dovecot/conf.d/10-ssl.conf</pre><p>Configure SSL:</p><pre>ssl = required<br>ssl_cert = &lt;/etc/ssl/certs/mailcert.pem<br>ssl_key = &lt;/etc/ssl/private/mailkey.pem<br>ssl_min_protocol = TLSv1.2<br>ssl_prefer_server_ciphers = yes</pre><h3>Step 9: Create System Users</h3><p>Each email address needs a corresponding Linux user:</p><pre># Create users<br>sudo useradd -m -s /bin/bash user<br>sudo useradd -m -s /bin/bash admin</pre><pre># Set passwords<br>sudo passwd user<br>sudo passwd admin</pre><pre># Create Maildir structure<br>sudo maildirmake.dovecot /home/user/Maildir<br>sudo maildirmake.dovecot /home/admin/Maildir</pre><pre># Set proper permissions<br>sudo chown -R user:user /home/user/Maildir<br>sudo chown -R admin:admin /home/admin/Maildir</pre><h3>Step 10: Configure DKIM for Email Authentication</h3><p>DKIM adds a digital signature to outgoing emails, improving deliverability.</p><pre># Install OpenDKIM<br>sudo apt install opendkim opendkim-tools -y</pre><pre># Create directory structure<br>sudo mkdir -p /etc/opendkim/keys/yourdomain.com<br>cd /etc/opendkim/keys/yourdomain.com</pre><pre># Generate keys<br>sudo opendkim-genkey -s mail -d yourdomain.com</pre><pre># Set permissions<br>sudo chown opendkim:opendkim mail.private<br>sudo chmod 600 mail.private</pre><p>Configure OpenDKIM:</p><pre>sudo nano /etc/opendkim.conf</pre><p>Add these configurations:</p><pre>Syslog yes<br>SyslogSuccess yes<br>LogWhy yes</pre><pre>Domain yourdomain.com<br>KeyFile /etc/opendkim/keys/yourdomain.com/mail.private<br>Selector mail</pre><pre>Socket inet:8891@localhost</pre><pre>PidFile /run/opendkim/opendkim.pid<br>OversignHeaders From</pre><pre>UserID opendkim<br>UMask 007</pre><pre>Mode sv<br>SubDomains no<br>AutoRestart yes</pre><p>Add DKIM to Postfix:</p><pre>sudo nano /etc/postfix/main.cf</pre><p>Add at the end:</p><pre># DKIM<br>milter_default_action = accept<br>milter_protocol = 6<br>smtpd_milters = inet:localhost:8891<br>non_smtpd_milters = inet:localhost:8891</pre><p>Get your DKIM DNS record:</p><pre>sudo cat /etc/opendkim/keys/yourdomain.com/mail.txt</pre><p>Add this as a TXT record in your DNS:</p><pre>mail._domainkey.yourdomain.com    TXT    &quot;v=DKIM1; k=rsa; p=YOUR_PUBLIC_KEY_HERE&quot;</pre><h3>Step 11: Start and Enable Services</h3><pre># Restart Postfix<br>sudo systemctl restart postfix<br>sudo systemctl enable postfix</pre><pre># Restart Dovecot<br>sudo systemctl restart dovecot<br>sudo systemctl enable dovecot</pre><pre># Restart OpenDKIM<br>sudo systemctl restart opendkim<br>sudo systemctl enable opendkim</pre><pre># Check service status<br>sudo systemctl status postfix<br>sudo systemctl status dovecot<br>sudo systemctl status opendkim</pre><h3>Step 12: Configure Firewall</h3><pre># Allow necessary ports<br>sudo ufw allow 25/tcp    # SMTP<br>sudo ufw allow 587/tcp   # Submission<br>sudo ufw allow 465/tcp   # SMTPS<br>sudo ufw allow 993/tcp   # IMAPS<br>sudo ufw allow 995/tcp   # POP3S</pre><pre># Enable firewall<br>sudo ufw enable</pre><h3>Step 13: Testing Your Email Server</h3><h3>Test SMTP (Sending)</h3><pre># Test from command line<br>echo &quot;Test email body&quot; | mail -s &quot;Test Subject&quot; recipient@example.com</pre><pre># Check mail logs<br>sudo tail -f /var/log/mail.log</pre><h3>Test with Telnet</h3><pre># Test SMTP connection<br>telnet mail.yourdomain.com 25</pre><pre># Test submission port<br>telnet mail.yourdomain.com 587</pre><pre># Test IMAP<br>telnet mail.yourdomain.com 993</pre><h3>Configure Email Client</h3><p>Use these settings in your email client (Thunderbird, Outlook, etc.):</p><p><strong>Incoming Mail (IMAP):</strong></p><ul><li>Server: mail.yourdomain.com</li><li>Port: 993</li><li>Security: SSL/TLS</li><li>Authentication: Normal password</li><li>Username: user (just the username, not full email)</li></ul><p><strong>Outgoing Mail (SMTP):</strong></p><ul><li>Server: mail.yourdomain.com</li><li>Port: 587</li><li>Security: STARTTLS</li><li>Authentication: Normal password</li><li>Username: user</li></ul><h3>Step 14: Monitor and Maintain</h3><h3>Check Logs Regularly</h3><pre># Main mail log<br>sudo tail -f /var/log/mail.log</pre><pre># Authentication issues<br>sudo tail -f /var/log/auth.log</pre><h3>Common Commands</h3><pre># View mail queue<br>mailq</pre><pre># Flush mail queue<br>sudo postfix flush</pre><pre># Check Postfix configuration<br>sudo postfix check</pre><pre># Reload Postfix after config changes<br>sudo postfix reload</pre><pre># Test Dovecot configuration<br>sudo doveconf -n</pre><h3>Automated Certificate Renewal</h3><pre># Test renewal<br>sudo certbot renew --dry-run</pre><pre># Certbot automatically sets up renewal, but verify:<br>sudo systemctl status certbot.timer</pre><h3>Troubleshooting Common Issues</h3><h3>Emails Not Sending</h3><ul><li>Check if port 25 is blocked by your ISP or hosting provider</li><li>Verify DNS records are properly configured</li><li>Check mail logs: sudo tail -100 /var/log/mail.log</li><li>Ensure firewall rules allow traffic</li><li>Test SPF, DKIM, and DMARC records using online tools</li></ul><h3>Authentication Failures</h3><ul><li>Verify user exists: id username</li><li>Check password: Try resetting with sudo passwd username</li><li>Review Dovecot auth logs: sudo grep dovecot /var/log/mail.log</li><li>Ensure Postfix can communicate with Dovecot: ls -la /var/spool/postfix/private/auth</li></ul><h3>Emails Marked as Spam</h3><ul><li>Verify reverse DNS (PTR record) is set correctly</li><li>Check SPF, DKIM, and DMARC using tools like MXToolbox</li><li>Ensure your server IP isn’t on blacklists: Check at mxtoolbox.com/blacklists.aspx</li><li>Warm up your IP by gradually increasing sending volume</li></ul><h3>Connection Issues</h3><ul><li>Verify services are running: sudo systemctl status postfix dovecot</li><li>Check if ports are listening: sudo netstat -tlnp | grep -E &#39;25|587|993&#39;</li><li>Test connectivity from external network</li><li>Review firewall rules: sudo ufw status</li></ul><h3>Security Best Practices</h3><ol><li><strong>Keep software updated</strong>: Regularly run sudo apt update &amp;&amp; sudo apt upgrade</li><li><strong>Use strong passwords</strong>: Enforce complex passwords for all email accounts</li><li><strong>Enable fail2ban</strong>: Protect against brute force attacks</li><li><strong>Regular backups</strong>: Backup /home/*/Maildir and configuration files</li><li><strong>Monitor logs</strong>: Set up log monitoring and alerts</li><li><strong>Limit access</strong>: Only allow necessary ports through firewall</li><li><strong>Use encrypted connections</strong>: Always require TLS/SSL</li><li><strong>Implement rate limiting</strong>: Prevent abuse of your server</li></ol><h3>Conclusion</h3><p>You now have a fully functional email server capable of sending and receiving emails with your custom domain. This setup provides you with complete control over your email infrastructure, enhanced privacy, and professional communication capabilities.</p><p>Remember that running an email server requires ongoing maintenance, monitoring, and security updates. Regularly check your logs, keep software updated, and monitor your server’s reputation to ensure reliable email delivery.</p><p>For production environments, consider additional components like spam filtering (SpamAssassin), webmail interfaces (Roundcube or Rainloop), and backup solutions to create a robust email infrastructure.</p><p>Happy emailing!</p><p>Thanks for reading!</p><p>If you’re a founder, startup, or business looking to build a web application, mobile app, AI solution, or automate your business processes, <strong>Arahita Labs</strong> can help turn your ideas into production-ready products.</p><p>We specialize in:</p><ul><li>Custom Web &amp; Mobile App Development</li><li>AI Applications &amp; Automations</li><li>MVP Development for Startups</li><li>UI/UX Design</li><li>Backend Systems &amp; APIs</li></ul><p>Learn more at <a href="https://arahita.com/"><strong>https://arahita.com</strong></a> or connect with us to discuss your project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e0547c0d089" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Image Generation Using ComfyUI: A Beginner’s Guide]]></title>
            <link>https://medium.com/@vipinnation/image-generation-using-comfyui-a-beginners-guide-bebe296ba909?source=rss-c54d20fb76cf------2</link>
            <guid isPermaLink="false">https://medium.com/p/bebe296ba909</guid>
            <category><![CDATA[stable-diffusion]]></category>
            <category><![CDATA[image-generation]]></category>
            <category><![CDATA[comfy-ui]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[image-processing]]></category>
            <dc:creator><![CDATA[Vipin Singh Inkiya]]></dc:creator>
            <pubDate>Sun, 09 Mar 2025 15:49:34 GMT</pubDate>
            <atom:updated>2026-06-25T15:54:42.370Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ujtgHALLIdZ_4edzkOufg.png" /></figure><p>ComfyUI is a powerful, node-based interface for Stable Diffusion that allows for flexible and customizable image generation. In this guide, we’ll cover the basic nodes required to generate an image using ComfyUI, including:</p><ul><li><strong>Load Checkpoint</strong></li><li><strong>Clip Text Encode (Positive and Negative Prompts)</strong></li><li><strong>Empty Latent Image</strong></li><li><strong>KSampler</strong></li><li><strong>VAE Decode</strong></li><li><strong>Save Image</strong></li></ul><p>By the end of this tutorial, you’ll understand how to build a simple workflow to generate AI-powered images.</p><h3>Step 1: Load the Checkpoint</h3><p>The <strong>Load Checkpoint</strong> node is the foundation of your workflow. This node loads the Stable Diffusion model that will be used for image generation.</p><h3>Steps:</h3><ol><li>Add the <strong>Load Checkpoint</strong> node.</li><li>Select a Stable Diffusion checkpoint (e.g., sd1.5.ckpt or sdxl.ckpt).</li></ol><h3>Step 2: Encode the Prompt Using Clip Text Encode (Positive &amp; Negative)</h3><p>The <strong>Clip Text Encode</strong> nodes process the text prompts into a format that the model can understand. You will use two instances of this node:</p><ul><li><strong>Positive Prompt</strong>: Describes what you want in the image.</li><li><strong>Negative Prompt</strong>: Describes what you want to avoid.</li></ul><h3>Steps:</h3><ol><li>Add two <strong>Clip Text Encode</strong> nodes.</li><li>Connect both to the <strong>Load Checkpoint</strong> node.</li><li>Enter your desired positive prompt, such as <em>“A futuristic cityscape at sunset.”</em></li><li>Enter a negative prompt to exclude unwanted elements, such as <em>“blurry, low quality, distorted faces.”</em></li></ol><h3>Step 3: Create an Empty Latent Image</h3><p>Before generating an image, we need to define the size of the output.</p><h3>Steps:</h3><ol><li>Add an <strong>Empty Latent Image</strong> node.</li><li>Set the desired width and height (e.g., 512x512 for SD1.5, 1024x1024 for SDXL).</li><li>Connect it to the <strong>Load Checkpoint</strong> node.</li></ol><h3>Step 4: Use KSampler for Image Generation</h3><p>The <strong>KSampler</strong> node performs the diffusion process, transforming noise into an image.</p><h3>Steps:</h3><ol><li>Add a <strong>KSampler</strong> node.</li><li>Connect it to:</li></ol><ul><li><strong>Clip Text Encode (Positive Prompt)</strong></li><li><strong>Clip Text Encode (Negative Prompt)</strong></li><li><strong>Empty Latent Image</strong> (Latent input)</li><li><strong>Load Checkpoint</strong></li></ul><ol><li>Adjust parameters like steps (e.g., 30), sampler type (e.g., Euler), and guidance scale.</li></ol><h3>Step 5: Decode with VAE</h3><p>The <strong>VAE Decode</strong> node converts latent space data into a visible image.</p><h3>Steps:</h3><ol><li>Add a <strong>VAE Decode</strong> node.</li><li>Connect it to the <strong>KSampler</strong> output.</li></ol><h3>Step 6: Save the Image</h3><p>Finally, we save the generated image.</p><h3>Steps:</h3><ol><li>Add a <strong>Save Image</strong> node.</li><li>Connect it to the <strong>VAE Decode</strong> node.</li><li>Set the file format and output directory.</li></ol><h3>Final Thoughts</h3><p>This is a basic workflow for generating images using ComfyUI. You can experiment with different prompts, samplers, and models to create unique outputs. As you become more familiar, explore advanced nodes like ControlNet, LoRAs, and inpainting for even more customization.</p><p>Happy image generating!</p><p>Thanks for reading!</p><p>If you’re a founder, startup, or business looking to build a web application, mobile app, AI solution, or automate your business processes, <strong>Arahita Labs</strong> can help turn your ideas into production-ready products.</p><p>We specialize in:</p><ul><li>Custom Web &amp; Mobile App Development</li><li>AI Applications &amp; Automations</li><li>MVP Development for Startups</li><li>UI/UX Design</li><li>Backend Systems &amp; APIs</li></ul><p>Learn more at <a href="https://arahita.com/"><strong>https://arahita.com</strong></a> or connect with us to discuss your project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bebe296ba909" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing Dark and Light Mode in React Native with Expo Router: A Complete Guide]]></title>
            <link>https://medium.com/@vipinnation/implementing-dark-and-light-mode-in-react-native-with-expo-router-a-complete-guide-bf26f32aba31?source=rss-c54d20fb76cf------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf26f32aba31</guid>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Vipin Singh Inkiya]]></dc:creator>
            <pubDate>Mon, 03 Feb 2025 04:32:14 GMT</pubDate>
            <atom:updated>2026-06-25T15:55:11.976Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L3XgrgxHWrhI21cFpynq5A.png" /></figure><p>In today’s mobile app development landscape, allowing users to switch between dark and light themes isn’t just a nice-to-have feature — it’s becoming increasingly standard. In this guide, we’ll implement a robust theming system in a React Native app using Expo Router, complete with theme persistence and system theme detection.</p><h3>Prerequisites</h3><p>Before we begin, make sure you have:</p><ul><li>An existing Expo project with Expo Router installed</li><li>Basic familiarity with React Native and React Context</li><li>AsyncStorage installed (@react-native-async-storage/async-storage)</li></ul><h3>Setting Up the Theme Context</h3><p>First, create a theme context to manage our app’s theme state. Create a new file called ThemeContext.js in your project:</p><pre>import React, { createContext, useState, useEffect } from &#39;react&#39;;<br>import AsyncStorage from &#39;@react-native-async-storage/async-storage&#39;;<br>import { useColorScheme } from &#39;react-native&#39;;<br><br>export const ThemeContext = createContext({<br>  theme: &#39;light&#39;,<br>  toggleTheme: () =&gt; {},<br>});<br><br>const THEME_STORAGE_KEY = &#39;@app_theme&#39;;<br><br>export function ThemeProvider({ children }) {<br>  const systemColorScheme = useColorScheme();<br>  const [theme, setTheme] = useState(&#39;light&#39;);<br> <br>  useEffect(() =&gt; {<br>    loadSavedTheme();<br>  }, []);<br><br>  const loadSavedTheme = async () =&gt; {<br>    try {<br>      const savedTheme = await AsyncStorage.getItem(THEME_STORAGE_KEY);<br>      if (savedTheme) {<br>        setTheme(savedTheme);<br>      } else {<br>        // Use system theme as default if no saved theme<br>        setTheme(systemColorScheme || &#39;light&#39;);<br>      }<br>    } catch (error) {<br>      console.error(&#39;Failed to load theme:&#39;, error);<br>    }<br>  };<br><br>  const toggleTheme = async () =&gt; {<br>    const newTheme = theme === &#39;light&#39; ? &#39;dark&#39; : &#39;light&#39;;<br>    setTheme(newTheme);<br>    try {<br>      await AsyncStorage.setItem(THEME_STORAGE_KEY, newTheme);<br>    } catch (error) {<br>      console.error(&#39;Failed to save theme:&#39;, error);<br>    }<br>  };<br><br>  return (<br>    &lt;ThemeContext.Provider value={{ theme, toggleTheme }}&gt;<br>      {children}<br>    &lt;/ThemeContext.Provider&gt;<br>  );<br>}</pre><h3>Creating Theme Constants</h3><p>Next, let’s define our theme colors and styles. Create a theme.js file:</p><pre>export const themes = {<br>  light: {<br>    background: &#39;#FFFFFF&#39;,<br>    text: &#39;#000000&#39;,<br>    primary: &#39;#007AFF&#39;,<br>    secondary: &#39;#5856D6&#39;,<br>    border: &#39;#E5E5EA&#39;,<br>    card: &#39;#F2F2F7&#39;,<br>  },<br>  dark: {<br>    background: &#39;#000000&#39;,<br>    text: &#39;#FFFFFF&#39;,<br>    primary: &#39;#0A84FF&#39;,<br>    secondary: &#39;#5E5CE6&#39;,<br>    border: &#39;#38383A&#39;,<br>    card: &#39;#1C1C1E&#39;,<br>  },<br>};</pre><h3>Wrapping the App with ThemeProvider</h3><p>In your _layout.js file (or main app entry point), wrap your app with the ThemeProvider:</p><pre>import { Stack } from &#39;expo-router&#39;;<br>import { ThemeProvider } from &#39;../context/ThemeContext&#39;;<br><br>export default function RootLayout() {<br>  return (<br>    &lt;ThemeProvider&gt;<br>      &lt;Stack /&gt;<br>    &lt;/ThemeProvider&gt;<br>  );<br>}</pre><h3>Creating a Theme-Aware Component</h3><p>Let’s create a custom hook to easily access theme values in our components:</p><pre>import { useContext } from &#39;react&#39;;<br>import { ThemeContext } from &#39;./ThemeContext&#39;;<br>import { themes } from &#39;./theme&#39;;<br><br>export function useTheme() {<br>  const { theme, toggleTheme } = useContext(ThemeContext);<br>  const colors = themes[theme];<br>  <br>  return {<br>    theme,<br>    toggleTheme,<br>    colors,<br>  };<br>}</pre><h3>Implementing Theme in Components</h3><p>Here’s how to use the theming system in your components:</p><pre>import { View, Text, TouchableOpacity, StyleSheet } from &#39;react-native&#39;;<br>import { useTheme } from &#39;../hooks/useTheme&#39;;<br><br>export default function HomeScreen() {<br>  const { colors, toggleTheme, theme } = useTheme();<br>  <br>  return (<br>    &lt;View style={[styles.container, { backgroundColor: colors.background }]}&gt;<br>      &lt;Text style={[styles.text, { color: colors.text }]}&gt;<br>        Current theme: {theme}<br>      &lt;/Text&gt;<br>      <br>      &lt;TouchableOpacity<br>        style={[styles.button, { backgroundColor: colors.primary }]}<br>        onPress={toggleTheme}<br>      &gt;<br>        &lt;Text style={[styles.buttonText, { color: colors.background }]}&gt;<br>          Toggle Theme<br>        &lt;/Text&gt;<br>      &lt;/TouchableOpacity&gt;<br>    &lt;/View&gt;<br>  );<br>}<br><br>const styles = StyleSheet.create({<br>  container: {<br>    flex: 1,<br>    alignItems: &#39;center&#39;,<br>    justifyContent: &#39;center&#39;,<br>  },<br>  text: {<br>    fontSize: 18,<br>    marginBottom: 20,<br>  },<br>  button: {<br>    padding: 12,<br>    borderRadius: 8,<br>  },<br>  buttonText: {<br>    fontSize: 16,<br>    fontWeight: &#39;600&#39;,<br>  },<br>});</pre><h3>Adding Status Bar Theme Support</h3><p>Don’t forget to update your status bar based on the theme:</p><pre>import { StatusBar } from &#39;expo-status-bar&#39;;<br><br>export default function App() {<br>  const { theme } = useTheme();<br>  <br>  return (<br>    &lt;&gt;<br>      &lt;StatusBar style={theme === &#39;dark&#39; ? &#39;light&#39; : &#39;dark&#39;} /&gt;<br>      {/* Rest of your app */}<br>    &lt;/&gt;<br>  );<br>}</pre><h3>Conclusion</h3><p>Implementing dark and light modes in your React Native app with Expo Router is straightforward when you follow a systematic approach. The combination of React Context for state management and AsyncStorage for persistence provides a robust solution that can easily scale as your app grows.</p><p>Remember to:</p><ul><li>Test your theme implementation across different screens and components</li><li>Consider system theme preferences</li><li>Maintain consistent styling across themes</li><li>Handle edge cases like theme switching during app usage</li></ul><p>With this implementation, you’ll have a flexible theming system that provides a great user experience and follows modern app development best practices.</p><p>Thanks for reading!</p><p>If you’re a founder, startup, or business looking to build a web application, mobile app, AI solution, or automate your business processes, <strong>Arahita Labs</strong> can help turn your ideas into production-ready products.</p><p>We specialize in:</p><ul><li>Custom Web &amp; Mobile App Development</li><li>AI Applications &amp; Automations</li><li>MVP Development for Startups</li><li>UI/UX Design</li><li>Backend Systems &amp; APIs</li></ul><p>Learn more at <a href="https://arahita.com/"><strong>https://arahita.com</strong></a> or connect with us to discuss your project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf26f32aba31" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing Google Sign-In in React Native: A Complete Guide]]></title>
            <link>https://medium.com/@vipinnation/implementing-google-sign-in-in-react-native-a-complete-guide-1581b0cd136b?source=rss-c54d20fb76cf------2</link>
            <guid isPermaLink="false">https://medium.com/p/1581b0cd136b</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[expo]]></category>
            <category><![CDATA[oauth]]></category>
            <dc:creator><![CDATA[Vipin Singh Inkiya]]></dc:creator>
            <pubDate>Tue, 28 Jan 2025 05:41:12 GMT</pubDate>
            <atom:updated>2026-06-25T15:55:28.625Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fsnx9wFM_RBoAriNSfz9mg.png" /></figure><h3>Introduction</h3><p>Google Sign-In integration has become a standard feature in modern mobile applications. It provides a seamless authentication experience while reducing friction in the user onboarding process. In this guide, we’ll walk through implementing Google Sign-In in a React Native application.</p><h4>Prerequisites</h4><p>Before we begin, make sure you have:</p><ul><li>A React Native project set up</li><li>Node.js and npm/yarn installed</li><li>Basic understanding of React Native development</li><li>A Google Cloud Console account</li></ul><h4>Setting Up Google Cloud Console</h4><ol><li>Go to the Google Cloud Console</li><li>Create a new project or select an existing one</li><li>Enable the Google Sign-In API</li><li>Configure OAuth consent screen</li><li>Create OAuth 2.0 client credentials</li></ol><ul><li>For Android: Generate SHA-1 fingerprint</li></ul><h3>Installation</h3><p>First, install the required dependencies:</p><pre>npm install @react-native-google-signin/google-signin<br># or<br>yarn add @react-native-google-signin/google-signin</pre><h3>Implementation</h3><p>Here’s a complete implementation of Google Sign-In:</p><pre>import { GoogleSignin, statusCodes } from &#39;@react-native-google-signin/google-signin&#39;;<br>import { useEffect, useState } from &#39;react&#39;;<br><br>// Configure Google Sign-In<br>GoogleSignin.configure({<br>  webClientId: &#39;YOUR_WEB_CLIENT_ID&#39;, <br>});<br><br>const GoogleAuth = () =&gt; {<br>  const [user, setUser] = useState(null);<br>  const [loading, setLoading] = useState(false);<br>  const [error, setError] = useState(null);<br><br>  useEffect(() =&gt; {<br>    checkCurrentUser();<br>  }, []);<br><br>  const checkCurrentUser = async () =&gt; {<br>    try {<br>      const isSignedIn = await GoogleSignin.isSignedIn();<br>      if (isSignedIn) {<br>        getCurrentUser();<br>      }<br>    } catch (error) {<br>      console.error(&#39;Check user error:&#39;, error);<br>    }<br>  };<br><br>  const getCurrentUser = async () =&gt; {<br>    try {<br>      const currentUser = await GoogleSignin.getCurrentUser();<br>      setUser(currentUser);<br>    } catch (error) {<br>      console.error(&#39;Get current user error:&#39;, error);<br>    }<br>  };<br><br>  const signIn = async () =&gt; {<br>    try {<br>      setLoading(true);<br>      setError(null);<br>      <br>      await GoogleSignin.hasPlayServices();<br>      const userInfo = await GoogleSignin.signIn();<br>      setUser(userInfo);<br>      <br>      // Get user&#39;s ID token<br>      const { accessToken, idToken } = await GoogleSignin.getTokens();<br>      // Send these tokens to your backend for verification<br>      <br>    } catch (error) {<br>      setError(error.message);<br>      if (error.code === statusCodes.SIGN_IN_CANCELLED) {<br>        console.log(&#39;Sign in cancelled&#39;);<br>      } else if (error.code === statusCodes.IN_PROGRESS) {<br>        console.log(&#39;Sign in in progress&#39;);<br>      } else if (error.code === statusCodes.PLAY_SERVICES_NOT_AVAILABLE) {<br>        console.log(&#39;Play services not available&#39;);<br>      } else {<br>        console.error(&#39;Sign-in error:&#39;, error);<br>      }<br>    } finally {<br>      setLoading(false);<br>    }<br>  };<br><br>  const signOut = async () =&gt; {<br>    try {<br>      await GoogleSignin.revokeAccess();<br>      await GoogleSignin.signOut();<br>      setUser(null);<br>    } catch (error) {<br>      console.error(&#39;Sign out error:&#39;, error);<br>    }<br>  };<br><br>  return {<br>    user,<br>    loading,<br>    error,<br>    signIn,<br>    signOut,<br>  };<br>};<br><br>export default GoogleAuth;</pre><h3>Usage</h3><p>Here’s how to use the GoogleAuth component:</p><pre>import GoogleAuth from &#39;./GoogleAuth&#39;;<br>const App = () =&gt; {<br> <br>const { user, loading, error, signIn, signOut } = GoogleAuth();<br><br>return (<br>    &lt;View style={styles.container}&gt;<br>      {loading ? (<br>        &lt;ActivityIndicator size=&quot;large&quot; /&gt;<br>      ) : user ? (<br>        &lt;&gt;<br>          &lt;Text&gt;Welcome, {user.user.name}&lt;/Text&gt;<br>          &lt;Button title=&quot;Sign Out&quot; onPress={signOut} /&gt;<br>        &lt;/&gt;<br>      ) : (<br>        &lt;Button title=&quot;Google Sign-In&quot; onPress={signIn} /&gt;<br>      )}<br>      {error &amp;&amp; &lt;Text style={styles.error}&gt;{error}&lt;/Text&gt;}<br>    &lt;/View&gt;<br>  );<br>};</pre><h3>Security Best Practices</h3><ol><li><strong>Token Verification</strong>: Always verify ID tokens on your backend server</li><li><strong>Scope Management</strong>: Request only the necessary scopes</li><li><strong>Error Handling</strong>: Implement comprehensive error handling</li><li><strong>Token Storage</strong>: Securely store tokens using secure storage solutions</li><li><strong>Regular Updates</strong>: Keep the Google Sign-In library updated</li></ol><h3>Common Issues and Solutions</h3><ol><li><strong>Configuration Issues</strong></li></ol><ul><li>Double-check your client IDs</li><li>Verify SHA-1 fingerprint for Android</li><li>Ensure bundle ID matches for iOS</li></ul><p>2. <strong>Play Services Errors</strong></p><ul><li>Implement proper Play Services availability check</li><li>Handle Play Services not available scenario</li></ul><p>3. <strong>Token Expiration</strong></p><ul><li>Implement token refresh mechanism</li><li>Handle token expiration gracefully</li></ul><h3>Conclusion</h3><p>Google Sign-In provides a robust authentication solution for React Native applications. While the initial setup might seem complex, following this guide should help you implement it successfully. Remember to handle edge cases and implement proper error handling for a smooth user experience.</p><h3>Resources</h3><ul><li>Official Google Sign-In Documentation</li><li>React Native Google Sign-In GitHub Repository</li><li>Google Cloud Console Documentation</li></ul><p>Thanks for reading!</p><p>If you’re a founder, startup, or business looking to build a web application, mobile app, AI solution, or automate your business processes, <strong>Arahita Labs</strong> can help turn your ideas into production-ready products.</p><p>We specialize in:</p><ul><li>Custom Web &amp; Mobile App Development</li><li>AI Applications &amp; Automations</li><li>MVP Development for Startups</li><li>UI/UX Design</li><li>Backend Systems &amp; APIs</li></ul><p>Learn more at <a href="https://arahita.com/"><strong>https://arahita.com</strong></a> or connect with us to discuss your project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1581b0cd136b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Convert Your React App Into a Desktop App]]></title>
            <link>https://medium.com/@vipinnation/how-to-convert-your-react-app-into-a-desktop-app-59bf0d2f5f8b?source=rss-c54d20fb76cf------2</link>
            <guid isPermaLink="false">https://medium.com/p/59bf0d2f5f8b</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[electron]]></category>
            <category><![CDATA[javascript-development]]></category>
            <dc:creator><![CDATA[Vipin Singh Inkiya]]></dc:creator>
            <pubDate>Sun, 06 Oct 2024 19:02:02 GMT</pubDate>
            <atom:updated>2026-06-25T15:55:42.126Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_6nYE8zNkOlXaFsCTRf5Dw.png" /></figure><p>If you’ve built a React web app and want to take it to the next level by making it available on desktop platforms, you’re in the right place! This guide will help you transform your React application into a desktop app using <strong>Electron</strong>, the most popular framework for building cross-platform desktop applications with JavaScript, HTML, and CSS.</p><p>By following these steps, you’ll unlock new possibilities for your app, delivering a better user experience and making it accessible beyond the browser.</p><h3>Why Convert Your React App to a Desktop App?</h3><p>Before diving into the technical details, let’s explore <strong>why</strong> you might want to convert your React app into a desktop app:</p><ol><li><strong>Offline Access</strong>: A desktop app can work offline, providing users uninterrupted access to your application without an internet connection.</li><li><strong>System Integration</strong>: Desktop apps can integrate more deeply with the operating system (file systems, notifications, and hardware access).</li><li><strong>User Experience</strong>: Desktop apps offer a different experience than browser-based apps, such as customized window controls and context menus.</li><li><strong>Monetization</strong>: Desktop apps can be distributed through platforms like the Windows Store or the Mac App Store.</li></ol><h3>Step 1: Setting Up Electron</h3><p>To convert your React app to a desktop app, we will use <strong>Electron</strong>. Electron combines <strong>Chromium</strong> and <strong>Node.js</strong> to build desktop apps with JavaScript. Essentially, it’s like wrapping your React app in a web browser but delivering it as a desktop app.</p><h3>Install Electron in Your React Project</h3><p>First, start by installing Electron:</p><pre>npm install electron --save-dev</pre><h3>Step 2: Create main.js</h3><p>Next, create a main.js file in the root of your project. This file will control the main process of your desktop app.</p><pre>const { app, BrowserWindow } = require(&#39;electron&#39;);<br>const path = require(&#39;path&#39;);</pre><pre>let mainWindow;</pre><pre>function createWindow() {<br>  mainWindow = new BrowserWindow({<br>    width: 800,<br>    height: 600,<br>    webPreferences: {<br>      preload: path.join(__dirname, &#39;preload.js&#39;),<br>      nodeIntegration: true,<br>    },<br>  });</pre><pre>  mainWindow.loadURL(&#39;http://localhost:3000&#39;); // Load your React app</pre><pre>  mainWindow.on(&#39;closed&#39;, function () {<br>    mainWindow = null;<br>  });<br>}</pre><pre>app.on(&#39;ready&#39;, createWindow);</pre><pre>app.on(&#39;window-all-closed&#39;, function () {<br>  if (process.platform !== &#39;darwin&#39;) {<br>    app.quit();<br>  }<br>});</pre><pre>app.on(&#39;activate&#39;, function () {<br>  if (mainWindow === null) {<br>    createWindow();<br>  }<br>});</pre><p>Here’s a quick breakdown of what’s happening in main.js:</p><ul><li>We create a new browser window with BrowserWindow.</li><li>We load our React app (running on localhost:3000).</li><li>We handle the window-all-closed event to quit the app when all windows are closed.</li></ul><h3>Step 3: Update package.json</h3><p>Add Electron as the start script for the desktop version. In package.json, add this to your scripts section:</p><pre>&quot;scripts&quot;: {<br>  &quot;start&quot;: &quot;react-scripts start&quot;,<br>  &quot;build&quot;: &quot;react-scripts build&quot;,<br>  &quot;electron&quot;: &quot;electron .&quot;<br>}</pre><p>Now you can run:</p><pre>npm run electron</pre><p>This will start Electron and load your React app in a desktop window. 🎉</p><h3>Step 4: Build Your React App for Production</h3><p>Once you’ve confirmed everything works, it’s time to build the React app. Run:</p><pre>npm run build</pre><p>This will bundle your React app into static files, which you can load into Electron.</p><h3>Step 5: Load Your Built React App in Electron</h3><p>Update your main.js file to load the production build instead of localhost:3000. Replace:</p><pre>mainWindow.loadURL(&#39;http://localhost:3000&#39;);</pre><p>With:</p><pre>mainWindow.loadFile(path.join(__dirname, &#39;build/index.html&#39;));</pre><h3>Step 6: Package Your App</h3><p>To package your desktop app, you can use <strong>Electron Builder</strong>, which simplifies the process of creating installers for your app.</p><p>Install Electron Builder:</p><pre>npm install electron-builder --save-dev</pre><p>Update your package.json to include a build section:</p><pre>&quot;build&quot;: {<br>  &quot;appId&quot;: &quot;com.example.react-desktop&quot;,<br>  &quot;productName&quot;: &quot;React Desktop App&quot;,<br>  &quot;directories&quot;: {<br>    &quot;output&quot;: &quot;dist&quot;<br>  },<br>  &quot;files&quot;: [<br>    &quot;build/**/*&quot;,<br>    &quot;main.js&quot;<br>  ],<br>  &quot;mac&quot;: {<br>    &quot;category&quot;: &quot;public.app-category.utilities&quot;<br>  },<br>  &quot;win&quot;: {<br>    &quot;target&quot;: &quot;nsis&quot;<br>  }<br>}</pre><p>Now you can package your app by running:</p><pre>npm run electron:build</pre><p>This command will create a packaged app in the dist folder, ready to be distributed!</p><h3>Bonus: Engaging With System APIs</h3><p>One of the coolest things about turning your React app into a desktop app is the ability to engage with system APIs. For example, you can display native notifications, interact with the file system, or even create system tray icons.</p><p>Here’s a quick example of how to show a native notification:</p><pre>const { Notification } = require(&#39;electron&#39;);</pre><pre>function showNotification() {<br>  const notification = {<br>    title: &#39;React Desktop App&#39;,<br>    body: &#39;Your desktop app is running successfully!&#39;,<br>  };</pre><pre>  new Notification(notification).show();<br>}</pre><pre>app.on(&#39;ready&#39;, showNotification);</pre><p>Now, when your app starts, it’ll show a native notification to the user. Imagine the possibilities!</p><h3>Wrapping Up</h3><p>Converting your React app into a desktop app opens up a world of new opportunities. With <strong>Electron</strong>, you can deliver a powerful, cross-platform desktop experience without needing to rebuild your entire app. Now you’ve got a fully functional desktop app from your React project — go out there and make something awesome!</p><h3>The Road Ahead</h3><p>You can dive deeper into Electron’s documentation to unlock even more features, such as system tray icons, advanced file handling, and deep OS integration. The journey doesn’t end here!</p><p>Happy coding, and welcome to the world of desktop development!</p><p>Thanks for reading!</p><p>If you’re a founder, startup, or business looking to build a web application, mobile app, AI solution, or automate your business processes, <strong>Arahita Labs</strong> can help turn your ideas into production-ready products.</p><p>We specialize in:</p><ul><li>Custom Web &amp; Mobile App Development</li><li>AI Applications &amp; Automations</li><li>MVP Development for Startups</li><li>UI/UX Design</li><li>Backend Systems &amp; APIs</li></ul><p>Learn more at <a href="https://arahita.com/"><strong>https://arahita.com</strong></a> or connect with us to discuss your project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59bf0d2f5f8b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Package Your Electron React App with Electron Builder]]></title>
            <link>https://medium.com/@vipinnation/package-your-electron-react-app-with-electron-builder-1d0609fd339c?source=rss-c54d20fb76cf------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d0609fd339c</guid>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[electron]]></category>
            <category><![CDATA[desktop]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Vipin Singh Inkiya]]></dc:creator>
            <pubDate>Fri, 27 Sep 2024 17:41:24 GMT</pubDate>
            <atom:updated>2026-06-25T15:56:06.904Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OaQBdIPy4ODS1TFckj16CA.png" /></figure><p>If you’re working with Electron and React, you might have reached a point where you’ve built an awesome desktop application but are now stuck wondering, <strong>“How do I package this and distribute it to users?”</strong>. Packaging your app so it runs smoothly across different platforms can feel like a daunting task — especially if you’re new to Electron or app distribution.</p><p>But don’t worry! In this post, I’ll walk you through how to use <strong>Electron Builder</strong> to package your Electron React app effortlessly. Whether you’re targeting Windows, macOS, or Linux, Electron Builder simplifies the entire process.</p><h3>Why Electron Builder?</h3><p>Electron Builder is a powerful tool designed to streamline the packaging of Electron apps for multiple platforms. It handles creating installers, auto-updates, and bundling all your app’s resources into a single executable file.</p><p>Some of the features of Electron Builder include:</p><ul><li><strong>Cross-platform packaging:</strong> Package your app for Windows, macOS, and Linux.</li><li><strong>Auto-updates:</strong> Electron Builder makes it easy to enable auto-updates for your app.</li><li><strong>Customizable:</strong> Allows deep customization of the build process if needed.</li></ul><h3>Step 1: Set Up Your Electron React App</h3><p>First, ensure you have a working Electron React app. If you don’t already have one, you can quickly create one using the following commands:</p><pre>npx create-react-app my-electron-app<br>cd my-electron-app<br>npm install --save-dev electron</pre><p>In your project’s public folder, add an index.js file as the entry point for Electron:</p><pre>// public/electron.js<br>const { app, BrowserWindow } = require(&#39;electron&#39;);<br>const path = require(&#39;path&#39;);<br><br>let mainWindow;<br><br>function createWindow() {<br>  mainWindow = new BrowserWindow({<br>    width: 800,<br>    height: 600,<br>    webPreferences: {<br>      preload: path.join(__dirname, &#39;preload.js&#39;),<br>    },<br>  });<br><br>  mainWindow.loadURL(&#39;http://localhost:3000&#39;);<br>  mainWindow.on(&#39;closed&#39;, function () {<br>    mainWindow = null;<br>  });<br>}<br><br>app.on(&#39;ready&#39;, createWindow);<br>app.on(&#39;window-all-closed&#39;, function () {<br>  if (process.platform !== &#39;darwin&#39;) {<br>    app.quit();<br>  }<br>});<br><br>app.on(&#39;activate&#39;, function () {<br>  if (mainWindow === null) {<br>    createWindow();<br>  }<br>});</pre><p>Now, modify your package.json to add Electron startup scripts:</p><pre>&quot;scripts&quot;: {<br>  &quot;start&quot;: &quot;react-scripts start&quot;,<br>  &quot;electron&quot;: &quot;electron public/electron.js&quot;,<br>  &quot;build&quot;: &quot;react-scripts build&quot;,<br>  &quot;postinstall&quot;: &quot;electron-builder install-app-deps&quot;<br>}</pre><h3>Step 2: Install Electron Builder</h3><p>Next, you need to install <strong>Electron Builder</strong> and configure it. Run the following command to install it as a development dependency:</p><pre>npm install --save-dev electron-builder</pre><p>Now, update your package.json with the build configuration:</p><pre>&quot;build&quot;: {<br>  &quot;appId&quot;: &quot;com.my-electron-app&quot;,<br>  &quot;productName&quot;: &quot;MyElectronApp&quot;,<br>  &quot;files&quot;: [<br>    &quot;build/**/*&quot;,<br>    &quot;public/electron.js&quot;<br>  ],<br>  &quot;directories&quot;: {<br>    &quot;buildResources&quot;: &quot;assets&quot;<br>  },<br>  &quot;mac&quot;: {<br>    &quot;target&quot;: &quot;dmg&quot;<br>  },<br>  &quot;win&quot;: {<br>    &quot;target&quot;: &quot;nsis&quot;<br>  },<br>  &quot;linux&quot;: {<br>    &quot;target&quot;: &quot;AppImage&quot;<br>  }<br>}</pre><p>This configuration does the following:</p><ul><li>Sets the app ID and product name.</li><li>Specifies what files should be included in the final build (build/**/* includes all files from React&#39;s production build).</li><li>Specifies the target platforms: .dmg for macOS, .nsis for Windows, and .AppImage for Linux.</li></ul><h3>Step 3: Build Your App</h3><p>Once everything is set up, it’s time to package your app. First, create a production build of your React app:</p><pre>npm run build</pre><p>Then, to package your Electron app using Electron Builder, run:</p><pre>npx electron-builder</pre><p>Electron Builder will take care of the rest — bundling your app into an installer for your operating system. You can find the packaged files in the dist/ folder.</p><h3>Step 5: Distribute Your App</h3><p>Now that your app is packaged, you can distribute it to users! Simply share the installer files (e.g., .exe for Windows, .dmg for macOS) with your users. You can also automate updates using Electron Builder’s built-in auto-update functionality.</p><h3>Conclusion</h3><p>Packaging an Electron React app may seem challenging at first, but with Electron Builder, the process is simplified into just a few steps. Whether you’re targeting Windows, macOS, or Linux, you can package your app and prepare it for distribution easily.</p><p>By following the steps in this guide, you’ll be able to ship your Electron React app to your users and start delivering a seamless desktop experience.</p><p>Thanks for reading!</p><p>If you’re a founder, startup, or business looking to build a web application, mobile app, AI solution, or automate your business processes, <strong>Arahita Labs</strong> can help turn your ideas into production-ready products.</p><p>We specialize in:</p><ul><li>Custom Web &amp; Mobile App Development</li><li>AI Applications &amp; Automations</li><li>MVP Development for Startups</li><li>UI/UX Design</li><li>Backend Systems &amp; APIs</li></ul><p>Learn more at <a href="https://arahita.com/"><strong>https://arahita.com</strong></a> or connect with us to discuss your project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d0609fd339c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring Maps in Expo with React Native]]></title>
            <link>https://medium.com/@vipinnation/exploring-maps-in-expo-with-react-native-d4559829c2cb?source=rss-c54d20fb76cf------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4559829c2cb</guid>
            <category><![CDATA[react-native-development]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[google-maps]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[expo]]></category>
            <dc:creator><![CDATA[Vipin Singh Inkiya]]></dc:creator>
            <pubDate>Mon, 16 Sep 2024 13:18:10 GMT</pubDate>
            <atom:updated>2026-06-25T15:56:19.843Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LmeokDtWuThnmJ1ry6JQFw.png" /></figure><p>Maps are essential to mobile apps, from navigation to location-based services. If you’re building a React Native app using Expo, integrating maps is straightforward with the help of react-native-maps. In this blog, we&#39;ll explore how to add and configure maps in an Expo project, including showing markers, customizing views, and handling user interactions.</p><h3>Setting Up Expo with React Native Maps</h3><p>Before diving into coding, ensure you have the necessary setup to integrate maps into your Expo app. Here’s a step-by-step guide:</p><h3>1. Initialize a New Expo Project</h3><p>If you haven’t already started your project, create one using Expo CLI:</p><pre>npx create-expo-app react-native-maps-demo<br>cd react-native-maps-demo</pre><h3>2. Install Dependencies</h3><p>To use maps, you’ll need to install the react-native-maps package, which integrates with Expo.</p><pre>expo install react-native-maps</pre><p>This command will ensure compatibility with the Expo environment.</p><h3>3. Obtain API Keys</h3><p>You&#39;ll need an API key to render maps from a service like Google Maps. You can get one by visiting the Google Cloud Platform and enabling the Maps SDK for Android and iOS.</p><p>Add the API key to your project by following these steps:</p><ul><li>For <strong>Android</strong>, add the key to app.json under the android.config.googleMaps.apiKey field.</li><li>For <strong>iOS</strong>, the key will be automatically detected if you’re using the default Expo Maps configuration.</li></ul><h3>4. Map Component</h3><p>Now, let’s create a simple map view. Here’s a basic map implementation with a marker in the center.</p><pre>import React from &#39;react&#39;;<br>import { StyleSheet, View } from &#39;react-native&#39;;<br>import MapView, { Marker } from &#39;react-native-maps&#39;;<br><br>export default function App() {<br>  return (<br>    &lt;View style={styles.container}&gt;<br>      &lt;MapView<br>        style={styles.map}<br>        initialRegion={{<br>          latitude: 37.78825,<br>          longitude: -122.4324,<br>          latitudeDelta: 0.0922,<br>          longitudeDelta: 0.0421,<br>        }}<br>      &gt;<br>        &lt;Marker<br>          coordinate={{<br>            latitude: 37.78825,<br>            longitude: -122.4324,<br>          }}<br>          title=&quot;My Location&quot;<br>          description=&quot;This is a marker in San Francisco&quot;<br>        /&gt;<br>      &lt;/MapView&gt;<br>    &lt;/View&gt;<br>  );<br>}<br><br>const styles = StyleSheet.create({<br>  container: {<br>    flex: 1,<br>    backgroundColor: &#39;#fff&#39;,<br>  },<br>  map: {<br>    width: &#39;100%&#39;,<br>    height: &#39;100%&#39;,<br>  },<br>});</pre><h3>5. Customizing the Map</h3><h4>5.1 Changing Map Styles</h4><p>Expo allows you to switch between different map types, such as standard, satellite, terrain, and hybrid.</p><pre>&lt;MapView<br>  style={styles.map}<br>  mapType=&quot;satellite&quot;<br>  initialRegion={{<br>    latitude: 37.78825,<br>    longitude: -122.4324,<br>    latitudeDelta: 0.0922,<br>    longitudeDelta: 0.0421,<br>  }}<br>&gt;</pre><p>Other available map types include:</p><ul><li>standard</li><li>hybrid</li><li>terrain</li></ul><h4>5.2 Adding Multiple Markers</h4><p>If your app needs to show multiple locations, you can add multiple Marker components.</p><pre>&lt;Marker<br>  coordinate={{ latitude: 37.78825, longitude: -122.4324 }}<br>  title=&quot;Marker 1&quot;<br>/&gt;<br>&lt;Marker<br>  coordinate={{ latitude: 37.75825, longitude: -122.4624 }}<br>  title=&quot;Marker 2&quot;<br>/&gt;</pre><h3>6. Handling User Interactions</h3><p>You can also capture user actions such as long pressing on the map to drop a marker.</p><pre>&lt;MapView<br>  style={styles.map}<br>  onLongPress={(e) =&gt; {<br>    console.log(&quot;Coordinates&quot;, e.nativeEvent.coordinate);<br>  }}<br>/&gt;</pre><p>This way, you can allow users to interact with the map, choose locations, or trigger specific events.</p><h3>7. Custom Markers</h3><p>For a more personalized experience, you can use custom markers by passing a custom view or image into the Marker component.</p><pre>&lt;Marker<br>  coordinate={{ latitude: 37.78825, longitude: -122.4324 }}<br>&gt;<br>  &lt;View style={styles.customMarker}&gt;<br>    &lt;Text&gt;📍&lt;/Text&gt;<br>  &lt;/View&gt;<br>&lt;/Marker&gt;</pre><p>Here, you can customize the marker to match your app’s theme or functionality.</p><h3>8. Map Clustering</h3><p>In scenarios where many markers are displayed, clustering can help simplify the user experience. Expo doesn’t directly support clustering, but you can implement it using third-party libraries like react-native-map-clustering.</p><pre>npm install react-native-map-clustering</pre><p>Then, wrap your MapView with the MapClusterer component:</p><pre>import MapView from &#39;react-native-maps&#39;;<br>import MapViewCluster from &#39;react-native-map-clustering&#39;;<br><br>&lt;MapViewCluster<br>  region={region}<br>  style={{ flex: 1 }}<br>&gt;<br>  {markers.map(marker =&gt; (<br>    &lt;Marker key={marker.id} coordinate={marker.coordinate} /&gt;<br>  ))}<br>&lt;/MapViewCluster&gt;</pre><p>This reduces map clutter and enhances readability.</p><h3>9. Testing on Real Devices</h3><p>It’s recommended to test map functionalities on a physical device as the emulator may have limited support for GPS and map interactions.</p><p>To run on a real device, simply use:</p><pre>expo start</pre><p>Scan the QR code with your Expo Go app, and your app will open on the device.</p><h3>Conclusion</h3><p>Integrating maps in Expo with React Native is a powerful way to provide location-based features in your apps. With the help of react-native-maps, you can easily show maps, add markers, and handle user interactions. By customizing map styles and markers, you can offer users a polished, interactive experience.</p><p>Maps have the potential to make your app more engaging, whether you’re building a delivery tracker, a local service locator, or a travel guide.</p><p>Start building today, and bring your ideas to life with maps in Expo React Native!</p><p>Thanks for reading!</p><p>If you’re a founder, startup, or business looking to build a web application, mobile app, AI solution, or automate your business processes, <strong>Arahita Labs</strong> can help turn your ideas into production-ready products.</p><p>We specialize in:</p><ul><li>Custom Web &amp; Mobile App Development</li><li>AI Applications &amp; Automations</li><li>MVP Development for Startups</li><li>UI/UX Design</li><li>Backend Systems &amp; APIs</li></ul><p>Learn more at <a href="https://arahita.com/"><strong>https://arahita.com</strong></a> or connect with us to discuss your project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4559829c2cb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Fetch User Location in Expo Router: A Comprehensive Guide]]></title>
            <link>https://medium.com/@vipinnation/how-to-fetch-user-location-in-expo-router-a-comprehensive-guide-592ad69aada4?source=rss-c54d20fb76cf------2</link>
            <guid isPermaLink="false">https://medium.com/p/592ad69aada4</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[expo]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-native-development]]></category>
            <dc:creator><![CDATA[Vipin Singh Inkiya]]></dc:creator>
            <pubDate>Mon, 09 Sep 2024 04:40:10 GMT</pubDate>
            <atom:updated>2026-06-25T15:56:33.117Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zOIgIzKSG63gpus2Ozj2_A.png" /></figure><p>In many mobile applications, fetching the user’s location can enhance functionality, whether it’s for navigation, local recommendations, or personalized content based on the user’s geographic area. In this blog post, we’ll explore how to fetch the user’s location using Expo’s built-in libraries, specifically integrating with the new <strong>Expo Router</strong>.</p><h3>Prerequisites</h3><p>To follow along, you’ll need:</p><ol><li>A working Expo project (You can create one using expo init).</li><li>Basic knowledge of <strong>React Native</strong> and <strong>JavaScript/TypeScript</strong>.</li><li>An understanding of the <strong>Expo Router</strong> (new in SDK 49+), which simplifies routing in Expo apps.</li></ol><h3>Step 1: Install Required Packages</h3><p>First, you need to install expo-location to access the device&#39;s location and expo-router for routing.</p><p>Run the following commands in your project directory:</p><pre>expo install expo-location<br>npm install expo-router</pre><p>expo-location provides access to location services, while expo-router is useful for handling navigation between screens.</p><h3>Step 2: Set Up Permissions</h3><p>Fetching the user’s location requires permission. In Expo, permissions for accessing the location are handled with expo-location.</p><p>For <strong>iOS</strong>, you’ll need to configure your app.json or app.config.js to include the appropriate location permissions:</p><pre>{<br>  &quot;expo&quot;: {<br>    &quot;ios&quot;: {<br>      &quot;infoPlist&quot;: {<br>        &quot;NSLocationWhenInUseUsageDescription&quot;: &quot;This app needs access to your location to show your current position.&quot;<br>      }<br>    }<br>  }<br>}</pre><p>For <strong>Android</strong>, ensure that your app.json includes the following permissions:</p><pre>{<br>  &quot;expo&quot;: {<br>    &quot;android&quot;: {<br>      &quot;permissions&quot;: [&quot;ACCESS_FINE_LOCATION&quot;]<br>    }<br>  }<br>}</pre><h3>Step 3: Fetch the User’s Location</h3><p>Now that permissions are configured, we can create a component to fetch and display the user’s location.</p><pre>import React, { useState, useEffect } from &#39;react&#39;;<br>import { View, Text, Button, ActivityIndicator } from &#39;react-native&#39;;<br>import * as Location from &#39;expo-location&#39;;<br>import { useRouter } from &#39;expo-router&#39;;<br><br>const LocationScreen = () =&gt; {<br>  const [location, setLocation] = useState&lt;Location.LocationObject | null&gt;(null);<br>  const [errorMsg, setErrorMsg] = useState&lt;string | null&gt;(null);<br>  const [loading, setLoading] = useState&lt;boolean&gt;(false);<br><br>  const router = useRouter();<br><br>  useEffect(() =&gt; {<br>    fetchLocation();<br>  }, []);<br><br>  const fetchLocation = async () =&gt; {<br>    setLoading(true);<br>    try {<br>      let { status } = await Location.requestForegroundPermissionsAsync();<br>      if (status !== &#39;granted&#39;) {<br>        setErrorMsg(&#39;Permission to access location was denied&#39;);<br>        return;<br>      }<br><br>      let locationData = await Location.getCurrentPositionAsync({});<br>      setLocation(locationData);<br>    } catch (error) {<br>      setErrorMsg(&#39;Error fetching location&#39;);<br>    } finally {<br>      setLoading(false);<br>    }<br>  };<br><br>  if (loading) {<br>    return &lt;ActivityIndicator size=&quot;large&quot; color=&quot;#0000ff&quot; /&gt;;<br>  }<br><br>  return (<br>    &lt;View style={{ flex: 1, alignItems: &#39;center&#39;, justifyContent: &#39;center&#39; }}&gt;<br>      {errorMsg ? (<br>        &lt;Text&gt;{errorMsg}&lt;/Text&gt;<br>      ) : location ? (<br>        &lt;View&gt;<br>          &lt;Text&gt;Latitude: {location.coords.latitude}&lt;/Text&gt;<br>          &lt;Text&gt;Longitude: {location.coords.longitude}&lt;/Text&gt;<br>        &lt;/View&gt;<br>      ) : (<br>        &lt;Text&gt;Fetching location...&lt;/Text&gt;<br>      )}<br>      &lt;Button title=&quot;Go Back&quot; onPress={() =&gt; router.back()} /&gt;<br>    &lt;/View&gt;<br>  );<br>};<br><br>export default LocationScreen;</pre><p>In this example:</p><ul><li>We request location permission using Location.requestForegroundPermissionsAsync().</li><li>Once permission is granted, we fetch the user’s current location using Location.getCurrentPositionAsync().</li><li>If permission is denied or an error occurs, an appropriate error message is shown.</li></ul><p>We use useRouter from <strong>Expo Router</strong> to allow for navigation back to the previous screen with the router.back() function.</p><h3>Step 4: Add a Route in the Expo Router</h3><p>In <strong>Expo Router</strong>, files in the app directory map to screens, so to navigate to the location screen, create a new screen in the app directory.</p><p>Here’s an example of how to set up routing:</p><pre>// app/_layout.tsx<br>import { Stack } from &#39;expo-router&#39;;<br><br>export default function Layout() {<br>  return (<br>    &lt;Stack&gt;<br>      &lt;Stack.Screen name=&quot;index&quot; options={{ title: &#39;Home&#39; }} /&gt;<br>      &lt;Stack.Screen name=&quot;location&quot; options={{ title: &#39;User Location&#39; }} /&gt;<br>    &lt;/Stack&gt;<br>  );<br>}</pre><p>Now, in the app/index.tsx, we create a home screen with a button to navigate to the location screen:</p><pre>import { View, Button } from &#39;react-native&#39;;<br>import { useRouter } from &#39;expo-router&#39;;<br><br>export default function HomeScreen() {<br>  const router = useRouter();<br><br>  return (<br>    &lt;View style={{ flex: 1, justifyContent: &#39;center&#39;, alignItems: &#39;center&#39; }}&gt;<br>      &lt;Button title=&quot;Fetch User Location&quot; onPress={() =&gt; router.push(&#39;/location&#39;)} /&gt;<br>    &lt;/View&gt;<br>  );<br>}</pre><p>When the button is clicked, the user will be taken to the /location screen where the app fetches and displays the user&#39;s location.</p><h3>Step 5: Testing the App</h3><p>To test location fetching:</p><ol><li>If you’re using an <strong>emulator</strong>, ensure that you simulate location data in your emulator settings.</li><li>On a <strong>physical device</strong>, you can test the real-time location feature.</li></ol><p>If everything works as expected, the user’s latitude and longitude will be displayed on the screen.</p><h3>Conclusion</h3><p>Fetching a user’s location in Expo using <strong>expo-location</strong> and routing with the <strong>Expo Router</strong> is straightforward and powerful. You can now build location-aware apps that leverage this functionality to provide personalized user experiences. With Expo’s permission management and easy routing, your development process is smoother than ever.</p><p>Thanks for reading!</p><p>If you’re a founder, startup, or business looking to build a web application, mobile app, AI solution, or automate your business processes, <strong>Arahita Labs</strong> can help turn your ideas into production-ready products.</p><p>We specialize in:</p><ul><li>Custom Web &amp; Mobile App Development</li><li>AI Applications &amp; Automations</li><li>MVP Development for Startups</li><li>UI/UX Design</li><li>Backend Systems &amp; APIs</li></ul><p>Learn more at <a href="https://arahita.com/"><strong>https://arahita.com</strong></a> or connect with us to discuss your project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=592ad69aada4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>