<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Harshit Kumar</title>
    <description>The latest articles on Forem by Harshit Kumar (@harshitkumar31).</description>
    <link>https://forem.com/harshitkumar31</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F75811%2F09ae71bf-3e48-4450-86b6-09f53b55ed16.webp</url>
      <title>Forem: Harshit Kumar</title>
      <link>https://forem.com/harshitkumar31</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/harshitkumar31"/>
    <language>en</language>
    <item>
      <title>Build Apps with Google AI Studio</title>
      <dc:creator>Harshit Kumar</dc:creator>
      <pubDate>Sun, 06 Jul 2025 11:48:10 +0000</pubDate>
      <link>https://forem.com/harshitkumar31/build-apps-with-google-ai-studio-2jac</link>
      <guid>https://forem.com/harshitkumar31/build-apps-with-google-ai-studio-2jac</guid>
      <description>&lt;p&gt;&lt;em&gt;This post is my submission for &lt;a href="https://dev.to/deved/build-apps-with-google-ai-studio"&gt;DEV Education Track: Build Apps with Google AI Studio&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;I built an app which generates a superhero's image along with their origin story and description of their powers&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://superhero-generator-ai-170554363231.us-west1.run.app/" rel="noopener noreferrer"&gt;https://superhero-generator-ai-170554363231.us-west1.run.app/&lt;/a&gt;&lt;/p&gt;

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

&lt;h2&gt;
  
  
  My Experience
&lt;/h2&gt;

&lt;p&gt;It was a very straightforward tutorial to follow, and I could easily follow along. Google has come up with an awesome product which will help folks build apps pretty easily. &lt;/p&gt;

</description>
      <category>deved</category>
      <category>learngoogleaistudio</category>
      <category>ai</category>
      <category>gemini</category>
    </item>
    <item>
      <title>Setup a NAS + Homelab using Raspberry Pi</title>
      <dc:creator>Harshit Kumar</dc:creator>
      <pubDate>Sat, 28 Jun 2025 06:31:34 +0000</pubDate>
      <link>https://forem.com/harshitkumar31/setup-a-nas-homelab-using-raspberry-pi-14pl</link>
      <guid>https://forem.com/harshitkumar31/setup-a-nas-homelab-using-raspberry-pi-14pl</guid>
      <description>&lt;p&gt;Setup a NAS + Homelab using Raspberry Pi&lt;/p&gt;

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

&lt;p&gt;I was tired of using cloud storage solutions and wanted to set up my own Network Attached Storage (NAS) at home.&lt;br&gt;
I also wanted to peek behind the curtains of how an app like Google photos works, where you can upload your photos and access them from anywhere.&lt;br&gt;
After some research, I decided to use a Raspberry Pi for this purpose. &lt;br&gt;
This article will guide you through the steps to set up your own NAS using a Raspberry Pi.&lt;br&gt;
It will also guide you through the process of setting up OpenMediaVault, CasaOs, Immich and Tailscale on your Raspberry Pi.&lt;br&gt;
All of these are quite easy to set up and will give you the ability to access your photos from anywhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.amazon.in/dp/B0CK2FCG1K?ref=ppx_yo2ov_dt_b_fed_asin_title" rel="noopener noreferrer"&gt;A Raspberry Pi (I used a Raspberry Pi 5 with 8GB RAM)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.amazon.in/dp/B0CZ4DGS18?ref=ppx_yo2ov_dt_b_fed_asin_title" rel="noopener noreferrer"&gt;Active cooler&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.amazon.in/dp/B0BDYVC5TD?ref=ppx_yo2ov_dt_b_fed_asin_title" rel="noopener noreferrer"&gt;A microSD card (I used a 64GB SanDisk Ultra)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://evelta.com/radxa-penta-sata-hat-for-rpi5-rock-5c-nas-server-solution/?srsltid=AfmBOopdK8priZIjp7Eb4EftHB_AXzeWMV6XroYQ5BnRA9VoIJO4iGK3" rel="noopener noreferrer"&gt;Radxa SATA HAT&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.amazon.in/dp/B07YD579WM?ref=ppx_yo2ov_dt_b_fed_asin_title" rel="noopener noreferrer"&gt;3 2.5 inch SATA SSDs (I used 3 1TB SSDs)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.amazon.in/dp/B0D4DM1D21?ref=ppx_yo2ov_dt_b_fed_asin_title" rel="noopener noreferrer"&gt;A USB-C power supply (I used a 5V 3A power supply)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setting up the Raspberry Pi
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Download the latest version of Raspberry Pi OS from the &lt;a href="https://www.raspberrypi.org/software/operating-systems/" rel="noopener noreferrer"&gt;official website&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Use &lt;a href="https://www.raspberrypi.org/software/" rel="noopener noreferrer"&gt;Raspberry Pi Imager&lt;/a&gt; to flash the OS onto the microSD card. You can follow &lt;a href="https://www.raspberrypi.com/documentation/computers/getting-started.html" rel="noopener noreferrer"&gt;https://www.raspberrypi.com/documentation/computers/getting-started.html&lt;/a&gt; for detailed instructions on how to do this.&lt;/li&gt;
&lt;li&gt;Insert the microSD card into the Raspberry Pi.&lt;/li&gt;
&lt;li&gt;Connect the active cooler to the Raspberry Pi.
You will need to break off 3 fins from the active cooler to make the SATA hat fit properly on the Raspberry Pi 5. Jeff Geerling has a video on how to do this: &lt;a href="https://youtu.be/l30sADfDiM8?si=iaZ1BJsbp0UnbNWb&amp;amp;t=362" rel="noopener noreferrer"&gt;The ULTIMATE Raspberry Pi 5 NAS&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Connect the Radxa SATA HAT to the Raspberry Pi.
Make sure to follow the instructions provided by Radxa for connecting the SATA HAT to the Raspberry Pi. You can find the instructions on their &lt;a href="https://docs.radxa.com/en/accessories/penta-sata-hat/penta-for-rpi5" rel="noopener noreferrer"&gt;website&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Connect the 3 SATA SSDs to the Radxa SATA HAT.&lt;/li&gt;
&lt;li&gt;Connect the USB-C power supply to the Raspberry Pi.&lt;/li&gt;
&lt;li&gt;Power on the Raspberry Pi and wait for it to boot up.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Setting up OpenMediaVault
&lt;/h2&gt;

&lt;p&gt;We will use OpenMediaVault (OMV) as our NAS operating system. OMV is a free network-attached storage server based on the Debian operating system. It provides a web-based interface to manage your storage, shares, and services.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open a terminal on your Raspberry Pi or connect to it via SSH.&lt;/li&gt;
&lt;li&gt;Update the package list and install the necessary dependencies:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Install OpenMediaVault using the following command:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;wget &lt;span class="nt"&gt;-O&lt;/span&gt; - https://raw.githubusercontent.com/openmediavault/openmediavault/master/install.sh | &lt;span class="nb"&gt;sudo &lt;/span&gt;bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;After the installation is complete, you can access the OpenMediaVault web interface by navigating to &lt;code&gt;http://&amp;lt;your-raspberry-pi-ip-address&amp;gt;&lt;/code&gt; in your web browser.&lt;/li&gt;
&lt;li&gt;Log in with the default credentials:

&lt;ul&gt;
&lt;li&gt;Username: &lt;code&gt;admin&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Password: &lt;code&gt;openmediavault&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Change the default password after logging in for the first time.&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setting up CasaOS
&lt;/h2&gt;

&lt;p&gt;CasaOS is a user-friendly home server operating system that allows you to manage your files, applications, and services easily. It provides a web interface to manage your NAS and other services.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Open a terminal on your Raspberry Pi or connect to it via SSH.&lt;/li&gt;
&lt;li&gt;Install Docker if it is not already installed:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;      &lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;docker.io
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Start the Docker service:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;      &lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start docker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Enable Docker to start on boot:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;      &lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;docker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Install CasaOS using the following command:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;      curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://get.casaos.io | &lt;span class="nb"&gt;sudo &lt;/span&gt;bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;After the installation is complete, you can access the CasaOS web interface by navigating to &lt;code&gt;http://&amp;lt;your-raspberry-pi-ip-address&amp;gt;:port&lt;/code&gt; in your web browser.
Replace &lt;code&gt;port&lt;/code&gt; with the port number you specified during the installation (default is 80).&lt;/li&gt;
&lt;li&gt;Log in with the default credentials:

&lt;ul&gt;
&lt;li&gt;Username: &lt;code&gt;admin&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Password: &lt;code&gt;casaos&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Change the default password after logging in for the first time.&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setting up Raid 5
&lt;/h2&gt;

&lt;p&gt;To set up a RAID 5 array with the 3 SATA SSDs connected to the Radxa SATA HAT, you can use OpenMediaVault's web interface. RAID 5 provides a good balance of performance and redundancy, allowing you to lose one drive without losing data.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the OpenMediaVault web interface.&lt;/li&gt;
&lt;li&gt;Go to &lt;code&gt;Storage&lt;/code&gt; &amp;gt; &lt;code&gt;Disks&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;You should see the 3 SATA SSDs listed there. If they are not listed, you may need to format them first. Also check if you have followed the instructions to connect the Radxa SATA HAT and the SSDs properly.

&lt;ul&gt;
&lt;li&gt;To format a disk, select it and click on &lt;code&gt;Wipe&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Choose &lt;code&gt;Quick&lt;/code&gt; or &lt;code&gt;Secure&lt;/code&gt; wipe as per your preference.&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;Yes&lt;/code&gt; to confirm.&lt;/li&gt;
&lt;li&gt;Repeat this for all 3 SSDs.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Go to &lt;code&gt;Storage&lt;/code&gt; &amp;gt; &lt;code&gt;RAID Management&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;Create&lt;/code&gt; to create a new RAID array.&lt;/li&gt;
&lt;li&gt;Select &lt;code&gt;RAID 5&lt;/code&gt; as the RAID level.&lt;/li&gt;
&lt;li&gt;Select the 3 SSDs you want to include in the RAID array.&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;Create&lt;/code&gt; to create the RAID array.&lt;/li&gt;
&lt;li&gt;Wait for the RAID array to be created. This may take some time depending on the size of the SSDs.&lt;/li&gt;
&lt;li&gt;Once the RAID array is created, you can see it listed under &lt;code&gt;Storage&lt;/code&gt; &amp;gt; &lt;code&gt;RAID Management&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Go to &lt;code&gt;Storage&lt;/code&gt; &amp;gt; &lt;code&gt;File Systems&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;Create&lt;/code&gt; to create a new file system.&lt;/li&gt;
&lt;li&gt;Select the RAID array you just created.&lt;/li&gt;
&lt;li&gt;Choose the file system type (e.g., &lt;code&gt;ext4&lt;/code&gt;) and give it a name.&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;Create&lt;/code&gt; to create the file system.&lt;/li&gt;
&lt;li&gt;Once the file system is created, you can see it listed under &lt;code&gt;Storage&lt;/code&gt; &amp;gt; &lt;code&gt;File Systems&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click on the file system and then click on &lt;code&gt;Mount&lt;/code&gt; to mount it.&lt;/li&gt;
&lt;li&gt;Go to &lt;code&gt;Storage&lt;/code&gt; &amp;gt; &lt;code&gt;Shared Folders&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;Add&lt;/code&gt; to create a new shared folder.&lt;/li&gt;
&lt;li&gt;Select the file system you just created and give the shared folder a name.&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;Save&lt;/code&gt; to create the shared folder.&lt;/li&gt;
&lt;li&gt;Go to &lt;code&gt;Access Rights Management&lt;/code&gt; &amp;gt; &lt;code&gt;User&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;Add&lt;/code&gt; to create a new user.&lt;/li&gt;
&lt;li&gt;Give the user a name and password.&lt;/li&gt;
&lt;li&gt;Assign the user to the shared folder you created earlier.&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;Save&lt;/code&gt; to create the user.&lt;/li&gt;
&lt;li&gt;Go to &lt;code&gt;Services&lt;/code&gt; &amp;gt; &lt;code&gt;SMB/CIFS&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Enable the SMB/CIFS service.&lt;/li&gt;
&lt;li&gt;Go to &lt;code&gt;Shares&lt;/code&gt; and click on &lt;code&gt;Add&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Select the shared folder you created earlier and give it a name.&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;Save&lt;/code&gt; to create the share.&lt;/li&gt;
&lt;li&gt;You can now access the shared folder from your local network using the SMB/CIFS protocol.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Setting up Tailscale
&lt;/h2&gt;

&lt;p&gt;Tailscale is a secure VPN service that allows you to access your devices from anywhere. It creates a secure connection between your devices, allowing you to access your NAS from anywhere in the world.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open a terminal on your Raspberry Pi or connect to it via SSH.&lt;/li&gt;
&lt;li&gt;Install Tailscale using the casaos app store or by following the instructions by BigBearTechWorld on &lt;a href="https://www.youtube.com/watch?v=BvVkM-EkmXM" rel="noopener noreferrer"&gt;YouTube&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;After the installation is complete, you can access the Tailscale web interface by navigating to &lt;code&gt;http://&amp;lt;your-raspberry-pi-ip-address&amp;gt;:port&lt;/code&gt; in your web browser.
Replace &lt;code&gt;port&lt;/code&gt; with the port number you specified during the installation (default is 80).&lt;/li&gt;
&lt;li&gt;Log in with your Tailscale account credentials.&lt;/li&gt;
&lt;li&gt;Follow the instructions to connect your Raspberry Pi to Tailscale.&lt;/li&gt;
&lt;li&gt;Once connected, you can access your Raspberry Pi from anywhere using the Tailscale IP address.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Setting up Immich
&lt;/h2&gt;

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

&lt;p&gt;Immich is a self-hosted photo and video backup solution that allows you to upload your photos and videos to your NAS and access them from anywhere. It provides a web interface to manage your photos and videos, and it also has mobile apps for iOS and Android.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open a terminal on your Raspberry Pi or connect to it via SSH.&lt;/li&gt;
&lt;li&gt;Install Immich using the casaos app store or by following the instructions on the &lt;a href="https://github.com/immich-app/immich" rel="noopener noreferrer"&gt;Immich GitHub repository&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;After the installation is complete, you can access the Immich web interface by navigating to &lt;code&gt;http://&amp;lt;your-raspberry-pi-ip-address&amp;gt;:port&lt;/code&gt; in your web browser.
Replace &lt;code&gt;port&lt;/code&gt; with the port number you specified during the installation (default is 80).&lt;/li&gt;
&lt;li&gt;Log in with your Immich account credentials.&lt;/li&gt;
&lt;li&gt;Follow the instructions to connect your Raspberry Pi to Immich.&lt;/li&gt;
&lt;li&gt;Once connected, you can upload your photos and videos to Immich and access them from anywhere using the Immich web interface or mobile apps.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Setting up Immich mobile app
&lt;/h2&gt;

&lt;p&gt;To access your photos and videos on the go, you can install the Immich mobile app on your iOS or Android device.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Download the Immich app from the &lt;a href="https://apps.apple.com/app/immich/id1676468700" rel="noopener noreferrer"&gt;App Store&lt;/a&gt; or &lt;a href="https://play.google.com/store/apps/details?id=com.immich.app" rel="noopener noreferrer"&gt;Google Play Store&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Open the app and log in with your Immich account credentials (make sure you are on your local network or connected via Tailscale to access your raspberry pi).&lt;/li&gt;
&lt;li&gt;Once logged in, you can access your photos and videos from your NAS and upload new photos and videos directly from your mobile device.&lt;/li&gt;
&lt;li&gt;You can also enable automatic backup of your photos and videos to Immich by going to the app settings and enabling the "Automatic Backup" option.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Setting up Portainer on CasaOS
&lt;/h2&gt;

&lt;p&gt;Portainer is a lightweight management UI that allows you to easily manage your Docker containers, images, networks, and volumes. It provides a web interface to manage your Docker environment.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the CasaOS web interface.&lt;/li&gt;
&lt;li&gt;Go to the App Store and search for "Portainer".&lt;/li&gt;
&lt;li&gt;Click on the Portainer app and then click on "Install".&lt;/li&gt;
&lt;li&gt;Follow the instructions to install Portainer.&lt;/li&gt;
&lt;li&gt;After the installation is complete, you can access the Portainer web interface by navigating to &lt;code&gt;http://&amp;lt;your-raspberry-pi-ip-address&amp;gt;:9000&lt;/code&gt; in your web browser.&lt;/li&gt;
&lt;li&gt;Log in with the default credentials:

&lt;ul&gt;
&lt;li&gt;Username: &lt;code&gt;admin&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Password: &lt;code&gt;portainer&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Change the default password after logging in for the first time.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This guide has walked you through the process of setting up a NAS using a Raspberry Pi, OpenMediaVault, CasaOS, Immich, and Tailscale.&lt;br&gt;
You now have a fully functional NAS that allows you to store, manage, and access your photos and videos from anywhere.&lt;/p&gt;

&lt;p&gt;You can also use Portainer to manage your Docker containers and applications on your Raspberry Pi.&lt;br&gt;
Feel free to explore other applications available in the CasaOS app store to enhance your NAS experience.&lt;br&gt;
If you have any questions or suggestions, feel free to reach out to me on &lt;a href="https://twitter.com/harshitkumar31" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; or &lt;a href="https://github.com/harshitkumar31" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>raspberrypi</category>
      <category>nas</category>
      <category>homelab</category>
    </item>
    <item>
      <title>Resources I wish I knew when I started my career</title>
      <dc:creator>Harshit Kumar</dc:creator>
      <pubDate>Tue, 26 Dec 2023 13:57:01 +0000</pubDate>
      <link>https://forem.com/harshitkumar31/resources-i-wish-i-knew-when-i-started-my-career-4gh6</link>
      <guid>https://forem.com/harshitkumar31/resources-i-wish-i-knew-when-i-started-my-career-4gh6</guid>
      <description>&lt;p&gt;The transition from college to your first job can be pretty daunting. There are so many tools, and concepts which are new to you or even if you are aware of them, you don't have experience with them. &lt;/p&gt;

&lt;p&gt;I've tried to compile a list of useful resources, and good-to-know stuff which I've picked up after working for around ~6 years in the Software Industry. This is a list I wish I had when I started my career.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://learngitbranching.js.org/?locale=en_US" rel="noopener noreferrer"&gt;1. Learn Git Branching&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The very first challenge I faced was how to fix conflicts. Although I had used GitHub before, it was never in a collaborative environment - so I had never encountered conflicts. &lt;/p&gt;

&lt;p&gt;Learn Git Branching is a great resource for beginners to learn how to create branches, fix conflicts, cherry-pick - all of which are pretty handy. And the neat part about this is - it's not just theory, you get to execute the commands in the website itself and see the visualization.&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://github.com/sindresorhus/awesome" rel="noopener noreferrer"&gt;2. Awesome Lists&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Awesome lists are curated resources related to a particular topic. Figuring out what tutorials to follow, what packages to use, and which courses to complete can be pretty time-consuming. &lt;/p&gt;

&lt;p&gt;If you have come across an interesting topic and would like to deep dive, search Awesome followed by the topic and hopefully there's an awesome list which will help you get started.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://clutch.co/resources/software-development-glossary-88-essential-terms" rel="noopener noreferrer"&gt;3. Glossary&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We software devs tend to use abbreviations whenever possible (perhaps as a way to communicate more efficiently). &lt;br&gt;
This however can confuse the new joinees, and the introverts might not gather the courage to ask what certain abbreviation means in bigger forums/meetings. &lt;/p&gt;

&lt;p&gt;Although I'd suggest folks inculcate the habit of asking questions if you are not there yet, you can rely on countless glossary lists online. In all likelihood, someone maintains a glossary list within your own company (devs have a habit of using abbreviations even when it comes to internal tools, services etc), so asking around for the same could help speed up your onboarding.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/practical-tutorials/project-based-learning" rel="noopener noreferrer"&gt;4. Project Based Learning&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I've mostly been a practical learner, so when challenged with a new language/framework/paradigm I prefer doing a small project to get myself comfortable with it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/codecrafters-io/build-your-own-x" rel="noopener noreferrer"&gt;Build your own X&lt;/a&gt; is another useful resource for a curious mind.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://roadmap.sh/" rel="noopener noreferrer"&gt;5. Roadmap&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Roadmaps are step by step guides towards a specific career path. It also has links to courses &amp;amp; resources to help with your journey further.&lt;/p&gt;

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

&lt;p&gt;&lt;a href=""&gt;6. Newsletters&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are new tools, packages released everyday. It's tough to keep track of developments, newsletters are a good way to get the latest developments related to your favorite tech.&lt;br&gt;
Here are a few I have subscribed to (do comment your favorite ones) - &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://javascriptweekly.com/" rel="noopener noreferrer"&gt;https://javascriptweekly.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://bytebytego.com/newsletter" rel="noopener noreferrer"&gt;https://bytebytego.com/newsletter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://console.dev/" rel="noopener noreferrer"&gt;https://console.dev/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://react.statuscode.com/" rel="noopener noreferrer"&gt;https://react.statuscode.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://nodeweekly.com/" rel="noopener noreferrer"&gt;https://nodeweekly.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://this-week-in-rust.org/" rel="noopener noreferrer"&gt;https://this-week-in-rust.org/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You could de-clutter your emails by having a dedicated label for your newsletters.&lt;/p&gt;

&lt;p&gt;&lt;a href=""&gt;7. Youtube Channel recommendations&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here are a few channels I follow and learn continuously from&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/@freecodecamp" rel="noopener noreferrer"&gt;https://www.youtube.com/@freecodecamp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/@jsconf_" rel="noopener noreferrer"&gt;https://www.youtube.com/@jsconf_&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/@CodingTech" rel="noopener noreferrer"&gt;https://www.youtube.com/@CodingTech&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/@infoq" rel="noopener noreferrer"&gt;https://www.youtube.com/@infoq&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/@Fireship" rel="noopener noreferrer"&gt;https://www.youtube.com/@Fireship&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/@hnasr" rel="noopener noreferrer"&gt;https://www.youtube.com/@hnasr&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/@GOTO-" rel="noopener noreferrer"&gt;https://www.youtube.com/@GOTO-&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/@ThePrimeTimeagen" rel="noopener noreferrer"&gt;https://www.youtube.com/@ThePrimeTimeagen&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://github.com/topics/cheatsheets" rel="noopener noreferrer"&gt;8. CheatSheets&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A cheatsheet is a concise set of notes used for quick reference. They typically contain one or two pages of most important and frequently used information about a specific topic.&lt;/p&gt;

&lt;p&gt;I've found cheatsheets to be really useful when starting with a new topic till I need to specifically deep dive into the topic.&lt;/p&gt;




&lt;p&gt;That's it, Hopefully these resources will help someone who's new in the Software Industry. Let me know what you think of these resources and if there are any others you'd recommend&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>career</category>
      <category>softwareengineering</category>
      <category>programming</category>
    </item>
    <item>
      <title>Diagrams as Code</title>
      <dc:creator>Harshit Kumar</dc:creator>
      <pubDate>Tue, 28 Feb 2023 07:02:17 +0000</pubDate>
      <link>https://forem.com/harshitkumar31/diagrams-as-code-1jjj</link>
      <guid>https://forem.com/harshitkumar31/diagrams-as-code-1jjj</guid>
      <description>&lt;p&gt;Have you ever started working on a new project, started going through the documentation and you realize that the architecture diagrams or sequence diagrams are out of date.&lt;/p&gt;

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

&lt;p&gt;I've certainly seen this situation arise numerous times in my career so far. So what do you do? One solution would be whoever's reading the document needs to do the work to figure out the updated architecture or flows and generate the new diagrams using UML tools. This isn't ideal and these are bound to get stale again in the future.&lt;/p&gt;

&lt;p&gt;Another solution which I prefer is - maintaining diagrams as code which live in the same repos as the code. There are many tools these days which help us author diagrams from code.&lt;br&gt;
My favorites are &lt;a href="https://github.com/mermaid-js/mermaid" rel="noopener noreferrer"&gt;Mermaid&lt;/a&gt; and &lt;a href="https://plantuml.com/" rel="noopener noreferrer"&gt;PlantUML&lt;/a&gt;.&lt;br&gt;
Now your code can live in the repo and evolve along with the codebase. You might need to do additional setup if you'd like the diagrams to be generated as part of your CI/CD.&lt;br&gt;
I like to maintain these in a &lt;code&gt;/docs&lt;/code&gt; folder within the project repo.&lt;/p&gt;

&lt;p&gt;An example of how the code would look like in mermaid and it's output are below:&lt;/p&gt;

&lt;p&gt;Code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;flowchart TD
    A[Christmas] --&amp;gt;|Get money| B(Go shopping)
    B --&amp;gt; C{Let me think}
    C --&amp;gt;|One| D[Laptop]
    C --&amp;gt;|Two| E[iPhone]
    C --&amp;gt;|Three| F[fa:fa-car Car]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;/p&gt;

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

&lt;p&gt;Bonus: Mermaid.js has built in support in GitHub for markdown files. You won't need to do anything special to generate diagrams here.&lt;/p&gt;

&lt;p&gt;That's it, what's your take on these? Do you know any tools which offer better options or more customization? Leave a comment 😄 !&lt;/p&gt;

</description>
      <category>discuss</category>
    </item>
    <item>
      <title>Creating a Proxy for your GraphQL Server</title>
      <dc:creator>Harshit Kumar</dc:creator>
      <pubDate>Mon, 21 Mar 2022 14:39:40 +0000</pubDate>
      <link>https://forem.com/harshitkumar31/creating-a-proxy-for-your-graphql-server-5b9o</link>
      <guid>https://forem.com/harshitkumar31/creating-a-proxy-for-your-graphql-server-5b9o</guid>
      <description>&lt;p&gt;I needed to create a proxy server for my GraphQL service to be able to make some decisions before reaching my service.&lt;/p&gt;

&lt;p&gt;This article will document how you can do the same with minimal amount of code 😏&lt;br&gt;
We'll be leveraging awesome utilities provided by &lt;a href="https://www.graphql-tools.com/" rel="noopener noreferrer"&gt;graphql-tools&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm init &lt;span class="nt"&gt;-y&lt;/span&gt;
npm i @graphql-tools/delegate @graphql-tools/utils @graphql-tools/wrap apollo-server cross-undici-fetch graphql typescript
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Create an &lt;a href="https://www.graphql-tools.com/docs/remote-schemas#creating-an-executor" rel="noopener noreferrer"&gt;executor&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Executor is a function used capable of retrieving GraphQL results (both introspection &amp;amp; fetching results during a query's execution).&lt;/p&gt;

&lt;p&gt;In the executor, I've defined the GraphQL service's URL which I want to proxy - &lt;a href="https://graphql.anilist.co/" rel="noopener noreferrer"&gt;https://graphql.anilist.co/&lt;/a&gt; (an open API to fetch your favourite Anime characters)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;executor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;variables&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;context&lt;/span&gt; &lt;span class="p"&gt;}:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;document&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;variables&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;query&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fetchResult&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://graphql.anilist.co/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;headers&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;query&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;variables&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;fetchResult&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Define applicationProxyResolver&lt;/p&gt;

&lt;p&gt;This function is passed to &lt;code&gt;wrapSchema&lt;/code&gt; method. In this method, you should be able to make some decisions. For example - I wanted to validate some headers &amp;amp; only honour the requests if they had these headers. We'll use &lt;code&gt;delegateToSchema&lt;/code&gt; to delegate the entire request to our original GraphQL service.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;applicationProxyResolver&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="nx"&gt;subschemaConfig&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;transformedSchema&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;subschemaConfig&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;transformedSchema&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="na"&gt;_parent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;_args&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;info&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;delegate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;delegateToSchema&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
            &lt;span class="na"&gt;schema&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;subschemaConfig&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nx"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;operationName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;info&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;operation&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nx"&gt;info&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nx"&gt;transformedSchema&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's fire up the graphQL proxy server 🚀&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;init&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;schema&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;wrapSchema&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="na"&gt;schema&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;introspectSchema&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;executor&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="nx"&gt;executor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;createProxyingResolver&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;applicationProxyResolver&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;server&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ApolloServer&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; 
        &lt;span class="nx"&gt;schema&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="c1"&gt;// The `listen` method launches a web server.&lt;/span&gt;
    &lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4001&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(({&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`🚀  Server ready at &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;init&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;You can find this code at &lt;a href="https://github.com/harshitkumar31/graphql-proxy" rel="noopener noreferrer"&gt;Github&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Is there an easier way to do this? Please comment &amp;amp; let me know 😁&lt;/p&gt;

</description>
      <category>graphql</category>
      <category>node</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
