<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gourav Singh Rawat</title>
    <description>The latest articles on DEV Community by Gourav Singh Rawat (@seek4samurai).</description>
    <link>https://dev.to/seek4samurai</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%2F767417%2Fd798b601-e307-4b31-be54-3328ddedc66c.jpg</url>
      <title>DEV Community: Gourav Singh Rawat</title>
      <link>https://dev.to/seek4samurai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/seek4samurai"/>
    <language>en</language>
    <item>
      <title>Know about HTTP/1.0 &amp; HTTP/2</title>
      <dc:creator>Gourav Singh Rawat</dc:creator>
      <pubDate>Mon, 08 Jan 2024 14:27:31 +0000</pubDate>
      <link>https://dev.to/seek4samurai/know-about-http10-http2-1ep6</link>
      <guid>https://dev.to/seek4samurai/know-about-http10-http2-1ep6</guid>
      <description>&lt;p&gt;&lt;em&gt;&lt;strong&gt;Hi readers!&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  HTTP
&lt;/h2&gt;

&lt;p&gt;HTTP/1 and HTTP/2 are two versions of the Hypertext Transfer Protocol, which is the foundation of data communication on the World Wide Web. They define how messages are formatted and transmitted, and how web servers and browsers should respond to various commands.&lt;/p&gt;

&lt;h2&gt;
  
  
  HTTP/1.0:
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Year of Introduction: 1996&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Key Features:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Simple and straightforward protocol.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Each request from the client is answered by a single response from the server, and the connection is closed after each request/response.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The lack of request pipelining often led to a phenomenon known as the "head-of-line blocking," where a slow-loading resource could block the loading of subsequent resources in parallel.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  HTTP/1.1:
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Year of Introduction: 1997&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Key Features:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Introduced persistent connections, allowing multiple requests and responses to be sent over a single connection, reducing latency.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Request pipelining, which allows multiple requests to be sent without waiting for each response, improving performance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Host header to support multiple domains on the same IP address.&lt;br&gt;
Chunked transfer encoding for efficient transmission of large data.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  HTTP/2:
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Year of Introduction: 2015&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Key Features:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Binary protocol: Unlike the text-based nature of HTTP/1.x, HTTP/2 is a binary protocol, which makes it more efficient to parse and less error-prone.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Multiplexing: Allows multiple requests and responses to be sent in parallel over a single connection, addressing the head-of-line blocking issue.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Header Compression: Reduces overhead by compressing header information.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Server Push: Allows the server to push resources to the client before they are explicitly requested, improving performance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Prioritization: Requests can be assigned priority levels, allowing more important resources to be delivered first.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;HTTP/2 was designed to address the limitations of HTTP/1.x and improve the overall performance and efficiency of web communication. It has become widely adopted, and many modern websites use HTTP/2 to provide a faster and more responsive user experience.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Hope you find this helpful. Thanks for reading.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>tutorial</category>
      <category>webdev</category>
      <category>learning</category>
    </item>
    <item>
      <title>How to make an API using FastAPI</title>
      <dc:creator>Gourav Singh Rawat</dc:creator>
      <pubDate>Sat, 23 Dec 2023 17:29:51 +0000</pubDate>
      <link>https://dev.to/seek4samurai/how-to-make-an-api-using-fastapi-299o</link>
      <guid>https://dev.to/seek4samurai/how-to-make-an-api-using-fastapi-299o</guid>
      <description>&lt;h2&gt;
  
  
  Let’s see how we can create a basic API using the FastAPI framework.
&lt;/h2&gt;

&lt;p&gt;First, make sure you have FastAPI and Uvicorn installed. You can install them using:&lt;/p&gt;

&lt;p&gt;As the FastAPI documentation suggests you'll need Uvicorn and FastAPI installed you can do so by:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;pip&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="n"&gt;fastapi&lt;/span&gt; &lt;span class="n"&gt;uvicorn&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;standard&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, let’s create a simple FastAPI application where we’ll be setting up our FastAPI app. Create a file named main.py:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# main.py
&lt;/span&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;fastapi&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;FastAPI&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FastAPI&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But that’s not all we’re just initializing our FastAPI instance, now we also need to setup something known as CORS (Cross-Origin Resource Sharing).&lt;/p&gt;

&lt;p&gt;CORS is important when you want to allow your API to be accessed by web applications from different origins. Modify your main.py file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# main.py
&lt;/span&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;fastapi&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;FastAPI&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;fastapi.middleware.cors&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;CORSMiddleware&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FastAPI&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# Configure CORS
&lt;/span&gt;
&lt;span class="n"&gt;origins&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;http://localhost&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;http://localhost:3000&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://yourfrontenddomain.com&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_middleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;CORSMiddleware&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;allow_origins&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;origins&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;allow_credentials&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;allow_methods&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;allow_headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="sh"&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;Replace the allowed origins (origins) with the actual domains of your front-end applications. Or if you’re just testing your app on localhost then you might not need to change much…&lt;/p&gt;

&lt;p&gt;Make an API.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nd"&gt;@app.get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;read_root&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;message&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello, World!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your file should look like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# main.py
&lt;/span&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;fastapi&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;FastAPI&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;fastapi.middleware.cors&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;CORSMiddleware&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FastAPI&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# Configure CORS
&lt;/span&gt;
&lt;span class="n"&gt;origins&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;http://localhost&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;http://localhost:3000&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://yourfrontenddomain.com&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_middleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;CORSMiddleware&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;allow_origins&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;origins&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;allow_credentials&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;allow_methods&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;allow_headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nd"&gt;@app.get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;read_root&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;message&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello, World!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Call your API of endpoint /. But before that we’ll need to start running the server. Now use the Uvicorn to initiate the FastAPI server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;uvicorn&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="nb"&gt;reload&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will start the FastAPI development server, and your API will be accessible at &lt;a href="http://127.0.0.1:8000"&gt;http://127.0.0.1:8000&lt;/a&gt;. The CORS middleware will allow requests from the specified origins.&lt;/p&gt;

&lt;p&gt;You can access the API by opening your browser or using a tool like curl or Postman. For example, if you’re running it locally, open &lt;a href="http://localhost:8000"&gt;http://localhost:8000&lt;/a&gt; in your browser, and you should see the “Hello, World!” message.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Hope this was useful. Thanks for reading.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>fastapi</category>
      <category>python</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Trying FastAPI as a Python Django developer.</title>
      <dc:creator>Gourav Singh Rawat</dc:creator>
      <pubDate>Thu, 21 Dec 2023 11:18:42 +0000</pubDate>
      <link>https://dev.to/seek4samurai/trying-fastapi-as-a-python-django-developer-3nla</link>
      <guid>https://dev.to/seek4samurai/trying-fastapi-as-a-python-django-developer-3nla</guid>
      <description>&lt;p&gt;&lt;em&gt;Hello readers!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It's been almost 3 years and most of the time I've always chosen Django, you ask? Well, Django provided everything out of the box I could ask for from authentication to database flexibility and whatnot.&lt;/p&gt;

&lt;p&gt;What about the FastAPI though?&lt;br&gt;
FastAPI is a modern, fast (as the name suggests), and highly performant web framework for building APIs with Python. If you're familiar with Django, exploring FastAPI can introduce you to some exciting features and differences. Here are some amazing things about FastAPI that might appeal to a Django developer:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Automatic Documentation:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;FastAPI automatically generates interactive API documentation using OpenAPI and Swagger UI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Async Support:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;FastAPI is designed with asynchronous support, enabling efficient handling of concurrent requests.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Automatic Data Validation:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Python type hints are used for automatic data validation, reducing the need for manual validation code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Dependency Injection:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;FastAPI features a powerful dependency injection system for managing and injecting dependencies into endpoints.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Built-in Authentication:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;FastAPI provides built-in support for OAuth and JWT authentication, streamlining the implementation of user authentication and authorization.&lt;/p&gt;

&lt;p&gt;Soon I'll be posting a good beginner tutorial about FastAPI so stay tuned!!!&lt;/p&gt;

&lt;p&gt;So my suggestion would be if you're going to build a project with a limited use and fewer developer features, go with FastAPI.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>python</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Best Repositories for beginners to contribute in Hacktoberfest</title>
      <dc:creator>Gourav Singh Rawat</dc:creator>
      <pubDate>Mon, 17 Oct 2022 12:36:38 +0000</pubDate>
      <link>https://dev.to/seek4samurai/best-repositories-for-beginners-to-contribute-in-hacktoberfest-667</link>
      <guid>https://dev.to/seek4samurai/best-repositories-for-beginners-to-contribute-in-hacktoberfest-667</guid>
      <description>&lt;h1&gt;
  
  
  Hacktoberfest 2022!
&lt;/h1&gt;

&lt;p&gt;Since Hacktoberfest 2022 is live, many new developers &amp;amp; engineers are stepping forward and looking for some open source projects that fit for their stack.&lt;br&gt;
But it's like finding a needle in a haystack...since there are lots &amp;amp; lots of repositories.&lt;/p&gt;
&lt;h2&gt;
  
  
  If you want a video for this article
&lt;/h2&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/f-lP_o5m5mk"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;This is the article for you to find few best open source projects that are hacktoberfest accepted &amp;amp; easy to understand as well.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Check Github topics for Hacktoberfest
&lt;/h4&gt;

&lt;p&gt;Go to Github and in &lt;a href="https://github.com/topics/hacktoberfest"&gt;Hacktoberfest&lt;/a&gt; topics section.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Xk35rSRz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2anx7p2vvxtng8582wia.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Xk35rSRz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2anx7p2vvxtng8582wia.png" alt="Hacktoberfest" width="764" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here you can find many projects and all of them are hacktoberfest accepted. You can select whichever suits your techstack.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Search for Docs websites
&lt;/h4&gt;

&lt;p&gt;Docs websites are usually open source and are relatively easier to understand. If you find anything where you can add some content or change some UI or anything.&lt;br&gt;
For example this repository:&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A9-wwsHG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/microsoft"&gt;
        microsoft
      &lt;/a&gt; / &lt;a href="https://github.com/microsoft/Web-Dev-For-Beginners"&gt;
        Web-Dev-For-Beginners
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      24 Lessons, 12 Weeks, Get Started as a Web Developer
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;&lt;a href="https://github.com/microsoft/Web-Dev-For-Beginners/blob/master/LICENSE"&gt;&lt;img src="https://camo.githubusercontent.com/9193963a1f6c74908c6a2c26b74e3db4e6418701318ba74a63edf08bf2faf1f7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6963726f736f66742f5765622d4465762d466f722d426567696e6e6572732e737667" alt="GitHub license"&gt;&lt;/a&gt;
&lt;a href="https://GitHub.com/microsoft/Web-Dev-For-Beginners/graphs/contributors/"&gt;&lt;img src="https://camo.githubusercontent.com/414bad781e032d72c348ce0472ccddcb2b9eeda4442ca798be0115b374f8f82c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f6d6963726f736f66742f5765622d4465762d466f722d426567696e6e6572732e737667" alt="GitHub contributors"&gt;&lt;/a&gt;
&lt;a href="https://GitHub.com/microsoft/Web-Dev-For-Beginners/issues/"&gt;&lt;img src="https://camo.githubusercontent.com/6595f503e0e63326780d520b990c3728257766a752b05abcf7c1af32ceaca39a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6d6963726f736f66742f5765622d4465762d466f722d426567696e6e6572732e737667" alt="GitHub issues"&gt;&lt;/a&gt;
&lt;a href="https://GitHub.com/microsoft/Web-Dev-For-Beginners/pulls/"&gt;&lt;img src="https://camo.githubusercontent.com/9ebbc945cf409eac09343ef65cc22e3ba3b292e6778d0676f90b9bca766a90ad/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732d70722f6d6963726f736f66742f5765622d4465762d466f722d426567696e6e6572732e737667" alt="GitHub pull-requests"&gt;&lt;/a&gt;
&lt;a href="http://makeapullrequest.com" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/0ff11ed110cfa69f703ef0dcca3cee6141c0a8ef465e8237221ae245de3deb3d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5052732d77656c636f6d652d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265" alt="PRs Welcome"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://GitHub.com/microsoft/Web-Dev-For-Beginners/watchers/"&gt;&lt;img src="https://camo.githubusercontent.com/f44c3d4112fe701371f7e9ad6d952996ed9bae4eccafe3471f926b5b4b7183f0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f77617463686572732f6d6963726f736f66742f5765622d4465762d466f722d426567696e6e6572732e7376673f7374796c653d736f6369616c266c6162656c3d5761746368266d61784167653d32353932303030" alt="GitHub watchers"&gt;&lt;/a&gt;
&lt;a href="https://GitHub.com/microsoft/Web-Dev-For-Beginners/network/"&gt;&lt;img src="https://camo.githubusercontent.com/0eefedc51bf25869f525243241197a2e5daaa8a85d705c71d0edcbeb4d374c48/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6d6963726f736f66742f5765622d4465762d466f722d426567696e6e6572732e7376673f7374796c653d736f6369616c266c6162656c3d466f726b266d61784167653d32353932303030" alt="GitHub forks"&gt;&lt;/a&gt;
&lt;a href="https://GitHub.com/microsoft/Web-Dev-For-Beginners/stargazers/"&gt;&lt;img src="https://camo.githubusercontent.com/edcce4696932bd846a82db3e2acfb54b5b82abe74774cdf499056de861424320/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6d6963726f736f66742f5765622d4465762d466f722d426567696e6e6572732e7376673f7374796c653d736f6369616c266c6162656c3d53746172266d61784167653d32353932303030" alt="GitHub stars"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://open.vscode.dev/microsoft/Web-Dev-For-Beginners" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/3ee94fcc0015f5b546765df956bce90ee7d065164d985ad0f711d302b633a6f9/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6f676f3d76697375616c73747564696f636f6465266c6162656c3d266d6573736167653d4f70656e253230696e25323056697375616c25323053747564696f253230436f6465266c6162656c436f6c6f723d32633263333226636f6c6f723d303037616363266c6f676f436f6c6f723d303037616363" alt="Open in Visual Studio Code"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
Web Development for Beginners - A Curriculum&lt;/h1&gt;
&lt;p&gt;Learn the fundamentals of web development with our 12-week comprehensive course by Microsoft Cloud Advocates. Each of the 24 lessons dive into JavaScript, CSS, and HTML through hands-on projects like terrariums, browser extensions, and space games. Engage with quizzes, discussions, and practical assignments. Enhance your skills and optimize your knowledge retention with our effective project-based pedagogy. Start your coding journey today!&lt;/p&gt;
&lt;h4&gt;
🧑‍🎓 &lt;em&gt;Are you a student?&lt;/em&gt;
&lt;/h4&gt;
&lt;p&gt;Visit &lt;a href="https://docs.microsoft.com/learn/student-hub/?WT.mc_id=academic-77807-sagibbon" rel="nofollow"&gt;&lt;strong&gt;Student Hub page&lt;/strong&gt;&lt;/a&gt; where you will find beginner resources, Student packs and even ways to get a free certificate voucher. This is the page you want to bookmark and check from time to time as we switch out content monthly.&lt;/p&gt;
&lt;h3&gt;
📣 Announcement - &lt;em&gt;New Curriculum&lt;/em&gt; on Generative AI was just released!&lt;/h3&gt;
&lt;p&gt;Don't miss our NEW 12 lesson curriculum on generative AI!&lt;/p&gt;
&lt;p&gt;Each lesson includes an assignment to complete, knowledge check and challenge to guide you on…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/microsoft/Web-Dev-For-Beginners"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Contribution towards these docs are one of the best things for beginners.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Look for e-books
&lt;/h4&gt;

&lt;p&gt;Yes, e-books are also open source and they can be a good place to start.&lt;br&gt;
Recently I found this guy, &lt;a href="https://github.com/bobbyiliev"&gt;Bobby Iliev&lt;/a&gt;. He has amazing e-books that I found very helpful.&lt;br&gt;
Since they are open source, you can contribute towards them.&lt;br&gt;
Like contributing towards these Repositories.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A9-wwsHG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/bobbyiliev"&gt;
        bobbyiliev
      &lt;/a&gt; / &lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook"&gt;
        101-linux-commands-ebook
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      101 Linux commands Open-source eBook
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/bobbyiliev/101-linux-commands-ebook/main/ebook/en/assets/cover.jpg"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--v_qAR-bN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/bobbyiliev/101-linux-commands-ebook/main/ebook/en/assets/cover.jpg" height="450" width="auto"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div&gt;
    &lt;p&gt;
        &lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook"&gt;&lt;img src="https://camo.githubusercontent.com/e2d029c49c7a63d1e44210842524f6daa70c768fcc898166a067e0caa05dbf3b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f626f626279696c6965762f3130312d6c696e75782d636f6d6d616e64732d65626f6f6b3f7374796c653d666f722d7468652d6261646765"&gt;&lt;/a&gt;
        &lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook"&gt;&lt;img src="https://camo.githubusercontent.com/d6779116223f83a3b73bb1248eff22215fe5adada283e6d488db830d8cccbc2f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f626f626279696c6965762f3130312d6c696e75782d636f6d6d616e64732d65626f6f6b3f6c6f676f436f6c6f723d677265656e267374796c653d666f722d7468652d6261646765"&gt;&lt;/a&gt;
        &lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook"&gt;&lt;img src="https://camo.githubusercontent.com/d0d91bf211012eb33f8811cf4bdf6e7de4c6523f64f6bea70a9f07cc95e77dd5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f626f626279696c6965762f3130312d6c696e75782d636f6d6d616e64732d65626f6f6b3f6c6f676f436f6c6f723d677265656e267374796c653d666f722d7468652d6261646765"&gt;&lt;/a&gt;
      &lt;a href="https://sugatoray.github.io/101-linux-commands-ebook" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/de23e234b960a2f53101f5ecb8892fe5eb186e12acded151170a7da10db3c8c0/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6162656c3d65426f6f6b266d6573736167653d526561642532304f6e6c696e6526636f6c6f723d6f72616e6765266c6f676f436f6c6f723d677265656e267374796c653d666f722d7468652d6261646765266c6f676f3d676974687562"&gt;&lt;img src="https://camo.githubusercontent.com/8d986c2e73eb1ae5f41a511c85b7c5e23b82a3f9f7d883ab53301069ecaa935f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f626f626279696c6965762f3130312d6c696e75782d636f6d6d616e64732d65626f6f6b3f6c6f676f436f6c6f723d79656c6c6f77267374796c653d666f722d7468652d6261646765"&gt;&lt;/a&gt;
        &lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook"&gt;&lt;img src="https://camo.githubusercontent.com/215788c1f63264b3e66aebf63d805f1a380b7961babe0b6654e09bce2bfe0b9b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d616465253230776974682d4d61726b646f776e2d3166343235662e7376673f7374796c653d666f722d7468652d6261646765"&gt;&lt;/a&gt;
        &lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook"&gt;&lt;img src="https://camo.githubusercontent.com/c2a5a6a4796d2852e33b2513b44706ec8710861876c5fd978fc3269ae23f4738/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f626f626279696c6965762f3130312d6c696e75782d636f6d6d616e64732d65626f6f6b3f7374796c653d666f722d7468652d6261646765"&gt;&lt;/a&gt;
    &lt;/p&gt;
&lt;/div&gt;
&lt;h2&gt;
💻 ++101 Linux commands Open-source eBook&lt;/h2&gt;
&lt;p&gt;This is an open-source eBook with 101 Linux commands that everyone should know. No matter if you are a DevOps/SysOps engineer, developer, or just a Linux enthusiast, you will most likely have to use the terminal at some point in your career.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Make sure to star the repository&lt;/strong&gt; ⭐&lt;/p&gt;
&lt;h2&gt;
📙 Online eBook&lt;/h2&gt;
&lt;p&gt;An online copy ⚡🌐 of this ebook is available &lt;a href="https://sugatoray.github.io/101-linux-commands-ebook" rel="nofollow"&gt;&lt;strong&gt;here&lt;/strong&gt; 📙&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
🔽 Download links&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook/blob/main/ebook/en/export/101-linux-commands-ebook-dark.pdf"&gt;Dark mode&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook/blob/main/ebook/en/export/101-linux-commands-ebook-light.pdf"&gt;Light mode&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
Content &lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#basics"&gt;Basics&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#file-hierarchy-standard-fhs"&gt;File Hierarchy Standard (FHS)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#commands"&gt;Commands&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#disk-and-file-system-management"&gt;Disk and File System Management&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#general-disk-manipulation-non-lvm"&gt;General Disk Manipulation (non-LVM)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#globs-wildcards"&gt;Globs (Wildcards)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#regex"&gt;Regex&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#stream-redirection"&gt;Stream redirection&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#text-readers--editors"&gt;Text Readers &amp;amp; Editors&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#less"&gt;Less&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#vi"&gt;VI&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#user-and-group-management"&gt;User and Group Management&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#file-system-permissions"&gt;File System Permissions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#ssh"&gt;SSH&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#cronjobs"&gt;Cronjobs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#package-management"&gt;Package Management&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#rpm"&gt;RPM&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#yum"&gt;YUM&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#-list-of-commands-by-category"&gt;📃 List of commands by category:&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#directory-navigation"&gt;Directory Navigation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#file-commands"&gt;File Commands&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#file-and-directory-manipulation"&gt;File and Directory Manipulation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#package-archive-and-compression-tools"&gt;Package archive and compression tools&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#system-commands"&gt;System commands&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#networking-commands"&gt;Networking Commands&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#package-management-1"&gt;Package Management&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#user-information-commands"&gt;User Information commands&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#session-commands"&gt;Session commands&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#getting-help"&gt;Getting Help&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/101-linux-commands-ebook#applications"&gt;Applications&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;…&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/bobbyiliev/101-linux-commands-ebook"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A9-wwsHG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/bobbyiliev"&gt;
        bobbyiliev
      &lt;/a&gt; / &lt;a href="https://github.com/bobbyiliev/introduction-to-git-and-github-ebook"&gt;
        introduction-to-git-and-github-ebook
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Free Introduction to Git and GitHub eBook
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/a58f83b0f278faaab4eb55e3b1db9be8bd9f5378018e369e46165e03d665acbb/68747470733a2f2f696d6775722e636f6d2f30797974494c342e706e67"&gt;&lt;img src="https://camo.githubusercontent.com/a58f83b0f278faaab4eb55e3b1db9be8bd9f5378018e369e46165e03d665acbb/68747470733a2f2f696d6775722e636f6d2f30797974494c342e706e67" height="450" width="auto"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div&gt;
    &lt;p&gt;
        &lt;a href="https://github.com/bobbyiliev/introduction-to-git-and-github-ebook"&gt;&lt;img src="https://camo.githubusercontent.com/5db7cfeffedfcdc3b858cbc3526f9923aece08f01083f49d943d20a7fcee692e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f626f626279696c6965762f696e74726f64756374696f6e2d746f2d6769742d616e642d6769746875622d65626f6f6b3f7374796c653d666f722d7468652d6261646765"&gt;&lt;/a&gt;
        &lt;a href="https://github.com/bobbyiliev/introduction-to-git-and-github-ebook"&gt;&lt;img src="https://camo.githubusercontent.com/97f2b2f912926281ea6c6db428010b5761fc94e1b88b10d45502f7839f451994/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f626f626279696c6965762f696e74726f64756374696f6e2d746f2d6769742d616e642d6769746875622d65626f6f6b3f6c6f676f436f6c6f723d677265656e267374796c653d666f722d7468652d6261646765"&gt;&lt;/a&gt;
        &lt;a href="https://github.com/bobbyiliev/introduction-to-git-and-github-ebook"&gt;&lt;img src="https://camo.githubusercontent.com/aab47185f74cd2ce04171b3b53832549e39ea6651324df57466093b1ef8f6db9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f626f626279696c6965762f696e74726f64756374696f6e2d746f2d6769742d616e642d6769746875622d65626f6f6b3f6c6f676f436f6c6f723d677265656e267374796c653d666f722d7468652d6261646765"&gt;&lt;/a&gt;
        &lt;a href="https://github.com/bobbyiliev/introduction-to-git-and-github-ebook"&gt;&lt;img src="https://camo.githubusercontent.com/215788c1f63264b3e66aebf63d805f1a380b7961babe0b6654e09bce2bfe0b9b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d616465253230776974682d4d61726b646f776e2d3166343235662e7376673f7374796c653d666f722d7468652d6261646765"&gt;&lt;/a&gt;
        &lt;a href="https://github.com/bobbyiliev/introduction-to-git-and-github-ebook"&gt;&lt;img src="https://camo.githubusercontent.com/e0c71c21daa4c486f95b35582faa9c7e01187c51353935b86f19eaf911f04ae2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f626f626279696c6965762f696e74726f64756374696f6e2d746f2d6769742d616e642d6769746875622d65626f6f6b3f7374796c653d666f722d7468652d6261646765"&gt;&lt;/a&gt;
    &lt;/p&gt;
&lt;/div&gt;
&lt;h2&gt;
💡 Introduction to Git and GitHub&lt;/h2&gt;
&lt;p&gt;This is an open-source introduction to Git and GitHub guide that will help you learn the basics of version control and start using Git for your SysOps, DevOps, and Dev projects. No matter if you are a DevOps/SysOps engineer, developer, or just a Linux enthusiast, you can use Git to track your code changes and collaborate with other members of your team or open source maintainers.&lt;/p&gt;
&lt;p&gt;The guide is suitable for anyone working as a developer, system administrator, or a DevOps engineer and wants to learn the basics of Git, GitHub and version control in general.&lt;/p&gt;
&lt;h2&gt;
🚀 Download&lt;/h2&gt;
&lt;p&gt;To download a copy of the eBook use one of the following links:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://github.com/bobbyiliev/introduction-to-git-and-github-ebook/raw/main/ebook/en/export/introduction-to-git-and-github-dark.pdf"&gt;&lt;strong&gt;Dark mode&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://github.com/bobbyiliev/introduction-to-git-and-github-ebook/raw/main/ebook/en/export/introduction-to-git-and-github-light.pdf"&gt;&lt;strong&gt;Light mode&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://github.com/bobbyiliev/introduction-to-git-and-github-ebook/raw/main/ebook/en/export/introduction-to-git-and-github.epub"&gt;&lt;strong&gt;ePub&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
📘 Chapters&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/introduction-to-git-and-github-ebookebook/en/content/000-introduction.md"&gt;&lt;strong&gt;About the book&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/introduction-to-git-and-github-ebookebook/en/content/001-introduction-to-git.md"&gt;&lt;strong&gt;Introduction to Git&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/introduction-to-git-and-github-ebookebook/en/content/002-version-control.md"&gt;&lt;strong&gt;Version Control&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/introduction-to-git-and-github-ebookebook/en/content/003-installing-git.md"&gt;&lt;strong&gt;Installing Git&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/introduction-to-git-and-github-ebookebook/en/content/004-basic-shell-commands.md"&gt;&lt;strong&gt;Basic Shell Commands&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/introduction-to-git-and-github-ebookebook/en/content/005-git-configuration.md"&gt;&lt;strong&gt;Git Configuration&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/introduction-to-git-and-github-ebookebook/en/content/006-introduction-to-GitHub.md"&gt;&lt;strong&gt;Introduction to GitHub&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/introduction-to-git-and-github-ebookebook/en/content/007-initializing-a-project.md"&gt;&lt;strong&gt;Initializing a Git project&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/introduction-to-git-and-github-ebookebook/en/content/008-git-status.md"&gt;&lt;strong&gt;Git Status&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bobbyiliev/introduction-to-git-and-github-ebookebook/en/content/009-git-add.md"&gt;&lt;strong&gt;Git Add&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;…&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/bobbyiliev/introduction-to-git-and-github-ebook"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Hope you liked this article. Thanks to these open source contributors like &lt;a href="https://github.com/bobbyiliev"&gt;Bobby Iliev&lt;/a&gt; today we have a lot of free tutorials and docs, where everyone can learn new things.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thanks for reading!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>hacktoberfest</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>When NOT to BLOCKCHAIN?</title>
      <dc:creator>Gourav Singh Rawat</dc:creator>
      <pubDate>Mon, 22 Aug 2022 04:45:35 +0000</pubDate>
      <link>https://dev.to/seek4samurai/when-not-to-blockchain-2h5m</link>
      <guid>https://dev.to/seek4samurai/when-not-to-blockchain-2h5m</guid>
      <description>&lt;p&gt;Hi this post is about when and where you're not supposed to use blockchain and it's practices, because implementing blockchain has it's own cost, something more than money!&lt;/p&gt;

&lt;p&gt;Now, I'm not any expert but I've seen some projects that were using some blockchains to store transactions about something very unnecessary, this way user experience is degraded and based on that this post flows.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to use Blockchain?
&lt;/h2&gt;

&lt;p&gt;Blockchains allow you to store something over them but at a cost, of course this cost varies from blockchain-to-blockchain and the time you're using it. &lt;br&gt;
&lt;a href="https://academy.binance.com/en/articles/what-is-layer-1-in-blockchain"&gt;Layer-1&lt;/a&gt; blockchains like Ethereum, Solana, Avalanche, Polkadot, etc. are very expensive and it's better to use &lt;a href="https://academy.binance.com/en/glossary/layer-2"&gt;Layer-2&lt;/a&gt; blockchains like &lt;a href="https://polygon.technology/"&gt;Polygon&lt;/a&gt; for transaction. &lt;br&gt;
Blockchains enhance the security &amp;amp; trust factor for users, and being decentralised it reduces the chances of single point of failure.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Boxm2JFO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0xcz2opsof2rd76oq7hb.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Boxm2JFO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0xcz2opsof2rd76oq7hb.gif" alt="Correct" width="388" height="292"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If there's an application that generates sensitive transactional data like an online banking application or the complete banking system, using blockchain makes sense as these transactions will then be stored over something very secured.&lt;/p&gt;

&lt;h2&gt;
  
  
  When not to use Blockchain?
&lt;/h2&gt;

&lt;p&gt;Blockchains are very expensive to use, some are even very slow to process the transaction, like compared to some other payment systems like Visa are way faster.&lt;br&gt;
Adding blockchain transactions to basic things like commenting on a post, removing posts, or something similar will just make your application unreliable.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rz-DBEbS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pqnrplf1j3foy9tnx86m.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rz-DBEbS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pqnrplf1j3foy9tnx86m.gif" alt="Nah man" width="480" height="272"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using blockchains require some knowledge and awareness about them, as a big blockchain application that is Crypto currencies &amp;amp; markets are already suffering from a underlying scammers &amp;amp; frauds, this awareness is very important for people who want to enter this new technology.&lt;/p&gt;

&lt;p&gt;Make sure to have some consultants or experienced people around you before implementing any of these new technologies, as some of these new technologies have some releases that are not meant to be used in production.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Hope it was worth reading.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>blockchain</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Nyan Cat or Giga Cat Epic Game</title>
      <dc:creator>Gourav Singh Rawat</dc:creator>
      <pubDate>Thu, 11 Aug 2022 16:51:00 +0000</pubDate>
      <link>https://dev.to/seek4samurai/nyan-cat-or-giga-cat-epic-game-1970</link>
      <guid>https://dev.to/seek4samurai/nyan-cat-or-giga-cat-epic-game-1970</guid>
      <description>&lt;h2&gt;
  
  
  Nyan Cat Game
&lt;/h2&gt;

&lt;p&gt;Nyan cat game is actually a music rhythm based game 🎶 I.e you start with a decent difficulty as the music in start is decent and it expect you to pass through it, after a few tries at least. &lt;br&gt;
Once you pass through the first phase of the game, you'll enter a Panic event phase, where it gets real exciting 🎸. Panic event can start anytime above the score of &lt;code&gt;50 pts&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why this?
&lt;/h2&gt;

&lt;p&gt;After participating in 4 previous Hackathons (actually winning non of them :P), I decided to do something really entertaining &amp;amp; crazy. So I came up with this idea to make a web game using &lt;a href="https://redis.io/docs/" rel="noopener noreferrer"&gt;Redis&lt;/a&gt; as a primary database. Thanks to &lt;a href="https://github.com/redis/redis-om-node" rel="noopener noreferrer"&gt;RedisOm&lt;/a&gt; it got really easy to do this.&lt;br&gt;
Easy to use thanks to the &lt;a href="https://redis.io/docs/" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;, it was a fun project to work on, and really think it's a Wacky Wildcard Project :P.&lt;/p&gt;
&lt;h3&gt;
  
  
  Submission Category:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Wacky Wildcards&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Languages used:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;JavaScript(Next.Js) &amp;amp; Css&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Screenshots 📷
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FSeek4samurai%2Fproject-giga-cat%2Fmain%2Fpublic%2Fdemo%2FDemo-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FSeek4samurai%2Fproject-giga-cat%2Fmain%2Fpublic%2Fdemo%2FDemo-1.png" alt="Demo-1"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FSeek4samurai%2Fproject-giga-cat%2Fmain%2Fpublic%2Fdemo%2FDemo-2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FSeek4samurai%2Fproject-giga-cat%2Fmain%2Fpublic%2Fdemo%2FDemo-2.png" alt="Demo-2"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Check out these Demo clips of the game 🤯
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fr6sa4k11761usmk50d0x.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fr6sa4k11761usmk50d0x.gif" alt="Img_1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F2avyi0u7wk8s60fjver7.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F2avyi0u7wk8s60fjver7.gif" alt="Img_2"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fp068ar5cb1u8irv3w5nz.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fp068ar5cb1u8irv3w5nz.gif" alt="Img_3"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fp3oz92cdzdw8w6k3rb78.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fp3oz92cdzdw8w6k3rb78.gif" alt="Img_4"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Overview video 🎥
&lt;/h2&gt;

&lt;p&gt;Here's a short video that explains the project and how it uses Redis:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=5dCb1ebFYIs" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.ytimg.com%2Fvi%2F5dCb1ebFYIs%2Fmaxresdefault.jpg" alt="YouTube video"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Seek4samurai" rel="noopener noreferrer"&gt;
        Seek4samurai
      &lt;/a&gt; / &lt;a href="https://github.com/Seek4samurai/project-giga-cat" rel="noopener noreferrer"&gt;
        project-giga-cat
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Nyan cat game with MetaMask authentication for Web 3.0 ecosystem. Made out of Next.js &amp;amp; Moralis. Database powered by @redis (Currently in hibernation)
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Nyan Cat Game&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;Nyan cat game is actually a music rhythm based game 🎶 I.e you start with a decent difficulty as the music in start is decent and it expect you to pass through it, after a few tries at least
Once you pass through the first phase of the game, you'll enter a Panic event phase, where it gets real exciting 🎸. Panic event can start anytime above the score of &lt;code&gt;50 pts&lt;/code&gt;.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Why this?&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;After participating in 4 previous Hackathons (actually winning non of them :P), I decided to do something really entertaining &amp;amp; crazy. So I came up with this idea to make a web game using &lt;a href="https://app.redislabs.com/" rel="nofollow noopener noreferrer"&gt;Redis&lt;/a&gt; as a primary database. Thanks to &lt;a href="https://github.com/redis/redis-om-node" rel="noopener noreferrer"&gt;RedisOm&lt;/a&gt; it got really easy to do this
Easy to use thanks to the &lt;a href="https://redis.io/docs/" rel="nofollow noopener noreferrer"&gt;Redis documentation&lt;/a&gt;, it was a fun project to work on, and really think it's a Wacky…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Seek4samurai/project-giga-cat" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  How it works 🤔
&lt;/h2&gt;

&lt;p&gt;When it comes to working of this game, it comes down to a web application. Here I've created a Next app using &lt;code&gt;npx create-next-app&lt;/code&gt;. Metamask wallet address for user Authentication, this app uses &lt;a href="https://nextjs.org/docs/getting-started" rel="noopener noreferrer"&gt;Next.js framework&lt;/a&gt; with &lt;a href="https://moralis.io/" rel="noopener noreferrer"&gt;Moralis&lt;/a&gt; SDK and Redis for querying &amp;amp; storing data into Redis cloud.&lt;br&gt;
Here game is rendered using HTML5 canvas.&lt;/p&gt;
&lt;h3&gt;
  
  
  How the data is stored: 🤔
&lt;/h3&gt;

&lt;p&gt;In this application, I've something called &lt;a href="https://github.com/redis/redis-om-node" rel="noopener noreferrer"&gt;Redis-om&lt;/a&gt; for Node.js.&lt;br&gt;
Here data is stored in the form of JSON where following schema is created&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Score&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Entity&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="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Schema&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;Score&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="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;address&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;score&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;number&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;sortable&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;textSearch&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&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="na"&gt;dataStructure&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&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;createScore&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="nx"&gt;data&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;await&lt;/span&gt; &lt;span class="nf"&gt;connect&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;repository&lt;/span&gt; &lt;span class="o"&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;fetchRepository&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="nx"&gt;client&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;score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;repository&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createEntity&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="nx"&gt;score&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="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;score&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;score&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;score&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;address&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;address&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;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;repository&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;save&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;score&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;ttlInSeconds&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;21600&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;repository&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;expire&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="nx"&gt;ttlInSeconds&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;await&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;close&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;id&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;Notice I've also declared something as &lt;code&gt;const ttlInSeconds = 21600;&lt;/code&gt; and then used it in &lt;code&gt;await repository.expire(id, ttlInSeconds);&lt;/code&gt; because we don't want to store any data longer than 6 hours. Yes, your scores will reset after 6 hours.&lt;br&gt;
Once this is done, we can create an API route in our Next.js application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createScore&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../../lib/redis&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="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;id&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;createScore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&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="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&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="nx"&gt;id&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;Once we create it in our database, it will be stored in our database by giving data from our frontend, I've used javascript's &lt;code&gt;fetch&lt;/code&gt; API for this purpose. You can &lt;a href="https://github.com/Seek4samurai/project-giga-cat/blob/main/lib/redis.js" rel="noopener noreferrer"&gt;check this file&lt;/a&gt;, where I've declared such logic.&lt;/p&gt;

&lt;h3&gt;
  
  
  How the data is accessed: 🤔
&lt;/h3&gt;

&lt;p&gt;Now if you've gone through the application, there is a section of leaderboard, where we have &lt;code&gt;scores&lt;/code&gt; and &lt;code&gt;addresses&lt;/code&gt; or &lt;code&gt;usernames&lt;/code&gt; of players with highest pts.&lt;br&gt;
To access our database and then fetch it from our Redis database, we have couple of ways like...&lt;/p&gt;

&lt;p&gt;In our development phase, I've used &lt;code&gt;Redis Insight&lt;/code&gt;, importing my database using &lt;code&gt;public endpoint&lt;/code&gt; &amp;amp; &lt;code&gt;password&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;But in our application I've used &lt;code&gt;.env.local&lt;/code&gt; file to store all API keys.&lt;br&gt;
Once that is done, in our &lt;code&gt;redis.js&lt;/code&gt; file we create a redis instance also called &lt;code&gt;Client()&lt;/code&gt; like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&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="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;redis-om&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="nc"&gt;Client&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;connect&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="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&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;isOpen&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&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;open&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;NEXT_PUBLIC_REDIS_URL&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;Now once this is setup, we use &lt;code&gt;fetch&lt;/code&gt; API to query for data.&lt;br&gt;
&lt;/p&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;fetchScores&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;res&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="s2"&gt;/api/search?&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&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;const&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;res&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="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;scores&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To do this, we also need to create an index using &lt;code&gt;await repository.createIndex();&lt;/code&gt; and then we can create another API route to call this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createIndex&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../../lib/redis&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="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&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="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;createIndex&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="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Index is created&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we use a custom function &lt;code&gt;searchScore()&lt;/code&gt; to get the data of top-3 players with highest scores, we used &lt;code&gt;RediSearch&lt;/code&gt; for that purpose.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&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;searchScore&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="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;connect&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;repository&lt;/span&gt; &lt;span class="o"&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;fetchRepository&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="nx"&gt;client&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;offset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&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;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&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;scores&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;repository&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sortDesc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;score&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="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;page&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;offset&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;count&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;scores&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;This will get us the data we want. And we can get that data using API route as &lt;code&gt;search.js&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;searchScore&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../../lib/redis&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="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&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="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;req&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;const&lt;/span&gt; &lt;span class="nx"&gt;query&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;keys&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="mi"&gt;0&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;scores&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;searchScore&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;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&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="nx"&gt;scores&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;You can &lt;a href="https://github.com/Seek4samurai/project-giga-cat/blob/main/lib/redis.js" rel="noopener noreferrer"&gt;check this file&lt;/a&gt;, where I've declared such logic.&lt;/p&gt;

&lt;p&gt;One more thing is that we are also displaying the top-3 players in the Home page of the Game. Let's dig it...&lt;br&gt;
So we're doing something similar to what we did above I.e.&lt;br&gt;
&lt;/p&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;fetchScores&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;res&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="s2"&gt;/api/search?&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&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;const&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;res&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="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;scores&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fetching score as an Object. Then in our separate &lt;code&gt;Marq.jsx&lt;/code&gt; component we are using it as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;score&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]?.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;score&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]?.&lt;/span&gt;&lt;span class="nx"&gt;name&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="nx"&gt;score&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]?.&lt;/span&gt;&lt;span class="nx"&gt;address&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;9&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="nx"&gt;score&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]?.&lt;/span&gt;&lt;span class="nx"&gt;address&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;39&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Refer to &lt;a href="https://github.com/redis/redis-om-node#-using-redisearch" rel="noopener noreferrer"&gt;Using RediSearch&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Hope everything was clear, and if not consider checking the video. If still stuck on something feel free to contact me over my any of the social handle, I'll be happy to help you :)&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to run it locally? 💻
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Requirements&lt;/strong&gt; 📝&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Node.js - Expected version "&amp;gt;=14.17.0". If you need help in installing on Linux like me &lt;a href="https://stackoverflow.com/questions/63312642/how-to-install-node-tar-xz-file-in-linux" rel="noopener noreferrer"&gt;Check out&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Yarn - 1.22.19 (I used).&lt;/li&gt;
&lt;li&gt;Metamask installed on Browser - &lt;a href="https://metamask.io/" rel="noopener noreferrer"&gt;Download here&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;You'll need Metamask account to pass Authentication&lt;/strong&gt; 📝&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FSeek4samurai%2Fproject-giga-cat%2Fmain%2Fpublic%2Fdemo%2Flogin.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FSeek4samurai%2Fproject-giga-cat%2Fmain%2Fpublic%2Fdemo%2Flogin.png" alt="Demo-Image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Follow these steps to run on your device after &lt;code&gt;Cloning the repository&lt;/code&gt; and &lt;code&gt;cd project-giga-cat&lt;/code&gt; to enter the root project folder.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;First things first, use &lt;code&gt;yarn install&lt;/code&gt; to install all the dependencies.&lt;/li&gt;
&lt;li&gt;In root directory of the repo, create a file &lt;code&gt;.env.local&lt;/code&gt; and declare 3 env variables. But before that go to &lt;a href="https://moralis.io/" rel="noopener noreferrer"&gt;Moralis.io&lt;/a&gt; &amp;amp; &lt;a href="https://app.redislabs.com/" rel="noopener noreferrer"&gt;Redis&lt;/a&gt; and create a free account over both.&lt;/li&gt;
&lt;li&gt;In Moralis dashboard, click on &lt;code&gt;Create new Dapp&lt;/code&gt; and select the Environment &lt;code&gt;Testnet&lt;/code&gt; and under testnets select &lt;code&gt;ETH Goerli&lt;/code&gt; testnet. Select a region and give a cute name, finally proceed with it.&lt;/li&gt;
&lt;li&gt;Now, create a subscription in your &lt;code&gt;Redis Cloud&lt;/code&gt; and then create a database for yourself. Make sure to save their details.&lt;/li&gt;
&lt;li&gt;In your &lt;code&gt;.env.local&lt;/code&gt;, create 3 variables as: 
  &lt;code&gt;NEXT_PUBLIC_MORALIS_SERVER_URL&lt;/code&gt;
  &lt;code&gt;NEXT_PUBLIC_MORALIS_APP_ID&lt;/code&gt;
  &lt;code&gt;NEXT_PUBLIC_REDIS_URL&lt;/code&gt;
and give them their values.&lt;/li&gt;
&lt;li&gt;For Moralis, go to settings of your Dapp, and copy the &lt;code&gt;Dapp URL&lt;/code&gt; for &lt;code&gt;SERVER_URL&lt;/code&gt; &amp;amp; &lt;code&gt;Application ID&lt;/code&gt; for &lt;code&gt;APP_ID&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;For Redis, go to your database and from &lt;code&gt;Security&lt;/code&gt; section copy the &lt;code&gt;user password&lt;/code&gt;, and also take the &lt;code&gt;public endpoint&lt;/code&gt; from &lt;code&gt;General&lt;/code&gt; section. Now paste them in the &lt;code&gt;.env.local&lt;/code&gt; file, formatted as &lt;code&gt;NEXT_PUBLIC_REDIS_URL=redis://default:password@endpoint:port&lt;/code&gt;. Note: port should be appended at the last of your &lt;code&gt;public endpoint&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Now run &lt;code&gt;yarn run dev&lt;/code&gt; to run the application.&lt;/li&gt;
&lt;li&gt;Go to &lt;code&gt;http://localhost:3000/&lt;/code&gt; and you'll see the &lt;code&gt;Connect Wallet&lt;/code&gt; page.&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;Connect wallet&lt;/code&gt; and for signing in, Metamask should've popped up. And you'll enter the dashboard.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you've find any difficulty in this, Check my video! 🔥&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you notice anything unusual try refreshing the page. If it doesn't fixes the behavior, please create a issue in Github :)&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  💥 New Update : Users can now have their temporary usernames 💥
&lt;/h2&gt;

&lt;p&gt;Thanks to a &lt;code&gt;Redis&lt;/code&gt; feature -&amp;gt; &lt;code&gt;TimeToLive&lt;/code&gt; or &lt;code&gt;ttl&lt;/code&gt;, users can assign themselves a temporary username for purpose of few hours till their scores exist. Check &amp;amp; read docs for more information.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deployment 🚀
&lt;/h2&gt;

&lt;p&gt;Deployment is done using &lt;a href="https://vercel.com/" rel="noopener noreferrer"&gt;Vercel&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stuck? 🤔
&lt;/h2&gt;

&lt;p&gt;Feel free to contact me through anywhere, LinkedIn, Gmail, or leave a create a Github issue.&lt;/p&gt;

&lt;h2&gt;
  
  
  MIT
&lt;/h2&gt;

&lt;p&gt;Each Soundtracks completely belongs to the respective artist &amp;amp; I don't own them at all.&lt;/p&gt;

&lt;p&gt;Hope you liked the project ❤️ and let's wait till the results 🤞🤞&lt;/p&gt;

&lt;p&gt;Made with ❤️ &amp;amp; &lt;a href="https://redis.io/" rel="noopener noreferrer"&gt;Redis&lt;/a&gt;&lt;/p&gt;

</description>
      <category>redishackathon</category>
      <category>javascript</category>
      <category>nextjs</category>
      <category>redis</category>
    </item>
    <item>
      <title>Are PoW &amp; PoS actually a Blockchain Consensus?</title>
      <dc:creator>Gourav Singh Rawat</dc:creator>
      <pubDate>Mon, 18 Jul 2022 06:18:11 +0000</pubDate>
      <link>https://dev.to/seek4samurai/are-pow-pos-actually-a-blockchain-consensus-2alj</link>
      <guid>https://dev.to/seek4samurai/are-pow-pos-actually-a-blockchain-consensus-2alj</guid>
      <description>&lt;p&gt;Some words on the blockchain Consensus from an upcoming small book on Ethereum. If you have suggestions for any topics, please DM or comment.&lt;/p&gt;

&lt;h2&gt;
  
  
  PoW &amp;amp; PoS
&lt;/h2&gt;

&lt;p&gt;I've seen people talk about PoW &amp;amp; PoS are blockchain consensus algorithms, but aren't they Sybil Resistance mechanisms.&lt;/p&gt;

&lt;p&gt;PoW &amp;amp; PoS are Sybil Resistance mechanisms that prevent from such attacks. Where as the consensus is an algorithm that is computed or mined.&lt;/p&gt;

&lt;h2&gt;
  
  
  Consensus
&lt;/h2&gt;

&lt;p&gt;We know there are thousands of nodes running on a blockchain, and every node could be engaged in some different computation. In order to reach a particular state of the blockchain, a mechanism is used called the consensus.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Consensus algorithm used by Bitcoin is Nakamoto Consensus and EthHash in the case of Ethereum.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It is during the computation where nodes reach this consensus or agree on some single value or single state of the blockchain in a distributed process.&lt;/p&gt;

&lt;p&gt;In public blockchains, this means that once the computation is completed all the other nodes will validate it, and once 51% of the nodes approve that particular computation, the computation is considered to be completed.&lt;/p&gt;

&lt;p&gt;As we know in blockchain, data or transactions are stored in blocks but before storage they are computed by the nodes and the node that completes that computational (mathematical) problem first is said to be the author of that block. &lt;/p&gt;

&lt;p&gt;Now since people can create multiple addresses to run these nodes and get an advantage over other users or even try to manipulate the blockchain, as majority rules in blockchain, we have some algorithms/mechanisms called &lt;strong&gt;Sybil resistance&lt;/strong&gt; algorithms/mechanisms, which are used and implemented in order to avoid these spamming. These mechanisms are helpful against Sybil attacks. &lt;/p&gt;

&lt;p&gt;The most popular Sybil Resistance mechanisms are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Proof-of-Work (PoW).&lt;/li&gt;
&lt;li&gt;Proof-of-Stake (Pos).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Sybil attack is when a single person creates multiple nodes or tries to flood the network with different identities to get an advantage over other nodes or use them to gain disproportionately larger influence on the blockchain.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>programming</category>
      <category>blockchain</category>
      <category>web3</category>
    </item>
    <item>
      <title>Function visibility in Solidity Smart Contracts</title>
      <dc:creator>Gourav Singh Rawat</dc:creator>
      <pubDate>Sat, 25 Jun 2022 16:01:48 +0000</pubDate>
      <link>https://dev.to/seek4samurai/function-visibility-in-solidity-smart-contracts-3fhf</link>
      <guid>https://dev.to/seek4samurai/function-visibility-in-solidity-smart-contracts-3fhf</guid>
      <description>&lt;p&gt;Before we begin, I hope you're familiar with Solidity Smart contracts if not &lt;a href="https://dev.to/seek4samurai/guide-for-smart-contracts-in-solidity-56l4"&gt;check out&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  What are Functions in Solidity
&lt;/h2&gt;

&lt;p&gt;Functions can be declared both inside and outside of the contract in solidity. Functions are one of the most important component in a programming language. They are units or a block of code which you can call anytime or anywhere depending on it's visibility.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;contract myContract{
    function add(uint num_1, uint num_2)public pure returns(uint){
        return num_1 + num_2;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I mentioned visibility above because calling a function completely depends on it.&lt;br&gt;
There are 4 types of visibility options of functions in solidity.&lt;/p&gt;
&lt;h2&gt;
  
  
  Public functions
&lt;/h2&gt;

&lt;p&gt;The example of function above was a public function, check this out.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;contract myContract{
    function add(uint num_1, uint num_2)public pure returns(uint){
        return num_1 + num_2;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A public function is callable almost everywhere and it'll be a part of your contract UI, you can play with solidity on &lt;a href="https://remix.ethereum.org/"&gt;Remix IDE&lt;/a&gt;. The compiler automatically creates a getter function for public functions, which are visible after you compile them. You can learn more about &lt;a href="https://docs.soliditylang.org/en/v0.8.15/contracts.html#getter-functions"&gt;Getter functions here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Private functions
&lt;/h2&gt;

&lt;p&gt;Private functions are functions that can only be called in the contract they are defined in. Private functions won't inherit at all, even if you derive another contract from your previous contract. &lt;br&gt;
Check this example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;contract oldContract{
    function add(uint num_1, uint num_2)private pure returns(uint){
        return num_1 + num_2;
    }
}

// this is not gonna work coz the function add() is private

contract newContract is oldContract{
    uint ans = add(2,4);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Internal functions
&lt;/h2&gt;

&lt;p&gt;Functions that are internal can be called inside the contract they're declared in as well as in any other contract that are derived from that i.e. Internal functions are inherited unlike private functions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;contract oldContract{
    function add(uint num_1, uint num_2)internal pure returns(uint){
        return num_1 + num_2;
    }
}

// this is gonna work coz the function add() is internal

contract newContract is oldContract{
    uint ans = add(2,4);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  External functions
&lt;/h2&gt;

&lt;p&gt;Functions that are set to external visibility can only be called from outside of the contract they are defined in.&lt;br&gt;
You cannot call a external function within the same contract.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;contract oldContract{
    function add(uint num_1, uint num_2)external pure returns(uint){
        return num_1 + num_2;
    }
    // This won't work coz add() function is set external visibility
    uint public answer = add(2, 4);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To make that work, you can create another contract and then call that function over there.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;contract oldContract{
    function add(uint num_1, uint num_2)external pure returns(uint){
        return num_1 + num_2;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But first you'll need to make an instance of that old contract in your new contract.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;contract newContract {
    oldContract instance = new oldContract();
    uint public answer = instance.add(3, 4);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hope function visibility was clear now and this tutorial was helpful.&lt;br&gt;
Please check out:&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Tjd_IwLVlgI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Join for more blockchain, ethereum and solidity smart contract content.&lt;br&gt;
&lt;em&gt;Thanks for reading and watching :)&lt;/em&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>tutorial</category>
      <category>blockchain</category>
      <category>programming</category>
    </item>
    <item>
      <title>Guide for Smart contracts in Solidity</title>
      <dc:creator>Gourav Singh Rawat</dc:creator>
      <pubDate>Tue, 21 Jun 2022 19:48:57 +0000</pubDate>
      <link>https://dev.to/seek4samurai/guide-for-smart-contracts-in-solidity-56l4</link>
      <guid>https://dev.to/seek4samurai/guide-for-smart-contracts-in-solidity-56l4</guid>
      <description>&lt;p&gt;You might heard people in web3 and blockchain talking about smart contracts and solidity.&lt;/p&gt;

&lt;h2&gt;
  
  
  What even is a smart contract
&lt;/h2&gt;

&lt;p&gt;In Solidity, smart contract can be considered as collection of constructor, functions and state variables, or to be more beginner friendly we can take contracts as a class in c++.&lt;br&gt;
In a smart contract, we can implement any algorithm or whatever you want to be done once your contract is deployed or compiled.&lt;/p&gt;

&lt;p&gt;here is a quick tutorial of the same: &lt;iframe width="710" height="399" src="https://www.youtube.com/embed/TiVHr9dqiPo"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Constructor
&lt;/h2&gt;

&lt;p&gt;Sometimes we want some variables to be declared as soon as our contract is deployed or compiled. So to achieve this we have constructors. These are initialised with a constructor keyword.&lt;br&gt;
&lt;code&gt;constructor() {}&lt;/code&gt;&lt;br&gt;
Since constructor is just a function that is run on contract creation, you can define or write code for initialising the contract.&lt;/p&gt;
&lt;h2&gt;
  
  
  2. State variables
&lt;/h2&gt;

&lt;p&gt;General variables where we store the state about our contract.&lt;/p&gt;
&lt;h2&gt;
  
  
  3. Functions
&lt;/h2&gt;

&lt;p&gt;You must be knowing what functions are if you're familiar with any other programming language. If there is something or some block of code that is to be run different times on many places, you can define those code lines in a functions and call that function to run them. &lt;br&gt;
Same applies in Solidity.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;contract my_contract{
   uint num_1 = 10;
   uint num_2 = 20;

   function add(uint a, uint b) public pure returns(uint){
      return a + b;
   }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But here's a thing to know in solidity is that if in a contract you declare a function and doesn't put any implementation inside it, our parent contract will become an &lt;code&gt;abstract contract&lt;/code&gt;. So our contract will look like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;abstract contract my_contract{
   function add(uint a, uint b) public virtual returns(uint);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see above, our contract &lt;code&gt;my_contract&lt;/code&gt; has a function &lt;code&gt;add&lt;/code&gt; that is not yet implemented, so we have marked our contract as abstract contract.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I hope this topic was clear, thanks for reading!&lt;br&gt;
Do checkout the video in the blog that describes the same&lt;/em&gt;&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>solidity</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>Questions whose answers are worth knowing in Machine Learning for beginners!</title>
      <dc:creator>Gourav Singh Rawat</dc:creator>
      <pubDate>Sat, 28 May 2022 10:17:58 +0000</pubDate>
      <link>https://dev.to/seek4samurai/questions-whose-answers-are-worth-knowing-in-machine-learning-for-beginners-3a1d</link>
      <guid>https://dev.to/seek4samurai/questions-whose-answers-are-worth-knowing-in-machine-learning-for-beginners-3a1d</guid>
      <description>&lt;p&gt;Some concepts and answers one should know in machine learning before going further. Wrote them in my weekend, because I was bored and I thought to dive into some data science, machine learning and statistics.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;&lt;em&gt;1. Explain what is regression?&lt;/em&gt;&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Regression is a supervised learning technique which helps us in finding the correlation between the dependent target variable and one or more independent predicting variable(s).&lt;br&gt;
It is mainly used for predictions, weather forecasting, or determining the causal-effect relationship between variables.&lt;/p&gt;

&lt;p&gt;In Regression, we plot a graph between the variables which best fits in the given data points or dataset, using this plot, the machine learning model can make predictions about the data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fact:&lt;/strong&gt; The method in which we analyse such type of regression is called Regression Analysis, which is indeed a statistical analysis to model the relationship between a dependent (target) and independent (predictor) variables with one or more independent variables.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;&lt;em&gt;2. What is Geometric machine learning model?&lt;/em&gt;&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Before we get to know the actual meaning of Geometric machine learning model, we need to know what's &lt;strong&gt;Euclidean data&lt;/strong&gt; and &lt;strong&gt;non-Euclidean data&lt;/strong&gt;.&lt;br&gt;
So, basically most of the data and information that we get to know or have, is Euclidean data (most of it). &lt;br&gt;
Euclidean data is just the datatypes that exists in 1-dimension or 2-dimension domain. &lt;br&gt;
&lt;em&gt;Euclidean data consist of audio, images, videos, numbers, some text and more similar type of data.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A non-Euclidean data is much like that we can't really explain in simple ways and it require much like 3-dimensional explanation, &lt;em&gt;for example a molecular structure or some hierarchy or a tree structure.&lt;/em&gt; &lt;br&gt;
Here a molecular structure or a network structure is a 3D structure which will fall into non-Euclidean data.&lt;/p&gt;

&lt;p&gt;After all above, Geometric machine learning model or Geometric Deep learning (GDL) is the model that aims to deal with or learn from the non-Euclidean data, or Geometric machine learning model or Geometric Deep Learning (GDL) is the niche field under the umbrella of deep learning that aims to build neural networks that can learn from non-euclidean data.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;&lt;em&gt;3. What is Analysis of variance(ANOVA)?&lt;/em&gt;&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Analysis of Variance is a test which an analyst might perform to check the difference among the means of the population by examining the amount of variation within each of the sample. ANOVA is the statistical approach of testing or comparing the two datasets, this is one of the best applied test when we have more that 2 populations or samples to be compared.&lt;/p&gt;

&lt;p&gt;But to compare the means of two or more populations or datasets, ANOVA would be appreciated if the samples of datasets satisfies the following:-&lt;/p&gt;

&lt;p&gt;&lt;em&gt;- Independence of case&lt;/em&gt; -&amp;gt; this assumption means that the case or samples of dependent variable should be independent or selected randomly, there should not be any sequence or pattern to be followed when selecting sample datasets.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;- Normality&lt;/em&gt; -&amp;gt; this means that the distribution of each group should be normal.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;- Homogeneity&lt;/em&gt; -&amp;gt; this means that the variance between each group should be same.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;&lt;em&gt;4. What are the types of Analysis of variance(ANOVA)&lt;/em&gt;&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;ANOVA has basically 3-types.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- One way analysis:&lt;/strong&gt; when we are comparing 3 or more than 3 groups based on 1 factor variable, then it's said to be one way analysis of that group.&lt;br&gt;
&lt;em&gt;Example:&lt;/em&gt; if we want to compare whether or not the mean output of three employees is same or not, based on the working hours of the three employees.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Two way analysis:&lt;/strong&gt; when there are two or more factor variables in a comparison then it is said to be two way analysis of those groups.&lt;br&gt;
&lt;em&gt;Example:&lt;/em&gt; if we compare whether or not the mean output of three employees is same or not based on their working hours and working locations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- K-way analysis:&lt;/strong&gt; When factor variables are k, then it is said to be the k-way analysis of variance(ANOVA).&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;&lt;em&gt;5. Explain in brief what is T-test and Z-test&lt;/em&gt;&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Before we dive in both of these tests, we need to know what is Hypothesis testing. A more descriptive article about this can be found &lt;a href="https://www.statisticshowto.com/probability-and-statistics/hypothesis-testing/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So hypothesis testing is method for us to test if our hypothesis is true or false, about the population using the sample dataset. Through hypothesis testing we can know if we have enough evidence about the population, and conclude if our hypothesis is true or false.&lt;/p&gt;

&lt;p&gt;So what is Z-test and T-test? Well both are Parametric tests i.e they rely on statistical distribution of the dataset. To know more about Parametric tests, &lt;a href="https://towardsdatascience.com/parametric-tests-the-t-test-c9b17faabfb0#:~:text=Parametric%20tests%20are%20those%20that,mean%20or%20variance%20of%20data."&gt;check this out!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Z-Test:&lt;/strong&gt;&lt;br&gt;
Z-test is a hypothesis test which ascertains the averages of the two datasets are different from each other, when standard deviation or variance is given. Z-test is usually preferred over T-test when in a dataset, sample-size &amp;gt; 30. It is based on Normal distribution and all data points are independent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. T-test:&lt;/strong&gt;&lt;br&gt;
T-test is also a hypothesis test which is used when either the standard deviation or variance is not known or the sample-size &amp;lt; 30, in a dataset. This states how averages of two datasets differ from each other.&lt;br&gt;
This test is based on t-distribution and data points are not dependent.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Hope this was informative for you! I might post few more briefly explained questions on similar topics.&lt;br&gt;
Thanks for reading!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>beginners</category>
      <category>computerscience</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Quick guide to FaceApi Machine learning model for web - ML5.js</title>
      <dc:creator>Gourav Singh Rawat</dc:creator>
      <pubDate>Sun, 22 May 2022 18:13:56 +0000</pubDate>
      <link>https://dev.to/seek4samurai/quick-guide-to-faceapi-machine-learning-model-for-web-ml5js-9mo</link>
      <guid>https://dev.to/seek4samurai/quick-guide-to-faceapi-machine-learning-model-for-web-ml5js-9mo</guid>
      <description>&lt;h2&gt;
  
  
  What is ML5.js?
&lt;/h2&gt;

&lt;p&gt;ml5.js is machine learning for the web in your web browser. Through some clever and exciting advancements, the folks building TensorFlow.js figured out that it is possible to use the web browser's built in graphics processing unit (GPU) to do calculations that would otherwise run very slowly using central processing unit (CPU). ml5 strives to make all these new developments in machine learning on the web more approachable for everyone.&lt;/p&gt;

&lt;p&gt;What I find amazing about ML5.js is that it's really easy for beginners to get started and it also gives a nice idea about running machine learning models.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;

&lt;p&gt;ML5 provides an amazingly easy face api to work with.It provides this face-api.js that allows you to access face and face landmark detection.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create a basic html page&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8" /&amp;gt;
    &amp;lt;title&amp;gt;face-api&amp;lt;/title&amp;gt;
    &amp;lt;script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.1.9/p5.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.1.9/addons/p5.sound.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script src="https://cdn.jsdelivr.net/gh/ml5js/Intro-ML-Arts-IMA@ml5-build-10-7-19/ml5_build/ml5.min.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;link rel="stylesheet" type="text/css" href="style.css" /&amp;gt;
    &amp;lt;meta charset="utf-8" /&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
    &amp;lt;script src="sketch.js"&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We are also importing p5.js, as it works best with Ml5.js.&lt;br&gt;
Once we have imported all necessary things we can get started with our sketch.js.&lt;/p&gt;

&lt;p&gt;So, the basic idea is that we create a video element at starting. Once&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// initialized variables
let faceapi;
let detections = [];

let video;
let canvas;

function setup() {
  canvas = createCanvas(1080, 720); // canvas window
  canvas.id("canvas");

  // getting video of user
  video = createCapture(video);
  video.id("video");
  video.size(width, height);

  // making face details
  const faceOptions = {
    withLandmarks: true,
    withExpressions: true,
    withDescriptors: true,
    minConfidence: 0.5,
  };

  //Initialize the model:
  faceapi = ml5.faceApi(video, faceOptions, faceReady);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We initialised some variables like video and canvas, in which we will setup our video element. We have created &lt;code&gt;faceOption&lt;/code&gt; array for ML5 and it'll return us the details about the face data that we sent when initialising the model. we used &lt;code&gt;ml5.faceapi()&lt;/code&gt; for this project as this is for detecting faces. Once a face is detected in our video element this should be called.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// on face detection
function faceReady() {
  faceapi.detect(gotFaces);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Above here, &lt;code&gt;gotFaces&lt;/code&gt; is a callback function, so we'll make another function once &lt;code&gt;faceApi&lt;/code&gt; detects a face.&lt;br&gt;
&lt;em&gt;This is a tricky part!&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Got faces:
function gotFaces(error, result) {
  if (error) {
    console.log(error);
    return;
  }

  detections = result; //Now all the data in this detections:

  clear(); //Draw transparent background;:
  drawBoxs(detections); //Draw detection box:
  drawLandmarks(detections); //// Draw all the face points:

  faceapi.detect(gotFaces); // Call the function again at here:
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once we get the face details, we store details in detections variable and clear previous on screen renders caused by our next step.&lt;br&gt;
Next we need to draw box and face landmarks over our user's face.&lt;/p&gt;

&lt;p&gt;Here we create two functions that draw box user's face.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function drawBoxs(detections) {
  if (detections.length &amp;gt; 0) {
    //If at least 1 face is detected:
    for (f = 0; f &amp;lt; detections.length; f++) {
      let { _x, _y, _width, _height } = detections[f].alignedRect._box;
      stroke(44, 169, 225);
      strokeWeight(1);
      noFill();
      rect(_x, _y, _width, _height);
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Above, if check in &lt;code&gt;detections&lt;/code&gt; array, if atleast one face is detected then we create a box with the help of coordinates that are provided with the help of Ml5 library. Remember we did a &lt;code&gt;clear()&lt;/code&gt; in our previous &lt;code&gt;gotFaces()&lt;/code&gt; function? We did this so once a face is detected, we create a box around it and then after few frames we clear that box and re-create it. So as to update it's coordinates.&lt;/p&gt;

&lt;p&gt;Now to create face landmarks we do similar things.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function drawLandmarks(detections) {
  if (detections.length &amp;gt; 0) {
    //If at least 1 face is detected:
    for (f = 0; f &amp;lt; detections.length; f++) {
      let points = detections[f].landmarks.positions;
      for (let i = 0; i &amp;lt; points.length; i++) {
        stroke(47, 255, 0); // points color
        strokeWeight(5); // points weight
        point(points[i]._x, points[i]._y);
      }
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, landmark points and coordinates are returned by ML5 api.&lt;/p&gt;

&lt;p&gt;Add some basic css for centering canvas.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;body {
  background-color: #000;
}

#canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

#video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
  border: 3px #fff solid;
  border-radius: 10px;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.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%2Frvufe83kaqldwjkv9olk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Frvufe83kaqldwjkv9olk.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
And our face detection application is ready!&lt;br&gt;
&lt;em&gt;Hope you liked this basic start guide. Thanks for reading&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>machinelearning</category>
      <category>beginners</category>
      <category>api</category>
    </item>
    <item>
      <title>Computer vision API - Using Microsoft Azure Cognitive services</title>
      <dc:creator>Gourav Singh Rawat</dc:creator>
      <pubDate>Fri, 13 May 2022 14:56:48 +0000</pubDate>
      <link>https://dev.to/seek4samurai/using-computer-vision-api-using-microsoft-azure-cognitive-services-4gi</link>
      <guid>https://dev.to/seek4samurai/using-computer-vision-api-using-microsoft-azure-cognitive-services-4gi</guid>
      <description>&lt;h2&gt;
  
  
  Cognitive services
&lt;/h2&gt;

&lt;p&gt;Cognitive Services are a set of machine learning algorithms that Microsoft has developed to solve problems in the field of Artificial Intelligence (AI). The goal of Cognitive Services is to democratise AI by packaging it into discrete components that are easy for developers to use in their own apps.&lt;/p&gt;

&lt;p&gt;I recently created an Application - &lt;code&gt;Azura&lt;/code&gt; with same method.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Seek4samurai" rel="noopener noreferrer"&gt;
        Seek4samurai
      &lt;/a&gt; / &lt;a href="https://github.com/Seek4samurai/Azura" rel="noopener noreferrer"&gt;
        Azura
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Yes.! Azura Play with it. Powered by Microsoft's @Azure-cognitive-service-computer-vision. It's available in both as web application and as a browser extension.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Azura&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;Yes.! Azura&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;What is Azura?🚀&lt;/h1&gt;
&lt;/div&gt;
This is an extension just like those we put on our browsers and also a sort of searching tool, that takes an Image url as input and processes it using Microsoft Azure's Computer vision and describes what the image is about. This is basically a tool that exists to describe the one use of Computer vision
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Live demo 🌏&lt;/h2&gt;

&lt;/div&gt;
Website is live at &lt;a href="https://azura-website.vercel.app/" rel="nofollow noopener noreferrer"&gt;https://azura-website.vercel.app/&lt;/a&gt; &lt;br&gt;
But do check the extension as well with even better user experience and with text to speech feature that reads out the description of the image.
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;How to use is as extension 🧑🏼‍💻&lt;/h2&gt;

&lt;/div&gt;
Clone or download it as zip, the following repository : &lt;a href="https://github.com/seek4samurai/azura" rel="noopener noreferrer"&gt;https://github.com/seek4samurai/azura&lt;/a&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Adding to your browser 📝&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;To add this extension, go to your browser &amp;gt;&amp;gt; extensions&lt;/p&gt;
&lt;p&gt;First you need to turn on the Developer mode: On.&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/Seek4samurai/Azura/main/public/screenshots/pic1.png"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FSeek4samurai%2FAzura%2Fmain%2Fpublic%2Fscreenshots%2Fpic1.png" alt="pic1"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Once this is done, you can now import extensions&lt;/p&gt;
&lt;p&gt;Click on…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Seek4samurai/Azura" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;If you're familiar with Computer vision, you must know how it works. This is a technique in which we train a machine's vision to recognise real world objects and similar things, which could either be some objects or even living things like human face or recognising animals.&lt;/p&gt;

&lt;p&gt;Microsoft Azure provides with some free to use cognitive service APIs to create such computer vision powered applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Creating Azure resource&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Select Computer vision from resource and then create a resource.&lt;br&gt;
&lt;a href="https://media.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%2Fotr5z9vxli4b6zz7mdvs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fotr5z9vxli4b6zz7mdvs.png" alt="Azure Home"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After you've created a resource.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F33ovrcjg6ic2o3koo986.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F33ovrcjg6ic2o3koo986.png" alt="Azure resource"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using API client&lt;/strong&gt;&lt;br&gt;
Once you did all before steps correctly, you can get started with your workspace.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Server setup&lt;/strong&gt;&lt;br&gt;
Get started with creating a server using, we are using nodejs &lt;code&gt;npm init -y&lt;/code&gt;. Once you've initialised, you've to install following packages and libraries.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "name": "azura-backend",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "dev": "nodemon ./src/index.js",
    "start": "node ./src/index.js"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@azure/cognitiveservices-computervision": "^8.1.0",
    "cors": "^2.8.5",
    "dotenv": "^16.0.0",
    "express": "^4.17.2"
  },
  "devDependencies": {
    "nodemon": "^2.0.15"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, we are using Express for creating server. And to use the Azure-cognitive services we install &lt;br&gt;
&lt;code&gt;npm i @azure/cognitiveservices-computervision&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Create a &lt;code&gt;src&lt;/code&gt; folder and &lt;code&gt;index.js&lt;/code&gt; file to start a server and handle basic routes in it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const express = require("express");
const dotenv = require("dotenv");
const cors = require("cors");

dotenv.config();

const imageController = require("./controller");

const app = express();
app.use(cors({
  origin: "*"
}));
app.use(express.json());

// Routes
app.use("/", imageController);

const PORT = process.env.PORT || 5000;

app.listen(PORT, () =&amp;gt; {
  console.log(`App running or port ${PORT}`);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once this is done, create &lt;code&gt;controller.js&lt;/code&gt; file, where we will use computer vision client for our application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const express = require("express");
const ComputerVisionClient =
  require("@azure/cognitiveservices-computervision").ComputerVisionClient;
const ApiKeyCredentials = require("@azure/ms-rest-js").ApiKeyCredentials;

const router = express.Router();

router.post("/describe", async (req, res) =&amp;gt; {
  const KEY = process.env.KEY;
  const ENDPOINT = process.env.ENDPOINT;

  // Create a new Client
  const computerVisionClient = new ComputerVisionClient(
    new ApiKeyCredentials({ inHeader: { "Ocp-Apim-Subscription-Key": KEY } }),
    ENDPOINT
  );

  if (!req.body.imageUrl) {
    return res.send("Image url is not set! Please provide an image!");
  }
});

module.exports = router;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remember you've to create &lt;code&gt;.env&lt;/code&gt; file in your local workspace and paste your API keys and endpoint, and to use them I'm using &lt;code&gt;dotenv&lt;/code&gt; package (hope that is understandable). We've initialised the client and when we hit the post request to redirect to &lt;code&gt;/describe&lt;/code&gt;, it should hit our client. You can try using postman to check this API call.&lt;br&gt;
And in the last line we are just checking if the request is empty, then simply return that empty url message.&lt;/p&gt;

&lt;p&gt;After all this we can go ahead and create a &lt;code&gt;try-catch&lt;/code&gt; block and use the&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  try {
    // Describe and Image Url
    const descUrl = req.body.imageUrl;
    const caption = (await computerVisionClient.describeImage(descUrl))
      .captions[0];

    res.send(
      `This maybe ${caption.text} (confidence ${caption.confidence.toFixed(2)})`
    );
  } catch (error) {
    console.log(error);
    res.send(error.message)
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, we are getting the &lt;code&gt;req.body.imageUrl&lt;/code&gt; from our frontend and using that URL for our client. And it will return and send response back to frontend.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frontend overview
&lt;/h2&gt;

&lt;p&gt;Since frontend is not the point of focus in this tutorial, we can take a quick overview of it.&lt;br&gt;
We take input from user and that URL is sent to our backend. I'm using &lt;code&gt;Axios&lt;/code&gt; for that purpose.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const res = await axios.post(
      "https://YourURL/describe",
      {
        imageUrl,
      }
    );
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In place of YourURL, paste your server's URL.&lt;/p&gt;

&lt;p&gt;You can check to print the response or log it in console. This will accept image's URL and return it's description, what the image is about.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thank you for reading.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>azure</category>
      <category>machinelearning</category>
      <category>node</category>
    </item>
  </channel>
</rss>
