<?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: Pleng Nakdee</title>
    <description>The latest articles on DEV Community by Pleng Nakdee (@plengnakdee).</description>
    <link>https://dev.to/plengnakdee</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%2F790370%2F3d26e4a8-b76f-4393-bb34-309ea19d304d.jpeg</url>
      <title>DEV Community: Pleng Nakdee</title>
      <link>https://dev.to/plengnakdee</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/plengnakdee"/>
    <language>en</language>
    <item>
      <title>My Portfolio: a Cloud Resume Challenge</title>
      <dc:creator>Pleng Nakdee</dc:creator>
      <pubDate>Tue, 11 Jan 2022 15:04:53 +0000</pubDate>
      <link>https://dev.to/plengnakdee/my-portfolio-a-cloud-resume-challenge-4bbm</link>
      <guid>https://dev.to/plengnakdee/my-portfolio-a-cloud-resume-challenge-4bbm</guid>
      <description>&lt;h2&gt;
  
  
  Part 0: Intro
&lt;/h2&gt;

&lt;p&gt;I have taken &lt;a href="https://cloudresumechallenge.dev/"&gt;The Cloud Resume Challenge&lt;/a&gt; and would like to share my take on the challenge. I didn’t follow the steps exactly as laid out in the book. You can see the finished website here: &lt;a href="https://pleng-nakdee.com/"&gt;my website&lt;/a&gt; and examples of the code here: &lt;a href="https://github.com/PlengNakdee/my-portfolio-public"&gt;github.&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Some background about me. I used to work in film and documentary, but I felt burned out and stagnated. So I tried to find something else to do. I learned about coding from online classes for 2 years, before I got my first developer job. Now, I’m working as a Cloud Engineer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 1: Next.js, Tailwind CSS
&lt;/h2&gt;

&lt;p&gt;Instead of HTML and CSS, I'm using Next.js and Tailwind CSS. I’ll not go into how to set them up, you can search for their documentation for that. The upside I see from using Tailwind is that it’s easier and faster to write than CSS. I used to spend so much time and frustration trying to get the responsiveness right, but now I don’t.&lt;/p&gt;

&lt;p&gt;I don't think too much about the design. I like dark mode, so my website is mostly white text on black background. I didn’t spend much time on the frontend, compared to the backend. This is because I just want a website that looks good, not perfect, and has functions that I want. These functions are: showing my resume, showing my projects, and sending a contact form. I will talk about the contact form later on.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Imcb-2fd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bqhojssnp7370dn05qqs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Imcb-2fd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bqhojssnp7370dn05qqs.png" alt="Homepage" width="880" height="429"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lARWb7L3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d33w6zg83u8anhy5iarn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lARWb7L3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d33w6zg83u8anhy5iarn.png" alt="Resume page" width="880" height="443"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Part 2: CDK, S3, CloudFront, Route 53
&lt;/h2&gt;

&lt;p&gt;I’m using AWS, you can see the infrastructure diagram here:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QQkiMx7h--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cvms49vsaqmy1hcgqivz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QQkiMx7h--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cvms49vsaqmy1hcgqivz.png" alt="Infrastructure diagram" width="405" height="715"&gt;&lt;/a&gt;&lt;br&gt;
The frontend lives in a S3 bucket, which will be served through CloudFront. I use CDK to create AWS resources. This is because CDK helps me define my infrastructure as a code and deploy it through ClodFormation.&lt;br&gt;
My S3 is looking like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    const siteBucket = new Bucket(this, "SiteBucket", {
      websiteIndexDocument: "index.html",
      websiteErrorDocument: "404.html",
      publicReadAccess: true,
      removalPolicy: RemovalPolicy.DESTROY,
      autoDeleteObjects: true,
    });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;My CloudFront is looking like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    const cloudDist = new Distribution(this, "myDist", {
      defaultBehavior: { origin: new S3Origin(siteBucket) },
    });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I use Route 53 as DNS web service. It took me sometime to figuring out about DNS record type and how to route traffic from CloudFront to my domain name.&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 3: GraphQL, AppSync, DynamoDB
&lt;/h2&gt;

&lt;p&gt;At the time of doing The Cloud Resume Challenge, I also worked on a client project that used the combination of GraphQL, AppSync and DynamoDB. So I just used what I already know on this project. I used this combination for a contact form function for my website.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kTEThYzb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dhsygtqbrre8oo97u2qa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kTEThYzb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dhsygtqbrre8oo97u2qa.png" alt="Contact form" width="880" height="502"&gt;&lt;/a&gt;&lt;br&gt;
Here is the dataflow diagram:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--99edjwdt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5wuyxpsoollaiw3jvjzb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--99edjwdt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5wuyxpsoollaiw3jvjzb.png" alt="dataflow diagram" width="419" height="126"&gt;&lt;/a&gt;&lt;br&gt;
As CDK, this is how I create AppSync api, datasource and resolver:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const api = new GraphqlApi(this, 'TestApi', {
      name: 'TestApi',
      schema: Schema.fromAsset(join(this.schemaDir, 'schema.graphql')),
      authorizationConfig: {
        defaultAuthorization: {
          authorizationType: AuthorizationType.API_KEY,
        },
      },
    });

    new CfnOutput(this, 'ApiUrl', {
      value: api.graphqlUrl,
    });

    const messagesTableDS = api.addDynamoDbDataSource('messagesDataSource', messagesTable);

    messagesTableDS.createResolver({
      typeName: 'Mutation',
      fieldName: 'addMessage',
      requestMappingTemplate: MappingTemplate.dynamoDbPutItem(
        PrimaryKey.partition('id').auto(),
        Values.projecting('input'),
      ),
      responseMappingTemplate: MappingTemplate.dynamoDbResultItem(),
    });`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Part 4: Jest, Cypress
&lt;/h2&gt;

&lt;p&gt;coming soon...&lt;/p&gt;

</description>
      <category>aws</category>
      <category>nextjs</category>
      <category>tailwindcss</category>
      <category>graphql</category>
    </item>
  </channel>
</rss>
