<?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: Cindy Le</title>
    <description>The latest articles on DEV Community by Cindy Le (@cindyledev).</description>
    <link>https://dev.to/cindyledev</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%2F526016%2F53a93fd8-82fa-427f-891d-fb05c82059a5.png</url>
      <title>DEV Community: Cindy Le</title>
      <link>https://dev.to/cindyledev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cindyledev"/>
    <language>en</language>
    <item>
      <title>3 Healthy Hobbies for Software Developers</title>
      <dc:creator>Cindy Le</dc:creator>
      <pubDate>Sat, 24 Jun 2023 00:50:52 +0000</pubDate>
      <link>https://dev.to/cindyledev/3-healthy-hobbies-for-software-developers-ien</link>
      <guid>https://dev.to/cindyledev/3-healthy-hobbies-for-software-developers-ien</guid>
      <description>&lt;p&gt;Software development is an intellectually demanding field that often requires long hours of focused work in front of a computer screen. As a software developer, it's crucial to find balance and maintain a healthy lifestyle. Engaging in physical hobbies not only provides a break from coding but also offers numerous benefits for both mind and body. In this article, we will explore two hobbies - Brazilian Jiu-Jitsu (BJJ), rock climbing, running/jogging. While there are certainly other hobbies that may be equally fulfilling, I am focusing solely on these particular activities due to my firsthand involvement and the positive impact they have had on my life.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Brazilian Jiu-Jitsu (BJJ)
&lt;/h2&gt;

&lt;p&gt;Software developing and BJJ might seem worlds apart, but they share remarkable similarities. Just as software developers navigate through complex code, BJJ practitioners navigate intricate techniques and strategies on the mat. Both activities require problem-solving skills, adaptability, and a keen eye for details.&lt;/p&gt;

&lt;p&gt;BJJ provides an outlet for software developers to exercise their analytical minds in a physical setting. It promotes mental agility, patience, and the ability to anticipate and respond to rapidly changing circumstances--qualities that are equally valuable in the coding world. Additionally, BJJ fosters resilience, as developers learn to embrace challenges, adapt to setbacks, and persist in the face of difficulties.&lt;/p&gt;

&lt;p&gt;Pair programming is a collaborative technique used in software development where two programmers work together on the same codebase. Similarly, BJJ emphasizes the importance of training with partners to improve skills and techniques.&lt;/p&gt;

&lt;p&gt;In pair programming, developers take turns as the "driver" (actively writing code) and the "navigator" (providing feedback, thinking strategically, and catching errors). This dynamic mirrors the interaction between training partners in BJJ. One person assumes the role of the "attacker" while the other plays the "defender", allowing for mutual learning, skill refinement, and the discovery of new approaches.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Rock Climbing
&lt;/h2&gt;

&lt;p&gt;Rock climbing is a hobby that can perfectly complement the analytical and problem-solving nature of software development. Scaling a challenging rock face demands mental focus, strategic thinking, and the ability to break down complex problems into manageable steps--skills that software developers are well-versed in.&lt;/p&gt;

&lt;p&gt;Both rock climbing and coding require attention to detail, precise execution, and the ability to plan ahead. Climbing teachers developers the importance of calculated risks, as they learn to evaluate different routes and anticipate potential obstacles. Moreover, conquering a difficult climb provides a tremendous sense of accomplishment, similar to the satisfaction of successfully completing a challenging coding project.&lt;/p&gt;

&lt;h3&gt;
  
  
  Belaying with a Partner
&lt;/h3&gt;

&lt;p&gt;Belaying is a fundamental aspect of rock climbing that involves one person managing the safety of another person. The belayer controls the rope and provides support by keeping it taut, ensuring the climber's safety in case of a fall.&lt;/p&gt;

&lt;p&gt;Similarly, software development often involves teamwork and collaboration. Developers frequently work in pairs or teams, where one person can serve as a "belaying" counterpart. This involves reviewing code, identifying potential issues, and offering guidance and support to ensure the overall quality and safety of the project.&lt;/p&gt;

&lt;p&gt;Just as a belayer provides a safety net for the climber, a software development partner offers a fresh perspective, acts as a sounding board, and provides valuable feedback during the development process. Both in climbing and software development, the collaboration between individuals fosters trust, enhances problem-solving, and promotes a shared responsibility for the successful outcome.&lt;/p&gt;

&lt;h3&gt;
  
  
  Lead Climbing
&lt;/h3&gt;

&lt;p&gt;Lead climbing is an advanced technique in rock climbing where the climber ascends while attaching the rope to anchors along the route. The lead climber takes on the responsibility of not only climbing but also securing the rope and protecting against potential falls.&lt;br&gt;
Similarly, in software development, taking on a lead role involves assuming responsibility for the project's overall direction, decision-making, and coordination. The lead developer guides the team, sets priorities, and ensures that the project progresses smoothly and meets the desired objectives.&lt;/p&gt;

&lt;p&gt;Lead climbers and lead developers share common characteristics such as decisiveness, risk management, and the ability to adapt to changing situations. Both roles require individuals to make critical judgments, anticipate challenges, and provide support and guidance to their teammates.&lt;/p&gt;

&lt;p&gt;Additionally, lead climbing and software development demand a strong sense of self-reliance and confidence. The lead climber must trust their skills and judgment to navigate challenging routes, while the lead developer must make crucial technical and managerial decisions. Both roles offer opportunities for personal growth and the development of leadership qualities.&lt;/p&gt;

&lt;p&gt;Rock climbing and software development share similarities through the concepts of belaying with a partner and lead climbing. Belaying with a partner mirrors the collaborative nature of software development, where individuals support and ensure the safety of their teammates. Lead climbing and lead development involve taking on responsibility, making critical decisions, and guiding others toward success. Recognizing these parallels can provide valuable insights for rock climbers and software developers alike, fostering effective teamwork, risk management, and personal growth in both domains.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Running/Jogging
&lt;/h2&gt;

&lt;p&gt;Running or jogging is a simple yet powerful physical hobby that complements the sedentary nature of software development. Just as developers strive for continuous improvement in their coding skills, runners aim to enhance their endurance and set new personal records.&lt;/p&gt;

&lt;p&gt;Running and software development share a common thread—both require discipline, commitment, and the ability to set goals. Developers often break down complex projects into smaller, manageable tasks, and runners do the same by setting incremental milestones to achieve their fitness objectives. Additionally, running/jogging serves as an effective stress reliever, helping developers recharge their minds and maintain a healthy work-life balance.&lt;/p&gt;

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

&lt;p&gt;Engaging in physical activities like Brazilian Jiu-Jitsu, rock climbing, and running/jogging can significantly benefit software developers. These hobbies offer opportunities to strengthen physical fitness, enhance mental focus, and provide a much-needed break from the coding world. The shared characteristics of these activities and software development, such as problem-solving, adaptability, and goal setting, make them a perfect match for developers looking to improve their overall well-being and achieve a healthy work-life balance. So, why wait? Step away from the screen and embark on a new adventure today!&lt;/p&gt;

</description>
      <category>softwareengineering</category>
      <category>hobbies</category>
      <category>developers</category>
      <category>lifestyle</category>
    </item>
    <item>
      <title>Configure third-party domain name and HTTPS for CloudFront distribution</title>
      <dc:creator>Cindy Le</dc:creator>
      <pubDate>Tue, 09 Aug 2022 16:03:00 +0000</pubDate>
      <link>https://dev.to/cindyledev/configure-third-party-domain-name-and-https-for-cloudfront-distribution-cloud-resume-challenge-part-3n-2nhp</link>
      <guid>https://dev.to/cindyledev/configure-third-party-domain-name-and-https-for-cloudfront-distribution-cloud-resume-challenge-part-3n-2nhp</guid>
      <description>&lt;p&gt;Part 3/n of the Cloud Resume Challenge&lt;/p&gt;

&lt;h2&gt;
  
  
  Chunk 1: Building the frontend
&lt;/h2&gt;

&lt;p&gt;After you have successfully used CloudFront to serve the Next.js website hosted on Amazon S3, you'll notice that the website &lt;a href="https://d1ij0wngzhbeyc.cloudfront.net/"&gt;https://d1ij0wngzhbeyc.cloudfront.net/&lt;/a&gt; is using HTTPS but what if you wanted to use another domain name like &lt;a href="https://d1ij0wngzhbeyc.cloudfront.net/"&gt;https://cindyle.dev&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Stack:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next.js&lt;/li&gt;
&lt;li&gt;Amazon S3&lt;/li&gt;
&lt;li&gt;Amazon CloudFront&lt;/li&gt;
&lt;li&gt;Third-party Domain (ie Namecheap)&lt;/li&gt;
&lt;li&gt;AWS Certificate Manager&lt;/li&gt;
&lt;li&gt;Route 53&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Setting up the Namecheap DNS
&lt;/h3&gt;

&lt;p&gt;You can purchase a domain name from Route 53, but while I was playing around with this Chunk, I bought a domain name from &lt;a href="https://www.namecheap.com/"&gt;Namecheap&lt;/a&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Purchase a domain name from Namecheap or any other domain registrar&lt;/li&gt;
&lt;li&gt;To add an alternative domain name (CNAME) to a CloudFront distribution, you must attach a trusted certificate that validates your authorization to use the domain name.&lt;/li&gt;
&lt;li&gt;Head over to the AWS Certificate Manager console and &lt;strong&gt;Request a certificate&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Certificate type: &lt;strong&gt;Request a public certificate&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Fully qualified domain name: &lt;strong&gt;cindyle.dev&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Select validation method: &lt;strong&gt;DNS validation - recommended&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;After you send the request, you should see that the Status says &lt;strong&gt;Pending Validation&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click on the Certificate ID, and you should see the &lt;strong&gt;CNAME name&lt;/strong&gt; and &lt;strong&gt;CNAME value&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;CNAME name: _916aeebf4a4ee9545320d30853000009.cindyle.dev.&lt;/li&gt;
&lt;li&gt;CNAME value: _f3e8e0dff0089b1eb52619f87dxxxxx8.mqzgcdqkwq.acm-validations.aws.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Over in your Namecheap console, in the Domain tab, make sure you have 

&lt;ul&gt;
&lt;li&gt;Nameservers: &lt;strong&gt;Namecheap Basic DNS&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Go to the Advanced DNS tab, select &lt;strong&gt;ADD NEW RECORD&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Type: CNAME Record&lt;/li&gt;
&lt;li&gt;Host: &lt;strong&gt;_916aeebf4a4ee9545320d30853000009&lt;/strong&gt; (NOTE: You only need the beginning part, not the &lt;em&gt;.cindyle.dev.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Value: &lt;strong&gt;_f3e8e0dff0089b1eb52619f87dxxxxx8.mqzgcdqkwq.acm-validations.aws.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;TTL: &lt;strong&gt;5 min&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;In the AWS Certificate Manager, wait for the Status to go from &lt;strong&gt;Pending validation&lt;/strong&gt; to &lt;strong&gt;Success&lt;/strong&gt;. This could take hours but setting the TTL to 5 minutes should only take 10-15 minutes.&lt;/li&gt;
&lt;li&gt;Once the certificate is validated, you don't need to keep the record anymore on Namecheap, so delete it.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Add an Alternative domain name (CNAME) to CloudFront
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;In the &lt;a href="https://console.aws.amazon.com/cloudfront/v3/home"&gt;Amazon CloudFront console&lt;/a&gt;, select the distribution you created &lt;a href="https://dev.to/cindyledev/use-cloudfront-to-serve-a-static-website-hosted-on-amazon-s3-cloud-resume-challenge-part-2n-29l0"&gt;previously&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;Edit&lt;/strong&gt; and under &lt;strong&gt;Alternative domain name (CNAME) - optional&lt;/strong&gt;, click on &lt;strong&gt;Add item&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Alternative domain name: cindyle.dev&lt;/li&gt;
&lt;li&gt;Custom SSL certificate: &lt;strong&gt;cindyle.dev (3ff2abcd-12ac-1234-a000-9jklfdsirba)&lt;/strong&gt; from the dropdown menu&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Save the changes and wait for the distribution to finish deploying&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Use Route 53 as the DNS Service to manage your DNS records
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;In the Route 53 Console, create a new Hosted Zone

&lt;ul&gt;
&lt;li&gt;Domain name: &lt;strong&gt;cindyle.dev&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Type: &lt;strong&gt;Public hosted zone&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Click on the Hosted zone details, and you should see four servers listed underneath &lt;strong&gt;Name servers&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;ns-1234.awsdns-35.org&lt;/li&gt;
&lt;li&gt;ns-123.awsdns-30.com&lt;/li&gt;
&lt;li&gt;ns-789.awsdns-09.net&lt;/li&gt;
&lt;li&gt;ns-7890.awsdns-06.co.uk&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Over in the Namecheap console, in the Domain tab, make sure you have &lt;strong&gt;Nameserver: Custom DNS&lt;/strong&gt; and enter the four name servers from your Route 53 Hosted Zone details&lt;/li&gt;
&lt;li&gt;Back in the Route 53 console, create a new Record

&lt;ul&gt;
&lt;li&gt;Record name: cindyle.dev (keep blank to create a record for the root domain)&lt;/li&gt;
&lt;li&gt;Type: A - Routes traffic to an IPv4 address and some AWS resources&lt;/li&gt;
&lt;li&gt;Alias (turn on)&lt;/li&gt;
&lt;li&gt;Route traffic to: Alias to CloudFront distribution&lt;/li&gt;
&lt;li&gt;Dropdown: d1ij0wngzhbeyc.cloudfront.net&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Create another new Record

&lt;ul&gt;
&lt;li&gt;Record name: cindyle.dev (keep blank to create a record for the root domain)&lt;/li&gt;
&lt;li&gt;Type: AAAA - Routes traffic to an IPv6 address and some AWS resources&lt;/li&gt;
&lt;li&gt;Alias (turn on)&lt;/li&gt;
&lt;li&gt;Route traffic to: Alias to CloudFront distribution&lt;/li&gt;
&lt;li&gt;Dropdown: d1ij0wngzhbeyc.cloudfront.net&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;You should see that &lt;a href="https://cindyle.dev"&gt;https://cindyle.dev&lt;/a&gt; is live&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>aws</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Use CloudFront to serve a static website hosted on Amazon S3</title>
      <dc:creator>Cindy Le</dc:creator>
      <pubDate>Mon, 08 Aug 2022 19:38:00 +0000</pubDate>
      <link>https://dev.to/cindyledev/use-cloudfront-to-serve-a-static-website-hosted-on-amazon-s3-cloud-resume-challenge-part-2n-29l0</link>
      <guid>https://dev.to/cindyledev/use-cloudfront-to-serve-a-static-website-hosted-on-amazon-s3-cloud-resume-challenge-part-2n-29l0</guid>
      <description>&lt;p&gt;Part 2/n of the Cloud Resume Challenge&lt;/p&gt;

&lt;h2&gt;
  
  
  Chunk 1: Building the frontend
&lt;/h2&gt;

&lt;p&gt;After configuring the Next.js website on S3, you'll notice that the website endpoint &lt;a href="http://cindy-crc.s3-website-us-east-1.amazonaws.com/"&gt;http://cindy-crc.s3-website-us-east-1.amazonaws.com/&lt;/a&gt; is HTTP. This is because the website URL should use HTTPS for security, and this is where we'll need to use CloudFront.&lt;/p&gt;

&lt;p&gt;Stack:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next.js&lt;/li&gt;
&lt;li&gt;Amazon S3&lt;/li&gt;
&lt;li&gt;Amazon CloudFront&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As you'll remember from the previous &lt;a href="https://dev.to/cindyledev/configure-a-static-website-on-amazon-s3-cloud-resume-challenge-1fdc"&gt;blog&lt;/a&gt;, you'll need to remove any Bucket policy attached to the S3 bucket and Block all public access to continue with this.&lt;/p&gt;

&lt;p&gt;We will be using a REST API endpoint as the origin, with access restricted by an Origin Access Identity (OAI).&lt;/p&gt;

&lt;h4&gt;
  
  
  Create the CloudFront Distribution
&lt;/h4&gt;

&lt;p&gt;I mostly followed &lt;a href="https://aws.amazon.com/premiumsupport/knowledge-center/cloudfront-serve-static-website/"&gt;Use CloudFront to serve a static website hosted on Amazon S3&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the &lt;a href="https://console.aws.amazon.com/cloudfront/v3/home"&gt;Amazon CloudFront console&lt;/a&gt;, choose &lt;strong&gt;Create distribution&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Origin domain: &lt;strong&gt;cindy-crc.s3.us-east-1.amazonaws.com&lt;/strong&gt; (from the dropdown menu)&lt;/li&gt;
&lt;li&gt;Name: &lt;strong&gt;cindy-crc.s3.us-east-1.amazonaws.com&lt;/strong&gt; (should be autofilled)&lt;/li&gt;
&lt;li&gt;S3 bucket access: &lt;strong&gt;Yes use OAI (bucket can restrict access to only CloudFront)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;For &lt;strong&gt;Origin access identity&lt;/strong&gt;, select &lt;strong&gt;Create new OAI&lt;/strong&gt; and choose the newly created OAI&lt;/li&gt;
&lt;li&gt;Bucket policy: &lt;strong&gt;Yes, update the bucket policy&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Default root object - optional: &lt;strong&gt;index.html&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create distribution&lt;/strong&gt; and wait for the &lt;strong&gt;Last modified&lt;/strong&gt; status to go from &lt;strong&gt;Deploying&lt;/strong&gt; to &lt;strong&gt;Date&lt;/strong&gt;. This may take ~5 minutes&lt;/li&gt;
&lt;li&gt;You should be able to visit the &lt;strong&gt;Distribution domain name&lt;/strong&gt; link &lt;a href="https://d1ij0wngzhbeyc.cloudfront.net"&gt;https://d1ij0wngzhbeyc.cloudfront.net&lt;/a&gt; and see the resume website&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Troubleshooting
&lt;/h4&gt;

&lt;p&gt;If you're getting an &lt;strong&gt;Access Denied&lt;/strong&gt; error, it's probably due to Bucket policy. You should be blocking all public access and only allowing your CloudFront Distribution to access your S3. The S3 bucket policy should look like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="err"&gt;{&lt;/span&gt;
    "Version": "2008-10-17",
    "Id": "PolicyForCloudFrontPrivateContent",
    "Statement": [
        {
            "Sid": "1",
            "Effect": "Allow",
            "Principal": {
&lt;span class="gd"&gt;-                "AWS": "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity Distribution-ID"
&lt;/span&gt;&lt;span class="gi"&gt;+                "AWS": "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E392Q20ZNZ7N4X"
&lt;/span&gt;            },
            "Action": "s3:GetObject",
&lt;span class="gd"&gt;-            "Resource": "arn:aws:s3:::Bucket-Name/*"
&lt;/span&gt;&lt;span class="gi"&gt;+            "Resource": "arn:aws:s3:::cindy-crc/*"
&lt;/span&gt;        }
    ]
&lt;span class="err"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>aws</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>cloud</category>
    </item>
    <item>
      <title>Configure a static Next.js website on Amazon S3</title>
      <dc:creator>Cindy Le</dc:creator>
      <pubDate>Fri, 05 Aug 2022 19:22:00 +0000</pubDate>
      <link>https://dev.to/cindyledev/configure-a-static-website-on-amazon-s3-cloud-resume-challenge-1fdc</link>
      <guid>https://dev.to/cindyledev/configure-a-static-website-on-amazon-s3-cloud-resume-challenge-1fdc</guid>
      <description>&lt;p&gt;This is the start of a multi-blog series as I make my way through the Cloud Resume Challenge. As advertised, the &lt;a href="https://cloudresumechallenge.dev/"&gt;Cloud Resume Challenge&lt;/a&gt; is a popular 16-step project that takes you from certified to hired in cloud. &lt;/p&gt;

&lt;p&gt;I already have a job and have passed two AWS exams. Still, a couple of months ago, I ventured off to see what's out there, and oh boy, the number of cloud questions I could not answer at the interviews made me really think, "I don't know my stuff. I owe it to the people involved to do a really good job here". The worst part is I didn't blindly send out resumes and hope these companies would call me; I reached out to my connections and asked them to put my name out there. Some of which returned to me with opportunities that have not been made public yet. I underperformed in these interviews, but I now know what these companies are looking for.&lt;/p&gt;

&lt;p&gt;Anyway, I don't want to ramble on about how I replayed these interviews in my head because this is about what I'm going to do moving forward to make myself a better candidate, so whenever I decide to venture off again, I'll be prepared!&lt;/p&gt;

&lt;h2&gt;
  
  
  Chunk 1: Building the frontend
&lt;/h2&gt;

&lt;p&gt;The minimum requirement for this part of Chunk 1 is to have an HTML page with some CSS and serve the files in an Amazon S3 bucket.&lt;/p&gt;

&lt;p&gt;It sounds simple enough, but since I love frontend development, so I decided to add the &lt;strong&gt;Developer Mod&lt;/strong&gt;. I'll build my website using a JavaScript framework instead of just HTML and CSS.&lt;/p&gt;

&lt;p&gt;Stack:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next.js&lt;/li&gt;
&lt;li&gt;Amazon S3&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Getting Started with Next.js
&lt;/h3&gt;

&lt;p&gt;I made a GitHub repo &lt;a href="https://github.com/cindyledev/cloud-resume-challenge"&gt;here&lt;/a&gt; if you wanna see what I have so far. For this part of Chunk 1, you really just need to have a Next.js app, then &lt;code&gt;build&lt;/code&gt; and &lt;code&gt;export&lt;/code&gt; it.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a new Next.js app using &lt;code&gt;create-next-app&lt;/code&gt;. We have been using &lt;a href="https://pnpm.io/"&gt;&lt;code&gt;pnpm&lt;/code&gt;&lt;/a&gt; on &lt;a href="https://github.com/Seneca-CDOT/telescope"&gt;Telescope&lt;/a&gt;, and I simply cannot go back to &lt;code&gt;npm&lt;/code&gt;.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pnpm create next-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Run &lt;code&gt;pnpm run dev&lt;/code&gt; to start the development server on &lt;code&gt;http://localhost:3000&lt;/code&gt; and view your initial Next.js application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Update the &lt;code&gt;build&lt;/code&gt; script in the &lt;code&gt;package.json&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;  "scripts": {
    ...
&lt;span class="gd"&gt;-    "build": "next build",
&lt;/span&gt;&lt;span class="gi"&gt;+    "build": "next build &amp;amp;&amp;amp; next export",
&lt;/span&gt;    ...
  },
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Run &lt;code&gt;pnpm run build&lt;/code&gt; will generate an &lt;code&gt;out&lt;/code&gt; directory with everything you need for your static website.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="p"&gt;cloud-resume-challenge
&lt;/span&gt;  ├── .next
  ├── node_modules
&lt;span class="gi"&gt;+ ├── out
+ │   ├── _next
+ │   ├── favicon.ico
+ │   ├── index.html
+ │   └── vercel.svg
&lt;/span&gt;  ├── pages
  ├── public
  ├── styles
  ├── .eslintrc.json
  ├── .gitignore
  ├── next.config.js
  ├── package.json
  ├── pnpm-lock.yaml
  └── README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Host the Next.js website on Amazon S3
&lt;/h3&gt;

&lt;p&gt;I mostly followed &lt;a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/HostingWebsiteOnS3Setup.html"&gt;Tutorial: Configuring a static website on Amazon S3&lt;/a&gt; for this part. However, to proceed with the CloudFront Distribution in a later blog post, you will need to &lt;strong&gt;Block all public access&lt;/strong&gt; for the S3 bucket.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the &lt;a href="https://console.aws.amazon.com/s3/"&gt;Amazon S3 console&lt;/a&gt;, choose &lt;strong&gt;Create bucket&lt;/strong&gt; and enter the following:

&lt;ul&gt;
&lt;li&gt;Bucket name: &lt;strong&gt;cindy-crc&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;AWS Region: &lt;strong&gt;US East (N. Virginia) us-east-1&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Uncheck &lt;strong&gt;Block &lt;em&gt;all&lt;/em&gt; public access&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Bucket Versioning: &lt;strong&gt;Enable&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;Create&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Once the bucket as been created, upload everything from your &lt;code&gt;out&lt;/code&gt; folder into the bucket&lt;/li&gt;
&lt;li&gt;Click on your newly created bucket from the list and go to the &lt;strong&gt;Properties&lt;/strong&gt; tab&lt;/li&gt;
&lt;li&gt;Go all the way to the bottom, under &lt;strong&gt;Static website hosting&lt;/strong&gt; and Enable Static website hosting&lt;/li&gt;
&lt;li&gt;Specify the &lt;strong&gt;Index document&lt;/strong&gt; as &lt;code&gt;index.html&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Save your changes, and you should be able to see a &lt;strong&gt;Bucket website endpoint&lt;/strong&gt; like &lt;a href="http://cindy-crc.s3-website-us-east-1.amazonaws.com/"&gt;http://cindy-crc.s3-website-us-east-1.amazonaws.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Permissions&lt;/strong&gt; tab of your bucket, add a new Bucket policy and save the changes
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="err"&gt;{&lt;/span&gt;
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "PublicReadGetObject",
            "Effect": "Allow",
            "Principal": "*",
            "Action": [
                "s3:GetObject"
            ],
            "Resource": [
&lt;span class="gd"&gt;-                "arn:aws:s3:::Bucket-Name/*"
&lt;/span&gt;&lt;span class="gi"&gt;+                "arn:aws:s3:::cindy-crc/*"
&lt;/span&gt;            ]
        }
    ]
&lt;span class="err"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Test your website endpoint by visiting &lt;a href="http://cindy-crc.s3-website-us-east-1.amazonaws.com/"&gt;http://cindy-crc.s3-website-us-east-1.amazonaws.com/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can stop here if you're satisfied with having a static website on Amazon S3, but for the purpose of the Cloud Resume Challenge, which will move on to using CloudFront, you need to remove the Bucket policy and Block all public access again.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>aws</category>
      <category>nextjs</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Remote Development with Visual Studio Code on AWS EC2</title>
      <dc:creator>Cindy Le</dc:creator>
      <pubDate>Sun, 13 Mar 2022 23:20:39 +0000</pubDate>
      <link>https://dev.to/cindyledev/remote-development-with-visual-studio-code-on-aws-ec2-4cla</link>
      <guid>https://dev.to/cindyledev/remote-development-with-visual-studio-code-on-aws-ec2-4cla</guid>
      <description>&lt;p&gt;The following will show you how to create and connect to a virtual machine (VM) on AWS using the Visual Studio Code &lt;a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh" rel="noopener noreferrer"&gt;Remote - SSH&lt;/a&gt; extension. You'll be able to run Telescope in development on a remote machine with VS Code just like if the source code was local. This documentation is based on &lt;a href="https://code.visualstudio.com/docs/remote/ssh-tutorial" rel="noopener noreferrer"&gt;Remote development over SSH&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://telescope.cdot.systems/" rel="noopener noreferrer"&gt;Telescope&lt;/a&gt; is a tool for tracking blogs around Seneca's open source develop. The application itself has many microservices that use Docker containers and are composed together using Docker-Compose. You can find the GitHub repo &lt;a href="https://github.com/Seneca-CDOT/telescope" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Telescope Tech Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Next.js&lt;/li&gt;
&lt;li&gt;Material UI&lt;/li&gt;
&lt;li&gt;Node.js&lt;/li&gt;
&lt;li&gt;Elasticsearch&lt;/li&gt;
&lt;li&gt;Redis&lt;/li&gt;
&lt;li&gt;Traefik&lt;/li&gt;
&lt;li&gt;Nginx&lt;/li&gt;
&lt;li&gt;Docker&lt;/li&gt;
&lt;li&gt;Supabase&lt;/li&gt;
&lt;li&gt;Jest&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Telescope Microservices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Dependency Discovery&lt;/li&gt;
&lt;li&gt;Feed Discovery&lt;/li&gt;
&lt;li&gt;Image&lt;/li&gt;
&lt;li&gt;Parser&lt;/li&gt;
&lt;li&gt;Planet&lt;/li&gt;
&lt;li&gt;Posts&lt;/li&gt;
&lt;li&gt;Search&lt;/li&gt;
&lt;li&gt;SSO&lt;/li&gt;
&lt;li&gt;Status&lt;/li&gt;
&lt;li&gt;Users&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Disclaimer&lt;/strong&gt;: This guide is specifically designed for students who are enrolled in AWS Academy so the services and technologies used adhere by the AWS Academy Learner Lab - Foundation Services restrictions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If you are not enrolled in AWS Academy, please note that the EC2 instance used in this guide is not within AWS's Free-Tier so please see &lt;a href="https://aws.amazon.com/ec2/pricing/on-demand/" rel="noopener noreferrer"&gt;EC2 Pricing&lt;/a&gt; to see if you're comfortable with these costs.&lt;/p&gt;

&lt;p&gt;Running Docker in development is CPU intensive so these are the EC2 instances I recommend:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Minimum: &lt;code&gt;t2.large (8 GiB RAM + 2 vCPU)&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Recommended: &lt;code&gt;r5.large (16 GiB RAM + 2 vCPU)&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Summary of Pricing&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;t2.large costs \$0.0928 per hour&lt;/li&gt;
&lt;li&gt;r5.large costs \$0.126 per hour&lt;/li&gt;
&lt;li&gt;20GB Amazon Elastic Block Storage (EBS) costs \$1 per month&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/ec2/pricing/on-demand/#Elastic_IP_Addresses" rel="noopener noreferrer"&gt;Elastic IP Address&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cost Estimate Per Month&lt;/strong&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;t2.large&lt;/th&gt;
&lt;th&gt;r5.large&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;EC2 Instance cost per hour&lt;/td&gt;
&lt;td&gt;\$0.0928&lt;/td&gt;
&lt;td&gt;\$0.126&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Elastic IP Address cost per hour&lt;/td&gt;
&lt;td&gt;\$0.005&lt;/td&gt;
&lt;td&gt;\$0.005&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hours per day&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Days per month&lt;/td&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sub-total&lt;/td&gt;
&lt;td&gt;\$17.60&lt;/td&gt;
&lt;td&gt;\$23.58&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;20GB EBS Volume&lt;/td&gt;
&lt;td&gt;\$0.5&lt;/td&gt;
&lt;td&gt;\$0.5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total&lt;/td&gt;
&lt;td&gt;\$18.10&lt;/td&gt;
&lt;td&gt;\$24.08&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

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

&lt;ul&gt;
&lt;li&gt;Download and install &lt;a href="https://code.visualstudio.com/download" rel="noopener noreferrer"&gt;Visual Studio Code&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Install the &lt;a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh" rel="noopener noreferrer"&gt;Remote - SSH&lt;/a&gt; extension&lt;/li&gt;
&lt;li&gt;AWS Academy Account. You will need your &lt;code&gt;AWS_ACCESS_KEY_ID&lt;/code&gt; and &lt;code&gt;AWS_SECRET_ACCESS_KEY&lt;/code&gt; and your SSH key (&lt;code&gt;.pem&lt;/code&gt; file)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Create your virtual machine (AWS EC2):
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;In the upper-right hand corner of your AWS Management Console, select a region. In this tutorial, &lt;code&gt;US East (N. Virginia) us-east-1&lt;/code&gt; as your &lt;code&gt;Region&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2Faws_console_region.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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2Faws_console_region.png" alt="AWS Console Region"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the search bar at the top, type in &lt;code&gt;ec2&lt;/code&gt; and click on &lt;code&gt;EC2&lt;/code&gt; to go to the EC2 Dashboard
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2Faws_search_ec2.png" alt="AWS Search EC2"&gt;
&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;Launch instances&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Step 1 - Choose an Amazon Machine Image (AMI): &lt;code&gt;Amazon Linux 2 AMI (HVM) - Kernel 5.10, SSD Volume Type&lt;/code&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2Faws_linux_2_ami.png" alt="AWS Linux 2 AMI"&gt;
&lt;/li&gt;
&lt;li&gt;Step 2 - Choose an Instance Type: &lt;code&gt;r5.large&lt;/code&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2Faws_instance_type.png" alt="AWS r5.large Instance Type"&gt;
&lt;/li&gt;
&lt;li&gt;Step 3 - Configure Instance Details:

&lt;ul&gt;
&lt;li&gt;IAM role: LabInstanceProfile
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2Faws_iam_role.png" alt="AWS LabInstanceProfile IAM Role"&gt;
&lt;/li&gt;
&lt;li&gt;Copy and paste the &lt;a href="https://github.com/Seneca-CDOT/telescope/blob/master/tools/aws-userdata.sh" rel="noopener noreferrer"&gt;aws-userdata.sh&lt;/a&gt; script into the &lt;code&gt;User data&lt;/code&gt; field
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2Faws_userdata.png" alt="AWS Userdata"&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Step 4 - Add Storage: Change the Size (GiB) from &lt;code&gt;8&lt;/code&gt; to &lt;code&gt;20&lt;/code&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2Faws_storage.png" alt="AWS Storage"&gt;
&lt;/li&gt;

&lt;li&gt;Step 5 - Add Tags: No tags are needed. Proceed to the next step.&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Step 6 - Configure Security Group:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Assign a security group: &lt;code&gt;Create a new security group&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Security group name: &lt;code&gt;telescope-sg&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add the following Rules:&lt;/li&gt;
&lt;li&gt;SSH for your IP address&lt;/li&gt;
&lt;li&gt;Type: &lt;code&gt;SSH&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Protocol: &lt;code&gt;TCP&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Port Range: &lt;code&gt;22&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Source: &lt;code&gt;My IP&lt;/code&gt; (When you select this from the dropdown menu, it will automatically put &lt;code&gt;&amp;lt;your-ip-address&amp;gt;/32&lt;/code&gt; in the field. For example &lt;code&gt;76.72.29.150/32&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Open port 3000 for your IP address&lt;/li&gt;
&lt;li&gt;Type: &lt;code&gt;Custom TCP&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Protocol: &lt;code&gt;TCP&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Port Range: &lt;code&gt;3000&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Source: &lt;code&gt;My IP&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Open port 8000 for your IP address&lt;/li&gt;
&lt;li&gt;Type: &lt;code&gt;Custom TCP&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Protocol: &lt;code&gt;TCP&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Port Range: &lt;code&gt;8000&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Source: &lt;code&gt;My IP&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Open port 8000 for your IP address&lt;/li&gt;
&lt;li&gt;Type: &lt;code&gt;Custom TCP&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Protocol: &lt;code&gt;TCP&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Port Range: &lt;code&gt;8443&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Source: &lt;code&gt;My IP&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B12_54_12-vscode-ssh.md%2B-%2Btelescope%2B-%2BVisual%2BStudio%2BCode.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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B12_54_12-vscode-ssh.md%2B-%2Btelescope%2B-%2BVisual%2BStudio%2BCode.png" alt="AWS Security Groups"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note: &lt;code&gt;My IP&lt;/code&gt; is the IP address of your (home) network. Your IP address will likely change if you manually reboot your router or a power outage occurs and your router reboots itself. If you know your IP address has changed, please update the Security Group on AWS.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on &lt;code&gt;Review and Launch&lt;/code&gt;. You will get a warning: &lt;code&gt;Your instance configuration is not eligible for the free usage tier&lt;/code&gt;, this is because we're using a &lt;code&gt;r5.large&lt;/code&gt; instance type.&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;Launch&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;In the pop-up, choose &lt;code&gt;Choose an existing key pair&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Select a key pair: &lt;code&gt;vockey&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Click on &lt;code&gt;Launch Instances&lt;/code&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2Faws_key_pair.png" alt="AWS Key Pair"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It will take a few minutes for AWS to launch your new EC2 instance.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Once your EC2 instance has been launched, you should name it something meaningful like &lt;code&gt;Telescope-Dev&lt;/code&gt; and you can find your EC2 instance's public IPv4 address. Make note of this IP address.
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B14_05_35-Preview%2Bvscode-ssh.md%2B-%2Btelescope%2B-%2BVisual%2BStudio%2BCode.png"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Associate an Elastic IP address to your EC2 instance
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;In the left-hand pane, go to &lt;code&gt;Network &amp;amp; Security&lt;/code&gt; &amp;gt; &lt;code&gt;Elastic IPs&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;Allocate Elastic IP address&lt;/code&gt; button
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2Faws_elastic_ip_address.png" alt="AWS Elastic IP Address"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Network Border Group: &lt;code&gt;us-east-1&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Public IPv4 address pool: &lt;code&gt;Amazon'pool of IPv4 addresses&lt;/code&gt;
and click on &lt;code&gt;Allocate&lt;/code&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2Faws_elastic_ip_address_2.png" alt="AWS Elastic IP Address Settings"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Select the newly created Elastic IP address. In the &lt;code&gt;Actions&lt;/code&gt; dropdown menu, select Associate Elastic IP address
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2Faws_elastic_ip_address_3.png" alt="AWS Elastic IP Address Actions"&gt;
&lt;/li&gt;
&lt;li&gt;Select the EC2 instance you've created in the previous section &lt;code&gt;Telescope-Dev&lt;/code&gt; and click on &lt;code&gt;Associate&lt;/code&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2Faws_elastic_ip_address_4.png" alt="AWS Elastic IP Address Associate"&gt;
&lt;/li&gt;
&lt;li&gt;In the left-hand pane, go to &lt;code&gt;Instances&lt;/code&gt;, select &lt;code&gt;Telescope-Dev&lt;/code&gt; and you should be able to see that your Elastic IP address has been associated to your EC2 instance&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Connect using SSH
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Obtain your AWS Credentials and SSH Key
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;You can find your AWS credentials under &lt;code&gt;AWS Details&lt;/code&gt; of your AWS Academy account
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2Faws_credentials.png" alt="AWS Credentials"&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Download the &lt;code&gt;SSH key&lt;/code&gt; (labsuser.pem) file to your local computer. Note the file location&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open up Visual Studio Code&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on the &lt;code&gt;Open a Remote Window&lt;/code&gt; icon at the bottom left-hand corner of the window&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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B13_11_22-.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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B13_11_22-.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select &lt;code&gt;Connect to Host&lt;/code&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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B13_12_53-Get%2BStarted%2B-%2BVisual%2BStudio%2BCode.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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B13_12_53-Get%2BStarted%2B-%2BVisual%2BStudio%2BCode.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select &lt;code&gt;Configure SSH Hosts...&lt;/code&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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B13_14_34-Visual%2BStudio%2BCode.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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B13_14_34-Visual%2BStudio%2BCode.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This will open up a &lt;code&gt;config&lt;/code&gt; file in Visual Studio Code. If you're using Windows, it'll be something like &lt;code&gt;C:/Users/cindy/.ssh/config&lt;/code&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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B13_15_09-Visual%2BStudio%2BCode.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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B13_15_09-Visual%2BStudio%2BCode.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Edit the &lt;code&gt;config&lt;/code&gt; file with the following:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Host aws-e2
    HostName &amp;lt;your-ec2-ip-address&amp;gt;
    User ec2-user
    IdentityFile ~/.ssh/labsuser.pem


&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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2Faws_ssh_config.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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2Faws_ssh_config.png" alt="AWS VS Code SSH Config"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Save the file&lt;/li&gt;
&lt;li&gt;When you click on the &lt;code&gt;Open a Remote Window&lt;/code&gt; icon at the bottom left-hand corner again and choose &lt;code&gt;Connect to Host&lt;/code&gt;, you will see &lt;code&gt;aws-ec2&lt;/code&gt; listed.&lt;/li&gt;
&lt;li&gt;Select &lt;code&gt;aws-ec2&lt;/code&gt; and a new Visual Studio Code window will open.
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B13_23_08-config%2B-%2BVisual%2BStudio%2BCode.png"&gt;
&lt;/li&gt;
&lt;li&gt;You will see &lt;code&gt;"aws-ec2" has fingerprint "SHA256:xxx"&lt;/code&gt; and &lt;code&gt;Are you sure you want to continue?&lt;/code&gt;. Click on &lt;code&gt;Continue&lt;/code&gt;. Then You should see that you're connected!
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B13_56_54-Get%2BStarted%2B-%2BVisual%2BStudio%2BCode.png"&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B13_58_26-.png"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Setting up your AWS credentials
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open up a terminal in Visual Studio Code (hotkey on Windows: &lt;code&gt;Ctrl + backtick&lt;/code&gt;). You should see that you're logged in as something like &lt;code&gt;[ec2-user@ip-172-31-4-0 ~]$&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Verify the AWS CLI installation&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

$ aws --version

aws-cli/2.3.0 Python/3.8.8 Linux/5.4.0-1045-aws exe/x86_64.ubuntu.20 prompt/off


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

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;Configure your AWS credentials&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

aws configure


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

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;Currently, everything is set as None so enter your credentials for your AWS IAM user.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

AWS Access Key ID [None]: ****************764G
AWS Secret Access Key [None]: ****************qBbe
Default region name [None]: us-east-1
Default output format [None]:


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

&lt;/div&gt;
&lt;h2&gt;
  
  
  Verify that everything in the aws-userdata.sh script was installed correctly
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Check Docker: &lt;code&gt;docker info&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Check docker-compose version: &lt;code&gt;docker-compose --version&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Check Node.js version: &lt;code&gt;node -v&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Check pnpm version: &lt;code&gt;pnpm -v&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Check git version: &lt;code&gt;git --version&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Authenticate as your GitHub account with the GitHub CLI
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Run &lt;code&gt;gh auth login&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;What account do you want to log into? &lt;code&gt;GitHub.com&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;What is your preferred protocol for Git operations? &lt;code&gt;SSH&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Generate a new SSH key to add to your GitHub account? &lt;code&gt;Yes&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Enter a passphase for your new SSH key (Optional): &lt;code&gt;********&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;How would you like to authenticate GitHub CLI? &lt;code&gt;Login with a web browser&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;First copy your one-time code: &lt;code&gt;ABC1-234D&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Opening up the Telescope repository in AWS EC2:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Clone your fork of the Telescope repository. For example &lt;code&gt;gh repo clone cindyledev/telescope&lt;/code&gt;. If you do not have a fork of the Telescope repository, run &lt;code&gt;gh repo clone -o upstream Seneca-CDOT/telescope&lt;/code&gt; to clone the Telescope repository and name the remote &lt;code&gt;upstream&lt;/code&gt; then proceed to Step 5.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

gh repo clone &amp;lt;github-username&amp;gt;/telescope


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

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open the &lt;code&gt;telescope&lt;/code&gt; directory and the entire Telescope files and folder structure should be visible to you!&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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B16_54_04-Settings.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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B16_54_04-Settings.png"&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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B16_55_08-Visual%2BStudio%2BCode.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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B16_55_08-Visual%2BStudio%2BCode.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add the Telescope repository and name the remote &lt;code&gt;upstream&lt;/code&gt; by entering&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

git remote add upstream https://github.com/Seneca-CDOT/telescope.git


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

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;Verify that the remote has been added&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

git remote -v


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

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;Set all the necessary environment variables in your .env file to contain your EC2 instance's public IPv4 address by executing the &lt;code&gt;aws-ip.sh&lt;/code&gt; script&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

sh ./tools/aws-ip.sh


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

&lt;/div&gt;
&lt;h3&gt;
  
  
  If you did everything correctly, you've completed the environment setup!
&lt;/h3&gt;
&lt;h2&gt;
  
  
  Now to get started with development...
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Install all dependencies&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

pnpm install


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

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;Start all Telescope services using the environment variables set in &lt;code&gt;.env&lt;/code&gt;. This will take some time to complete&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Note: Do not use &lt;code&gt;pnpm services:start&lt;/code&gt;. This will use the environment variables in &lt;code&gt;config/env.development&lt;/code&gt; and we don't want that here.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

docker-compose --env-file .env up -d


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

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;Start the Telescope development server on Port 3000&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

pnpm start


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

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;Find your EC2 instance's public IPv4&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

$ curl -s http://169.254.169.254/latest/meta-data/public-ipv4

35.174.16.133


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

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open &lt;code&gt;&amp;lt;public-ip&amp;gt;:8000&lt;/code&gt; browser tab to see Telescope running on a AWS Cloud9 environment!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open &lt;code&gt;&amp;lt;public-ip&amp;gt;:3000/feeds&lt;/code&gt; in another browser tab to see all the feeds in the backend&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open &lt;code&gt;&amp;lt;public-ip&amp;gt;:8443/v1/&amp;lt;microservice-port&amp;gt;&lt;/code&gt; in another browser tab to see the microservices. For example &lt;code&gt;35.174.16.133:8443/v1/status&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B17_10_36-Telescope%2B%25E2%2580%2594%2BMozilla%2BFirefox.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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B17_10_36-Telescope%2B%25E2%2580%2594%2BMozilla%2BFirefox.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently Asked Questions (FAQ)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  How do I stop my docker containers?
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&lt;p&gt;pnpm services:stop&lt;/p&gt;

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

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  How do I delete my docker containers?&lt;br&gt;
&lt;/h3&gt;
&lt;br&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&lt;p&gt;docker system prune -af --volumes&lt;/p&gt;

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

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  I can't open &lt;code&gt;&amp;lt;EC2-ip&amp;gt;:8000&lt;/code&gt; running, what could I be doing wrong?&lt;br&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;If you have a VPN on, turn it off and get your IP address by visiting &lt;a href="http://checkip.amazonaws.com/" rel="noopener noreferrer"&gt;http://checkip.amazonaws.com/&lt;/a&gt; then updating your Security Group to allow your IP address to access the ports 22, 3000, 8000, and 8443.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Your home IP address may have changed because your router was rebooted. This can happen when you manually reboot your router or when a power outage occurs. The solution here is the same as above. You can get your IP address by visting &lt;a href="http://checkip.amazonaws.com/" rel="noopener noreferrer"&gt;http://checkip.amazonaws.com/&lt;/a&gt; then updating your Security Group to allow your IP address to access the ports 22, 3000, 8000, and 8443.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  How do I turn off my EC2 instance if I'm actively not using it?
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Close your Remote Connection on VS Code&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Manually turning the EC2 instance off using the AWS Console&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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B17_35_32-vscode-ssh.md%2B-%2Btelescope%2B-%2BVisual%2BStudio%2BCode.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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B17_35_32-vscode-ssh.md%2B-%2Btelescope%2B-%2BVisual%2BStudio%2BCode.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Stop your AWS Academy Lab&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>aws</category>
      <category>devops</category>
      <category>docker</category>
      <category>cloud</category>
    </item>
    <item>
      <title>How to Dockerize a Docusaurus v2 application</title>
      <dc:creator>Cindy Le</dc:creator>
      <pubDate>Tue, 08 Mar 2022 14:46:31 +0000</pubDate>
      <link>https://dev.to/cindyledev/how-to-dockerize-a-docusaurus-v2-application-fp7</link>
      <guid>https://dev.to/cindyledev/how-to-dockerize-a-docusaurus-v2-application-fp7</guid>
      <description>&lt;p&gt;Let's get started with the most basic &lt;a href="https://docusaurus.io/docs" rel="noopener noreferrer"&gt;Docusaurus&lt;/a&gt; application.&lt;/p&gt;

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

&lt;ol&gt;
&lt;li&gt;Create a new Docusaurus site
```
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;npx create-docusaurus@latest my-website classic&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
Your directory structure should look like this:

![Directory structure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uzsk43jvyqbgbu0ozbeh.png)

2. Start the site:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;cd my-website&lt;br&gt;
npx docusaurus start&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
3. Open `http://localhost:3000`. Once you see that your website is running locally you can close the server then proceed to the next section.

## Adding the Dockerfile

1. Add the `host` flag to the `start` and `serve` scripts in the `package.json` file

```diff


  "scripts": {
    "docusaurus": "docusaurus",
--  "start": "docusaurus start",
++  "start": "docusaurus start --host 0.0.0.0",
    "build": "docusaurus build",
    "swizzle": "docusaurus swizzle",
    "deploy": "docusaurus deploy",
    "clear": "docusaurus clear",
--  "serve": "docusaurus serve",
++  "serve": "docusaurus serve --host 0.0.0.0",
    "write-translations": "docusaurus write-translations",
    "write-heading-ids": "docusaurus write-heading-ids"
  },


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

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;Create a new file called &lt;code&gt;Dockerfile&lt;/code&gt; in the root of the project&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;

&lt;span class="c"&gt;## Base ########################################################################&lt;/span&gt;
&lt;span class="c"&gt;# Use a larger node image to do the build for native deps (e.g., gcc, python)&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;node:lts&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;base&lt;/span&gt;

&lt;span class="c"&gt;# Reduce npm log spam and colour during install within Docker&lt;/span&gt;
&lt;span class="k"&gt;ENV&lt;/span&gt;&lt;span class="s"&gt; NPM_CONFIG_LOGLEVEL=warn&lt;/span&gt;
&lt;span class="k"&gt;ENV&lt;/span&gt;&lt;span class="s"&gt; NPM_CONFIG_COLOR=false&lt;/span&gt;

&lt;span class="c"&gt;# We'll run the app as the `node` user, so put it in their home directory&lt;/span&gt;
&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /home/node/app&lt;/span&gt;
&lt;span class="c"&gt;# Copy the source code over&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; --chown=node:node . /home/node/app/&lt;/span&gt;

&lt;span class="c"&gt;## Development #################################################################&lt;/span&gt;
&lt;span class="c"&gt;# Define a development target that installs devDeps and runs in dev mode&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;base&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;development&lt;/span&gt;
&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /home/node/app&lt;/span&gt;
&lt;span class="c"&gt;# Install (not ci) with dependencies, and for Linux vs. Linux Musl (which we use for -alpine)&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;# Switch to the node user vs. root&lt;/span&gt;
&lt;span class="k"&gt;USER&lt;/span&gt;&lt;span class="s"&gt; node&lt;/span&gt;
&lt;span class="c"&gt;# Expose port 3000&lt;/span&gt;
&lt;span class="k"&gt;EXPOSE&lt;/span&gt;&lt;span class="s"&gt; 3000&lt;/span&gt;
&lt;span class="c"&gt;# Start the app in debug mode so we can attach the debugger&lt;/span&gt;
&lt;span class="k"&gt;CMD&lt;/span&gt;&lt;span class="s"&gt; ["npm", "start"]&lt;/span&gt;

&lt;span class="c"&gt;## Production ##################################################################&lt;/span&gt;
&lt;span class="c"&gt;# Also define a production target which doesn't use devDeps&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;base&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;production&lt;/span&gt;
&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /home/node/app&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; --chown=node:node --from=development /home/node/app/node_modules /home/node/app/node_modules&lt;/span&gt;
&lt;span class="c"&gt;# Build the Docusaurus app&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;npm run build

&lt;span class="c"&gt;## Deploy ######################################################################&lt;/span&gt;
&lt;span class="c"&gt;# Use a stable nginx image&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;nginx:stable-alpine&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;deploy&lt;/span&gt;
&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /home/node/app&lt;/span&gt;
&lt;span class="c"&gt;# Copy what we've installed/built from production&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; --chown=node:node --from=production /home/node/app/build /usr/share/nginx/html/&lt;/span&gt;


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

&lt;/div&gt;
&lt;h3&gt;
  
  
  Working with Docker container in development
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;To build the Docker container for development, run&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

docker build --target development -t docs:dev .


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

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;To run the Docker container in development, run&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

docker run -p 3000:3000 docs:dev


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

&lt;/div&gt;

&lt;p&gt;Note: Remember to stop the container before proceeding to the next step&lt;/p&gt;

&lt;h3&gt;
  
  
  Working with Docker container in production
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;To build the Docker container for production, run&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

docker build -t docusaurus:latest .


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

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;To run the Docker container in production, run&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

docker run --rm -p 3000:80 docusaurus:latest


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

&lt;/div&gt;

</description>
      <category>docker</category>
      <category>documentation</category>
      <category>opensource</category>
    </item>
    <item>
      <title>My '20% time' spent on Telescope</title>
      <dc:creator>Cindy Le</dc:creator>
      <pubDate>Mon, 21 Feb 2022 17:40:46 +0000</pubDate>
      <link>https://dev.to/cindyledev/my-20-time-spent-on-telescope-4e1f</link>
      <guid>https://dev.to/cindyledev/my-20-time-spent-on-telescope-4e1f</guid>
      <description>&lt;p&gt;I procrastinated a lot on this blog because I didn't know where to start, but anyway, I was assigned several tasks at work last year, which resulted in me writing a lot of documentation. One particular doc had to be read in order, from top to bottom, and I didn't want to split it into different docs... See what I'm trying to get at? I'm having problems organizing docs at work, and guess what other project was having the same problem? Telescope!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.cnbc.com/2021/12/16/google-20-percent-rule-shows-exactly-how-much-time-you-should-spend-learning-new-skills.html"&gt;Google has a '20% time' rule&lt;/a&gt; so I decided to use my time on Telescope.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“We encourage our employees, in addition to their regular projects, to spend 20% of their time working on what they think will most benefit Google,” founders Sergey Brin and Larry Page wrote in their IPO letter. “This empowers them to be more creative and innovative. Many of our significant advances [like AdSense and Google News] have happened in this manner.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I was eager to get started, so I went back to the age-old issue &lt;a href="https://github.com/Seneca-CDOT/telescope/issues/290"&gt;#290&lt;/a&gt; I filed years ago. I had to remind myself what had been completed for this issue because although I initially suggested using Docusaurus, we found out Gatsby.js supported adding markdown pages, so I started working on just the About page to have something similar to Docusaurus but use Gatsby plugins instead. Unfortunately, we were stuck on the design and ran out of time to complete it.&lt;/p&gt;

&lt;p&gt;When the 2.0 team was porting our Gatsby.js frontend to Next.js, we also found out that Next.js also supports MDX so &lt;a href="https://github.com/chrispinkney"&gt;Chris&lt;/a&gt; converted my work on the About page and implemented it in Next.js. &lt;/p&gt;

&lt;p&gt;Come Winter 2022, I decided to resurrect the issue and tried to convenience the team (mainly myself) that it would be fun. Of course, I didn't expect any interest in this because students typically want to write code and contribute to an area of their interest which is rarely maintaining documentation. &lt;/p&gt;

&lt;p&gt;I initially put up a &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/2776"&gt;PR&lt;/a&gt; that created a microservice for the docs using Next.js, MDX, and Tailwind CSS. Yes, this was my terrible attempt at getting Tailwind CSS into Telescope, but we already had a Next.js frontend, and it didn't make sense to have two Next.js projects to maintain. My &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/2794"&gt;second PR&lt;/a&gt; used Docusaurus, but I introduced too many parts, which made it extremely difficult to review. I added: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The Docusaurus project itself&lt;/li&gt;
&lt;li&gt;Dockerized it&lt;/li&gt;
&lt;li&gt;Attempted to hook it up to Traefik&lt;/li&gt;
&lt;li&gt;Attempted to hook it up to Nginx&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the end, it wasn't working as expected, so I made a &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/2853"&gt;third PR&lt;/a&gt;. Smaller PRs are easier to review and understand. Unfortunately, I got carried away with my second PR because I didn't want the Docusaurus feature to turn out like my Gatsby About page, where only one part of it was implemented, and the rest was unfinished.&lt;/p&gt;

&lt;p&gt;I had thought of an MVP for Docusaurus in my head, but now I'm gonna write it down here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Docusaurus website contains all the Telescope docs&lt;/li&gt;
&lt;li&gt;Docusaurus website is accessible on staging and production at &lt;a href="http://dev.telescope.cdot.systems/docs"&gt;http://dev.telescope.cdot.systems/docs&lt;/a&gt; and &lt;a href="http://telescope.cdot.systems/docs"&gt;http://telescope.cdot.systems/docs&lt;/a&gt;, respectively&lt;/li&gt;
&lt;li&gt;Each doc shows when the doc was last modified and by whom.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As you can see, we're already almost there. I also filed many &lt;code&gt;nice to have&lt;/code&gt; issues and was surprised at the number of contributors that rallied behind the Docusaurus feature. I try my best to keep the &lt;a href="https://github.com/orgs/Seneca-CDOT/projects/3"&gt;Docusaurus Project Board&lt;/a&gt; up to date because I could quickly lose track of everything since I didn't do all the work.&lt;/p&gt;

&lt;p&gt;For the 2.7 Release, we closed 20 issues and PRs related to Docusaurus! Thank you to our contributors, reviewers, and project board creator. In no particular order:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/cindyledev"&gt;cindyledev&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/sancodes"&gt;sancodes&lt;/a&gt; - First-time contributor on Telescope&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/menghif"&gt;menghif&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/humphd"&gt;humphd&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/tcvan0707"&gt;tcvan0707&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/dbelokon"&gt;dbelokon&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Kevan-Y"&gt;Kevan-Y&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/JerryHue"&gt;JerryHue&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/TueeNguyen"&gt;TueeNguyen&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/joelazwar"&gt;joelazwar&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/tpmai22"&gt;tpmai22&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/TDDR"&gt;TDDR&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/sirinoks"&gt;sirinoks&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>docusaurus</category>
      <category>docker</category>
      <category>opensource</category>
      <category>documentation</category>
    </item>
    <item>
      <title>Adding Job Type Filtering</title>
      <dc:creator>Cindy Le</dc:creator>
      <pubDate>Wed, 24 Nov 2021 15:50:42 +0000</pubDate>
      <link>https://dev.to/cindyledev/adding-job-type-filtering-4jp1</link>
      <guid>https://dev.to/cindyledev/adding-job-type-filtering-4jp1</guid>
      <description>&lt;h1&gt;
  
  
  ExamPro Markdown Lab Part 3
&lt;/h1&gt;

&lt;p&gt;This is part of the &lt;a href="https://www.exampro.co/"&gt;ExamPro&lt;/a&gt; Next.js course. Additional content will be added to this lab, such as pagination and job type filtering.&lt;/p&gt;

&lt;p&gt;In this lab, we will be adding the job type filtering feature to the existing application&lt;/p&gt;

&lt;h3&gt;
  
  
  Filter by Job Type: All, Full-Time, Part-Time Feature
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;localhost:3000/jobs/type/full-time&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eelmsjip--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://exampro-support.s3.amazonaws.com/Nextjs/job_listing_with_filtering.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eelmsjip--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://exampro-support.s3.amazonaws.com/Nextjs/job_listing_with_filtering.png" alt="" width="800" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create &lt;code&gt;pages/jobs/type/[type_name].js&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Import the following&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;promises&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;fs&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="s1"&gt;fs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;path&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;path&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;matter&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;gray-matter&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Job&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;@/components/jobs/Job&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;JobsHeader&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;@/components/jobs/JobsHeader&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Layout&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;@/components/Layout&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;ol&gt;
&lt;li&gt;Create the getStaticPaths() function
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;getStaticPaths&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Read from the /jobs directory&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;files&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;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;readdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;jobs&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;types&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;files&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&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;filename&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;markdown&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;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;readFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;jobs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;utf-8&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="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;matter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;markdown&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

      &lt;span class="c1"&gt;// Return the job types in lowercase. Eg. 'full-time' instead of 'Full-Time'&lt;/span&gt;
      &lt;span class="k"&gt;return&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;type&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toLowerCase&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;paths&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;types&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;params&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_name&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="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="nx"&gt;paths&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;fallback&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Create the getStaticProps() function
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// This function takes the type_name from getStaticPaths()&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;getStaticProps&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;params&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;type_name&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="c1"&gt;// Read from /jobs directory&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;files&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;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;readdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;jobs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

  &lt;span class="c1"&gt;// Map through jobs directory&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;jobs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;files&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&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;filename&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="c1"&gt;// Set 'slug' to name of md file&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;slug&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.md&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="p"&gt;);&lt;/span&gt;
      &lt;span class="c1"&gt;// Read all markdown from file&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;markdown&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;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;readFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;jobs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;utf-8&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="c1"&gt;// Extract data from markdown&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;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;matter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;markdown&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

      &lt;span class="c1"&gt;// return slug and data in an array&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;slug&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="p"&gt;};&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// Maps through all the job types&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;types&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;job&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;job&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="nx"&gt;type&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c1"&gt;// Only take the unique job types&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;uniqueTypes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;types&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;jobTypes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;job&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;job&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="nx"&gt;type&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;type_name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// return jobs, typeName, types&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;jobTypes&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;typeName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;type_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;types&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;uniqueTypes&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;ol&gt;
&lt;li&gt;Create &lt;code&gt;JobTypePostings()&lt;/code&gt; function
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;JobTypePostings&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;typeName&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;jobType&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;typeName&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="se"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;^|&lt;/span&gt;&lt;span class="se"&gt;[\s&lt;/span&gt;&lt;span class="sr"&gt;-&lt;/span&gt;&lt;span class="se"&gt;])\S&lt;/span&gt;&lt;span class="sr"&gt;/g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;match&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;match&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toUpperCase&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Layout&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Jobs | ExamPro&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;JobsHeader&lt;/span&gt; &lt;span class="nx"&gt;jobType&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;jobType&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bg-white my-4 shadow overflow-hidden divide-y divide-gray-200 sm:rounded-md&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ul&lt;/span&gt; &lt;span class="nx"&gt;role&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;list&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;divide-y divide-gray-200&lt;/span&gt;&lt;span class="dl"&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="cm"&gt;/* Maps through each job */&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;job&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;index&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Job&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;job&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;job&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;          &lt;span class="p"&gt;))}&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/ul&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Layout&lt;/span&gt;&lt;span class="err"&gt;&amp;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;
  
  
  Update the &lt;code&gt;[page_index].js&lt;/code&gt; file
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Import the JobsHeader component
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;JobsHeader&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;@/components/jobs/JobsHeader&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;ol&gt;
&lt;li&gt;Replace the following lines
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;px-4 py-4 sm:px-6 md:flex md:items-center md:justify-between&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;flex-1 min-w-0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h2&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-2xl font-bold leading-7 text-gray-900 sm:text-3xl sm:truncate&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nx"&gt;Job&lt;/span&gt; &lt;span class="nx"&gt;Postings&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h2&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;with&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;JobsHeader&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>nextjs</category>
      <category>tailwindcss</category>
      <category>markdown</category>
      <category>react</category>
    </item>
    <item>
      <title>Adding Pagination</title>
      <dc:creator>Cindy Le</dc:creator>
      <pubDate>Wed, 24 Nov 2021 15:46:18 +0000</pubDate>
      <link>https://dev.to/cindyledev/create-a-job-listing-using-nextjs-tailwindcss-and-markdown-2oh3</link>
      <guid>https://dev.to/cindyledev/create-a-job-listing-using-nextjs-tailwindcss-and-markdown-2oh3</guid>
      <description>&lt;h1&gt;
  
  
  ExamPro Markdown Lab Part 2
&lt;/h1&gt;

&lt;p&gt;This is part of the &lt;a href="https://www.exampro.co/" rel="noopener noreferrer"&gt;ExamPro&lt;/a&gt; Next.js course. Additional content will be added to this lab, such as pagination and job type filtering.&lt;/p&gt;

&lt;p&gt;In this lab, we will be adding the pagination feature to the existing application&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding Pagination Feature
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;http://localhost:3000/jobs&lt;/code&gt; would look like this:&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%2Fexampro-support.s3.amazonaws.com%2FNextjs%2Fjob_listing_with_pagination.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%2Fexampro-support.s3.amazonaws.com%2FNextjs%2Fjob_listing_with_pagination.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Config file
&lt;/h4&gt;

&lt;p&gt;This file will be used to set how many jobs will be displayed on one page&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create &lt;code&gt;./config/index.js&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;JOBS_PER_PAGE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Pagination Component
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Create &lt;code&gt;./components/jobs/Pagination.js&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Link&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;next/link&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ChevronLeftIcon&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ChevronRightIcon&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="s1"&gt;@heroicons/react/solid&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;JOBS_PER_PAGE&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="s1"&gt;@/config/index&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Pagination&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;currentPage&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;numJobs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;numPages&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;isFirst&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;currentPage&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;1&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;isLast&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;currentPage&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;numPages&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;prevPage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`/jobs/page/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;currentPage&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;nextPage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`/jobs/page/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;currentPage&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;firstJobOfPage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;parseInt&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;currentPage&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;JOBS_PER_PAGE&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&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;lastJobOfPage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;parseInt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;currentPage&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;JOBS_PER_PAGE&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="nx"&gt;numPages&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;;
&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bg-white px-4 py-3 flex items-center justify-between border-t border-gray-200 sm:px-6&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;flex-1 flex justify-between sm:hidden&lt;/span&gt;&lt;span class="dl"&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="cm"&gt;/* If not first page, display the Previous link */&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;isFirst&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Link&lt;/span&gt; &lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;prevPage&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
              &lt;span class="nx"&gt;Previous&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/a&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Link&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="p"&gt;)}&lt;/span&gt;

        &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="cm"&gt;/* If not last page, display the Next link */&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;isLast&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Link&lt;/span&gt; &lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;nextPage&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
              &lt;span class="nx"&gt;Next&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/a&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Link&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="p"&gt;)}&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hidden sm:flex-1 sm:flex sm:items-center sm:justify-between&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-sm text-gray-700&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nx"&gt;Showing&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;span&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;font-medium&lt;/span&gt;&lt;span class="dl"&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;firstJobOfPage&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/span&amp;gt; to{' '&lt;/span&gt;&lt;span class="err"&gt;}
&lt;/span&gt;            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;span&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;font-medium&lt;/span&gt;&lt;span class="dl"&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;lastJobOfPage&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;numJobs&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;numJobs&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;lastJobOfPage&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/span&amp;gt;{' '&lt;/span&gt;&lt;span class="err"&gt;}
&lt;/span&gt;            &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;span&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;font-medium&lt;/span&gt;&lt;span class="dl"&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;numJobs&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/span&amp;gt; result&lt;/span&gt;&lt;span class="err"&gt;s
&lt;/span&gt;          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;nav&lt;/span&gt;
            &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;relative z-0 inline-flex rounded-md shadow-sm -space-x-px&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="nx"&gt;aria&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;label&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Pagination&lt;/span&gt;&lt;span class="dl"&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="cm"&gt;/* If not first page, display the Previous link */&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;isFirst&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
              &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Link&lt;/span&gt; &lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;prevPage&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;span&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sr-only&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Previous&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/span&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;                  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ChevronLeftIcon&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;h-5 w-5&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;aria&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;hidden&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;true&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/a&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;              &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Link&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;            &lt;span class="p"&gt;)}&lt;/span&gt;

            &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="cm"&gt;/* Loop through numPages array */&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;length&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;numPages&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;i&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;list-none&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Link&lt;/span&gt; &lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;`/jobs/page/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&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;passHref&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;i&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="nx"&gt;currentPage&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&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;lt;&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;
                      &lt;span class="nx"&gt;aria&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;page&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                      &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;z-10 bg-orange-50 border-orange-400 text-orange-500 relative inline-flex items-center px-4 py-2 border text-sm font-medium&lt;/span&gt;&lt;span class="dl"&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;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
                    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/a&lt;/span&gt;&lt;span class="err"&gt;&amp;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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium&lt;/span&gt;&lt;span class="dl"&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;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
                    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/a&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;                  &lt;span class="p"&gt;)}&lt;/span&gt;
                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Link&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;              &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/li&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;            &lt;span class="p"&gt;))}&lt;/span&gt;

            &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="cm"&gt;/* If not last page, display the Next link */&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;isLast&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
              &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Link&lt;/span&gt; &lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;nextPage&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;span&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sr-only&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Next&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/span&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;                  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ChevronRightIcon&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;h-5 w-5&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;aria&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;hidden&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;true&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/a&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;              &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Link&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;            &lt;span class="p"&gt;)}&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/nav&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;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 add pagination, we need a new dynamic route for our job listings.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create &lt;code&gt;pages/jobs/page/[page_index].js&lt;/code&gt; file&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Import fs and path modules&lt;/li&gt;
&lt;li&gt;Import matter&lt;/li&gt;
&lt;li&gt;Import Job component&lt;/li&gt;
&lt;li&gt;Import Layout component&lt;/li&gt;
&lt;li&gt;Import Pagination
&lt;/li&gt;
&lt;/ul&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;promises&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;fs&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="s1"&gt;fs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;path&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;path&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;matter&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;gray-matter&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;JOBS_PER_PAGE&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="s1"&gt;@/config/index&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Job&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;@/components/jobs/Job&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Layout&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;@/components/Layout&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Pagination&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;@/components/jobs/Pagination&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;ol&gt;
&lt;li&gt;Create getStaticPaths() function
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&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;getStaticPaths&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Read from the /jobs directory&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;files&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;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;jobs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="c1"&gt;// Get the number of files and divide by JOBS_PER_PAGE then round up&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;numPages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ceil&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;files&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;JOBS_PER_PAGE&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;paths&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;

  &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="nx"&gt;numPages&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&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;paths&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;params&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;page_index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toString&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="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;paths&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;fallback&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Create getStaticProps() function
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&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;getStaticProps&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;params&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;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;parseInt&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;page_index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// Read from /jobs directory&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;files&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;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;jobs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

  &lt;span class="c1"&gt;// Map through jobs directory&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;jobs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;files&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filename&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="c1"&gt;// Set 'slug' to name of md file&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;slug&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.md&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="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// Read all markdown from file&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;markdown&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;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;jobs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;utf-8&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// Extract data from markdown&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;data&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;matter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;markdown&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// return slug and data in an array&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;slug&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="p"&gt;};&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="c1"&gt;// Get total number of jobs&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;numJobs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;files&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c1"&gt;// Get the number of files and divide by JOBS_PER_PAGE then round up&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;numPages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ceil&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;files&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;JOBS_PER_PAGE&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c1"&gt;// Get the page index&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pageIndex&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c1"&gt;// Display only the number of jobs based on JOBS_PER_PAGE&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;displayJobs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;jobs&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="nx"&gt;pageIndex&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;JOBS_PER_PAGE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pageIndex&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;JOBS_PER_PAGE&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;displayJobs&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="nx"&gt;numJobs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nx"&gt;numPages&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;currentPage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;page&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;ol&gt;
&lt;li&gt;Create the JobPostings() function
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;JobPostings&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;numJobs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;numPages&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;currentPage&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Layout&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Jobs | ExamPro&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;px-4 py-4 sm:px-6 md:flex md:items-center md:justify-between&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;flex-1 min-w-0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h2&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-2xl font-bold leading-7 text-gray-900 sm:text-3xl sm:truncate&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nx"&gt;Job&lt;/span&gt; &lt;span class="nx"&gt;Postings&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h2&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bg-white my-4 shadow overflow-hidden divide-y divide-gray-200 sm:rounded-md&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ul&lt;/span&gt; &lt;span class="nx"&gt;role&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;list&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;divide-y divide-gray-200&lt;/span&gt;&lt;span class="dl"&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="cm"&gt;/* Maps through each job */&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;job&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;index&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Job&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;job&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;job&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;          &lt;span class="p"&gt;))}&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/ul&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Pagination&lt;/span&gt; &lt;span class="nx"&gt;currentPage&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;currentPage&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;numJobs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;numJobs&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;numPages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;numPages&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Layout&lt;/span&gt;&lt;span class="err"&gt;&amp;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;ol&gt;
&lt;li&gt;Since we most of the same functionality in &lt;code&gt;pages/jobs/index.js&lt;/code&gt; and &lt;code&gt;pages/jobs/page/[page_index.js]&lt;/code&gt;, we can just delete everything in &lt;code&gt;pages/jobs/index.js&lt;/code&gt; import like so:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;getStaticProps&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="s1"&gt;./page/[page_index]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;JobPostings&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;./page/[page_index]&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="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;getStaticProps&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="nx"&gt;JobPostings&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>nextjs</category>
      <category>tailwindcss</category>
      <category>markdown</category>
      <category>react</category>
    </item>
    <item>
      <title>Creating the Basic Job Listing</title>
      <dc:creator>Cindy Le</dc:creator>
      <pubDate>Sat, 20 Nov 2021 01:19:06 +0000</pubDate>
      <link>https://dev.to/cindyledev/create-a-job-listing-using-nextjs-tailwindcss-and-markdown-4kf0</link>
      <guid>https://dev.to/cindyledev/create-a-job-listing-using-nextjs-tailwindcss-and-markdown-4kf0</guid>
      <description>&lt;h1&gt;
  
  
  ExamPro Markdown Lab Part 1
&lt;/h1&gt;

&lt;p&gt;This is part of the &lt;a href="https://www.exampro.co/"&gt;ExamPro&lt;/a&gt; Next.js course. &lt;a href="https://exampro-markdown.vercel.app/"&gt;Preview of complete lab deployed on Vercel&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this lab, we will be creating the Job Listings portion of ExamPro using the following stack:&lt;/p&gt;

&lt;h2&gt;
  
  
  Technology Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Node.js (12.22.0 or later)&lt;/li&gt;
&lt;li&gt;Next.js (12.0.4)&lt;/li&gt;
&lt;li&gt;React (17.0.2)&lt;/li&gt;
&lt;li&gt;TailwindCSS (3.0.0)&lt;/li&gt;
&lt;li&gt;gray-matter (4.0.3)&lt;/li&gt;
&lt;li&gt;marked (4.0.3)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Application Screenshots
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;localhost:3000/jobs/&lt;/code&gt; display a list of all jobs&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SdvJZvmE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://exampro-support.s3.amazonaws.com/Nextjs/list_of_all_jobs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SdvJZvmE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://exampro-support.s3.amazonaws.com/Nextjs/list_of_all_jobs.png" alt="" width="800" height="555"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;localhost:3000/jobs/[slug]&lt;/code&gt; displays individual jobs&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yBoBRIJU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://exampro-support.s3.amazonaws.com/Nextjs/individual_job_listing.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yBoBRIJU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://exampro-support.s3.amazonaws.com/Nextjs/individual_job_listing.png" alt="" width="800" height="832"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;You may choose to start a new repository or continue with the current &lt;code&gt;exampro-nextjs&lt;/code&gt; project&lt;/p&gt;

&lt;p&gt;If you're starting from scratch, proceed to Step 1.&lt;/p&gt;
&lt;h3&gt;
  
  
  Setting Up Next.js
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Create a new Next.js app called &lt;code&gt;exampro-markdown&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx create-next-app@latest exampro-markdown
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Change to the &lt;code&gt;exampro-markdown&lt;/code&gt; directory
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;exampro-markdown
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Setting Up TailwindCSS
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Install TailwindCSS, its peer-dependencies, plugins, and other Tailwind Labs tools
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-D&lt;/span&gt; tailwindcss@latest postcss@latest autoprefixer@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @headlessui/react @heroicons/react
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Initialize your Tailwind configuration files
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx tailwindcss init &lt;span class="nt"&gt;-p&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Include Tailwind in your CSS by replacing the original content with the following lines in your &lt;code&gt;./styles/globals.css&lt;/code&gt; file
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@tailwind&lt;/span&gt; &lt;span class="n"&gt;base&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@tailwind&lt;/span&gt; &lt;span class="n"&gt;components&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@tailwind&lt;/span&gt; &lt;span class="n"&gt;utilities&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;In &lt;code&gt;tailwind.config.js&lt;/code&gt;, add &lt;code&gt;orange&lt;/code&gt; to your colors by adding the following line at the top of the file
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;colors&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;tailwindcss/colors&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;and extending the color palette to including &lt;code&gt;orange&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="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./components/**/*.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./pages/**/*.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;colors&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;orange&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;colors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;orange&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="na"&gt;variants&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;extend&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;plugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Setting Up &lt;a href="https://prettier.io/docs/en/install.html"&gt;Prettier and Husky&lt;/a&gt; Hooks (optional)
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Install Prettier, Husky, and lint-staged
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--save-dev&lt;/span&gt; &lt;span class="nt"&gt;--save-exact&lt;/span&gt; prettier
npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--save-dev&lt;/span&gt; husky lint-staged
npx husky &lt;span class="nb"&gt;install
&lt;/span&gt;npm set-script prepare &lt;span class="s2"&gt;"husky install"&lt;/span&gt;
npx husky add .husky/pre-commit &lt;span class="s2"&gt;"npx lint-staged"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Create &lt;code&gt;.prettierrc.json&lt;/code&gt; in the root directory
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"arrowParens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"always"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"bracketSpacing"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"embeddedLanguageFormatting"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"auto"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"endOfLine"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"lf"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"htmlWhitespaceSensitivity"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"css"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"insertPragma"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"bracketSameLine"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"jsxSingleQuote"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"proseWrap"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"preserve"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"quoteProps"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"as-needed"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"requirePragma"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"singleQuote"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tabWidth"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"trailingComma"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"es5"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"useTabs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"vueIndentScriptAndStyle"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"printWidth"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Create &lt;code&gt;.prettierignore&lt;/code&gt; in the root directory
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package.json
package-lock.json
node_modules/
.cache
.next
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;In the &lt;code&gt;package.json&lt;/code&gt;, add the following scripts and lint-staged:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"prettier"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"prettier --write &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;./**/*.{md,json,html,css,js,yml}&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"prettier-check"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"prettier --check &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;./**/*.{md,json,html,css,js,yml}&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"lint-staged"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"**/*"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"prettier --write --ignore-unknown"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Install gray-matter and marked
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--save&lt;/span&gt; gray-matter
npm &lt;span class="nb"&gt;install &lt;/span&gt;marked
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Removing unnecessary file and code
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Delete the &lt;code&gt;styles/Home.module.css&lt;/code&gt; file&lt;/li&gt;
&lt;li&gt;Remove everything inside the parent &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; element in &lt;code&gt;./pages/index.js&lt;/code&gt; and the &lt;code&gt;import&lt;/code&gt; lines
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Head&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;next/head&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;Image&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;next/image&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;styles&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;../styles/Home.module.css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Setting up &lt;a href="https://code.visualstudio.com/docs/languages/jsconfig"&gt;&lt;code&gt;jsconfig.json&lt;/code&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;This specifies path mapping to be computed relative to baseUrl option.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create &lt;code&gt;jsconfig.json&lt;/code&gt; file
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"compilerOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"module"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"commonjs"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"target"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"es6"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"baseUrl"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"paths"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"@/components/*"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"components/*"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"@/config/*"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"config/*"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"@/styles/*"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"styles/*"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Using provided components and stylesheets
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Copy the following components and stylesheet into your project. These are React components that have been styled using TailwindCSS. &lt;code&gt;Markdown.module.css&lt;/code&gt; is used to style the Markdown content&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Footer from &lt;code&gt;./components/Footer.js&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Header from &lt;code&gt;./components/Header.js&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Layout from &lt;code&gt;./components/Layout.js&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Main from &lt;code&gt;./components/Main.js&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Job from &lt;code&gt;./components/jobs/Job.js&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;JobsHeader from &lt;code&gt;./components/jobs/JobsHeader.js&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;TypeLabel from &lt;code&gt;./components/jobs/TypeLabel.js&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;TypeList from &lt;code&gt;./components/jobs/TypeList.js&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;./styles/Markdown.module.css&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Update the &lt;code&gt;./pages/index.js&lt;/code&gt; file to include the Layout and Main components
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Main&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;@/components/Main&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Layout&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;@/components/Layout&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="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;Home&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Layout&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Main&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Layout&lt;/span&gt;&lt;span class="err"&gt;&amp;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;ol&gt;
&lt;li&gt;Run &lt;code&gt;npm run dev&lt;/code&gt; to start the server, you should see
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--L45m1teX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://exampro-support.s3.amazonaws.com/Nextjs/starting_app.png" alt="" width="800" height="398"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Markdown Implementation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Job Postings
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Create &lt;code&gt;/jobs&lt;/code&gt; directory and fill it with job postings in markdown (&lt;code&gt;.md&lt;/code&gt; files).&lt;/li&gt;
&lt;li&gt;You can copy the &lt;code&gt;.md&lt;/code&gt; files in the &lt;code&gt;/jobs&lt;/code&gt; of the repository or create your own using &lt;a href="https://jaspervdj.be/lorem-markdownum/"&gt;Lorem Markdownum&lt;/a&gt;. Make sure to include frontmatter above your markdown. Frontmatter looks like:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Cloud&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Support&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Engineer'&lt;/span&gt;
&lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Part-Time'&lt;/span&gt;
&lt;span class="na"&gt;location&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Remote'&lt;/span&gt;
&lt;span class="na"&gt;category&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Operations,&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;IT&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;and&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Support&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Engineering'&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  JobPostings Component (Page component that shows list of all jobs)
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Create &lt;code&gt;pages/jobs/index.js&lt;/code&gt; file&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Import the &lt;code&gt;fs&lt;/code&gt; and &lt;code&gt;path&lt;/code&gt; modules&lt;/li&gt;
&lt;li&gt;Import &lt;code&gt;matter&lt;/code&gt; from &lt;code&gt;gray-matter&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Import the Job Component&lt;/li&gt;
&lt;li&gt;Import the Layout component
&lt;/li&gt;
&lt;/ul&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;promises&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;fs&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="s1"&gt;fs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;path&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;path&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;matter&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;gray-matter&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Job&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;@/components/jobs/Job&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Layout&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;@/components/Layout&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;ol&gt;
&lt;li&gt;Create the getStaticProps() function
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;getStaticProps&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Read from /jobs directory&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;files&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;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;readdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;jobs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

  &lt;span class="c1"&gt;// Map through jobs directory&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;jobs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;files&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&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;filename&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="c1"&gt;// Set 'slug' to name of md file&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;slug&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.md&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="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// Read all markdown from file&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;markdown&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;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;readFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;jobs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;utf-8&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// Extract data from markdown&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;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;matter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;markdown&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// return slug and data in an array&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;slug&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="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="na"&gt;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;jobs&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;ol&gt;
&lt;li&gt;Your &lt;code&gt;JobPostings()&lt;/code&gt; function will take the &lt;code&gt;jobs&lt;/code&gt; prop from the &lt;code&gt;getStaticProps()&lt;/code&gt; function and map through each of the job markdown files in &lt;code&gt;/jobs&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Takes the `jobs` prop from the getStaticProps() function&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;JobPostings&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;jobs&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Layout&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Jobs | ExamPro&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;px-4 py-4 sm:px-6 md:flex md:items-center md:justify-between&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;flex-1 min-w-0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h2&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-2xl font-bold leading-7 text-gray-900 sm:text-3xl sm:truncate&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nx"&gt;Job&lt;/span&gt; &lt;span class="nx"&gt;Postings&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h2&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bg-white my-4 shadow overflow-hidden divide-y divide-gray-200 sm:rounded-md&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ul&lt;/span&gt; &lt;span class="nx"&gt;role&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;list&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;divide-y divide-gray-200&lt;/span&gt;&lt;span class="dl"&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="cm"&gt;/* Maps through each job */&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;job&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;index&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Job&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;job&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;job&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;          &lt;span class="p"&gt;))}&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/ul&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Layout&lt;/span&gt;&lt;span class="err"&gt;&amp;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;
  
  
  Markdown Component (For parsing markdown)
&lt;/h4&gt;

&lt;p&gt;This component handles the parsing of the markdown content to html so we can style it using Markdown.module.css&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create &lt;code&gt;./components/Markdown.js&lt;/code&gt; file
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;marked&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="s1"&gt;marked&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;styles&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;@/styles/Markdown.module.css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Takes content (for example from ./pages/jobs/[slug].js)&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;Markdown&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;content&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="c1"&gt;// Uses marked to parse markdown to html&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;styles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;markdown&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;dangerouslySetInnerHTML&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="na"&gt;__html&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;marked&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;content&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;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;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;
  
  
  JobPage Component (Individual job posting)
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Create &lt;code&gt;./pages/jobs/[slug].js&lt;/code&gt; file&lt;/li&gt;
&lt;li&gt;Import the following
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;promises&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;fs&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="s1"&gt;fs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;path&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;path&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Link&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;next/link&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;matter&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;gray-matter&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;BriefcaseIcon&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;LocationMarkerIcon&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;UsersIcon&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="s1"&gt;@heroicons/react/solid&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Markdown&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;@/components/Markdown&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Layout&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;@/components/Layout&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;ol&gt;
&lt;li&gt;Create a getStaticPaths() function
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;getStaticPaths&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Read from the /jobs directory&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;files&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;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;readdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;jobs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="c1"&gt;// Map through the files&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;paths&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;files&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&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;filename&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="na"&gt;params&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Create a slug using the name of the file without the .md extension at the end&lt;/span&gt;
        &lt;span class="na"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.md&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="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="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;paths&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;fallback&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Create a getStaticProps() function
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// This function takes the slug from getStaticPaths()&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;getStaticProps&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;params&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;slug&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="c1"&gt;// Read file with name of slug + .md extension in the /jobs directory&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;markdown&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;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;readFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;jobs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;slug&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.md&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;utf-8&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c1"&gt;// Use `matter` to extract the content and data from each file&lt;/span&gt;
  &lt;span class="c1"&gt;// content is the body of the markdown file&lt;/span&gt;
  &lt;span class="c1"&gt;// data is the frontmatter of the markdown file&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;content&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;matter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;markdown&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// Return content, data, and slug as props&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;content&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="nx"&gt;slug&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;ol&gt;
&lt;li&gt;Your JobPage() function will take &lt;code&gt;content&lt;/code&gt; and &lt;code&gt;data&lt;/code&gt; as props from getStaticProps() and will display them as React Components
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;JobPage&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;content&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="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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Layout&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&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;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; | ExamPro`&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;px-4 py-4 sm:px-6 md:flex md:items-center md:justify-between lg:flex lg:items-center lg:justify-between&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;flex-1 min-w-0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h2&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-2xl font-bold leading-7 text-gray-900 sm:text-3xl sm:truncate&lt;/span&gt;&lt;span class="dl"&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;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h2&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mt-1 flex flex-col sm:flex-row sm:flex-wrap sm:mt-0 sm:space-x-6&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mt-2 flex items-center text-sm text-gray-500&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
              &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;UsersIcon&lt;/span&gt;
                &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;flex-shrink-0 mr-1.5 h-5 w-5 text-gray-400&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                &lt;span class="nx"&gt;aria&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;hidden&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;true&lt;/span&gt;&lt;span class="dl"&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;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;category&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mt-2 flex items-center text-sm text-gray-500&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
              &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;LocationMarkerIcon&lt;/span&gt;
                &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;flex-shrink-0 mr-1.5 h-5 w-5 text-gray-400&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                &lt;span class="nx"&gt;aria&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;hidden&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;true&lt;/span&gt;&lt;span class="dl"&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;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mt-2 flex items-center text-sm text-gray-500&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
              &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;BriefcaseIcon&lt;/span&gt;
                &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;flex-shrink-0 mr-1.5 h-5 w-5 text-gray-400&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                &lt;span class="nx"&gt;aria&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;hidden&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;true&lt;/span&gt;&lt;span class="dl"&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;data&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mt-5 flex lg:mt-0 lg:ml-4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;span&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sm:ml-3&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Link&lt;/span&gt; &lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/jobs&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;passHref&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
              &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt;
                &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;button&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;inline-flex items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-orange-500 hover:bg-orange-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-orange-400&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
              &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="nx"&gt;Back&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;Jobs&lt;/span&gt;
              &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Link&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/span&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Markdown&lt;/span&gt; &lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Layout&lt;/span&gt;&lt;span class="err"&gt;&amp;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;



</description>
      <category>nextjs</category>
      <category>tailwindcss</category>
      <category>markdown</category>
      <category>react</category>
    </item>
    <item>
      <title>Remote Development using SSH with Visual Studio Code on an AWS EC2 instance</title>
      <dc:creator>Cindy Le</dc:creator>
      <pubDate>Sat, 13 Nov 2021 00:05:40 +0000</pubDate>
      <link>https://dev.to/cindyledev/remote-development-using-ssh-with-visual-studio-code-on-an-aws-ec2-instance-2fel</link>
      <guid>https://dev.to/cindyledev/remote-development-using-ssh-with-visual-studio-code-on-an-aws-ec2-instance-2fel</guid>
      <description>&lt;p&gt;The following will show you how to create and connect to a virtual machine (VM) on AWS using the Visual Studio Code &lt;a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh" rel="noopener noreferrer"&gt;Remote - SSH&lt;/a&gt; extension. You'll be able to run Telescope in development on a remote machine with VS Code just like if the source code was local. This documentation is based on &lt;a href="https://code.visualstudio.com/docs/remote/ssh-tutorial" rel="noopener noreferrer"&gt;Remote development over SSH&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://telescope.cdot.systems/" rel="noopener noreferrer"&gt;Telescope&lt;/a&gt; is a tool for tracking blogs around Seneca's open source develop. The application itself has many microservices that use Docker containers and are composed together using Docker-Compose. You can find the GitHub repo &lt;a href="https://github.com/Seneca-CDOT/telescope" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Telescope Tech Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Next.js&lt;/li&gt;
&lt;li&gt;Material UI&lt;/li&gt;
&lt;li&gt;Node.js&lt;/li&gt;
&lt;li&gt;Elasticsearch&lt;/li&gt;
&lt;li&gt;Redis&lt;/li&gt;
&lt;li&gt;Traefik&lt;/li&gt;
&lt;li&gt;Firebase&lt;/li&gt;
&lt;li&gt;Jest&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Telescope Microservices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Auth&lt;/li&gt;
&lt;li&gt;Feed-Discovery&lt;/li&gt;
&lt;li&gt;Image&lt;/li&gt;
&lt;li&gt;Parser&lt;/li&gt;
&lt;li&gt;Planet&lt;/li&gt;
&lt;li&gt;Posts&lt;/li&gt;
&lt;li&gt;Search&lt;/li&gt;
&lt;li&gt;Status&lt;/li&gt;
&lt;li&gt;Users&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Disclaimer&lt;/strong&gt;: The EC2 instance used in this guide is not within AWS's Free-Tier so please see &lt;a href="https://aws.amazon.com/ec2/pricing/on-demand/" rel="noopener noreferrer"&gt;EC2 Pricing&lt;/a&gt; to see if you're comfortable with these costs. Running Docker in development is CPU intensive so these are the EC2 instances I recommend:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Minimum: &lt;code&gt;t2.medium (4 GiB RAM + 2 vCPU)&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Recommended: &lt;code&gt;t2.large (8 GiB RAM + 2 vCPU)&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Summary of Pricing&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;t2.medium costs \$0.0464 per hour&lt;/li&gt;
&lt;li&gt;t2.large costs \$0.0928 per hour&lt;/li&gt;
&lt;li&gt;30GB Amazon Elastic Block Storage (EBS) costs \$3 per month&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cost Estimate Per Month&lt;/strong&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;t2.medium&lt;/th&gt;
&lt;th&gt;t2.large&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Cost per hour&lt;/td&gt;
&lt;td&gt;\$0.0464&lt;/td&gt;
&lt;td&gt;\$0.0928&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hours per day&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Days per month&lt;/td&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sub-total&lt;/td&gt;
&lt;td&gt;\$11.14&lt;/td&gt;
&lt;td&gt;\$22.27&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;30GB EBS Volume&lt;/td&gt;
&lt;td&gt;\$3&lt;/td&gt;
&lt;td&gt;\$3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total&lt;/td&gt;
&lt;td&gt;\$14.14&lt;/td&gt;
&lt;td&gt;\$25.27&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

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

&lt;ul&gt;
&lt;li&gt;Download and install &lt;a href="https://code.visualstudio.com/download" rel="noopener noreferrer"&gt;Visual Studio Code&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Install the &lt;a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh" rel="noopener noreferrer"&gt;Remote - SSH&lt;/a&gt; extension&lt;/li&gt;
&lt;li&gt;Create an &lt;a href="https://aws.amazon.com/" rel="noopener noreferrer"&gt;AWS Account&lt;/a&gt;. You can watch this &lt;a href="https://www.youtube.com/watch?v=3hLmDS179YE&amp;amp;t=10552s" rel="noopener noreferrer"&gt;part&lt;/a&gt; of the AWS Certified Cloud Practitioner course on creating an account if you need help.&lt;/li&gt;
&lt;li&gt;Create an IAM user with administrative privileges. You will need your &lt;code&gt;AWS_ACCESS_KEY_ID&lt;/code&gt; and &lt;code&gt;AWS_SECRET_ACCESS_KEY&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Sign into your AWS Account using your IAM user&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Create your virtual machine (AWS EC2):
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;In the upper-right hand corner of your AWS Management Console, select &lt;code&gt;US East (Ohio) us-east-2&lt;/code&gt; as your &lt;code&gt;Region&lt;/code&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Faws-cloud9%2F2021-10-26%2B09_08_11-.png"&gt;
&lt;/li&gt;
&lt;li&gt;In the upper-left hand corner of your AWS Management Console, click on &lt;code&gt;Services&lt;/code&gt;. This will bring up a list of AWS Services, search for &lt;code&gt;EC2&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;Launch instances&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Step 1 - Choose an Amazon Machine Image (AMI): &lt;code&gt;Ubuntu Server 20.04 LTS (HVM), SSD Volume Type&lt;/code&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B12_47_51-vscode-ssh.md%2B-%2Btelescope%2B-%2BVisual%2BStudio%2BCode.png"&gt;
&lt;/li&gt;
&lt;li&gt;Step 2 - Choose an Instance Type: &lt;code&gt;t2.medium&lt;/code&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B12_49_07-vscode-ssh.md%2B-%2Btelescope%2B-%2BVisual%2BStudio%2BCode.png"&gt;
&lt;/li&gt;
&lt;li&gt;Step 3 - Configure Instance Details: Accept the defaults and proceed to the next step&lt;/li&gt;
&lt;li&gt;Step 4 - Add Storage: Change the Size (GiB) from &lt;code&gt;8&lt;/code&gt; to &lt;code&gt;20&lt;/code&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B12_51_25-vscode-ssh.md%2B-%2Btelescope%2B-%2BVisual%2BStudio%2BCode.png"&gt;
&lt;/li&gt;
&lt;li&gt;Step 5 - Add Tags: No tags are needed. Proceed to the next step.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Step 6 - Configure Security Group:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Assign a security group: &lt;code&gt;Create a new security group&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Security group name: &lt;code&gt;telescope-sg&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add the following Rules:&lt;/li&gt;
&lt;li&gt;SSH for your IP address&lt;/li&gt;
&lt;li&gt;Type: &lt;code&gt;SSH&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Protocol: &lt;code&gt;TCP&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Port Range: &lt;code&gt;22&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Source: &lt;code&gt;My IP&lt;/code&gt; (When you select this from the dropdown menu, it will automatically put &lt;code&gt;&amp;lt;your-ip-address&amp;gt;/32&lt;/code&gt; in the field. For example &lt;code&gt;76.72.29.150/32&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Open port 3000 for your IP address&lt;/li&gt;
&lt;li&gt;Type: &lt;code&gt;Custom TCP&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Protocol: &lt;code&gt;TCP&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Port Range: &lt;code&gt;3000&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Source: &lt;code&gt;My IP&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Open port 8000 for your IP address&lt;/li&gt;
&lt;li&gt;Type: &lt;code&gt;Custom TCP&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Protocol: &lt;code&gt;TCP&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Port Range: &lt;code&gt;8000&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Source: &lt;code&gt;My IP&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Open port 8000 for your IP address&lt;/li&gt;
&lt;li&gt;Type: &lt;code&gt;Custom TCP&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Protocol: &lt;code&gt;TCP&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Port Range: &lt;code&gt;8443&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Source: &lt;code&gt;My IP&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B12_54_12-vscode-ssh.md%2B-%2Btelescope%2B-%2BVisual%2BStudio%2BCode.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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B12_54_12-vscode-ssh.md%2B-%2Btelescope%2B-%2BVisual%2BStudio%2BCode.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on &lt;code&gt;Review and Launch&lt;/code&gt;. You will get a warning: &lt;code&gt;Your instance configuration is not eligible for the free usage tier&lt;/code&gt;, this is because we're using a &lt;code&gt;t2.medium&lt;/code&gt; instance type.&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;Launch&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;In the pop-up, choose &lt;code&gt;Create a new key pair&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Key pair type: &lt;code&gt;RSA&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Key pair name: &lt;code&gt;telescope-dev-key&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Click on &lt;code&gt;Download Key Pair&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;If you're using Windows, save the file in the &lt;code&gt;.ssh&lt;/code&gt; directory in your user profile folder (for example &lt;code&gt;C:/Users/cindy/.ssh/&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;Launch Instances&lt;/code&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B12_57_01-Launch%2Binstance%2Bwizard%2B_%2BEC2%2BManagement%2BConsole%2B%25E2%2580%2594%2BMozilla%2BFirefox.png"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It will take a few minutes for AWS to launch your new EC2 instance.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Once your EC2 instance has been launched, you should name it something meaningful like &lt;code&gt;Telescope-Dev&lt;/code&gt; and you can find your EC2 instance's public IPv4 address. Make note of this IP address.
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B14_05_35-Preview%2Bvscode-ssh.md%2B-%2Btelescope%2B-%2BVisual%2BStudio%2BCode.png"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Connect using SSH
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open up Visual Studio Code&lt;/li&gt;
&lt;li&gt;Click on the &lt;code&gt;Open a Remote Window&lt;/code&gt; icon at the bottom left-hand corner of the window
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B13_11_22-.png"&gt;
&lt;/li&gt;
&lt;li&gt;Select &lt;code&gt;Connect to Host&lt;/code&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B13_12_53-Get%2BStarted%2B-%2BVisual%2BStudio%2BCode.png"&gt;
&lt;/li&gt;
&lt;li&gt;Select &lt;code&gt;Configure SSH Hosts...&lt;/code&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B13_14_34-Visual%2BStudio%2BCode.png"&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This will open up a &lt;code&gt;config&lt;/code&gt; file in Visual Studio Code. If you're using Windows, it'll be something like &lt;code&gt;C:/Users/cindy/.ssh/config&lt;/code&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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B13_15_09-Visual%2BStudio%2BCode.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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B13_15_09-Visual%2BStudio%2BCode.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Edit the &lt;code&gt;config&lt;/code&gt; file with the following:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Host aws-ec2
    HostName &amp;lt;your-ec2-ip-address&amp;gt;
    User ubuntu
    IdentityFile ~/.ssh/telescope-dev-key.pem
&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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B14_02_31-config%2B-%2Btelescope%2B-%2BVisual%2BStudio%2BCode.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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B14_02_31-config%2B-%2Btelescope%2B-%2BVisual%2BStudio%2BCode.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Save the file&lt;/li&gt;
&lt;li&gt;When you click on the &lt;code&gt;Open a Remote Window&lt;/code&gt; icon at the bottom left-hand corner again and choose &lt;code&gt;Connect to Host&lt;/code&gt;, you will see &lt;code&gt;aws-ec2&lt;/code&gt; listed.&lt;/li&gt;
&lt;li&gt;Select &lt;code&gt;aws-ec2&lt;/code&gt; and a new Visual Studio Code window will open.
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B13_23_08-config%2B-%2BVisual%2BStudio%2BCode.png"&gt;
&lt;/li&gt;
&lt;li&gt;You will see &lt;code&gt;"aws-ec2" has fingerprint "SHA256:xxx"&lt;/code&gt; and &lt;code&gt;Are you sure you want to continue?&lt;/code&gt;. Click on &lt;code&gt;Continue&lt;/code&gt;. Then You should see that you're connected!
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B13_56_54-Get%2BStarted%2B-%2BVisual%2BStudio%2BCode.png"&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B13_58_26-.png"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Setting up your AWS credentials
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open up a terminal in Visual Studio Code (hotkey on Windows: &lt;code&gt;Ctrl + backtick&lt;/code&gt;). You should see that you're logged in as something like &lt;code&gt;ubuntu@ip-172.31.23.4&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install &lt;code&gt;unzip&lt;/code&gt;. We will need this to install the AWS CLI&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo apt install unzip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Install the latest version of the AWS CLI
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Verify the AWS CLI installation
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ aws --version

aws-cli/2.3.0 Python/3.8.8 Linux/5.4.0-1045-aws exe/x86_64.ubuntu.20 prompt/off
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Remove the &lt;code&gt;awscliv2.zip&lt;/code&gt; file and &lt;code&gt;aws&lt;/code&gt; directory
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rm awscliv2.zip
rm -rf aws
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Configure your AWS credentials
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws configure
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Currently, everything is set as None so enter your credentials for your AWS IAM user.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;AWS Access Key ID [None]: ****************764G
AWS Secret Access Key [None]: ****************qBbe
Default region name [None]: us-east-2
Default output format [None]:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Installing Docker and Docker-Compose
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Install Docker Engine - Community Edition
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Update the apt package index:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Install packages to allow apt to use a repository over HTTPS:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install \
    ca-certificates \
    curl \
    gnupg \
    lsb-release
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Add Docker’s official GPG key:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Use the following command to set up the stable repository:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list &amp;gt; /dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Update the apt package index again:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Install the latest version of Docker Engine community:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install docker-ce docker-ce-cli containerd.io
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Add your user to the Docker group (&lt;a href="https://docs.docker.com/install/linux/linux-postinstall/" rel="noopener noreferrer"&gt;source&lt;/a&gt;):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo usermod -aG docker $USER
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Activate the changes to groupss
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;newgrp docker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Now run docker as a service on your machine, on startup:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Enable docker on startup: &lt;code&gt;sudo systemctl enable docker&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Disable docker on startup: &lt;code&gt;sudo systemctl disable docker&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Install Docker-Compose
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Run to download the current stable version of Docker-Compose:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Apply executable permissions to the downloaded file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo chmod +x /usr/local/bin/docker-compose
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Check installation using:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ docker-compose --version

docker-compose version 1.29.2, build 5becea4c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Install Node.js and npm
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Install Node.js 16.x and npm 8.1
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Verify installation
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ node -v
v16.12.0

$ npm -v
8.1.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Setting up the Telescope repository in AWS EC2:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Clone the Telescope repository and name the remote &lt;code&gt;upstream&lt;/code&gt; by entering
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone -o upstream https://github.com/Seneca-CDOT/telescope.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open the &lt;code&gt;telescope&lt;/code&gt; directory and the entire Telescope files and folder structure should be visible to you!&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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B16_54_04-Settings.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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B16_54_04-Settings.png"&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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B16_55_08-Visual%2BStudio%2BCode.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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B16_55_08-Visual%2BStudio%2BCode.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Set all the necessary environment variables in your env.remote file to contain your EC2 instance's public IPv4 address by executing the &lt;code&gt;aws-ip.sh&lt;/code&gt; script&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sh ./tools/aws-ip.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  If you did everything correctly, you've completed the environment setup!
&lt;/h3&gt;

&lt;h2&gt;
  
  
  Now to get started with development...
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Install all dependencies
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Start all Telescope services. This will take some time to complete
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker-compose --env-file .env up -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Start the Telescope development server on Port 3000
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Find your EC2 instance's public IPv4
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ curl -s http://169.254.169.254/latest/meta-data/public-ipv4

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open &lt;code&gt;&amp;lt;public-ip&amp;gt;:8000&lt;/code&gt; browser tab to see Telescope running on a AWS Cloud9 environment!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open &lt;code&gt;&amp;lt;public-ip&amp;gt;:3000/feeds&lt;/code&gt; in another browser tab to see all the feeds in the backend&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open &lt;code&gt;&amp;lt;public-ip&amp;gt;:8443/v1/&amp;lt;microservice-port&amp;gt;&lt;/code&gt; in another browser tab to see the microservices. For example &lt;code&gt;35.174.16.133:8443/v1/posts&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B17_10_36-Telescope%2B%25E2%2580%2594%2BMozilla%2BFirefox.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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B17_10_36-Telescope%2B%25E2%2580%2594%2BMozilla%2BFirefox.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently Asked Questions (FAQ)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  How do I stop my docker containers?
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run services:stop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  How do I delete my docker containers?
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker system prune -af --volumes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  I get &lt;code&gt;Permission denied&lt;/code&gt; error when I run &lt;code&gt;docker-compose --env-file .env up -d&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Sometimes the Docker permissions aren't set properly when you first install Docker. You may need to reboot your VM or run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;newgrp docker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  I can't open :8000 running, what could I be doing wrong?
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;If you have a VPN on, turn it off and get your IP address by visiting &lt;a href="http://checkip.amazonaws.com/" rel="noopener noreferrer"&gt;http://checkip.amazonaws.com/&lt;/a&gt; then allow your IP address to access the ports 3000 and 8000.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;AWS may change your EC2 instance IP address when you stop or restart your EC2 instance. One solution is to purchase an &lt;a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html#eip-basics" rel="noopener noreferrer"&gt;Elastic IP address&lt;/a&gt; to reserve the particular public IP address. However, you can just clean out the &lt;code&gt;env.remote&lt;/code&gt; and &lt;code&gt;.env&lt;/code&gt; files and run the &lt;code&gt;./tools/aws-ip.sh&lt;/code&gt; script again to set your new EC2 IP address in the appropriate environment variables. Just remember to use the new EC2 IP address in the browser as well.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  I can't SSH into my EC2 instance
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Same reason as above, your EC2 instance IP address may change when you stop or restart your EC2 instance. So make sure your &lt;code&gt;.ssh/config&lt;/code&gt; file has the correct HostName&lt;/li&gt;
&lt;li&gt;If your own IP address changes (for example, you changed internet providers or you moved to a new location with a different IP address), you need to update your inbound rules to allow your IP address to access port 22. Don't forget to allow access to port 3000 and 8000 as well.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  How do I turn off my EC2 instance if I'm actively not using it?
&lt;/h3&gt;

&lt;p&gt;There are a number of different methods to stop an EC2 instance:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Manually turning it off using the AWS Console&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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B17_35_32-vscode-ssh.md%2B-%2Btelescope%2B-%2BVisual%2BStudio%2BCode.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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B17_35_32-vscode-ssh.md%2B-%2Btelescope%2B-%2BVisual%2BStudio%2BCode.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Creating a Cloudwatch alarm to stop your EC2 instance for you after some inactivity&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click on the &lt;code&gt;+&lt;/code&gt; underneath &lt;code&gt;Alarm status&lt;/code&gt; to start creating an alarm
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B17_49_53-vscode-ssh.md%2B-%2Btelescope%2B-%2BVisual%2BStudio%2BCode.png"&gt;
&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;Create an alarm&lt;/code&gt; radio button
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B17_50_43-Manage%2BCloudWatch%2Balarms%2B_%2BEC2%2BManagement%2BConsole%2B%25E2%2580%2594%2BMozilla%2BFirefox.png"&gt;
&lt;/li&gt;
&lt;li&gt;Set &lt;code&gt;Alarm action&lt;/code&gt; to &lt;code&gt;Stop&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Set alarm to trigger if the CPU utilization of the EC2 instance has been less 25% for an hour
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Fvscode-ssh%2F2021-10-26%2B17_52_37-Manage%2BCloudWatch%2Balarms%2B_%2BEC2%2BManagement%2BConsole%2B%25E2%2580%2594%2BMozilla%2BFirefox.png"&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>aws</category>
      <category>cloud</category>
      <category>docker</category>
      <category>devops</category>
    </item>
    <item>
      <title>Remote Development with AWS Cloud9 IDE using a Docker and Docker-Compose application</title>
      <dc:creator>Cindy Le</dc:creator>
      <pubDate>Fri, 12 Nov 2021 23:41:47 +0000</pubDate>
      <link>https://dev.to/cindyledev/getting-started-with-aws-cloud9-ide-using-a-docker-and-docker-compose-application-35hj</link>
      <guid>https://dev.to/cindyledev/getting-started-with-aws-cloud9-ide-using-a-docker-and-docker-compose-application-35hj</guid>
      <description>&lt;p&gt;In this tutorial, we will be setting up Telescope in AWS Cloud9 IDE. &lt;a href="https://telescope.cdot.systems/" rel="noopener noreferrer"&gt;Telescope&lt;/a&gt; is a tool for tracking blogs around Seneca's open source develop. The application itself has many microservices that use Docker containers and are composed together using Docker-Compose. You can find the GitHub repo &lt;a href="https://github.com/Seneca-CDOT/telescope" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Telescope Tech Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Next.js&lt;/li&gt;
&lt;li&gt;Material UI&lt;/li&gt;
&lt;li&gt;Node.js&lt;/li&gt;
&lt;li&gt;Elasticsearch&lt;/li&gt;
&lt;li&gt;Redis&lt;/li&gt;
&lt;li&gt;Traefik&lt;/li&gt;
&lt;li&gt;Firebase&lt;/li&gt;
&lt;li&gt;Jest&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Telescope Microservices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Auth&lt;/li&gt;
&lt;li&gt;Feed-Discovery&lt;/li&gt;
&lt;li&gt;Image&lt;/li&gt;
&lt;li&gt;Parser&lt;/li&gt;
&lt;li&gt;Planet&lt;/li&gt;
&lt;li&gt;Posts&lt;/li&gt;
&lt;li&gt;Search&lt;/li&gt;
&lt;li&gt;Status&lt;/li&gt;
&lt;li&gt;Users&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/cloud9/" rel="noopener noreferrer"&gt;AWS Cloud9&lt;/a&gt; is a cloud-based integrated development environment (IDE) that lets you write, run, and debug your code with just a browser.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disclaimer&lt;/strong&gt;: The EC2 instance used in this guide is not within AWS's Free-Tier so please see &lt;a href="https://aws.amazon.com/ec2/pricing/on-demand/" rel="noopener noreferrer"&gt;EC2 Pricing&lt;/a&gt; to see if you're comfortable with these costs. Cloud9 has a cost-saving setting to help reduce costs by automatically hibernating after 30 minutes of inactivity. Running Docker in development is CPU intensive so these are the EC2 instances I recommend:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Minimum: &lt;code&gt;t2.medium (4 GiB RAM + 2 vCPU)&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Recommended: &lt;code&gt;t2.large (8 GiB RAM + 2 vCPU)&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Summary of Pricing&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;t2.medium costs \$0.0464 per hour&lt;/li&gt;
&lt;li&gt;t2.large costs \$0.0928 per hour&lt;/li&gt;
&lt;li&gt;30GB Amazon Elastic Block Storage (EBS) costs \$3 per month&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cost Estimate Per Month&lt;/strong&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;t2.medium&lt;/th&gt;
&lt;th&gt;t2.large&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Cost per hour&lt;/td&gt;
&lt;td&gt;\$0.0464&lt;/td&gt;
&lt;td&gt;\$0.0928&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hours per day&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Days per month&lt;/td&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sub-total&lt;/td&gt;
&lt;td&gt;\$11.14&lt;/td&gt;
&lt;td&gt;\$22.27&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;30GB EBS Volume&lt;/td&gt;
&lt;td&gt;\$3&lt;/td&gt;
&lt;td&gt;\$3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total&lt;/td&gt;
&lt;td&gt;\$14.14&lt;/td&gt;
&lt;td&gt;\$25.27&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

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

&lt;ul&gt;
&lt;li&gt;Create an &lt;a href="https://aws.amazon.com/" rel="noopener noreferrer"&gt;AWS Account&lt;/a&gt;. You can watch this &lt;a href="https://www.youtube.com/watch?v=3hLmDS179YE&amp;amp;t=10552s" rel="noopener noreferrer"&gt;part&lt;/a&gt; of the AWS Certified Cloud Practitioner course on creating an account if you need help.&lt;/li&gt;
&lt;li&gt;Sign into your AWS Account&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Creating your Cloud9 Environment:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;In the upper-right hand corner of your AWS Management Console, select &lt;code&gt;US East (Ohio) us-east-2&lt;/code&gt; as your &lt;code&gt;Region&lt;/code&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Faws-cloud9%2F2021-10-26%2B09_08_11-.png" alt="Select us-east-2 region"&gt;
&lt;/li&gt;
&lt;li&gt;In the upper-left hand corner of your AWS Management Console, click on &lt;code&gt;Services&lt;/code&gt;. This is bring up a list of AWS Services, search for &lt;code&gt;Cloud9&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;Create Environment&lt;/code&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fseneca-cdot-telescope.s3.amazonaws.com%2Faws-cloud9%2F2021-10-26%2B09_14_54-Welcome%2Bto%2BAWS%2BCloud9%2B%25E2%2580%2594%2BMozilla%2BFirefox.png" alt="Create environment"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Step 1 - Name environment:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Name: &lt;code&gt;Telescope-Dev&lt;/code&gt; (whatever you want)&lt;/p&gt;

&lt;p&gt;Description (optional): &lt;code&gt;AWS Cloud9 development environment for Telescope&lt;/code&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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Faws-cloud9%2F2021-10-26%2B09_15_58-Create%2Ba%2Bnew%2Benvironment%2B%25E2%2580%2594%2BMozilla%2BFirefox.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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Faws-cloud9%2F2021-10-26%2B09_15_58-Create%2Ba%2Bnew%2Benvironment%2B%25E2%2580%2594%2BMozilla%2BFirefox.png" alt="Step 1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Step 2 - Configure settings:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Environment type: &lt;code&gt;Create a new EC2 instance for environment (direct access)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Instance type: &lt;code&gt;Other instance type: t2.medium (4 GiB RAM + 2 vCPU)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Platform: &lt;code&gt;Ubuntu Server 18.04 LTS&lt;/code&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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Faws-cloud9%2F2021-10-26%2B09_17_57-Create%2Ba%2Bnew%2Benvironment%2B%25E2%2580%2594%2BMozilla%2BFirefox.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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Faws-cloud9%2F2021-10-26%2B09_17_57-Create%2Ba%2Bnew%2Benvironment%2B%25E2%2580%2594%2BMozilla%2BFirefox.png" alt="Step 2a"&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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Faws-cloud9%2F2021-10-26%2B09_19_55-Create%2Ba%2Bnew%2Benvironment%2B%25E2%2580%2594%2BMozilla%2BFirefox.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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Faws-cloud9%2F2021-10-26%2B09_19_55-Create%2Ba%2Bnew%2Benvironment%2B%25E2%2580%2594%2BMozilla%2BFirefox.png" alt="Step 2b"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Step 3 - Review and click &lt;code&gt;Create Environment&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It will take a few minutes for AWS to create your new C9 environment&lt;/p&gt;
&lt;h2&gt;
  
  
  Opening the ports on our EC2 instance:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Firstly, we'll need the MAC address of our EC2 instance
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ curl -s http://169.254.169.254/latest/meta-data/mac

06:c5:aa:63:ee:f4
&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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Faws-cloud9%2F2021-10-26%2B09_30_02-.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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Faws-cloud9%2F2021-10-26%2B09_30_02-.png" alt="Getting MAC address"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Using your EC2 instance's MAC address, we can get a list of Security Groups
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ curl -s http://169.254.169.254/latest/meta-data/network/interfaces/macs/&amp;lt;your_mac&amp;gt;/security-group-ids

sg-0c63c6f026a2b9288
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Find out what your IP address is using &lt;a href="http://checkip.amazonaws.com/" rel="noopener noreferrer"&gt;http://checkip.amazonaws.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;You will need to authorize your IP address access to ports 3000, 8000, and 8443
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws ec2 authorize-security-group-ingress --group-id &amp;lt;sg-id&amp;gt; \
--port 3000 \
--protocol tcp \
--cidr &amp;lt;my-ip&amp;gt;/32
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws ec2 authorize-security-group-ingress --group-id &amp;lt;sg-id&amp;gt; \
--port 8000 \
--protocol tcp \
--cidr &amp;lt;my-ip&amp;gt;/32
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws ec2 authorize-security-group-ingress --group-id &amp;lt;sg-id&amp;gt; \
--port 8443 \
--protocol tcp \
--cidr &amp;lt;my-ip&amp;gt;/32
&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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Faws-cloud9%2F2021-10-26%2B09_34_11-Telescope-Dev%2B-%2BAWS%2BCloud9%2B%25E2%2580%2594%2BMozilla%2BFirefox.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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Faws-cloud9%2F2021-10-26%2B09_34_11-Telescope-Dev%2B-%2BAWS%2BCloud9%2B%25E2%2580%2594%2BMozilla%2BFirefox.png" alt="Opening the ports"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Resize your Amazon EBS volume
&lt;/h2&gt;

&lt;p&gt;Check first using &lt;code&gt;df -h&lt;/code&gt; in the terminal&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1      9.7G  9.3G  371M  97% /
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you first create an EC2 instance, it has an EBS Volume of 10GB. To increase it to 20GB, create a new file called &lt;code&gt;resize.sh&lt;/code&gt; in &lt;code&gt;~/environment&lt;/code&gt; directory and copy the following script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash

# Specify the desired volume size in GiB as a command-line argument. If not specified, default to 20 GiB.
SIZE=${1:-20}

# Get the ID of the environment host Amazon EC2 instance.
INSTANCEID=$(curl http://169.254.169.254/latest/meta-data/instance-id)

# Get the ID of the Amazon EBS volume associated with the instance.
VOLUMEID=$(aws ec2 describe-instances \
  --instance-id $INSTANCEID \
  --query "Reservations[0].Instances[0].BlockDeviceMappings[0].Ebs.VolumeId" \
  --output text)

# Resize the EBS volume.
aws ec2 modify-volume --volume-id $VOLUMEID --size $SIZE

# Wait for the resize to finish.
while [ \
  "$(aws ec2 describe-volumes-modifications \
    --volume-id $VOLUMEID \
    --filters Name=modification-state,Values="optimizing","completed" \
    --query "length(VolumesModifications)"\
    --output text)" != "1" ]; do
sleep 1
done

# Check if we're on an NVMe filesystem
if [ $(readlink -f /dev/xvda) = "/dev/xvda" ]
then
  # Rewrite the partition table so that the partition takes up all the space that it can.
  sudo growpart /dev/xvda 1

  # Expand the size of the file system.
  # Check if we are on AL2
  STR=$(cat /etc/os-release)
  SUB="VERSION_ID=\"2\""
  if [[ "$STR" == *"$SUB"* ]]
  then
    sudo xfs_growfs -d /
  else
    sudo resize2fs /dev/xvda1
  fi

else
  # Rewrite the partition table so that the partition takes up all the space that it can.
  sudo growpart /dev/nvme0n1 1

  # Expand the size of the file system.
  # Check if we're on AL2
  STR=$(cat /etc/os-release)
  SUB="VERSION_ID=\"2\""
  if [[ "$STR" == *"$SUB"* ]]
  then
    sudo xfs_growfs -d /
  else
    sudo resize2fs /dev/nvme0n1p1
  fi
fi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Disclaimer&lt;/strong&gt;: AWS Free-Tier includes 30GB of Storage, 2 million I/Os, and 1GB of snapshot storage with &lt;a href="https://aws.amazon.com/ebs/pricing/" rel="noopener noreferrer"&gt;Amazon Elastic Block Store (EBS)&lt;/a&gt; free for 12 months.&lt;/p&gt;

&lt;p&gt;In the terminal, execute the script by running&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sh resize.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify size change with &lt;code&gt;df -h&lt;/code&gt; again&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1       20G  9.3G   11G  48% /
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Install Docker-Compose
&lt;/h2&gt;

&lt;p&gt;By default, Docker is installed on AWS EC2's Ubuntu but Docker-Compose is not, so we have to install it ourselves.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Run to download the current stable version of Docker-Compose:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Apply executable permissions to the downloaded file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo chmod +x /usr/local/bin/docker-compose
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Check installation using:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ docker-compose --version

docker-compose version 1.29.2, build 5becea4c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Setting up the Telescope repository in Cloud9:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;In the terminal, clone the Telescope repository and name the remote &lt;code&gt;upstream&lt;/code&gt; by entering
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone -o upstream https://github.com/Seneca-CDOT/telescope.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Change to the telescope directory
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd telescope
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Set all the necessary environment variables in your env.remote file to contain your EC2 instance's public IPv4 address by executing the &lt;code&gt;aws-ip.sh&lt;/code&gt; script
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sh ./tools/aws-ip.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  If you did everything correctly, you've completed the environment setup using AWS Cloud9! Yay!
&lt;/h3&gt;

&lt;h2&gt;
  
  
  Now to get started with development...
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Install all depenencies
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Start all Telescope services. This will take some time to complete
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker-compose --env-file .env up -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Start the Telescope development server on Port 3000
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PORT=3000 npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Find your EC2 instance's public IPv4
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ curl -s http://169.254.169.254/latest/meta-data/public-ipv4

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open &lt;code&gt;&amp;lt;public-ip&amp;gt;:8000&lt;/code&gt; browser tab to see Telescope running on a AWS Cloud9 environment!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open &lt;code&gt;&amp;lt;public-ip&amp;gt;:3000/feeds&lt;/code&gt; in another browser tab to see all the feeds in the backend&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open &lt;code&gt;&amp;lt;public-ip&amp;gt;:8443/v1/&amp;lt;microservice-port&amp;gt;&lt;/code&gt; in another browser tab to see the microservices. For example &lt;code&gt;35.174.16.133:8443/v1/posts&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Faws-cloud9%2F2021-10-26%2B09_54_59-Mozilla%2BFirefox.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%2Fseneca-cdot-telescope.s3.amazonaws.com%2Faws-cloud9%2F2021-10-26%2B09_54_59-Mozilla%2BFirefox.png" alt="Ports 3000 and 8000 opened in browser"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently Asked Questions (FAQ)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What's in &lt;code&gt;aws-ip.sh&lt;/code&gt;?
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ipv4=$(curl http://169.254.169.254/latest/meta-data/public-ipv4)

sed -r \
  -e  "s@(.+=)http://localhost:8000(/[^ ]*)*@\1http://$ipv4:3000\2@g" \
  -e  "s@(.+=)http://localhost:3000(/[^ ]*)*@\1http://$ipv4:8000\2@g" \
  -e  "s@(.+=)http://localhost([^:]*)@\1http://$ipv4:8443\2@g" \
  -e  "s@development\.yml@gitpod\.yml@" \
  config/env.development &amp;gt; .env

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  How do I stop my docker containers?
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run services:stop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  How do I delete my docker containers?
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker system prune -af --volumes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  I think I have multiple services using the same port, how I can check?
&lt;/h3&gt;

&lt;p&gt;To see a list of all running services and what ports they're binding to&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo lsof -i -P -n | grep LIST
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  I can't open :8000 running, what could I be doing wrong?
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;If you have a VPN on, turn it off and get your IP address by visiting &lt;a href="http://checkip.amazonaws.com/" rel="noopener noreferrer"&gt;http://checkip.amazonaws.com/&lt;/a&gt; then allow your IP address to access the ports 3000 and 8000.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;AWS may change your EC2 instance IP address when you stop or restart your EC2 instance. One solution is to purchase an &lt;a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html#eip-basics" rel="noopener noreferrer"&gt;Elastic IP address&lt;/a&gt; to reserve the particular public IP address. However, you can just clean out the &lt;code&gt;env.remote&lt;/code&gt; and &lt;code&gt;.env&lt;/code&gt; files and run the &lt;code&gt;./tools/aws-ip.sh&lt;/code&gt; script again to set your new EC2 IP address in the appropriate environment variables. Just remember to use the new EC2 IP address in the browser as well.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Resources
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=RrKRN9zRBWs" rel="noopener noreferrer"&gt;AWS Certified Developer - Associate 2020&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloud</category>
      <category>docker</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
