<?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: Vinayak Kalushe</title>
    <description>The latest articles on Forem by Vinayak Kalushe (@vinayak-k160).</description>
    <link>https://forem.com/vinayak-k160</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%2F376779%2F45bea41f-c8d8-4c55-b6f4-33be472db45b.png</url>
      <title>Forem: Vinayak Kalushe</title>
      <link>https://forem.com/vinayak-k160</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/vinayak-k160"/>
    <language>en</language>
    <item>
      <title>Forward vs Reverse Proxies: Understanding Their Role in Network Architecture</title>
      <dc:creator>Vinayak Kalushe</dc:creator>
      <pubDate>Tue, 24 Sep 2024 12:23:41 +0000</pubDate>
      <link>https://forem.com/vinayak-k160/forward-vs-reverse-proxies-understanding-their-role-in-network-architecture-1dej</link>
      <guid>https://forem.com/vinayak-k160/forward-vs-reverse-proxies-understanding-their-role-in-network-architecture-1dej</guid>
      <description>&lt;h2&gt;
  
  
  What Are Forward and Reverse Proxies?
&lt;/h2&gt;

&lt;p&gt;In the realm of network architecture, proxies play a critical role in managing and optimizing the flow of data between clients and servers. Forward proxies and reverse proxies are two common types of proxies. Despite their similar names, they serve very different purposes and are used in distinct scenarios. This blog post aims to shed light on what forward proxies and reverse proxies are, how they work, and their respective benefits.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Forward Proxy?
&lt;/h2&gt;

&lt;p&gt;A forward proxy, often simply called a proxy, acts as an intermediary between a client and the internet. When a client requests a resource from the internet, the client’s request is first directed to the forward proxy., which then forwards the request to the appropriate server. The server responds to the forward proxy, which in turn sends the response back to the client.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  Use Cases for Forward Proxies
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Anonymity and Privacy:&lt;/strong&gt; Forward proxies can hide the client's IP address from the server, providing a layer of anonymity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content Filtering:&lt;/strong&gt; Organizations can use forward proxies to block access to certain websites or content, enforcing internet usage policies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Caching:&lt;/strong&gt; Forward proxies cache frequently requested resources, reducing bandwidth usage and improving load times.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bypassing Geo-restrictions:&lt;/strong&gt; Users can use forward proxies to access content that is restricted to certain geographical locations.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Example Scenario
&lt;/h3&gt;

&lt;p&gt;Imagine you're in an office environment where certain websites are restricted. When you try to access a blocked website, your request is sent to a forward proxy server, which checks the company's policy. If the site is allowed, the proxy fetches the data and sends it to you; if not, it blocks access.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Reverse Proxy?
&lt;/h2&gt;

&lt;p&gt;A reverse proxy, on the other hand, sits in front of the servers and acts as an intermediary for requests coming from clients. When a client makes a request to a server, the request goes to the reverse proxy first. The reverse proxy then forwards the request to the appropriate server, receives the response, and sends it back to the client.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  Use Cases for Reverse Proxies
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Load Balancing:&lt;/strong&gt; Reverse proxies can distribute incoming traffic across multiple servers, preventing any single server from becoming overwhelmed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security:&lt;/strong&gt; By hiding the IP addresses of backend servers, reverse proxies add a layer of security, making it harder for attackers to target the servers directly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SSL Termination:&lt;/strong&gt; Reverse proxies can handle SSL encryption and decryption, reducing the load on backend servers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Caching and Compression:&lt;/strong&gt; Similar to forward proxies, reverse proxies can cache content and compress responses, improving performance and reducing bandwidth usage.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Examples of Reverse Proxy Software
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Nginx:&lt;/strong&gt; A popular web server and reverse proxy known for its performance and scalability.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Caddy Server:&lt;/strong&gt; An open-source web server with automatic HTTPS functions as a reverse proxy.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example Scenario
&lt;/h3&gt;

&lt;p&gt;Consider a popular e-commerce website that receives millions of visitors daily. Instead of all users directly hitting the main server, their requests go through a reverse proxy. The proxy efficiently distributes requests across multiple servers, ensuring no single server is overwhelmed and that the website remains responsive.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Differences Between Forward and Reverse Proxies
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Direction of Traffic:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Forward Proxy: Manages traffic from a client to an external server, acting as an intermediary.&lt;/li&gt;
&lt;li&gt;Reverse Proxy: Routes client requests to internal backend servers, ensuring optimized distribution and security.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Primary Purpose:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Forward Proxy: Primarily used for client-side benefits such as anonymity, content filtering, and bypassing restrictions.&lt;/li&gt;
&lt;li&gt;Reverse Proxy: Primarily used for server-side benefits such as load balancing, security, and SSL termination.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visibility:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Forward Proxy: The server sees the proxy as the client.&lt;/li&gt;
&lt;li&gt;Reverse Proxy: The client sees the proxy as the server.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

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

&lt;p&gt;Both forward proxies and reverse proxies play essential roles in network architecture, but they serve different purposes and are deployed in different scenarios. Understanding the distinctions between them can help you choose the right proxy type for your specific needs, whether it's enhancing client privacy, improving server performance, or adding an extra layer of security.&lt;/p&gt;

&lt;p&gt;By leveraging the appropriate proxy type, organizations can optimize their network infrastructure, ensuring efficient, secure, and reliable communication between clients and servers.&lt;/p&gt;

</description>
      <category>networking</category>
      <category>security</category>
    </item>
    <item>
      <title>How to Create an SSL Certificate for Nginx on Ubuntu 22</title>
      <dc:creator>Vinayak Kalushe</dc:creator>
      <pubDate>Tue, 27 Feb 2024 12:11:13 +0000</pubDate>
      <link>https://forem.com/vinayak-k160/how-to-create-an-ssl-certificate-for-nginx-on-ubuntu-22-32g3</link>
      <guid>https://forem.com/vinayak-k160/how-to-create-an-ssl-certificate-for-nginx-on-ubuntu-22-32g3</guid>
      <description>&lt;p&gt;When running a web server, it's crucial to secure it with SSL (Secure Sockets Layer) to ensure your website's data is encrypted and secure. This article will guide you through the process of creating an SSL certificate for Nginx on Ubuntu 22.&lt;/p&gt;

&lt;p&gt;SSL (Secure Sockets Layer) is a security protocol used to establish encrypted links between a web server and a browser. It ensures that all data passing between the web server and browsers remain private and integral, preventing hackers from stealing private information such as credit card numbers, names, and addresses. SSL is an essential component of web security and is used by millions of websites to protect their online transactions with their customers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Install Certbot
&lt;/h2&gt;

&lt;p&gt;First, you need to install Certbot, a free, open-source software tool developed by the Electronic Frontier Foundation (EFF). Certbot is designed to simplify the process of setting up and renewing SSL certificates on your server. It uses Let’s Encrypt certificates, which are free, automated, and open certificates provided by the Internet Security Research Group (ISRG).&lt;/p&gt;

&lt;p&gt;To install Certbot, run the following commands in your terminal:&lt;br&gt;
&lt;/p&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-get update
&lt;span class="nb"&gt;sudo &lt;/span&gt;snap &lt;span class="nb"&gt;install &lt;/span&gt;core&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;snap refresh core
&lt;span class="nb"&gt;sudo &lt;/span&gt;snap &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--classic&lt;/span&gt; certbot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As a final step, it's recommended to link the Certbot command from the snap install directory to your system path. This will allow you to run Certbot by simply typing 'certbot' in your terminal. This step isn't always necessary with all packages, but it's useful when using snaps as they are designed to be less intrusive and avoid conflicts with other system packages.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; /snap/bin/certbot /usr/bin/certbot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These commands will update your package lists, ensure you have the necessary software to manage repositories, add the necessary repositories, and finally install Certbot and its Nginx plugin.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Obtain a Certificate
&lt;/h2&gt;

&lt;p&gt;Next, you'll need to obtain the SSL certificate from Let's Encrypt. You can do this using the following command:&lt;br&gt;
&lt;/p&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;certbot &lt;span class="nt"&gt;--nginx&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will start the certification process. You'll be prompted to enter your email address, which is used for urgent notices and certificate expiry warnings. You'll also need to agree to the terms of service.&lt;/p&gt;

&lt;p&gt;After providing the necessary information, Certbot will communicate with the Let's Encrypt CA (Certificate Authority). It will then run a challenge to verify that you control the domain you're requesting a certificate for. This ensures that only the legitimate owner of a domain can get a Let's Encrypt certificate for it.&lt;/p&gt;

&lt;p&gt;To create  multiple certificates use the following command:&lt;br&gt;
&lt;/p&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;certbot &lt;span class="nt"&gt;--nginx&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; example.com &lt;span class="nt"&gt;-d&lt;/span&gt; example2.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's important to be aware that the Certbot command highlighted above is designed to automatically alter your Nginx configuration file. This tool is very useful as it automates the process, reducing the risk of human error and simplifying the task. However, if your specific situation requires you to generate only the certificate, without any modifications to the Nginx configuration file, then the Certbot command might not be the best choice for you. In such a case, use the following command:&lt;br&gt;
&lt;/p&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;certbot certonly &lt;span class="nt"&gt;--nginx&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: Configure the UFW Firewall
&lt;/h2&gt;

&lt;p&gt;Before we proceed, it's important to ensure that your server's firewall is set to allow traffic on Nginx Full. UFW, or Uncomplicated Firewall, is the default firewall configuration tool for Ubuntu.&lt;/p&gt;

&lt;p&gt;To enable the UFW firewall, you can use the following command:&lt;br&gt;
&lt;/p&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;ufw &lt;span class="nb"&gt;enable&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, allow Nginx Full, which will enable both HTTP and HTTPS traffic, with the following command:&lt;br&gt;
&lt;/p&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;ufw allow &lt;span class="s1"&gt;'Nginx Full'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To delete the redundant Nginx HTTP profile allowance, you can use the following command:&lt;br&gt;
&lt;/p&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;ufw delete allow &lt;span class="s1"&gt;'Nginx HTTP'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can then verify the changes by checking the status of the UFW firewall:&lt;br&gt;
&lt;/p&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;ufw status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output should show &lt;code&gt;Nginx Full&lt;/code&gt; in the list of allowed services, meaning your firewall is now set up to allow web traffic.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5w7z9jjoi22x0kohorts.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5w7z9jjoi22x0kohorts.png" alt="Ubuntu Firewall Status" width="756" height="296"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 4: Configure Nginx
&lt;/h2&gt;

&lt;p&gt;Once you've obtained your SSL certificate, Certbot will automatically configure Nginx to use it. It modifies the Nginx configuration file to point to the new certificate and sets up automatic renewal. This means you don't have to worry about manually configuring your web server or renewing your certificate as Certbot takes care of it.&lt;/p&gt;

&lt;p&gt;If “certonly” is used then certbot will not automatically configure  Nginx. Add the following line in nginx.conf file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;server &lt;span class="o"&gt;{&lt;/span&gt;
    ...
    &lt;span class="c"&gt;#replace example.com with your domain&lt;/span&gt;
    server_name example.com&lt;span class="p"&gt;;&lt;/span&gt;
    ...
    &lt;span class="c"&gt;#enalbe 443 ssl port&lt;/span&gt;
    listen &lt;span class="o"&gt;[&lt;/span&gt;::]:443 ssl http2 &lt;span class="nv"&gt;ipv6only&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;on&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;# managed by Certbot&lt;/span&gt;
    listen 443 ssl http2&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;# managed by Certbot&lt;/span&gt;
    ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;# managed by Certbot&lt;/span&gt;
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;# managed by Certbot&lt;/span&gt;
    include /etc/letsencrypt/options-ssl-nginx.conf&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;# managed by Certbot&lt;/span&gt;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;# managed by Certbot&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use the command &lt;code&gt;sudo nginx -t&lt;/code&gt; to test your Nginx configuration. If the syntax is okay, the system will return a message saying "syntax is okay. configuration file /etc/nginx/nginx.conf test is successful." If you see this message, it means that your configuration file has no syntax errors.&lt;/p&gt;

&lt;p&gt;To ensure the changes take effect, restart Nginx using the command &lt;code&gt;sudo systemctl restart nginx&lt;/code&gt;. This will apply the configuration changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Verify Certbot Auto-Renewal
&lt;/h2&gt;

&lt;p&gt;Let’s Encrypt’s certificates are valid for 90 days. However, Certbot automatically renews the certificates before they expire to prevent any downtime due to an expired certificate.&lt;br&gt;
&lt;/p&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 status snap.certbot.renew.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To verify that automatic renewal is set up correctly, you can run a dry run with the following command:&lt;br&gt;
&lt;/p&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;certbot renew &lt;span class="nt"&gt;--dry-run&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the dry run completes successfully, it means automatic renewal is set up correctly. Your website is now secured with an SSL certificate, and you can rest easy knowing that Certbot will automatically renew your certificate before it expires.&lt;/p&gt;

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

&lt;p&gt;While Certbot offers convenience and automation, it's important to understand the basics of SSL, how certificates work, and when they need to be renewed to ensure the security of your site. It's also important to note that SSL certificates should be just one part of your overall web server security strategy.&lt;/p&gt;

</description>
      <category>websitesecurity</category>
      <category>nginx</category>
      <category>ssl</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Setting Up Nginx for Laravel: A Comprehensive Guide</title>
      <dc:creator>Vinayak Kalushe</dc:creator>
      <pubDate>Fri, 23 Feb 2024 21:48:43 +0000</pubDate>
      <link>https://forem.com/vinayak-k160/setting-up-nginx-for-laravel-a-comprehensive-guide-4h5m</link>
      <guid>https://forem.com/vinayak-k160/setting-up-nginx-for-laravel-a-comprehensive-guide-4h5m</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In the ever-evolving world of web development, Laravel has consistently secured its position as one of the most popular PHP frameworks. Its elegant syntax, extensive set of features, and robustness have made it a favorite among developers world over. However, to bring a Laravel application to life, a server is needed. This is where Nginx comes in.&lt;/p&gt;

&lt;p&gt;Nginx is a high-performance HTTP server that is known for its stability, rich feature set, simple configuration, and low resource consumption. Nginx can be efficiently configured for Laravel, hence making it a suitable choice for running Laravel applications. This blog post aims to guide you through the process of setting up Nginx for Laravel. It will cover the steps involved in installing Nginx, configuring Laravel, and setting up Nginx to work with Laravel.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Nginx
&lt;/h2&gt;

&lt;p&gt;Before we can configure Nginx for Laravel, Nginx itself needs to be installed on the server. This guide will focus on installing Nginx on a Ubuntu machine. This can be accomplished by executing the following commands in the terminal:&lt;br&gt;
&lt;/p&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;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;nginx

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These commands update your package lists for upgrades and new package installations followed by the installation of Nginx. After the installation is complete, it's crucial to verify that Nginx was installed correctly. You can do this by checking the version of Nginx installed on your server. To check the Nginx version, use the command &lt;code&gt;nginx -v&lt;/code&gt;. If Nginx has been installed successfully, the version number will be displayed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing PHP
&lt;/h2&gt;

&lt;p&gt;Before Laravel can run on your Nginx server, you need to install PHP and PHP-FPM (FastCGI Process Manager). PHP-FPM is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites. Here is how you can install PHP and PHP-FPM on Ubuntu:&lt;/p&gt;

&lt;p&gt;Install PHP and PHP-FPM. If you want to install a specific version of PHP, replace 'php' with the version you want to install. For example, if you want to install PHP 7.4, you would use 'php7.4' and 'php7.4-fpm':&lt;br&gt;
&lt;/p&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;php php-fpm php-mysql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the installation is complete, you can verify that PHP and PHP-FPM have been installed correctly by checking their versions. Use these commands to check the PHP and PHP-FPM versions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If PHP and PHP-FPM have been installed successfully, the version numbers will be displayed.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Laravel Configuration
&lt;/h2&gt;

&lt;p&gt;Before we jump into configuring Nginx, it's essential that your Laravel project is set up and ready. If you haven't yet created a Laravel project, you can do so by executing the command &lt;code&gt;composer create-project --prefer-dist laravel/laravel blog&lt;/code&gt;, where 'blog' is the name of your project.&lt;/p&gt;

&lt;p&gt;After creating a Laravel project, it's imperative to set the appropriate permissions for the storage and bootstrap/cache directories to ensure that Laravel functions correctly. Use the following commands to set these permissions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; :www-data /path/to/your/laravel/root/directory
&lt;span class="nb"&gt;sudo chmod&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; 775 /path/to/your/laravel/root/directory/storage
&lt;span class="nb"&gt;sudo chmod&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; 775 /path/to/your/laravel/root/directory/bootstrap/cache
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remember to replace '/path/to/your/laravel/root/directory' with the actual path to your Laravel project.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Configuring Nginx for Laravel&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Create a New Configuration File&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Navigate to Nginx's &lt;strong&gt;&lt;code&gt;sites-available&lt;/code&gt;&lt;/strong&gt; directory and create a configuration file for your project:&lt;br&gt;
&lt;/p&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;nano /etc/nginx/sites-available/your_domain.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Configuration File Content&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Paste the following configuration, adjusting &lt;strong&gt;&lt;code&gt;your_domain.com&lt;/code&gt;&lt;/strong&gt;, the root directory, and the PHP version as necessary:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;server &lt;span class="o"&gt;{&lt;/span&gt;
    listen 80&lt;span class="p"&gt;;&lt;/span&gt;
    server_name your_domain.com&lt;span class="p"&gt;;&lt;/span&gt;
    root /var/www/your_domain.com/public&lt;span class="p"&gt;;&lt;/span&gt;

    add_header X-Frame-Options &lt;span class="s2"&gt;"SAMEORIGIN"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    add_header X-XSS-Protection &lt;span class="s2"&gt;"1; mode=block"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    add_header X-Content-Type-Options &lt;span class="s2"&gt;"nosniff"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    index index.html index.htm index.php&lt;span class="p"&gt;;&lt;/span&gt;

    charset utf-8&lt;span class="p"&gt;;&lt;/span&gt;

    location / &lt;span class="o"&gt;{&lt;/span&gt;
        try_files &lt;span class="nv"&gt;$uri&lt;/span&gt; &lt;span class="nv"&gt;$uri&lt;/span&gt;/ /index.php?&lt;span class="nv"&gt;$query_string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;

    location &lt;span class="o"&gt;=&lt;/span&gt; /favicon.ico &lt;span class="o"&gt;{&lt;/span&gt; access_log off&lt;span class="p"&gt;;&lt;/span&gt; log_not_found off&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;
    location &lt;span class="o"&gt;=&lt;/span&gt; /robots.txt  &lt;span class="o"&gt;{&lt;/span&gt; access_log off&lt;span class="p"&gt;;&lt;/span&gt; log_not_found off&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;

    error_page 404 /index.php&lt;span class="p"&gt;;&lt;/span&gt;

    location ~ &lt;span class="se"&gt;\.&lt;/span&gt;php&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
        fastcgi_pass unix:/var/run/php/php8.2-fpm.sock&lt;span class="p"&gt;;&lt;/span&gt;
        fastcgi_index index.php&lt;span class="p"&gt;;&lt;/span&gt;
        fastcgi_param SCRIPT_FILENAME &lt;span class="nv"&gt;$realpath_root$fastcgi_script_name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        include fastcgi_params&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;

    location ~ /&lt;span class="se"&gt;\.&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;?!well-known&lt;span class="o"&gt;)&lt;/span&gt;.&lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        deny all&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Enabling Your Site and Restarting Nginx&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Enable the Site&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Link your site to Nginx's &lt;strong&gt;&lt;code&gt;sites-enabled&lt;/code&gt;&lt;/strong&gt; directory:&lt;br&gt;
&lt;/p&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; ln -s /etc/nginx/sites-available/your_domain.com /etc/nginx/sites-enabled/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Test Nginx Configuration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ensure there are no syntax errors:&lt;br&gt;
&lt;/p&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;nginx &lt;span class="nt"&gt;-t&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Restart Nginx&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Apply your changes:&lt;br&gt;
&lt;/p&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 restart nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;While setting up Nginx for Laravel might seem like a daunting task initially, especially for beginners, it is not as complicated as it appears. Once you delve into the process and understand each step, it becomes pretty straightforward.&lt;/p&gt;

&lt;p&gt;The crux of the setup involves three primary steps: the installation of Nginx, the configuration of Laravel, and the Nginx configuration for Laravel. A smooth and successful setup is often achieved by meticulously following these steps and paying close attention to the configurations.&lt;/p&gt;

&lt;p&gt;Once set up, you can enjoy the benefits of a high-performance HTTP server running your Laravel applications. Happy coding, and here's to creating fantastic applications with Laravel and Nginx!&lt;/p&gt;

</description>
      <category>nginx</category>
      <category>laravel</category>
      <category>webdev</category>
      <category>deployment</category>
    </item>
    <item>
      <title>Gridsome FaunaDB Todo App</title>
      <dc:creator>Vinayak Kalushe</dc:creator>
      <pubDate>Thu, 30 Apr 2020 16:08:18 +0000</pubDate>
      <link>https://forem.com/vinayak-k160/gridsome-faunadb-todo-app-24kb</link>
      <guid>https://forem.com/vinayak-k160/gridsome-faunadb-todo-app-24kb</guid>
      <description>&lt;h3&gt;
  
  
  Link to Demo: &lt;a href="https://gridsome-faunadb-todo.netlify.app/"&gt;https://gridsome-faunadb-todo.netlify.app/&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;JAM stack is a very new way of developing modern world applications. When we talk about JAM stack we no longer have to worry about the operating systems, web servers, backend programming languages, and databases. JAM Stack is a software development philosophy that only makes use of Javascript, API's, and Markups. With the help of JAM stack, you can build fast and secure sites and web apps that are delivered directly from the CDN's rather than a specific web server. This allows you to worry less about setting up the servers, databases, hosting, etc and focus mostly on the purpose of the application that you are developing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jSPkt2RO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/0%2AxVmPXHxmW49m9blj" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jSPkt2RO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/0%2AxVmPXHxmW49m9blj" alt="" width="800" height="440"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;During the course of the COVID-19 pandemic, I decided to explore JAM stack and found out that it allowed me to build my apps way more easily and way faster than a traditional approach. So I decided to build a small ToDo application. The following is the Tech Stack that I have used to develop the ToDo application.&lt;/p&gt;

&lt;h3&gt;
  
  
  FaunaDB
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aEUOXaNt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/838/0%2A9xvqjVApYY0_WtjM" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aEUOXaNt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/838/0%2A9xvqjVApYY0_WtjM" alt="" width="419" height="120"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;FaunaDB is a globally-distributed, serverless, cloud database management system for modern applications, such as those based on JAMstack. It enables you to instantly create a full-featured data backend for applications, in seconds. Just sign up and query! FaunaDB transforms the traditional DBMS into a Data API that gives you all of the capabilities of an old-guard database, without sacrificing flexibility, scale, and performance. FaunaDB core functions are inspired by Calvin: a clock-less, strictly-serializable transactional protocol for multi-region environments.&lt;/p&gt;

&lt;p&gt;Getting started with FaunaDB&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Register on &lt;a href="https://dashboard.fauna.com/accounts/register"&gt;https://dashboard.fauna.com/accounts/register&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Create a new Database.&lt;/li&gt;
&lt;li&gt;Create a new Collections named “todos”&lt;/li&gt;
&lt;li&gt;Create the secret key for your application under the security tab. Make sure to save this key because it is only displayed once. This is the key that we are going to use to make a connection with our faunadb’s database form out Gridsome application.&lt;/li&gt;
&lt;li&gt;Save secret key in .env variable to use it later&lt;/li&gt;
&lt;li&gt;Install the faunadb’s library &lt;code&gt;npm install --save faunadb&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Initialize library by follow code
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;faunadb&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="nx"&gt;faunadb&lt;/span&gt;&lt;span class="err"&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;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;faunadb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
&lt;span class="na"&gt;secret&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;VUE_APP_FAUNA_SECRET&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;q&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;faunadb&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Gridsome
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1Om-it8F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1000/0%2AfdDWm4GAPojD4LYl" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1Om-it8F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1000/0%2AfdDWm4GAPojD4LYl" alt="" width="516" height="98"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Gridsome generates static HTML that hydrates into a Vue SPA once loaded in the browser. This means you can build both static websites &amp;amp; dynamic apps with Gridsome. It’s perfect for JAMstack workflow&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TBpLnhVL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://medium.com/%40vinayak.k160/gridsome-faunadb-todo-app-fae13504dbc3" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TBpLnhVL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://medium.com/%40vinayak.k160/gridsome-faunadb-todo-app-fae13504dbc3" alt="" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Getting started with Gridsome&lt;br&gt;
Install Gridsome CLI tool&lt;/p&gt;

&lt;p&gt;Using NPM&lt;br&gt;
&lt;code&gt;npm install --global @gridsome/cli&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Using Yarn&lt;br&gt;
&lt;code&gt;yarn global add @gridsome/cli&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Create a Gridsome Project&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;gridsome create my-gridsome-site&lt;/code&gt; to install default starter&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cd my-gridsome-site&lt;/code&gt; to open the folder&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;gridsome develop&lt;/code&gt; to start a local dev server at &lt;code&gt;http://localhost:8080&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Netlify
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--frQmbFMA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1000/1%2A6EwWSBknlxfk-zErn-d8DQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--frQmbFMA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1000/1%2A6EwWSBknlxfk-zErn-d8DQ.png" alt="" width="800" height="218"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Netlify is one of the fastest growing deployment solutions which is a great solution for your serverless webapps. Using netlify is very easy too, you can just drag and drop and your website folder and it’s done in an instance&lt;/p&gt;

&lt;h3&gt;
  
  
  TailwindCSS and Buefy
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oJXyIpEW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/636/0%2A53haOdnCVnMMdWyi" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oJXyIpEW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/636/0%2A53haOdnCVnMMdWyi" alt="" width="318" height="159"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GxFOKHhE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/718/0%2AoUl9jep09EFrXkqs" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GxFOKHhE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/718/0%2AoUl9jep09EFrXkqs" alt="" width="359" height="140"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;TailwindCSS and Buefy are great combinations when it comes to developing the frontend of your application. I have made use of Tailwind’s utilities and Buefy’s components to develop the ToDo app.&lt;/p&gt;

&lt;p&gt;Getting started with the application. Firstly we’ll have a look at all the CRUD operations in our ToDo app. We can create a todo, update a todo as completed, and delete a todo.&lt;/p&gt;

&lt;h3&gt;
  
  
  Let’s first have a look at how to create a todo.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;faunadbt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;faunadb&lt;/span&gt;&lt;span class="dl"&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;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;faunadbt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;Secret&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;VUE_APP_FAUNA_SECRET&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;q&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;faunadbt&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="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;moment&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;moment&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
 &lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;methods&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;addTodo&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nx"&gt;client&lt;/span&gt;
          &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="nx"&gt;q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Collection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;todo&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;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;todoname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;completed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;trashed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;user_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;date&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&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;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;res&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;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;todoname&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;todo_data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;unshift&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&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;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Fetching all the todo’s and store it in a variable
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;        &lt;span class="nx"&gt;client&lt;/span&gt;
          &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="nx"&gt;q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Paginate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
              &lt;span class="nx"&gt;q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Index&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;all_todo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;       &lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&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;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&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;var&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&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;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ref&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;q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="p"&gt;});&lt;/span&gt;
            &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&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;res&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;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;todo_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
              &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;todo_data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reverse&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;h3&gt;
  
  
  Marks as Complete
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;      &lt;span class="nx"&gt;client&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="nx"&gt;q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Ref&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Collection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;todo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
              &lt;span class="na"&gt;completed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;completed&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;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Deleting a record
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;         &lt;span class="nx"&gt;client&lt;/span&gt;
          &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="nx"&gt;q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Delete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
              &lt;span class="nx"&gt;q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Ref&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Collection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="nx"&gt;todo&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nx"&gt;id&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;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To create production build of you application run command &lt;code&gt;gridsome build&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It will generate production ready code in the dist folder&lt;/p&gt;

&lt;p&gt;To deploy production ready project on netlify&lt;/p&gt;

&lt;p&gt;Login to netlify and drag and drop your dist folder on netlify&lt;/p&gt;

&lt;p&gt;You can clone the entire app and play around with it.&lt;br&gt;
&lt;a href="https://github.com/Vinayak-k160/Gridsome-FaunaDB-Todo"&gt;https://github.com/Vinayak-k160/Gridsome-FaunaDB-Todo&lt;/a&gt;&lt;/p&gt;

</description>
      <category>gridsome</category>
      <category>fauna</category>
      <category>vue</category>
      <category>jamstack</category>
    </item>
  </channel>
</rss>
