<?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: Malik Idrees</title>
    <description>The latest articles on DEV Community by Malik Idrees (@malikidrees).</description>
    <link>https://dev.to/malikidrees</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%2F661954%2F7767d78b-9216-41d8-ad37-3ffc2785058f.jpg</url>
      <title>DEV Community: Malik Idrees</title>
      <link>https://dev.to/malikidrees</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/malikidrees"/>
    <language>en</language>
    <item>
      <title>Syncing Data in Near Real-Time: Integrate DynamoDB and OpenSearch</title>
      <dc:creator>Malik Idrees</dc:creator>
      <pubDate>Sat, 16 Nov 2024 07:43:26 +0000</pubDate>
      <link>https://dev.to/malikidrees/syncing-data-in-near-real-time-integrate-dynamodb-and-opensearch-3onc</link>
      <guid>https://dev.to/malikidrees/syncing-data-in-near-real-time-integrate-dynamodb-and-opensearch-3onc</guid>
      <description>&lt;h2&gt;
  
  
  Syncing Data in Near Real-Time: Integrate DynamoDB and OpenSearch
&lt;/h2&gt;

&lt;p&gt;Synchronizing data between DynamoDB and OpenSearch can yield incredible performance for fast searches and complex queries on structured, nested data. In this article, we’ll cover an architecture that facilitates near real-time data synchronization from DynamoDB to OpenSearch using a single-table design. We’ll explore how this setup enhances search functionality, optimizes costs, and supports complex, nested data updates.&lt;/p&gt;

&lt;p&gt;This architecture is built on AWS DynamoDB, using its single-table design for efficient data storage, with OpenSearch integration to handle fast, scalable searches across complex data structures.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Use Single Table Design and OpenSearch Together?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;DynamoDB and OpenSearch serve distinct purposes. While DynamoDB provides cost-efficient, fast storage and retrieval of data, OpenSearch is optimized for search operations. By using a single-table design in DynamoDB, we organize related entities under a single partition, improving efficiency and scalability. This design also simplifies the syncing process, as DynamoDB and OpenSearch are synchronized based on DynamoDB Streams.&lt;/p&gt;

&lt;p&gt;The primary use cases for this integration include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Near Real-Time Syncing&lt;/strong&gt;: Reflecting changes from DynamoDB to OpenSearch with minimal latency.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Efficient Handling of Array and Nested Structures&lt;/strong&gt;: Structuring data in OpenSearch to accommodate nested and array-based data stored in DynamoDB, without unnecessary overwrites.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Optimized Search Performance&lt;/strong&gt;: Using OpenSearch for fast searches on complex, nested, and array-based data with minimal impact on DynamoDB performance.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;System Design Overview: Key Components&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Our system design leverages several AWS services to ensure data is consistently and accurately synchronized. Below, we outline each component’s role, along with key aspects of the single-table DynamoDB design and how data is transformed for OpenSearch compatibility.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Model (Single Table) Overview&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In a single-table design, related entities share a common partition, with each row differentiated by sort keys. Here’s an example setup for a logistics management system:&lt;/p&gt;

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

&lt;p&gt;This table allows for efficient querying by PK, retrieving all related entities, such as order details and items, under a single partition.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Architecture Flow&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here’s a high-level view of how the system processes data updates:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;DynamoDB Streams&lt;/strong&gt;: Captures changes to DynamoDB records and triggers an AWS Lambda function.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Lambda Event Processor&lt;/strong&gt;: &lt;br&gt;
The Lambda function processes each stream event through the &lt;strong&gt;BaseEntityProcessor&lt;/strong&gt; class, which maps DynamoDB’s single-table structure to OpenSearch’s flat document structure.&lt;br&gt;
This transformation ensures each &lt;strong&gt;Order&lt;/strong&gt; or &lt;strong&gt;Shipment&lt;/strong&gt; is stored as a single document in OpenSearch, accommodating array-based fields such as &lt;strong&gt;items&lt;/strong&gt; under a unified document.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;OpenSearch Service&lt;/strong&gt;:&lt;br&gt;
OpenSearch stores order items, shipments, and customers in a flat document structure for faster query performance, enabling complex queries on nested data, such as &lt;code&gt;orderItems&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The diagram below illustrates the flow of data from DynamoDB to OpenSearch via AWS Lambda:&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Detailed Component Breakdown&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;DynamoDB Stream and Lambda Event Processing
**DynamoDB Streams notify the system whenever there’s a data change (insert, update, or delete). The Lambda function processes each event individually, with the **BaseEntityProcessor&lt;/strong&gt; mapping DynamoDB records to OpenSearch fields:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Array Transformation&lt;/strong&gt;: In DynamoDB, arrays like &lt;code&gt;items&lt;/code&gt; are stored as separate rows. In OpenSearch, they are transformed into a single document structure where all items fall under &lt;code&gt;orderItems&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data Syncing&lt;/strong&gt;: When an item is added or removed from &lt;code&gt;items&lt;/code&gt; in DynamoDB, the entire array is updated in OpenSearch, ensuring it reflects the latest state.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;OpenSearch Bulk and Partial Updates&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To efficiently sync large data sets, we use OpenSearch’s bulk API for batch updates. Here’s how the OpenSearch service processes updates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Flat Document Structure&lt;/strong&gt;: Each &lt;strong&gt;Order **document in OpenSearch contains a complete array of **orderItems&lt;/strong&gt;. When any item in DynamoDB’s &lt;strong&gt;items&lt;/strong&gt; row is modified, OpenSearch is updated to reflect the full set of items under &lt;strong&gt;orderItems&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Handling Nested Updates&lt;/strong&gt;: Information like shipment is stored within specific sections (e.g., shipmentInfo in OpenSearch). Updates to these nested fields are applied directly to their respective sections, preserving document structure and avoiding overwrites of unrelated data.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Implementation and Code Structure&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This project’s file structure is organized for efficient management of different entities, event processing, and OpenSearch operations. Here’s an outline of the key directories and files:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;📦stream
 ┣ 📂handlers
 ┃ ┣ 📜StreamBatchHandler.ts
 ┣ 📂processors
 ┃ ┣ 📂entity-processors
 ┃ ┃ ┣ 📜OrderEntityProcessor.ts
 ┃ ┃ ┗ 📜UserEntityProcessor.ts
 ┃ ┣ 📂order-processors
 ┃ ┃ ┗ 📜ShipmentProcessor.ts
 ┃ ┣ BaseEntityProcessor.ts
 ┃ ┣ BatchProcessor.ts
 ┃ ┣ EntityProcessorFactory.ts
 ┃ ┣ EventProcessor.ts
 ┣ 📂services
 ┃ ┣ 📜OpenSearchBulkService.ts
 ┣ 📂utils
 ┃ ┗ 📜Logger.ts
 ┣ 📜README.md
 ┣ 📜event.json
 ┣ 📜index.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Each directory plays a specific role:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;handlers&lt;/strong&gt;: Contains Lambda functions to process DynamoDB streams.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;processors&lt;/strong&gt;: Contains &lt;strong&gt;BaseEntityProcessor&lt;/strong&gt;, defining generic methods, abstract functions, and shared variables for various entities. Key processors in &lt;strong&gt;entity-processors&lt;/strong&gt; extend BaseEntityProcessor:&lt;br&gt;
&lt;strong&gt;OrderEntityProcessor.ts&lt;/strong&gt; processes core order details, including nested attributes and array-based structures like items.&lt;br&gt;
&lt;strong&gt;UserEntityProcessor.ts&lt;/strong&gt; handles user-related data processing.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The order-processors subfolder provides specialized processors, such as &lt;strong&gt;ShipmentProcessor.ts&lt;/strong&gt;, that handle shipment details, which are called by &lt;strong&gt;OrderEntityProcessor&lt;/strong&gt; for deeper, order-specific transformations for OpenSearch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Optimizing DynamoDB and OpenSearch Sync for Real-World Applications&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Some optimization tips to keep in mind when implementing this system in production:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use Cached Index Checks&lt;/strong&gt;: Caching index checks improves system efficiency, as checking for an index only happens once per entity, reducing load on OpenSearch.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Consider Retry Mechanisms&lt;/strong&gt;: Implement retry logic in OpenSearch operations to handle intermittent network failures or throttling.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Optimized Partial Updates&lt;/strong&gt;: With targeted updates on nested structures like orderItems by unique IDs, the system avoids full overwrites in OpenSearch. This method keeps updates focused and minimizes data transfer, making syncing more efficient.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This architecture demonstrates how integrating DynamoDB (single-table design) with OpenSearch enables scalable, near real-time data synchronization. Using a single-table structure in DynamoDB optimizes data organization and retrieval, minimizing duplicated data while centralizing related entities within a single partition. OpenSearch’s document model complements this by supporting flexible, fast searches on large, complex datasets.&lt;/p&gt;

&lt;p&gt;With a reliable syncing mechanism, this system handles nested and array-based data, ensuring that all changes in DynamoDB are immediately accessible for search and analytics via OpenSearch. This solution is broadly applicable across e-commerce, logistics, and other high-demand industries.&lt;br&gt;
&lt;a href="https://github.com/idrsdev/dynamo-opensearch-sync" rel="noopener noreferrer"&gt;&lt;strong&gt;GitHub - idrsdev/dynamo-opensearch-sync&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>dynamodb</category>
      <category>opensearch</category>
      <category>aws</category>
      <category>lambda</category>
    </item>
    <item>
      <title>Agile Board: A Trello-like API in NestJS with Unit and e2e Testing</title>
      <dc:creator>Malik Idrees</dc:creator>
      <pubDate>Wed, 06 Sep 2023 19:53:04 +0000</pubDate>
      <link>https://dev.to/malikidrees/agile-board-a-trello-like-api-in-nestjs-with-unit-and-e2e-testing-4823</link>
      <guid>https://dev.to/malikidrees/agile-board-a-trello-like-api-in-nestjs-with-unit-and-e2e-testing-4823</guid>
      <description>&lt;p&gt;🚀 Agile Board: Simplify Project Management with Ease!&lt;/p&gt;

&lt;p&gt;Introducing Agile Board, a Trello-like API powered by Node.js and NestJS. 🌟&lt;/p&gt;

&lt;p&gt;Streamline your project management, enhance team collaboration, and effortlessly track tasks with our user-friendly API. Here's what you can do:&lt;/p&gt;

&lt;p&gt;🔹 Create Custom Workspaces and Boards: Tailor your workspaces and boards to match your project needs. Flexibility at its finest.&lt;/p&gt;

&lt;p&gt;🔹 Effortless Task Management: Add, update, and track tasks across multiple boards and workspaces.&lt;/p&gt;

&lt;p&gt;🔹 Seamless Collaboration: Collaborate seamlessly with team members by adding comments to tasks. Keep everyone in the loop.&lt;/p&gt;

&lt;p&gt;🔹 Robust Security: Implemented password hashing and precise permission control at the backend to ensure your information remains safe.&lt;/p&gt;

&lt;p&gt;Your insights and suggestions are welcomed!&lt;/p&gt;

&lt;p&gt;🧬 Postgres and TypeOrm: For streamlined database interactions.&lt;/p&gt;

&lt;p&gt;🧬 Testing: Unit and end-to-end testing for one of the modules showcases the power of testing.&lt;/p&gt;

&lt;p&gt;🧬 Global Database Setup and Teardown: Effortlessly manage your database for E2E testing—customizable to your exact needs.&lt;/p&gt;

&lt;p&gt;🧬 Dynamic Config Module: Seamlessly switch between configurations for normal operations and testing.&lt;/p&gt;

&lt;p&gt;Explore Agile Board now on GitHub, and don't hesitate to share your valuable feedback.&lt;br&gt;
Note: Documentation preview is available, but you'll need to set it up using the provided .env.example for usage.&lt;/p&gt;

&lt;p&gt;You can view the API documentation here&lt;br&gt;
&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;a href="https://idrsdev.github.io/agile-board/" rel="noopener noreferrer"&gt;
      idrsdev.github.io
    &lt;/a&gt;
&lt;/div&gt;



&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/idrsdev" rel="noopener noreferrer"&gt;
        idrsdev
      &lt;/a&gt; / &lt;a href="https://github.com/idrsdev/agile-board" rel="noopener noreferrer"&gt;
        agile-board
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Bring all your tasks, teams, and tools together in one centralized platform! Open to contributions⭐ Raise a PR⚡! You can view API Docs Here
    &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="http://nestjs.com/" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/4b0000b8e7a6449a924fe0212093b9f3936ef80cc8fdfbb770baad58f58b8c2c/68747470733a2f2f6e6573746a732e636f6d2f696d672f6c6f676f2d736d616c6c2e737667" width="200" alt="Nest Logo"&gt;&lt;/a&gt;
&lt;/p&gt;


&lt;p&gt;A progressive &lt;a href="http://nodejs.org" rel="nofollow noopener noreferrer"&gt;Node.js&lt;/a&gt; framework for building efficient and scalable server-side applications.&lt;/p&gt;
&lt;br&gt;
    &lt;p&gt;&lt;br&gt;
&lt;a href="https://www.npmjs.com/~nestjscore" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/24dfd27aa1b2b7b9b523f5eaf2c6abf33084588f7f567553ad9e4b36113b5717/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f406e6573746a732f636f72652e737667" alt="NPM Version"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.npmjs.com/~nestjscore" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/b7c951e242d9686b460a9eab8b265d7240f84b29a79c299c648aa95d64bf8440/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f6c2f406e6573746a732f636f72652e737667" alt="Package License"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.npmjs.com/~nestjscore" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/7b83739222090e241d71c5fd4938703c7dedfafef0cde0d96022c3cf9b3a57ca/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f646d2f406e6573746a732f636f6d6d6f6e2e737667" alt="NPM Downloads"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://circleci.com/gh/nestjs/nest" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/90e78bdb27156e5275cdb3028402d4cc16b313c300b8dfdadd865455164d68ad/68747470733a2f2f696d672e736869656c64732e696f2f636972636c6563692f6275696c642f6769746875622f6e6573746a732f6e6573742f6d6173746572" alt="CircleCI"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://coveralls.io/github/nestjs/nest?branch=master" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/3c5d9fe3d2b47c6e02dd884319a0049859d22493dc47665d219edfaa4412632b/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6e6573746a732f6e6573742f62616467652e7376673f6272616e63683d6d61737465722339" alt="Coverage"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://discord.gg/G7Qnnhy" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/418492403803275197fbce1084b95b08d56ad9c7d2a0d6d3fa70dea12ff31284/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646973636f72642d6f6e6c696e652d627269676874677265656e2e737667" alt="Discord"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://opencollective.com/nest#backer" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/ebdc9e103775edc0db99103676102f341ba228170356d4e069dfef64ef635593/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6e6573742f6261636b6572732f62616467652e737667" alt="Backers on Open Collective"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://opencollective.com/nest#sponsor" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/9e95a1e851cf02fe970fce3fd496498c907a566aef7b32edbe699fb701e1fdbc/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6e6573742f73706f6e736f72732f62616467652e737667" alt="Sponsors on Open Collective"&gt;&lt;/a&gt;&lt;br&gt;
  &lt;a href="https://paypal.me/kamilmysliwiec" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/4f9ed737abe81e3e0c3278f57f87fe09674513cb858c4a7dd0712c795e75c39b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d50617950616c2d6666336635392e737667"&gt;&lt;/a&gt;&lt;br&gt;
    &lt;a href="https://opencollective.com/nest#sponsor" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/fab509818f8e438f1f2e4d7b42baf9d12b6bf45b2ad80fd338a764334867bf47/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f537570706f727425323075732d4f70656e253230436f6c6c6563746976652d3431423838332e737667" alt="Support us"&gt;&lt;/a&gt;&lt;br&gt;
  &lt;a href="https://twitter.com/nestframework" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/e984f5b62ec34062df9b35352b3c756486e5b83f9dc33d14116286cd40f5f071/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f6e6573746672616d65776f726b2e7376673f7374796c653d736f6369616c266c6162656c3d466f6c6c6f77"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Description&lt;/h2&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://github.com/nestjs/nest" rel="noopener noreferrer"&gt;Nest&lt;/a&gt; framework TypeScript starter repository.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Installation&lt;/h2&gt;

&lt;/div&gt;

&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;$ yarn install&lt;/pre&gt;

&lt;/div&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Running the app&lt;/h2&gt;

&lt;/div&gt;

&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; development&lt;/span&gt;
$ yarn run start

&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; watch mode&lt;/span&gt;
$ yarn run start:dev

&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; production mode&lt;/span&gt;
$ yarn run start:prod&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Test&lt;/h2&gt;

&lt;/div&gt;

&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; unit tests&lt;/span&gt;
$ yarn run &lt;span class="pl-c1"&gt;test&lt;/span&gt;

&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; e2e tests&lt;/span&gt;
$ yarn run test:e2e

&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; test coverage&lt;/span&gt;
$ yarn run test:cov&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Support&lt;/h2&gt;

&lt;/div&gt;

&lt;p&gt;Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please &lt;a href="https://docs.nestjs.com/support" rel="nofollow noopener noreferrer"&gt;read more here&lt;/a&gt;.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Stay in touch&lt;/h2&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Author - &lt;a href="https://kamilmysliwiec.com" rel="nofollow noopener noreferrer"&gt;Kamil Myśliwiec&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Website - &lt;a href="https://nestjs.com/" rel="nofollow noopener noreferrer"&gt;https://nestjs.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Twitter - &lt;a href="https://twitter.com/nestframework" rel="nofollow noopener noreferrer"&gt;@nestframework&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;License&lt;/h2&gt;

&lt;/div&gt;

&lt;p&gt;Nest is &lt;a href="https://github.com/idrsdev/agile-boardLICENSE" rel="noopener noreferrer"&gt;MIT licensed&lt;/a&gt;.&lt;/p&gt;

&lt;/div&gt;
&lt;br&gt;
&lt;br&gt;
  &lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/idrsdev/agile-board" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


</description>
      <category>node</category>
      <category>typescript</category>
      <category>api</category>
      <category>typeorm</category>
    </item>
    <item>
      <title>Building a Memory Sharing API with Node.js, MongoDB, and Docker</title>
      <dc:creator>Malik Idrees</dc:creator>
      <pubDate>Sat, 14 Jan 2023 21:31:31 +0000</pubDate>
      <link>https://dev.to/malikidrees/docker-nodejs-and-mongodb-a-guide-to-mvc-ocg</link>
      <guid>https://dev.to/malikidrees/docker-nodejs-and-mongodb-a-guide-to-mvc-ocg</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;The Memory App is a web application that enables users to create and share memories with others. The app is built using JavaScript language, MongoDB for the database, and follows the MVC (Model-View-Controller) architecture. In this blog post, we will discuss the project structure of the Memory App, and explain how to install and run the app via Docker.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Structure
&lt;/h2&gt;

&lt;p&gt;The Memory App has a well-organized project structure that includes several important files and directories. The following is a brief description of each directory:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;app.js&lt;/code&gt; file serves as the entry point for the application.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;config&lt;/code&gt; directory contains the &lt;code&gt;db.js&lt;/code&gt; file, which sets up the database connection.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;controllers&lt;/code&gt; directory includes files that handle the logic for different routes, such as &lt;code&gt;commentController.js&lt;/code&gt; and &lt;code&gt;memoryController.js&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;middleware&lt;/code&gt; directory includes files that handle authentication and error handling, such as &lt;code&gt;authMiddleware.js&lt;/code&gt; and &lt;code&gt;errorMiddleware.js&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;models&lt;/code&gt; directory includes files that define the schema for different data types, such as &lt;code&gt;memoryModel.js&lt;/code&gt; and &lt;code&gt;userModel.js&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;routes&lt;/code&gt; directory includes files that define the various API endpoints for the app, such as &lt;code&gt;memoryRoutes.js&lt;/code&gt; and &lt;code&gt;userRoutes.js&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;services&lt;/code&gt; directory includes files that handle the business logic for different features, such as &lt;code&gt;memoryServices.js&lt;/code&gt; and &lt;code&gt;userServices.js&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;utils&lt;/code&gt; directory includes files that handle utility functions, such as &lt;code&gt;uploadImage.js&lt;/code&gt; and &lt;code&gt;sendMail.js&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;validators&lt;/code&gt; directory includes files that handle input validation, such as &lt;code&gt;memoryValidator.js&lt;/code&gt; and &lt;code&gt;userValidator.js&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Docker Installation
&lt;/h2&gt;

&lt;p&gt;Docker is a containerization platform that enables developers to package their applications and dependencies together in a portable container. This allows for consistent and reproducible environments across different development, testing, and production environments. The Memory App can be easily installed and run using Docker.&lt;/p&gt;

&lt;p&gt;Before installing the Memory App, make sure that Docker is installed on your system. You can download the Docker Desktop for Windows or Mac, or install the Docker Engine for Linux.&lt;/p&gt;

&lt;p&gt;Once Docker is installed, navigate to the root directory of the Memory App in your terminal. The app is configured to be run using Docker Compose, which is a tool for defining and running multi-container Docker applications. The app's Docker Compose configuration is defined in the file &lt;code&gt;docker-compose.yml&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To start the app, run the command &lt;code&gt;docker-compose up&lt;/code&gt; in the terminal. This command will start the app's containers and make the app available at &lt;code&gt;http://localhost:5000/api/memory&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To stop the app and remove the containers, run the command &lt;code&gt;docker-compose down&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To run the app in production mode, use the command &lt;code&gt;docker-compose -f docker-compose.yml -f docker-compose.prod.yml up&lt;/code&gt;. This will make the app available at &lt;code&gt;http://localhost/api/memory&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You can pass an additional flag &lt;code&gt;-d&lt;/code&gt; to the command to keep the containers running in the background.&lt;/p&gt;

&lt;p&gt;It is also possible to override the default settings of the compose file using a separate override file by running the command &lt;code&gt;docker-compose -f docker-compose.yml -f docker-compose.override.yml up&lt;/code&gt;. &lt;code&gt;docker-compose up&lt;/code&gt; automatically applies this if we name the file &lt;code&gt;docker-compose.override.yml&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In production mode, the environment variables need to be set in the production environment. We could create a separate &lt;code&gt;.env&lt;/code&gt; file for production and provide it inside the &lt;code&gt;docker-compose.prod&lt;/code&gt; file. We could also containerize a MongoDB database.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/idrsdev" rel="noopener noreferrer"&gt;
        idrsdev
      &lt;/a&gt; / &lt;a href="https://github.com/idrsdev/memoryapp" rel="noopener noreferrer"&gt;
        memoryapp
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      API for a social media application where user can post, share, view, comment and like memories.
    &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;h2 class="heading-element"&gt;Table of Contents&lt;/h2&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://github.com/idrsdev/memoryapp#installation" rel="noopener noreferrer"&gt;Installation&lt;/a&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://github.com/idrsdev/memoryapp#locally" rel="noopener noreferrer"&gt;Locally&lt;/a&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="https://github.com/idrsdev/memoryapp#install-dependencies" rel="noopener noreferrer"&gt;Install Dependencies&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/idrsdev/memoryapp#run" rel="noopener noreferrer"&gt;Run&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/idrsdev/memoryapp#docker" rel="noopener noreferrer"&gt;Docker&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/idrsdev/memoryapp#api-docs" rel="noopener noreferrer"&gt;API Docs&lt;/a&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="https://github.com/idrsdev/memoryapp#open-endpoints" rel="noopener noreferrer"&gt;Open Endpoints&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/idrsdev/memoryapp#endpoints-that-require-authentication" rel="noopener noreferrer"&gt;Endpoints that require Authentication&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/idrsdev/memoryapp#memory-related" rel="noopener noreferrer"&gt;Memory related&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/idrsdev/memoryapp#user-related" rel="noopener noreferrer"&gt;User related&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/idrsdev/memoryapp#comment-related" rel="noopener noreferrer"&gt;Comment related&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/idrsdev/memoryapp#reset-password" rel="noopener noreferrer"&gt;Reset Password&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/idrsdev/memoryapp#upload-image" rel="noopener noreferrer"&gt;Upload Image&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/idrsdev/memoryapp#project-structure" rel="noopener noreferrer"&gt;Project Structure&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Installation&lt;/h2&gt;
&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Locally&lt;/h3&gt;
&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h5 class="heading-element"&gt;Install Dependencies&lt;/h5&gt;

&lt;/div&gt;
&lt;p&gt;$ &lt;code&gt;npm install&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;$ &lt;code&gt;cp .env.example .env&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;set these environment variables&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h5 class="heading-element"&gt;Run&lt;/h5&gt;

&lt;/div&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;npm run dev (:5000)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Docker&lt;/h3&gt;

&lt;/div&gt;
&lt;p&gt;$ &lt;code&gt;docker compose up&lt;/code&gt;
&lt;br&gt;Available at &lt;code&gt;http://localhost:5000/api/memory&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;To stop and remove containers&lt;br&gt;
$ &lt;code&gt;docker compose down&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;To run in production mode&lt;br&gt;
$ &lt;code&gt;docker compose -f docker-compose.yml -f docker-compose.prod.yml up&lt;/code&gt;
&lt;br&gt;Available at &lt;code&gt;http://localhost/api/memory&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;You can pass an additional flag &lt;code&gt;-d&lt;/code&gt; to keep it running in background&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;API Docs&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;BaseURL : &lt;code&gt;http://localhost:5000/api&lt;/code&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h4 class="heading-element"&gt;Open Endpoints&lt;/h4&gt;

&lt;/div&gt;
&lt;p&gt;Open endpoints require no Authentication.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Login POST /user/login/&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h4 class="heading-element"&gt;Endpoints that require Authentication&lt;/h4&gt;

&lt;/div&gt;
&lt;p&gt;Closed endpoints require a valid Token to be included in the header of the
request. A Token can be acquired from the Login view above.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h4 class="heading-element"&gt;Memory related&lt;/h4&gt;

&lt;/div&gt;
&lt;p&gt;Endpoints for viewing and manipulating the Memories.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Create Memory:&lt;/code&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/idrsdev/memoryapp" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


</description>
      <category>webdev</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>Dockerizing a React App</title>
      <dc:creator>Malik Idrees</dc:creator>
      <pubDate>Sat, 16 Jul 2022 14:02:00 +0000</pubDate>
      <link>https://dev.to/malikidrees/dockerizing-a-react-app-4f45</link>
      <guid>https://dev.to/malikidrees/dockerizing-a-react-app-4f45</guid>
      <description>&lt;h4&gt;
  
  
  Let's do it
&lt;/h4&gt;

&lt;p&gt;We are going to create a MERN Stack boilerplate using docker which can serve as a base to create other apps as well.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A quick note: react is ready to go in production. but backend (nodejs) could be improved further. So you could also focus only on react!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Feel free to comment if you have optimitized nodejs API's using pm2 etc.&lt;/p&gt;

&lt;p&gt;Now let's create our project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;project
└───backend
          - index.js
          - .env
└───frontend
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;First we are going to create our backend and frontend and then we will move on to dockerize them.&lt;/p&gt;
&lt;h5&gt;
  
  
  Lets setup our backend first.
&lt;/h5&gt;

&lt;p&gt;&lt;code&gt;$ cd backend&lt;/code&gt;&lt;br&gt;
&lt;code&gt;$ npm init&lt;/code&gt;&lt;br&gt;
If you want to skip these questions&lt;br&gt;
&lt;code&gt;$ npm init -y&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It creates&lt;code&gt;package.json&lt;/code&gt;. The package.json file holds some basic information about your application as well as metadata about your app. Add inside &lt;code&gt;package.json&lt;/code&gt; add:(enables ES 6 modules, u can use import syntax)&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;module&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Let's install express server.&lt;br&gt;
&lt;code&gt;$ npm i express&lt;/code&gt;&lt;br&gt;
&lt;code&gt;$ npm i dotenv&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Replace &lt;code&gt;.env&lt;/code&gt; with below:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NODE_ENV = development
PORT = 5000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Replace &lt;code&gt;index.js&lt;/code&gt; with below code&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="nx"&gt;express&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;dotenv&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dotenv&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="nx"&gt;dotenv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;config&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;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;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="o"&gt;=&amp;gt;&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="nx"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;API is running&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;PORT&lt;/span&gt; &lt;span class="o"&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;PORT&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;PORT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`
Server running in &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;NODE_ENV&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; mode on &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;PORT&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; Port`&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;Test if our app is running&lt;br&gt;
&lt;code&gt;$ node backend/index.js&lt;/code&gt; It should be available at &lt;code&gt;http://localhost:5000/&lt;/code&gt;&lt;/p&gt;
&lt;h5&gt;
  
  
  Lets do frontend now.
&lt;/h5&gt;

&lt;p&gt;Make sure you are inside frontend folder. Let's creates a react app. But hot reloading does not work well with &lt;code&gt;react-scripts @5.0.0&lt;/code&gt; (At the time of writing)&lt;br&gt;
&lt;code&gt;$ cd frontend&lt;/code&gt;&lt;br&gt;
&lt;code&gt;$ npx create-react-app ./&lt;/code&gt;&lt;br&gt;
So for now you could use this.&lt;br&gt;
&lt;code&gt;$ cd root&lt;/code&gt;&lt;br&gt;
&lt;code&gt;$ npx create-react-app ./client --scripts-version 4.0.3&lt;/code&gt;&lt;br&gt;
&lt;code&gt;$ cd client&lt;/code&gt;&lt;br&gt;
&lt;code&gt;$ npm run start&lt;/code&gt; our app should be available at &lt;code&gt;https://localhost:3000/&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Now we are going to dockerize our app.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  Docker file &lt;code&gt;Server&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;$ cd backend&lt;/code&gt;&lt;br&gt;
Create a &lt;code&gt;.dockerignore&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node_modules
Dockerfile
.gitignore
.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Create a &lt;code&gt;Dockerfile&lt;/code&gt; without any extension.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; node:16.14.0-slim&lt;/span&gt;

&lt;span class="c"&gt;#create app directory inside docker&lt;/span&gt;
&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /usr/src/app&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; package*.json ./&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt;

&lt;span class="c"&gt;#Bundle source code&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; . .&lt;/span&gt;
&lt;span class="k"&gt;EXPOSE&lt;/span&gt;&lt;span class="s"&gt; 5000&lt;/span&gt;

&lt;span class="k"&gt;CMD&lt;/span&gt;&lt;span class="s"&gt; ["npm","run","dev"]&lt;/span&gt;

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

&lt;/div&gt;

&lt;h5&gt;
  
  
  let's build our docker image &lt;code&gt;Server&lt;/code&gt;
&lt;/h5&gt;

&lt;p&gt;&lt;code&gt;$ docker build -t backend .&lt;/code&gt;&lt;br&gt;
To run our container&lt;br&gt;
&lt;code&gt;$ docker run -p port 4000:5000 backend&lt;/code&gt;&lt;br&gt;
To run with hot reloading use this command and remove container at the end.&lt;br&gt;
&lt;code&gt;$ docker run --rm -it -p 5000:5000 -v ${PWD}:/usr/src/app --name app-backend backend&lt;/code&gt;&lt;br&gt;
available at &lt;code&gt;https://localhost:4000/&lt;/code&gt;&lt;/p&gt;
&lt;h5&gt;
  
  
  Docker file &lt;code&gt;frontend&lt;/code&gt;
&lt;/h5&gt;

&lt;p&gt;&lt;code&gt;$ cd frontend&lt;/code&gt;&lt;br&gt;
Create a &lt;code&gt;.dockerignore&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node_modules
Dockerfile
.gitignore
.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Create &lt;code&gt;Dockerfile&lt;/code&gt;without any extension&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; node:16.14.0-slim&lt;/span&gt;
&lt;span class="c"&gt;# Working directory&lt;/span&gt;
&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /user/src/frontend&lt;/span&gt;
&lt;span class="c"&gt;# Install dependencies&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; package*.json ./&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;span class="c"&gt;# Copy local files to frontend folder&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; . .&lt;/span&gt;
&lt;span class="k"&gt;EXPOSE&lt;/span&gt;&lt;span class="s"&gt; 3000&lt;/span&gt;

&lt;span class="k"&gt;CMD&lt;/span&gt;&lt;span class="s"&gt; ["npm","start"]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Create &lt;code&gt;Dockerfile.prod&lt;/code&gt; file for production builds&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;node:16.14.0-slim&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;build-stage&lt;/span&gt;
&lt;span class="k"&gt;ENV&lt;/span&gt;&lt;span class="s"&gt; NODE_ENV production&lt;/span&gt;
&lt;span class="c"&gt;# Add a work directory&lt;/span&gt;
&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /user/src/frontend&lt;/span&gt;
&lt;span class="c"&gt;# ENV PATH /app/node_modules/.bin:$PATH&lt;/span&gt;
&lt;span class="c"&gt;# Cache and Install dependencies&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; package*.json ./&lt;/span&gt;
&lt;span class="c"&gt;# COPY yarn.lock .&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--production&lt;/span&gt;
&lt;span class="c"&gt;# Copy app files&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; . .&lt;/span&gt;
&lt;span class="c"&gt;# Build the app&lt;/span&gt;

&lt;span class="k"&gt;RUN &lt;/span&gt;npm run build

&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; nginx:1.21.6-alpine&lt;/span&gt;
&lt;span class="k"&gt;ENV&lt;/span&gt;&lt;span class="s"&gt; NODE_ENV production&lt;/span&gt;
&lt;span class="c"&gt;# Copy built assets from builder&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; --from=build-stage /user/src/frontend/build /usr/share/nginx/html&lt;/span&gt;
&lt;span class="c"&gt;# Add your nginx.conf&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; nginx/nginx.conf /etc/nginx/conf.d/default.conf&lt;/span&gt;
&lt;span class="c"&gt;# Expose port&lt;/span&gt;
&lt;span class="k"&gt;EXPOSE&lt;/span&gt;&lt;span class="s"&gt; 80&lt;/span&gt;
&lt;span class="c"&gt;# Start nginx&lt;/span&gt;
&lt;span class="k"&gt;CMD&lt;/span&gt;&lt;span class="s"&gt; ["nginx", "-g", "daemon off;"]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h5&gt;
  
  
  Docker Compose
&lt;/h5&gt;

&lt;p&gt;Instead of typing those long command through terminal. Compose files allow us to manage container easily.&lt;/p&gt;

&lt;p&gt;Create &lt;code&gt;docker-compose.yml&lt;/code&gt; file&lt;br&gt;
&lt;code&gt;$ cd root&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;version: '3'
services:
  frontend:
    container_name: react-dev
    build:
      context: ./frontend
    ports:
      - 3000:3000
    env_file: ./frontend/.env
    environment:
      - NODE_ENV=development
      - CHOKIDAR_USEPOLLING=true
    volumes:
      - ./frontend:/user/src/frontend
      - /user/src/frontend/node_modules
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Create &lt;code&gt;docker-compose.prod.yml&lt;/code&gt; file for production builds(React only)&lt;br&gt;
&lt;code&gt;$ cd root&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;version: '3'
services:
  frontend:
    container_name: react-prod
    image: react-prod
    build:
      context: ./frontend
      dockerfile: Dockerfile.prod
    ports:
      - 1337:80
    env_file: ./frontend/.env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h5&gt;
  
  
  Some useful Docker commands
&lt;/h5&gt;

&lt;p&gt;Show all containers in running state.&lt;br&gt;
&lt;code&gt;$ docker ps&lt;/code&gt; or newer version &lt;code&gt;$ docker container ls&lt;/code&gt;&lt;br&gt;
To show all running and exited container&lt;br&gt;
&lt;code&gt;$ docker ps -a&lt;/code&gt; or &lt;code&gt;$ docker container --all&lt;/code&gt;&lt;br&gt;
Run a container bash session.&lt;br&gt;
&lt;code&gt;$ docker exec -it &amp;lt;container name&amp;gt; bash&lt;/code&gt;&lt;br&gt;
Run a image bash session.&lt;br&gt;
&lt;code&gt;$ docker run -it &amp;lt;image name&amp;gt; bash&lt;/code&gt;&lt;br&gt;
&lt;code&gt;$ docker run -it backend bash&lt;/code&gt; then&lt;code&gt;$ node -v&lt;/code&gt; prints node version.&lt;br&gt;
To pull base images before using them e.g.&lt;br&gt;
&lt;code&gt;$ docker pull &amp;lt;image name&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;code&gt;$ docker pull node:16.14.0-slim&lt;/code&gt;&lt;br&gt;
Run your image (backend) as a container(app-backend).&lt;br&gt;
&lt;code&gt;$ docker run -p 2000:5000 --name app-backend backend&lt;/code&gt;&lt;br&gt;
To start existing container.&lt;br&gt;
&lt;code&gt;$ docker container start &amp;lt;container name&amp;gt;&lt;/code&gt;&lt;br&gt;
To stop an existing container.&lt;br&gt;
&lt;code&gt;$ docker stop &amp;lt;container name&amp;gt;&lt;/code&gt;&lt;br&gt;
To remove a container.&lt;br&gt;
&lt;code&gt;$ docker rm &amp;lt;container name&amp;gt;&lt;/code&gt;&lt;br&gt;
To stop all container&lt;br&gt;
&lt;code&gt;$ docker stop $(docker ps -a -q)&lt;/code&gt;&lt;br&gt;
To remove all container&lt;br&gt;
&lt;code&gt;$ docker rm $(docker ps -a -q)&lt;/code&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://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/idrsdev"&gt;
        idrsdev
      &lt;/a&gt; / &lt;a href="https://github.com/idrsdev/mern-template-docker"&gt;
        mern-template-docker
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h4&gt;
MERN Stack template&lt;/h4&gt;
&lt;p&gt;We are going to create a MERN Stack boilerplate which can be extended for other use cases. Run it &lt;code&gt;locally&lt;/code&gt; or on &lt;code&gt;Docker&lt;/code&gt;.&lt;/p&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;project
└───backend
└───frontend
└───.env
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h5&gt;
Lets setup our backend first.&lt;/h5&gt;
&lt;p&gt;&lt;code&gt;$ cd backend&lt;/code&gt;&lt;br&gt;
&lt;code&gt;$ npm init&lt;/code&gt;&lt;br&gt;
If you want to skip these questions&lt;br&gt;
&lt;code&gt;$ npm init -y&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;It creates&lt;code&gt; package.json&lt;/code&gt;. The package.json file holds some basic information about your application as well as metadata about your app. Add inside &lt;code&gt; package.json&lt;/code&gt; add:&lt;/p&gt;
&lt;div class="highlight highlight-source-js notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-s"&gt;"type"&lt;/span&gt;: &lt;span class="pl-s"&gt;"module"&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Let's install express server
&lt;code&gt;$ npm i express&lt;/code&gt;&lt;br&gt;
&lt;code&gt;$ npm i dotenv&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Replace &lt;code&gt;.env&lt;/code&gt; with below:&lt;/p&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;NODE_ENV = development
PORT = 5000
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Replace &lt;code&gt;index.js&lt;/code&gt; with below code&lt;/p&gt;
&lt;div class="highlight highlight-source-js notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-k"&gt;import&lt;/span&gt; &lt;span class="pl-s1"&gt;express&lt;/span&gt; &lt;span class="pl-k"&gt;from&lt;/span&gt; &lt;span class="pl-s"&gt;'express'&lt;/span&gt;
&lt;span class="pl-k"&gt;import&lt;/span&gt; &lt;span class="pl-s1"&gt;dotenv&lt;/span&gt; &lt;span class="pl-k"&gt;from&lt;/span&gt; &lt;span class="pl-s"&gt;'dotenv'&lt;/span&gt;
&lt;span class="pl-s1"&gt;dotenv&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;config&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;

&lt;span class="pl-k"&gt;const&lt;/span&gt; &lt;span class="pl-s1"&gt;app&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-en"&gt;express&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;

&lt;span class="pl-s1"&gt;app&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;get&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s"&gt;'/'&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt; &lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s1"&gt;req&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt; &lt;span class="pl-s1"&gt;res&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt; &lt;span class="pl-c1"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="pl-kos"&gt;{&lt;/span&gt;
    &lt;span class="pl-s1"&gt;res&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;send&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s"&gt;'API is running'&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;
&lt;span class="pl-kos"&gt;}&lt;/span&gt;&lt;/pre&gt;…
&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/idrsdev/mern-template-docker"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;ps: somehow the changes in react part is missing from repo. Create a pull request!&lt;/p&gt;

&lt;p&gt;LinkedIn: &lt;a href="https://www.linkedin.com/in/malikidrees/"&gt;LinkedIn&lt;/a&gt;&lt;br&gt;
GitHub: &lt;a href="https://github.com/malik-idrees"&gt;Link&lt;/a&gt; ⭐&lt;br&gt;
Fiverr: &lt;a href="https://www.fiverr.com/share/27Yy04"&gt;imidrees&lt;/a&gt; ✨&lt;br&gt;
Thanks for reading!&lt;/p&gt;

</description>
      <category>react</category>
      <category>docker</category>
      <category>webdev</category>
      <category>devops</category>
    </item>
    <item>
      <title>Responsive sidebar using React and Tailwind with dark mode and react-router</title>
      <dc:creator>Malik Idrees</dc:creator>
      <pubDate>Sun, 15 May 2022 00:19:00 +0000</pubDate>
      <link>https://dev.to/malikidrees/react-tailwind-responsive-sidebar-dark-mode-with-react-router-4g3e</link>
      <guid>https://dev.to/malikidrees/react-tailwind-responsive-sidebar-dark-mode-with-react-router-4g3e</guid>
      <description>&lt;p&gt;I was searching for a simple layout with responsive sidebar and support for dark mode built with react and tailwind. And I decided to create one myself.&lt;/p&gt;

&lt;p&gt;Supports light and dark mode &lt;br&gt;
Responsive Side Bar &lt;br&gt;
Mobile Menu&lt;br&gt;
&lt;a href="https://react-tailwind-dark-sidebar.netlify.app/" rel="noopener noreferrer"&gt;Live Website&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;No third party libraries used!&lt;/p&gt;

&lt;p&gt;Feel free to contribute and extend it in any suitable way :)&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/idrsdev" rel="noopener noreferrer"&gt;
        idrsdev
      &lt;/a&gt; / &lt;a href="https://github.com/idrsdev/react-sidebar-tailwind-darkmode" rel="noopener noreferrer"&gt;
        react-sidebar-tailwind-darkmode
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Responsive sidebar built with React and Tailwind. Support for dark mode, react-router and Mobile Menu. Feel free to contribute⭐
    &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;Getting Started with Create React App&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;This project was bootstrapped with &lt;a href="https://github.com/facebook/create-react-app" rel="noopener noreferrer"&gt;Create React App&lt;/a&gt;.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Available Scripts&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;In the project directory, you can run:&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;&lt;code&gt;npm start&lt;/code&gt;&lt;/h3&gt;
&lt;/div&gt;
&lt;p&gt;Runs the app in the development mode.&lt;br&gt;
Open &lt;a href="http://localhost:3000" rel="nofollow noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt; to view it in your browser.&lt;/p&gt;
&lt;p&gt;The page will reload when you make changes.&lt;br&gt;
You may also see any lint errors in the console.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;&lt;code&gt;npm test&lt;/code&gt;&lt;/h3&gt;

&lt;/div&gt;
&lt;p&gt;Launches the test runner in the interactive watch mode.&lt;br&gt;
See the section about &lt;a href="https://facebook.github.io/create-react-app/docs/running-tests" rel="nofollow noopener noreferrer"&gt;running tests&lt;/a&gt; for more information.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;&lt;code&gt;npm run build&lt;/code&gt;&lt;/h3&gt;

&lt;/div&gt;
&lt;p&gt;Builds the app for production to the &lt;code&gt;build&lt;/code&gt; folder.&lt;br&gt;
It correctly bundles React in production mode and optimizes the build for the best performance.&lt;/p&gt;
&lt;p&gt;The build is minified and the filenames include the hashes.&lt;br&gt;
Your app is ready to be deployed!&lt;/p&gt;
&lt;p&gt;See the section about &lt;a href="https://facebook.github.io/create-react-app/docs/deployment" rel="nofollow noopener noreferrer"&gt;deployment&lt;/a&gt; for more information.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;&lt;code&gt;npm run eject&lt;/code&gt;&lt;/h3&gt;

&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Note: this is a one-way operation. Once you &lt;code&gt;eject&lt;/code&gt;, you can't go back!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you…&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/idrsdev/react-sidebar-tailwind-darkmode" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Connect with me :)&lt;br&gt;
&lt;a href="https://www.linkedin.com/in/malik-idrees/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; ✨&lt;/p&gt;

</description>
      <category>react</category>
      <category>tailwindcss</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>A Simple chat app using Socket.io with NodeJS and ReactJS</title>
      <dc:creator>Malik Idrees</dc:creator>
      <pubDate>Sun, 12 Dec 2021 21:16:52 +0000</pubDate>
      <link>https://dev.to/malikidrees/a-simple-chat-app-using-socketio-with-nodejs-and-reactjs-46i0</link>
      <guid>https://dev.to/malikidrees/a-simple-chat-app-using-socketio-with-nodejs-and-reactjs-46i0</guid>
      <description>&lt;h3&gt;
  
  
  I have used:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;NodeJS with Express for server side logic&lt;/li&gt;
&lt;li&gt;ReactJS to build a simple client app&lt;/li&gt;
&lt;li&gt;Socket.io for real-time connection between both sides&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://reactsocket.netlify.app" rel="noopener noreferrer"&gt;Live Preview&lt;/a&gt;&lt;br&gt;
Connect from two different tabs or two different PC's to test it out&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Favw8utrdbq9rhq29b6y9.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Favw8utrdbq9rhq29b6y9.PNG" alt="shows the landing page" width="800" height="317"&gt;&lt;/a&gt;&lt;br&gt;
You can use it to understand how sockets work in react with a bit of touch from Material UI(An unoptimized overkill).&lt;/p&gt;

&lt;p&gt;I am a full stack developer and i created this small app to understand working of sockets. Here is another &lt;a href="https://youtu.be/ZwFA3YMfkoc" rel="noopener noreferrer"&gt;resource&lt;/a&gt; to learn about socket by JavaScript Mastery.&lt;br&gt;
&lt;a href="https://github.com/Malik-Idrees/React_Socket.io.git" rel="noopener noreferrer"&gt;Source code&lt;/a&gt;&lt;br&gt;
Stay Tuned  for more coming soon! &lt;/p&gt;

&lt;h3&gt;
  
  
  What's next?
&lt;/h3&gt;

&lt;p&gt;A detailed article about creating API's using Node.js and MongoDb along with In-memory testing and optional GitHub actions to test and deploy to Heroku whenever I have free time.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/malik-Idrees" rel="noopener noreferrer"&gt;Link&lt;/a&gt; ⭐&lt;br&gt;
Thanks for reading!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>react</category>
      <category>socket</category>
    </item>
    <item>
      <title>Client Side React Application using GitHub GraphQL API - RepoFinder</title>
      <dc:creator>Malik Idrees</dc:creator>
      <pubDate>Mon, 18 Oct 2021 00:12:04 +0000</pubDate>
      <link>https://dev.to/malikidrees/client-side-react-application-using-github-graphql-api-188i</link>
      <guid>https://dev.to/malikidrees/client-side-react-application-using-github-graphql-api-188i</guid>
      <description>&lt;h5&gt;
  
  
  hello everyone!
&lt;/h5&gt;

&lt;p&gt;Ever thought to display GitHub projects dynamically in Your portfolio ?&lt;/p&gt;

&lt;p&gt;Today, we will interact with GitHub GraphQL API using react.&lt;br&gt;
Provide a username and get related information. Simple right? let's see!&lt;/p&gt;

&lt;p&gt;Here's How the Final App Looks like: RIP Picture Qualtiy!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7FX7zz1B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5lpnidj8olis8htdp1ib.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7FX7zz1B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5lpnidj8olis8htdp1ib.JPG" alt="Contains react apollo graphql " width="800" height="351"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Motivation
&lt;/h4&gt;

&lt;p&gt;I recently created &lt;a href="https://malik-idrees.github.io/"&gt;My Portfolio&lt;/a&gt; website with plain HTML , CSS, JavaScript Which also have a GitHub Action To compress these files!. But I wanted to fetch my GitHub info and my projects dynamically so that's how I created a small App which does exactly that!&lt;/p&gt;
&lt;h4&gt;
  
  
  Tech Used
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="'https://reactjs.org/'"&gt;React&lt;/a&gt;&lt;br&gt;
&lt;a href="'https://graphql.org/'"&gt;GraphQL&lt;/a&gt;&lt;br&gt;
&lt;a href="'https://www.apollographql.com/docs/react/get-started/'"&gt;Apollo Client&lt;/a&gt;&lt;br&gt;
&lt;a href="'https://react.semantic-ui.com/'"&gt;Semantic UI React&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  Features
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;Fetch User details&lt;br&gt;
Fetch Top Repositories of the user&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  Components
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;Easy to reuse and small ones!&lt;br&gt;
Navbar - Title and A logo&lt;br&gt;
RepoCard - Displays repo Image and details&lt;br&gt;
UserCard - User Card with Image and details&lt;br&gt;
RepoCardList - Lists All Repositories&lt;/p&gt;
&lt;/blockquote&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/idrsdev"&gt;
        idrsdev
      &lt;/a&gt; / &lt;a href="https://github.com/idrsdev/Repo-Finder"&gt;
        Repo-Finder
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Written for Dev.to Article. It shows how to Get your repos and render them anywhere like your portfolio. You could get Any user repositories by providing username Leave a star⭐
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h3&gt;
Env Variables&lt;/h3&gt;
&lt;p&gt;Create a .env file in then root and add the following&lt;/p&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;REACT_APP_GITHUB_ACCESS_TOKEN = "YOUR_GITHUB_ACCESS_TOKEN"
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h1&gt;
Getting Started with Create React App&lt;/h1&gt;
&lt;p&gt;This project was bootstrapped with &lt;a href="https://github.com/facebook/create-react-app"&gt;Create React App&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
Available Scripts&lt;/h2&gt;
&lt;p&gt;In the project directory, you can run:&lt;/p&gt;
&lt;h3&gt;
&lt;code&gt;npm start&lt;/code&gt;
&lt;/h3&gt;
&lt;p&gt;Runs the app in the development mode.&lt;br&gt;
Open &lt;a href="http://localhost:3000" rel="nofollow"&gt;http://localhost:3000&lt;/a&gt; to view it in the browser.&lt;/p&gt;
&lt;p&gt;The page will reload if you make edits.&lt;br&gt;
You will also see any lint errors in the console.&lt;/p&gt;
&lt;h3&gt;
&lt;code&gt;npm test&lt;/code&gt;
&lt;/h3&gt;
&lt;p&gt;Launches the test runner in the interactive watch mode.&lt;br&gt;
See the section about &lt;a href="https://facebook.github.io/create-react-app/docs/running-tests" rel="nofollow"&gt;running tests&lt;/a&gt; for more information.&lt;/p&gt;
&lt;h3&gt;
&lt;code&gt;npm run build&lt;/code&gt;
&lt;/h3&gt;
&lt;p&gt;Builds the app for production to the &lt;code&gt;build&lt;/code&gt; folder.&lt;br&gt;
It correctly bundles React in production mode and optimizes the build for the best performance.&lt;/p&gt;
&lt;p&gt;The build is minified and the filenames include the hashes.&lt;br&gt;
Your app is ready to be deployed!&lt;/p&gt;
&lt;p&gt;See the section about &lt;a href="https://facebook.github.io/create-react-app/docs/deployment" rel="nofollow"&gt;deployment&lt;/a&gt; for more information.&lt;/p&gt;
&lt;h3&gt;
&lt;code&gt;npm run eject&lt;/code&gt;
&lt;/h3&gt;
&lt;p&gt;…&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/idrsdev/Repo-Finder"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h4&gt;
  
  
  Defining Queries:
&lt;/h4&gt;

&lt;p&gt;I have defined two queries: GET_USER_INFO, GET_USER_REPOS&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;GET_USER_INFO&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;gql&lt;/span&gt;&lt;span class="s2"&gt;`
//Insert User Query
`&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;GET_USER_REPOS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;gql&lt;/span&gt;&lt;span class="s2"&gt;`query{} `&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here's how GET_USER_INFO looks 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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;GET_USER_INFO&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;gql&lt;/span&gt;&lt;span class="s2"&gt;`
   query GET_USER_INFO($login: String!) {
      user(login: $login) {
         id
         avatarUrl
         name
         login
         bio
         followers(first: 6) {
            totalCount
         }
         following(first: 6) {
            totalCount
         }
         location
      }
   }
`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Fetch data using useQuery:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="c1"&gt;//Important ! You must use a variable named login  &lt;/span&gt;
   &lt;span class="c1"&gt;//#Required By Schema I guess!&lt;/span&gt;
   &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&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;=&lt;/span&gt; &lt;span class="nx"&gt;useQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;GET_USER_INFO&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;variables&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;login&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
   &lt;span class="p"&gt;})&lt;/span&gt;

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Time ?
&lt;/h3&gt;

&lt;p&gt;I worked on and off for around 3/4 days! I wanted to start off with REST API but I wanted to try something different&lt;br&gt;
&lt;strong&gt;For day 1:&lt;/strong&gt; I experiment with GitHub GraphQL API, created a react app&lt;br&gt;
&lt;strong&gt;For day 2:&lt;/strong&gt; Started with frontend and Created a working app&lt;br&gt;
&lt;strong&gt;For day 3:&lt;/strong&gt; Code refactor and breakdown into small components &lt;br&gt;
&lt;strong&gt;For day 4:&lt;/strong&gt; here I am for past few hours&lt;br&gt;
Don't Worry Just Go through getting started guides! There is nothing fancy or complex!&lt;/p&gt;

&lt;p&gt;For starters here's how you would get the repos, try it here:&lt;br&gt;
&lt;a href="'https://docs.github.com/en/graphql/overview/explorer'"&gt;GitHub GraphQL API PlayGround&lt;/a&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="nx"&gt;query&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;REPOSITORY&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;last&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;repos&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;edges&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;repo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;node&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="p"&gt;...&lt;/span&gt; &lt;span class="nx"&gt;on&lt;/span&gt; &lt;span class="nx"&gt;Repository&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nx"&gt;name&lt;/span&gt;
          &lt;span class="nx"&gt;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;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;h4&gt;
  
  
  Possible Features / Modifications
&lt;/h4&gt;

&lt;p&gt;You could simply use  fetch/Axios instead of using Apollo client. Which I myself may do in future!&lt;/p&gt;

&lt;p&gt;For Non-Personal use, First get user token by GitHub-Login!&lt;br&gt;
Then experiment with features like Starring your favorite repository.&lt;br&gt;
GitHub GraphQL API documentation is simple &amp;amp; great.&lt;/p&gt;

&lt;p&gt;Here's how to perform queries using Axios&lt;a&gt;&lt;/a&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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;query&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;`{
        query{
            rateLimit{
                remaining
            }
        }
    }`&lt;/span&gt;
    &lt;span class="nx"&gt;axios&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`https://api.github.com/graphql`&lt;/span&gt;&lt;span class="p"&gt;,{&lt;/span&gt;
        &lt;span class="na"&gt;query&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="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt;
            &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Authorization&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;`bearer &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you like the post. Give It A Thumbs Up! 💙&lt;/p&gt;

</description>
      <category>react</category>
      <category>graphql</category>
      <category>javascript</category>
      <category>github</category>
    </item>
  </channel>
</rss>
