<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Nicholas Vincent-Hill on Medium]]></title>
        <description><![CDATA[Stories by Nicholas Vincent-Hill on Medium]]></description>
        <link>https://medium.com/@nvincenthill?source=rss-4ff178295765------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*j48iiOnCBF2_Ls0cQrlA7Q.jpeg</url>
            <title>Stories by Nicholas Vincent-Hill on Medium</title>
            <link>https://medium.com/@nvincenthill?source=rss-4ff178295765------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 04:55:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nvincenthill/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Forging a design framework — creating a unified + modular UI framework at a start-up ]]></title>
            <link>https://medium.com/forge-engineering/forging-a-design-framework-creating-a-unified-modular-ui-framework-at-a-start-up-63cdd37c6976?source=rss-4ff178295765------2</link>
            <guid isPermaLink="false">https://medium.com/p/63cdd37c6976</guid>
            <category><![CDATA[design]]></category>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Nicholas Vincent-Hill]]></dc:creator>
            <pubDate>Wed, 01 Apr 2020 17:20:59 GMT</pubDate>
            <atom:updated>2020-04-01T17:20:59.416Z</atom:updated>
            <content:encoded><![CDATA[<h3>Forging a design framework — creating a unified + modular UI framework at a start-up 🏗</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IzW5Ylv7Lir-PBEsq21ybw.png" /></figure><p>To improve our frontend engineering output and ergonomics at <a href="http://forgeglobal.com/">Forge</a> we implemented a unified design framework. We’re proud to present our new design framework <a href="https://forge-design-framework.herokuapp.com/"><strong>here</strong></a>.</p><h3><strong>Why we need unified frontend design</strong></h3><p>Karri Saarinen, a former Principal Designer at Airbnb, summarizes many of Airbnb’s main priorities for <a href="https://airbnb.design/building-a-visual-language/">building a universal design system</a>. Here are some of the problems we wanted to address:</p><ul><li>Standardize UI patterns to improve both design output and code quality (the code and the app should look like it was written by one master engineer/designer)</li><li>Improve new product features construction, development, and design iteration velocity</li><li>Create a flexible tool we can iterate on to accomplish our <a href="https://atomicdesign.bradfrost.com/">atomic design</a> ambitions 🚀</li></ul><blockquote>A unified design language shouldn’t be just a set of static rules and individual atoms; it should be an evolving ecosystem.</blockquote><blockquote><em>Airbnb — </em><a href="https://airbnb.design/building-a-visual-language/"><em>“Building a visual language”</em></a></blockquote><p>Let’s take a look at the nuts and bolts of our solution to these problems.</p><h3>How did we build it?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*QolorjgoiWlzRKrx1gBOvw.png" /><figcaption>Our private package on <a href="https://github.com/features/packages">Github packages</a></figcaption></figure><p>We started by collaborating with our Design team to assemble a bare-minimum list of UI components to implement or refactor/add to the library. After implementing roughly 50 unique components (design atoms or UI molecules) we were able to eliminate the existing Sass from our CRM and market-making internal application; this allowed us to remove MaterialUI as a local dependency and exchange our legacy styling for our new universal design framework.</p><p>Here’s the tech we used:</p><h4>Tech stack</h4><ul><li><a href="https://www.typescriptlang.org/"><strong>TypeScript</strong></a><strong> </strong>— Type-safe JavaScript is the top of our full-stack type safety approach to modern ergonomic web development.</li><li><a href="https://reactjs.org/"><strong>React.js</strong></a> — The functional front-end framework with hooks (accessing the brand color palette with useTheme, standardized margin and padding with useStyles, sidebar with useSidebar, etc.).</li><li><a href="https://jestjs.io/"><strong>Jest</strong></a> — The framework for unit and <a href="https://jestjs.io/docs/en/snapshot-testing">snapshot testing</a> with <a href="https://airbnb.io/enzyme/">Enzyme</a>. All of our design atoms and molecules are snapshot-tested to prevent regressions negatively impacting our users.</li><li><a href="https://github.com/features/packages"><strong>Github Packages</strong></a> — The package manager and version control.</li><li><a href="https://github.com/whitecolor/yalc"><strong>Yalc</strong></a> — The local package development tool.</li><li><a href="https://material-ui.com/"><strong>Material-UI</strong></a><strong> </strong>— The base UI layer; our design framework is a superset of the Material-UI component library.</li><li><a href="https://www.docz.site/"><strong>Docz</strong></a><strong> </strong>— The Gatsby.js-based documentation site with interactive <a href="https://github.com/mdx-js/mdx">MDX</a>-enabled playgrounds. Check it out <a href="https://forge-design-framework.herokuapp.com/">here</a>.</li></ul><p>Here’s an example component in our new design framework which demonstrates our user requirements as well. We provide small atomic components with simple declarative API’s that developers can easily compose into large UI structures/molecules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rOUA8P6qURJTnPPcip3j5A.png" /><figcaption>Our generic contact information card is a molecule composed from smaller UI ‘atoms’</figcaption></figure><p>As a PDE (Product, Design, Engineering) organization, this unified framework allows us to all improve our process in the following ways:</p><h4>Product</h4><p>Our product managers are now able to produce high quality mocks without as much hands-on work from our design team. Alternatively they can construct simple wire-frame views of new products/features and feel confidant that the implemented output will be consistent with Forge’s existing product/feature suite.</p><p>The example below is a new dashboard feature (a mobile-responsive interactive table view) we were able to sketch, implement, and test in a single two-week sprint due to our existing modular UI library.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ybWDNEbKv0Isem9Nsfil3w.png" /><figcaption>A rough wireframe built by product</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*naKTBpM2OHtdc8o7jBICQA.png" /><figcaption>An MVP implementation using our design framework</figcaption></figure><h4><strong>Design</strong></h4><p>Our Design team no longer needs to create high fidelity mocks saving valuable time to create the design vision for our brand and future products/features.</p><p>Whenever a new atom/molecule is required Design and Engineering can work together to create a generic reusable solution and add it to the growing library of components — creating a lasting, tested, and documented solution built into the institutional memory of our PDE organization.</p><p>We can apply this same iterative process to updating our brand assets, color palette, and/or specific components in the library and have these changes be reflected across all our products and features. This allows our Design team to control the consistent design and palette across all Forge Global applications.</p><p>A final benefit from our unified UI — users quickly become familiar with our generic UI patterns and when they encounter a new component they will have an existing intuitive understanding of how that new feature works; we are better able to communicate intent and function quickly and precisely.</p><h4>Engineering</h4><p>The third group in our PDE-triumvirate, Engineering benefits through increased workflow efficiency, code quality, and ease of development. We are now able to systematically expand our unified frontend capabilities while responding to new feature requests or design changes.</p><p>We can also rigorously practice TDD on small, atomic components and feel confident with them when functionally composed into larger UI structures (a field component in a form in a modal in a flow, etc.).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FWpC33xk0XDmZxDwxUnLMA.png" /><figcaption>UI components built with TDD and snapshot testing to ward off regressions</figcaption></figure><h3><strong>Conclusion</strong></h3><p>Implementing our design framework has already increased the velocity of our frontend feature development and standardized design patterns across our PDE organization.</p><p>The upfront investment in planning, implementation, and coordination between Design, Product, and Engineering is also increasing the speed and ease of onboarding/converting new developers into valuable contributors to our frontend codebase.</p><p>We still improving our process (Yalc and MDX don’t offer the greatest developer ergonomics right now) and we continue to add new design atoms and UI molecules to our library daily. Thanks for reading!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_xlqHZsWYOlnCj-cjlIv5w.png" /><figcaption>Our design framework components in the wild</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*KA736UUwQ-1gDVpGN1533Q.png" /></figure><p><a href="http://nicknacks.tech/"><em>Nicholas Vincent-Hill</em></a><em> is a software engineer at </em><a href="http://forgeglobal.com/"><em>Forge</em></a><em> who enjoys building beautiful mobile-first web applications</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63cdd37c6976" width="1" height="1" alt=""><hr><p><a href="https://medium.com/forge-engineering/forging-a-design-framework-creating-a-unified-modular-ui-framework-at-a-start-up-63cdd37c6976">Forging a design framework — creating a unified + modular UI framework at a start-up 🏗</a> was originally published in <a href="https://medium.com/forge-engineering">Forge Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I built my own MailChimp app with AWS SES and MJML ✉️]]></title>
            <link>https://medium.com/hackernoon/how-i-built-my-own-mailchimp-app-with-aws-ses-and-mjml-%EF%B8%8F-5e180432cc33?source=rss-4ff178295765------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e180432cc33</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[mailchimp]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[email-marketing]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Nicholas Vincent-Hill]]></dc:creator>
            <pubDate>Wed, 05 Jun 2019 18:16:00 GMT</pubDate>
            <atom:updated>2019-06-06T17:23:27.234Z</atom:updated>
            <content:encoded><![CDATA[<h4>Have you ever had to send repetitive emails in a job that you wished you could just automate?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tWhVaYccGPb7YL9rMoh_og.png" /></figure><h3>What is dotmail.tech?</h3><p>This is an open-source FERN-stack app to programatically send responsively-designed emails with Nodemailer and MJML templates (check out the code <a href="https://github.com/nvincenthill/dotmail">here</a>).</p><p>Here’s an example email sent with my app:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wDhIxhtPq-R0TCyFZ6RmoA.png" /><figcaption>An example templated email sent with dotmail.tech</figcaption></figure><h3>Tech stack</h3><p>Here’s the tech I used:</p><h4>Front End</h4><ul><li><a href="https://reactjs.org/">React.js</a> — The front-end MVC framework</li><li><a href="https://redux.js.org/">Redux</a> — The state management</li><li><a href="https://jestjs.io/">Jest</a> — The testing framework</li><li><a href="https://airbnb.io/enzyme/">Enzyme</a> — The testing utilities</li></ul><h4>Back End</h4><ul><li><a href="https://firebase.google.com/">Firebase</a> — The OAuth and cloud Firestore database</li><li><a href="https://expressjs.com/">Express</a> — The server</li><li><a href="https://nodejs.org/">Node.js</a> — The back-end</li><li><a href="https://mustache.github.io/">Mustache</a> — The logic-less template system</li><li><a href="https://mjml.io/">MJML</a> — The framework that makes responsive email easy</li><li><a href="https://github.com/visionmedia/supertest/">SuperTest</a> — The http integration testing</li></ul><h4>Deployed With</h4><ul><li><a href="https://www.docker.com/">Docker</a> — The package/container management</li><li><a href="https://aws.amazon.com/ses/">AWS SES</a> — The flexible and highly-scalable email sending and receiving platform</li><li><a href="https://aws.amazon.com/ec2/">AWS EC2</a> — The secure and resizable compute capacity in the cloud</li></ul><h3>Technical Challenges</h3><p>There were a number of technical challenges I had to address to build this application.</p><p>In order to create a rich, responsive HTML email I used MJML and transpiled it to responsive HTML. This allowed me to write modular blocks of markup and not worry about 700+ lines of HTML and CSS required for each template to ensure a responsive experience for the end recipient.</p><p>I used <a href="https://mustache.github.io/">Mustache</a> to inject variables into the transpiled HTML to personalize content to each recipient. AWS SES has its own templating service but this free open-source tool worked well for me and has a simple-to-learn API.</p><p>AWS SES was the clear choice for the email sending service. My required throughput was well below the 60,000 free emails sent per month and AWS SES can churn through batches of emails to be sent (at least at my small scale) instantaneously.</p><p>I use <a href="https://www.mail-tester.com/">Mail Tester</a> to evaluate my emails to ensure they evade spam filters. This is a crucial step and taught me a lot about Apache SpamAssassin and how modern filters classify emails as spam or not. Metrics like raw text to HTML percentage and image to text ratio are important and can negatively affect how your email is classified to automated filters.</p><h3>Future features</h3><p>There are a number a features I’d still like to add to this project. The last major feature completed was a preview feature to view the email before sending built with React portals; the client can assemble the email and view a real-time preview in a different tab.</p><p>I also like to eventually add the ability to programmatically generate email from injected variables and pre-built “lego” building blocks of MJML. This could facilitate a newsletter or other recurring publication with a standard layout but variable content blocks.</p><h3>Conclusion</h3><p>I’m excited to use this application in my personal and professional life to automate away email stress. Repetitive emails at work, thank you notes, and birthday e-cards can and should be written once and programmatically generated with the required data injected.</p><p>I’d love to hear your comments/suggestions/critiques in the comments or make a pull request if you find anything that could be improved!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*T3TJaIOAh_mlwwOj.png" /></figure><blockquote><em>Read Next:</em></blockquote><blockquote><a href="https://hackernoon.com/how-to-build-and-deploy-a-beautiful-personal-portfolio-site-with-aws-s3-route53-and-cloudfront-af125ccbb1c2">How to build and deploy a beautiful static site with AWS S3, Route53, and CloudFront</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e180432cc33" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/how-i-built-my-own-mailchimp-app-with-aws-ses-and-mjml-%EF%B8%8F-5e180432cc33">How I built my own MailChimp app with AWS SES and MJML ✉️</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to build and deploy a beautiful personal portfolio site with AWS S3, Route53, and CloudFront ]]></title>
            <link>https://medium.com/hackernoon/how-to-build-and-deploy-a-beautiful-personal-portfolio-site-with-aws-s3-route53-and-cloudfront-af125ccbb1c2?source=rss-4ff178295765------2</link>
            <guid isPermaLink="false">https://medium.com/p/af125ccbb1c2</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Nicholas Vincent-Hill]]></dc:creator>
            <pubDate>Wed, 10 Apr 2019 21:07:12 GMT</pubDate>
            <atom:updated>2019-04-29T01:55:20.546Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to build and deploy a beautiful static site with AWS S3, Route53, and CloudFront 🔥</h3><p><em>This is a step-by-step guide to creating a responsive static billboard/portfolio site, deploying it to the web with AWS, and serving it securely with HTTPS.</em></p><p><em>This guide is designed for beginner and intermediate-level software engineers and web developers looking for an easy way to create a personal site for cheaper than paid-services like SquareSpace or other site-builders. Basic technical requirements include a knowledge of HTML/CSS/JS, npm, and Git (the advanced site creation process uses Gatsby.js which requires knowledge of React.js and GraphQL).</em></p><p><em>The only economic requirements are AWS Route53 hosted zone fees ($0.50/month) and the cost of acquiring a domain (I rented nickvh.tech for $25 for five years from get.tech). The estimated time commitment is four to five hours depending on individual skill and experience.</em></p><p><em>This guide will enable you, the developer, to control all aspects of the design, development, and deployment of your site.</em></p><h4>Step 1 — Create your personal site (the easy way or the hard way)</h4><p><strong>Here’s the easy way-</strong> go <a href="https://html5up.net/">here</a> and pick out a fully responsive, super customizable, and 100% free (under the <a href="https://html5up.net/license">Creative Commons</a>) HTML/CSS/JS template. Download it and customize/build on it until you love it!</p><p>Call npm init in the root directory of your chosen project. Make sure to git init, add all non-public information to .gitignore, and write great commit messages.</p><p><strong>Here’s the hard way-</strong> use Gatsby.js to build a blazing fast static site and PWA from scratch. This isn’t a Gatsby.js tutorial (plenty of great tutorials can be found <a href="https://www.gatsbyjs.org/tutorial/">here</a>) and requires React.js and GraphQL knowledge. A number of starter templates can be found <a href="https://www.gatsbyjs.org/starters/?v=2">here</a> (I used the “strata” HTML5UP template as a jumping off point for <a href="https://www.nickvh.tech/">nickvh.tech</a>).</p><p>Test and develop your website until you are happy with it and want to share it with the world. We will be building a continuous development pipeline with either Grunt or the gatsby-plugin-s3 plugin later so future revisions/deployment will be quick and easy.</p><h4>Step 2 — Get a domain</h4><p>Sites like <a href="https://get.tech/">https://get.tech</a> or <a href="https://www.namecheap.com/">https://www.namecheap.com</a> offer very compelling prices for domains. I waited for a promotion and got <a href="https://get.tech/">https://nickvh.tech</a> for $25 for five years. Alternatively buy a .dev domain from <a href="https://domains.google/#/">Google</a>.</p><h4>Step 3 — Create an AWS account</h4><p>Create an <a href="https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/">AWS account</a>. This step is fairly straightforward. New accounts get free services for a year — outlined <a href="https://aws.amazon.com/free/">here</a>. This requires you to have an active credit card on file with AWS. <strong>Be aware of the security implications and do not accidentally push your AWS credentials to the public web.</strong></p><h4>Step 4 — Configure AWS S3 buckets</h4><blockquote>Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance. This means customers can use it to store and protect any amount of data for a range of use cases, such as websites, mobile applications, backup and restore, archive, enterprise applications, IoT devices, and big data analytics.</blockquote><p>AWS S3 is where your static site will live; there are a few things to do in order to configure this correctly.</p><p>First create a bucket; AWS S3 and Route53 only work correctly if your bucket name and domain name match precisely — name your bucket mysite.domain (i.e. nickvh.tech). Make sure to set permissions correctly; the public should be able to read from the bucket but not write to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nDKOVzwkcQamFyaTVWYDHw.png" /><figcaption>Make sure to give public read access to your bucket</figcaption></figure><p>Next navigate to “Properties” and configure AWS S3 to statically serve index.html (see below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jU6929oqVXSINz3o9LHJZg.png" /></figure><p>Create a bucket (also public read access enabled) named <a href="http://www.mysite.domain/">www.mysite.domain</a> (<a href="http://www.nickvh.tech/">www.nickvh.tech</a> in my case) and redirect to the main bucket address (see below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3r7p-HOEkXp97fOOdA58dA.png" /></figure><p>Next, create aws-keys.json in the root directory of your project:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5a5b1e2f555692d7f741ab753da5784b/href">https://medium.com/media/5a5b1e2f555692d7f741ab753da5784b/href</a></iframe><p>Here’s a <a href="https://help.bittitan.com/hc/en-us/articles/115008255268-How-do-I-find-my-AWS-Access-Key-and-Secret-Access-Key-">guide</a> to finding your AWS access key ID and Secret key.</p><p><strong>Remember to add </strong>aws-keys.json<strong> to your </strong>.gitignore<strong>! One of my students accidentally pushed their AWS credentials to Github, was programmatically attacked, and incurred ~$1.3k in charges in a few hours.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vb3KlOUa_yZJ_yyZEz9zEg.png" /><figcaption>Don’t let this happen to you!</figcaption></figure><h4>Step 5 — Upload your site to AWS S3 with Grunt or gatsby-plugin-s3</h4><blockquote>Grunt is a JavaScript task runner, a tool used to automatically perform frequent tasks such as minification, compilation, unit testing, and linting. It uses a command-line interface to run custom tasks defined in a file.</blockquote><p>If you choose the easy way to create your site, you can use Grunt to upload your completed site files to your AWS S3 bucket.</p><pre>npm install grunt grunt-aws-s3 --save-dev</pre><p>Create a Gruntfile.js:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dc955498d37020dbc740c9799a8068b5/href">https://medium.com/media/dc955498d37020dbc740c9799a8068b5/href</a></iframe><p>Add this to the scripts object of your package.json.</p><pre>&quot;deploy&quot;: &quot;grunt deploy&quot;</pre><p>Now whenever you want to deploy a new production version of your site just execute npm run deploy. This will only POST/PUT files to AWS S3 that have changed — reducing the number of requests you need to pay for (new AWS accounts get 2,000 free PUT requests/month for the first year).</p><p>Alternatively — if you built your site with Gatsby.js, forget Grunt and just use gatsby-plugin-s3 for static site deployment. I wrote a npm script npm run ship which builds the production bundle and uploads it to AWS S3 - gatsby build &amp;&amp; gatsby-plugin-s3 deploy. The code for my Gatsby site can be found <a href="https://github.com/nvincenthill/portfolio_v3">here</a>.</p><h4>Step 6 — Create a distribution with AWS CloudFront</h4><blockquote>Amazon CloudFront is a fast content delivery network (CDN) service that securely delivers data, videos, applications, and APIs to customers globally with low latency, high transfer speeds, all within a developer-friendly environment.</blockquote><p>Create a new CloudFront distribution (loosely following these <a href="https://aws.amazon.com/premiumsupport/knowledge-center/cloudfront-https-requests-s3/">AWS docs</a>). Make sure to specify <strong>Alternate Domain Names</strong> <strong>(CNAMEs)</strong> correctly and request a custom SSL certificate to enable HTTPS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dKBOI5qkk-JZUoTs4KOrHQ.png" /></figure><p>Also specify the <strong>Default Root Object</strong> as index.html.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YdRYM7Ygu_pHCViM6ARgYA.png" /><figcaption>Remember to specify Default Root Object</figcaption></figure><p>Click Create Origin to link your S3 bucket to your CloudFront Distribution. Specify <strong>Origin Domain Name</strong> as YOUR_S3_BUCKET_NAME.s3.amazonaws.com. Do not restrict bucket access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q2B1TcFuw2o9vvkXOXwnjQ.png" /><figcaption>CloudFront Distribution Origin</figcaption></figure><p>Create a new behavior and set <strong>Viewer Protocol Policy </strong>to “Redirect HTTP to HTTPS.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y7BAWIzgm-TCa_jdCBTKqA.png" /><figcaption>CloudFront Distribution Behaviors</figcaption></figure><p>You can also customize error responses — I redirect 404 errors to a custom 404.html page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CyDZcVNq6o3FtA1fDGOjDw.png" /><figcaption>CloudFront Error Pages</figcaption></figure><h4>Step 7 — Redirect traffic to your new CDN with AWS Route53</h4><blockquote>Amazon Route 53 is a highly available and scalable cloud <a href="https://aws.amazon.com/route53/what-is-dns/">Domain Name System (DNS)</a> web service. It is designed to give developers and businesses an extremely reliable and cost effective way to route end users to Internet applications by translating names like <a href="http://www.example.com/">www.example.com</a> into the numeric IP addresses like 192.0.2.1 that computers use to connect to each other.</blockquote><p>Now we need to connect your domain name (mysite.domain) to your CloudFront distribution so that when a user makes a request to your domain they receive your index.html and the rest of your static site (by hitting your newly created CDN).</p><p>Open the AWS Route53 console and create a new <strong>Hosted Zone</strong>. Here’s some helpful <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/migrate-dns-domain-inactive.html">AWS docs</a> to get you started.</p><p><strong>Make sure to update the name servers for the domain you bought. Use the method provided by the registrar for the domain you purchased to change the name servers for the domain (use the four Route53 name servers found in the NS — Name server record set).</strong></p><p>Create a new record set and set the alias target to your AWS CloudFront distribution (see below). Make sure to name it yoursite.domain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*gDQ-77A2FQ0n3Qlr47vcaQ.png" /><figcaption>Alias your CloudFront distribution</figcaption></figure><p>Changes to domain name servers take time to propagate so make sure to wait a few minutes before attempting to access your site via your new domain.</p><h4>Step 8 — Bask in the glory of your newly deployed site! (or troubleshoot problems)</h4><p>You did it! Enjoy your beautiful new portfolio site deployed to the world wide web. Check out <a href="http://nickvh.tech/">my site</a> I built and deployed using this tech stack; I wired up the contact form with AWS Lambda using <a href="https://dev.to/adnanrahic/building-a-serverless-contact-form-with-aws-lambda-and-aws-ses-4jm0">this guide</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lkRw8tZ_QI_tDfz0Tagufg.jpeg" /><figcaption>Enjoy your new beautiful portfolio site! <a href="http://html5up.com/">html5up.com</a></figcaption></figure><blockquote><em>Read Next:</em></blockquote><blockquote><a href="https://hackernoon.com/scrabblr-a-react-game-with-react-dnd-and-react-flip-move-40cfaac786e2">Scrabblr — A React game with react-dnd and react-flip-move</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af125ccbb1c2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/how-to-build-and-deploy-a-beautiful-personal-portfolio-site-with-aws-s3-route53-and-cloudfront-af125ccbb1c2">How to build and deploy a beautiful personal portfolio site with AWS S3, Route53, and CloudFront 🔥</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to build and deploy a beautiful personal portfolio site with AWS S3, Route53, and CloudFront ]]></title>
            <link>https://medium.com/free-code-camp/how-to-build-and-deploy-a-beautiful-personal-portfolio-site-with-aws-s3-route53-and-cloudfront-8827975129ef?source=rss-4ff178295765------2</link>
            <guid isPermaLink="false">https://medium.com/p/8827975129ef</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Nicholas Vincent-Hill]]></dc:creator>
            <pubDate>Wed, 10 Apr 2019 21:03:38 GMT</pubDate>
            <atom:updated>2019-04-17T17:19:31.779Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to build and deploy a beautiful personal static site with AWS S3, Route53, and CloudFront 🔥</h3><p><em>This is a step-by-step guide to creating a responsive static billboard/portfolio site, deploying it to the web with AWS, and serving it securely with HTTPS.</em></p><p>This guide is designed for beginner and intermediate-level software engineers and web developers looking for an easy way to create a personal site for cheaper than paid-services like SquareSpace or other site-builders. Basic technical requirements include a knowledge of HTML/CSS/JS, npm, and Git (the advanced site creation process uses Gatsby.js which requires knowledge of React.js and GraphQL).</p><p>The only economic requirements are AWS Route53 hosted zone fees ($0.50/month) and the cost of acquiring a domain (I rented nickvh.tech for $25 for five years from get.tech). Netlify is a free option as well. The estimated time commitment is four to five hours depending on individual skill and experience.</p><p>This guide will enable you, the developer, to control all aspects of the design, development, and deployment of your site.</p><h4><strong>Step 1 — Create your personal site (the easy way or the hard way)</strong></h4><p><strong>Here’s the easy way:</strong> go <a href="https://html5up.net/">here</a> and pick out a fully responsive, super customizable, and 100% free (under the <a href="https://html5up.net/license">Creative Commons</a>) HTML/CSS/JS template. Download it and customize/build on it until you love it!</p><p>Create a package.json by calling npm init in the root directory of your chosen project. Make sure to git init, add all non-public information to .gitignore, and write great commit messages.</p><p><strong>Here’s the hard way:</strong> use Gatsby.js to build a blazing fast static site and PWA from scratch. This isn’t a Gatsby.js tutorial (plenty of great tutorials can be found <a href="https://www.gatsbyjs.org/tutorial/">here</a>) and requires React.js and GraphQL knowledge. A number of starter templates can be found <a href="https://www.gatsbyjs.org/starters/?v=2">here</a> (I used the “strata” HTML5UP template as a jumping off point for <a href="https://www.nickvh.tech/">nickvh.tech</a>).</p><p>Test and develop your website until you are happy with it and want to share it with the world. We will be building a continuous development pipeline with either Grunt or the gatsby-plugin-s3 plugin later so future revisions/deployment will be quick and easy.</p><h4><strong>Step 2 — Get a domain</strong></h4><p>Sites like <a href="https://get.tech/">https://get.tech</a> or <a href="https://www.namecheap.com/">https://www.namecheap.com</a> offer very compelling prices for domains. I waited for a promotion and got <a href="https://get.tech/">https://nickvh.tech</a> for $25 for five years. Alternatively buy a .dev domain from <a href="https://domains.google/#/">Google</a>.</p><h4><strong>Step 3 — Create an AWS account</strong></h4><p>Create an <a href="https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/">AWS account</a>. This step is fairly straightforward. New accounts get free services for a year — outlined <a href="https://aws.amazon.com/free/">here</a>. This requires you to have an active credit card on file with AWS. <strong>Be aware of the security implications and do not accidentally push your AWS credentials to the public web.</strong></p><h4><strong>Step 4 — Configure AWS S3 buckets</strong></h4><blockquote><em>Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance. This means customers can use it to store and protect any amount of data for a range of use cases, such as websites, mobile applications, backup and restore, archive, enterprise applications, IoT devices, and big data analytics.</em></blockquote><p>AWS S3 is where your static site will live; there are a few things to do in order to configure this correctly.</p><p>First create a bucket; AWS S3 and Route53 only work correctly if your bucket name and domain name match precisely — name your bucket mysite.domain (i.e. nickvh.tech). Make sure to set permissions correctly; the public should be able to read from the bucket but not write to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nDKOVzwkcQamFyaTVWYDHw.png" /><figcaption>Make sure to give public read access to your bucket</figcaption></figure><p>Next navigate to “Properties” and configure AWS S3 to statically serve index.html (see below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jU6929oqVXSINz3o9LHJZg.png" /></figure><p>Create a bucket (also public read access enabled) named www.mysite.domain (<a href="http://www.nickvh.tech/">www.nickvh.tech</a> in my case) and redirect to the main bucket address (see below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3r7p-HOEkXp97fOOdA58dA.png" /></figure><p>Next, create aws-keys.json in the root directory of your project:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5a5b1e2f555692d7f741ab753da5784b/href">https://medium.com/media/5a5b1e2f555692d7f741ab753da5784b/href</a></iframe><p>Here’s a <a href="https://help.bittitan.com/hc/en-us/articles/115008255268-How-do-I-find-my-AWS-Access-Key-and-Secret-Access-Key-">guide</a> to finding your AWS access key ID and Secret key.</p><p><strong>Remember to add </strong>aws-keys.json<strong> to your </strong>.gitignore<strong>! One of my students accidentally pushed their AWS credentials to Github, was programmatically attacked, and incurred ~$1.3k in charges in a few hours.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vb3KlOUa_yZJ_yyZEz9zEg.png" /><figcaption>Don’t let this happen to you!</figcaption></figure><h4>Step 5— Upload your site to AWS S3 with Grunt or gatsby-plugin-s3</h4><blockquote><em>Grunt is a JavaScript task runner, a tool used to automatically perform frequent tasks such as minification, compilation, unit testing, and linting. It uses a command-line interface to run custom tasks defined in a file.</em></blockquote><p>If you choose the easy way to create your site, you can use Grunt to upload your completed site files to your AWS S3 bucket.</p><pre>npm install grunt grunt-aws-s3 --save-dev</pre><p>Create a Gruntfile.js:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dc955498d37020dbc740c9799a8068b5/href">https://medium.com/media/dc955498d37020dbc740c9799a8068b5/href</a></iframe><p>Add this to the scripts object of your package.json.</p><pre>&quot;deploy&quot;: &quot;grunt deploy&quot;</pre><p>Now whenever you want to deploy a new production version of your site just execute npm run deploy. This will only POST/PUT files to AWS S3 that have changed — reducing the number of requests you need to pay for (new AWS accounts get 2,000 free PUT requests/month for the first year).</p><p>Alternatively — if you built your site with Gatsby.js, forget Grunt and just use gatsby-plugin-s3 for static site deployment. I wrote a npm script npm run ship which builds the production bundle and uploads it to AWS S3 - gatsby build &amp;&amp; gatsby-plugin-s3 deploy. The code for my Gatsby site can be found <a href="https://github.com/nvincenthill/portfolio_v3">here</a>.</p><h4><strong>Step 6— Create a distribution with AWS CloudFront</strong></h4><blockquote><em>Amazon CloudFront is a fast content delivery network (CDN) service that securely delivers data, videos, applications, and APIs to customers globally with low latency, high transfer speeds, all within a developer-friendly environment.</em></blockquote><p>Create a new CloudFront distribution (loosely following these <a href="https://aws.amazon.com/premiumsupport/knowledge-center/cloudfront-https-requests-s3/">AWS docs</a>). Make sure to specify <strong>Alternate Domain Names</strong> <strong>(CNAMEs)</strong> correctly and request a custom SSL certificate to enable HTTPS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dKBOI5qkk-JZUoTs4KOrHQ.png" /></figure><p>Also specify the <strong>Default Root Object</strong> as index.html.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YdRYM7Ygu_pHCViM6ARgYA.png" /><figcaption>Remember to specify Default Root Object</figcaption></figure><p>Click Create Origin to link your S3 bucket to your CloudFront Distribution. Specify <strong>Origin Domain Name</strong> as YOUR_S3_BUCKET_NAME.s3.amazonaws.com. Do not restrict bucket access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q2B1TcFuw2o9vvkXOXwnjQ.png" /><figcaption>CloudFront Distribution Origin</figcaption></figure><p>Create a new behavior and set <strong>Viewer Protocol Policy </strong>to “Redirect HTTP to HTTPS.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y7BAWIzgm-TCa_jdCBTKqA.png" /><figcaption>CloudFront Distribution Behaviors</figcaption></figure><p>You can also customize error responses — I redirect 404 errors to a custom 404.html page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CyDZcVNq6o3FtA1fDGOjDw.png" /><figcaption>CloudFront Error Pages</figcaption></figure><h4><strong>Step 7— Redirect traffic to your new CDN with AWS Route53</strong></h4><blockquote><em>Amazon Route 53 is a highly available and scalable cloud </em><a href="https://aws.amazon.com/route53/what-is-dns/"><em>Domain Name System (DNS)</em></a><em> web service. It is designed to give developers and businesses an extremely reliable and cost effective way to route end users to Internet applications by translating names like </em><a href="http://www.example.com/"><em>www.example.com</em></a><em> into the numeric IP addresses like 192.0.2.1 that computers use to connect to each other.</em></blockquote><p>Now we need to connect your domain name (mysite.domain) to your CloudFront distribution so that when a user makes a request to your domain they receive your index.html and the rest of your static site (by hitting your newly created CDN).</p><p>Open the AWS Route53 console and create a new <strong>Hosted Zone</strong>. Here’s some helpful <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/migrate-dns-domain-inactive.html">AWS docs</a> to get you started.</p><p><strong>Make sure to update the name servers for the domain you bought. Use the method provided by the registrar for the domain you purchased to change the name servers for the domain (use the four Route53 name servers found in the NS — Name server record set).</strong></p><p>Create a new record set and set the alias target to your AWS CloudFront distribution (see below). Make sure to name it yoursite.domain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*gDQ-77A2FQ0n3Qlr47vcaQ.png" /><figcaption>Alias your CloudFront distribution</figcaption></figure><p>Changes to domain name servers take time to propagate so make sure to wait a few minutes before attempting to access your site via your new domain.</p><h4>Step 8— Bask in the glory of your newly deployed site! (or troubleshoot problems)</h4><p>You did it! Enjoy your beautiful new portfolio site deployed to the world wide web. Check out <a href="http://nickvh.tech/">my site</a> I built and deployed using this tech stack; I wired up the contact form with AWS Lambda using <a href="https://dev.to/adnanrahic/building-a-serverless-contact-form-with-aws-lambda-and-aws-ses-4jm0">this guide</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lkRw8tZ_QI_tDfz0Tagufg.jpeg" /><figcaption>Enjoy your new beautiful portfolio site! <a href="http://html5up.com/">html5up.com</a></figcaption></figure><blockquote><em>Read Next:</em></blockquote><blockquote><a href="https://hackernoon.com/scrabblr-a-react-game-with-react-dnd-and-react-flip-move-40cfaac786e2">Scrabblr — A React game with react-dnd and react-flip-move</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8827975129ef" width="1" height="1" alt=""><hr><p><a href="https://medium.com/free-code-camp/how-to-build-and-deploy-a-beautiful-personal-portfolio-site-with-aws-s3-route53-and-cloudfront-8827975129ef">How to build and deploy a beautiful personal portfolio site with AWS S3, Route53, and CloudFront 🔥</a> was originally published in <a href="https://medium.com/free-code-camp">We’ve moved to freeCodeCamp.org/news</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scrabblr — A React game with react-dnd and react-flip-move]]></title>
            <link>https://medium.com/hackernoon/scrabblr-a-react-game-with-react-dnd-and-react-flip-move-40cfaac786e2?source=rss-4ff178295765------2</link>
            <guid isPermaLink="false">https://medium.com/p/40cfaac786e2</guid>
            <category><![CDATA[design]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[codingbootcamp]]></category>
            <category><![CDATA[games]]></category>
            <dc:creator><![CDATA[Nicholas Vincent-Hill]]></dc:creator>
            <pubDate>Mon, 18 Jun 2018 13:11:01 GMT</pubDate>
            <atom:updated>2018-06-18T13:11:01.590Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a high level overview of my implementation of a puzzle/word game built entirely in React. It’s not the prettiest code ever written, but I’m happy with my first browser-based game.</p><h3><a href="https://scrabblr.herokuapp.com/">Scrabblr</a> — Improve your Scrabble skills while having tons of fun</h3><figure><a href="https://scrabblr.herokuapp.com/"><img alt="" src="https://cdn-images-1.medium.com/max/751/1*d4ldJrlOxFf2SABu9HNteg.png" /></a><figcaption>Click me to play Scrabblr!</figcaption></figure><p><strong>Background</strong> —I was looking at animation solutions in React.js and stumbled upon Joshua Comeau’s <a href="https://github.com/joshwcomeau/react-flip-move">react-flip-move</a> <a href="http://joshwcomeau.github.io/react-flip-move/examples/#/scrabble?_k=8l9xbo">demo</a>. I saw the potential to build all sorts of scrabble-like games with his cool drag-and-drop and animated motion interface.</p><h3><strong>Technical challenges</strong></h3><h4>Decorators with Babel</h4><p>Joshua Comeau’s <a href="https://github.com/joshwcomeau/react-flip-move">react-flip-move</a> requires function decorators; a language feature not supported by create-react-app’s compiler Babel.</p><figure><a href="https://babeljs.io/docs/plugins/syntax-decorators/"><img alt="" src="https://cdn-images-1.medium.com/max/681/1*cQUivCI1ey-ysWHsIHPi6Q.png" /></a></figure><p>The package <a href="https://github.com/timarney/react-app-rewired">react-app-rewired</a> solves this problem by overriding create-react-app Webpack configs without ejecting (something that‘s super scary for a noob like me who didn’t want to deal with Webpack’s complexity under the hood).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v3nHcvuopO0c8_UWPdF5YQ.png" /><figcaption>config-overrides.js</figcaption></figure><p>The above code allow’s me to inject the <a href="https://github.com/loganfsmyth/babel-plugin-transform-decorators-legacy">transform-decorators-legacy</a> plugin (without ejecting) to handle decorators. One problem solved with many more to go.</p><h4>Creating a game loop</h4><p>To me what separates a cool thing and a “game” is the concept of a <a href="https://gamedevelopment.tutsplus.com/articles/gamedev-glossary-what-is-the-game-loop--gamedev-2469">game loop</a>.</p><p>The main game loop begins with user input (a button clicked to start a new game). The user shuffles tiles and finds words.</p><p>Every time the user changes the location of a tile I check for any valid words. If the word is valid, I score that word and increment the total score by the word’s score. I also add that word to a “Found Words” array as to not double count if it’s found again in the future.</p><p>When the user finds all possible words(see below for the implementation of the all possible matches problem) or gives up (clicks the surrender button) the game loop ends and a results modal appears.</p><p>The data or source of truth is all contained in state and passed to my components with the new React.context API (to avoid <a href="https://itnext.io/compound-components-with-react-v16-3-6679c752bd56">prop-drilling</a>). When a new game loop starts these values are all reset in state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bYiJEArRuL_C42oqE1SKgA.png" /><figcaption>Method to initializes game loop inside the App component</figcaption></figure><h4>Accessing tile location to find characters</h4><p>This problem took me an embarrassingly long time to solve. The tile’s (x, y) position in the grid matrix is contained in state.tiles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FdqAvNOZcpvXwa-Z4zj15w.png" /><figcaption>Tiles are created with default properties and held in state</figcaption></figure><p>I needed to be able to scrape letters from tiles by their position and assemble a string to validate. My solution is a complete hack job and I won’t show it here- it’s the checkForWords() method in App.js on <a href="https://github.com/nvincenthill/scrabblr">my Github</a> which is in desperate need of refactoring.</p><h4>Validating words</h4><p>I also needed a quick way to check if a string of characters was a valid English word. The <a href="https://www.wordsapi.com/">free dictionary API’s</a> I considered had prohibitively low requests allowed per day and high latency. I needed a solution that allowed me to check an exhaustive local list quickly. The Object.hasOwnProperty() method invoked on a dictionary of 270,000+ key-value pairs works nicely and quickly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*tkqUOK9wajv9UGEvqJ4Qsw.png" /><figcaption>Check a single word against the Scrabble dictionary</figcaption></figure><p>The code below is my solution to find all possible valid words given an array of letters. This is how I calculate the number of words remaining to display to the user and know when to end the game loop.</p><p>My original attempt, without utilizing the Object.hasOwnProperty() method and speed optimizations took nearly ten seconds to calculate all possible valid words. This implementation appears nearly instantaneous to the user and is called at the start of a new game loop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*choRe7lPf7kjPpsUwJhtHw.png" /><figcaption>Find all possible valid English words given an array of letters</figcaption></figure><p><strong>Conclusion</strong></p><p>I learned a lot building this project and I’m proud of the result; my game runs fast and looks good. Eventually I’d like to add OAuth and data permanence, high score record keeping, and user-designed levels.</p><p>I’m still new to programming and web design — I’d love to hear your comments/suggestions/critiques in the comments.</p><p>Play <a href="https://scrabblr.herokuapp.com/">Scrabblr here!</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*S0H89POj_i2ndJSRFebGtg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*Rp4dAQfFd6Oex9_DzSH_YA.png" /><figcaption>Thanks for reading!</figcaption></figure><blockquote><em>Read Next:</em></blockquote><blockquote><a href="https://medium.com/coding-overload/introduction-and-a-little-about-accessing-iexs-api-with-javascript-7ae4e8af79d6">Introduction and a little about accessing IEX’s API with JavaScript</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40cfaac786e2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/scrabblr-a-react-game-with-react-dnd-and-react-flip-move-40cfaac786e2">Scrabblr — A React game with react-dnd and react-flip-move</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I built a React game with react-dnd and react-flip-move]]></title>
            <link>https://medium.com/free-code-camp/how-i-built-a-react-game-with-react-dnd-and-react-flip-move-26300156a825?source=rss-4ff178295765------2</link>
            <guid isPermaLink="false">https://medium.com/p/26300156a825</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[games]]></category>
            <dc:creator><![CDATA[Nicholas Vincent-Hill]]></dc:creator>
            <pubDate>Thu, 14 Jun 2018 00:41:38 GMT</pubDate>
            <atom:updated>2018-06-14T00:41:38.685Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a high level overview of my implementation of a puzzle/word game built entirely in React. It’s not the prettiest code ever written, but I’m happy with my first browser-based game.</p><p>Here’s what I built:</p><h4><a href="https://scrabblr.herokuapp.com/">Scrabblr</a> — Improve your Scrabble skills while having tons of fun</h4><figure><a href="https://scrabblr.herokuapp.com/"><img alt="" src="https://cdn-images-1.medium.com/max/751/1*d4ldJrlOxFf2SABu9HNteg.png" /></a><figcaption>Click me to play Scrabblr!</figcaption></figure><h3><strong>Background</strong></h3><p>I was looking at animation solutions in React.js and stumbled upon Joshua Comeau’s <a href="https://github.com/joshwcomeau/react-flip-move">react-flip-move</a> <a href="http://joshwcomeau.github.io/react-flip-move/examples/#/scrabble?_k=8l9xbo">demo</a>. I saw the potential to build all sorts of scrabble-like games with his cool drag-and-drop and animated motion interface.</p><h3>Technical challenges</h3><h4>Decorators with Babel</h4><p>Joshua Comeau’s <a href="https://github.com/joshwcomeau/react-flip-move">react-flip-move</a> requires function decorators, a language feature not supported by create-react-app’s compiler Babel.</p><figure><a href="https://babeljs.io/docs/plugins/syntax-decorators/"><img alt="" src="https://cdn-images-1.medium.com/max/681/1*cQUivCI1ey-ysWHsIHPi6Q.png" /></a></figure><p>The package <a href="https://github.com/timarney/react-app-rewired">react-app-rewired</a> solves this problem by overriding create-react-app Webpack configs without ejecting (something that’s super scary for a noob like me who didn’t want to deal with Webpack’s complexity under the hood).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v3nHcvuopO0c8_UWPdF5YQ.png" /><figcaption>config-overrides.js</figcaption></figure><p>The above code allowed me to inject the <a href="https://github.com/loganfsmyth/babel-plugin-transform-decorators-legacy">transform-decorators-legacy</a> plugin (without ejecting) to handle decorators. One problem solved with many more to go.</p><h4>Creating a game loop</h4><p>To me, what separates a cool thing and a “game” is the concept of a <a href="https://gamedevelopment.tutsplus.com/articles/gamedev-glossary-what-is-the-game-loop--gamedev-2469">game loop</a>.</p><p>The main game loop begins with user input (a button clicked to start a new game). The user shuffles tiles and finds words.</p><p>Every time the user changes the location of a tile, the game checks for any valid words. If the word is valid, it scores that word and increments the total score by the word’s score. It also adds that word to a “Found Words” array so it doesn’t double count if it’s found again in the future.</p><p>When the user finds all possible words (see below for the implementation of the all possible matches problem) or gives up (clicks the surrender button) the game loop ends and a results modal appears.</p><p>The data or source of truth is all contained in state and passed to my components with the new React.context API (to avoid <a href="https://itnext.io/compound-components-with-react-v16-3-6679c752bd56">prop-drilling</a>). When a new game loop starts, these values are all reset in state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bYiJEArRuL_C42oqE1SKgA.png" /><figcaption>Method to initializes game loop inside the App component</figcaption></figure><h4>Accessing tile location to find characters</h4><p>This problem took me an embarrassingly long time to solve. The tile’s (x, y) position in the grid matrix is contained in state.tiles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FdqAvNOZcpvXwa-Z4zj15w.png" /><figcaption>Tiles are created with default properties and held in state</figcaption></figure><p>I needed to be able to scrape letters from tiles by their position and assemble a string to validate. My solution is a complete hack job and I won’t show it here — it’s the checkForWords() method in App.js on <a href="https://github.com/nvincenthill/scrabblr">my Github</a>, which is in desperate need of refactoring.</p><h4>Validating words</h4><p>I also needed a quick way to check if a string of characters was a valid English word. The <a href="https://www.wordsapi.com/">free dictionary API’s</a> I considered had prohibitively low requests allowed per day and high latency. I needed a solution that allowed me to check an exhaustive local list quickly. The Object.hasOwnProperty() method invoked on a dictionary of 270,000+ key-value pairs works nicely and quickly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*tkqUOK9wajv9UGEvqJ4Qsw.png" /><figcaption>Check a single word against the Scrabble dictionary</figcaption></figure><p>The code below is my solution to find all possible valid words given an array of letters. This is how I calculate the number of words remaining to display to the user and know when to end the game loop.</p><p>My original attempt, without utilizing the Object.hasOwnProperty() method and speed optimizations took nearly ten seconds to calculate all possible valid words. This implementation appears nearly instantaneous to the user and is called at the start of a new game loop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*choRe7lPf7kjPpsUwJhtHw.png" /><figcaption>Find all possible valid English words given an array of letters</figcaption></figure><h3><strong>Conclusion</strong></h3><p>I learned a lot building this project and I’m proud of the result: my game runs fast and looks good. Eventually I’d like to add OAuth and data permanence, high score record keeping, and user-designed levels.</p><p>I’m still new to programming and web design — I’d love to hear your comments/suggestions/critiques in the comments.</p><p>Play <a href="https://scrabblr.herokuapp.com/">Scrabblr here!</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*S0H89POj_i2ndJSRFebGtg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*Rp4dAQfFd6Oex9_DzSH_YA.png" /><figcaption>Thanks for reading!</figcaption></figure><blockquote><em>Read Next:</em></blockquote><blockquote><a href="https://medium.com/coding-overload/introduction-and-a-little-about-accessing-iexs-api-with-javascript-7ae4e8af79d6">Introduction and a little about accessing IEX’s API with JavaScript</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26300156a825" width="1" height="1" alt=""><hr><p><a href="https://medium.com/free-code-camp/how-i-built-a-react-game-with-react-dnd-and-react-flip-move-26300156a825">How I built a React game with react-dnd and react-flip-move</a> was originally published in <a href="https://medium.com/free-code-camp">We’ve moved to freeCodeCamp.org/news</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction and a little about accessing IEX’s API with JavaScript]]></title>
            <link>https://medium.com/@nvincenthill/introduction-and-a-little-about-accessing-iexs-api-with-javascript-7ae4e8af79d6?source=rss-4ff178295765------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ae4e8af79d6</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[codingbootcamp]]></category>
            <dc:creator><![CDATA[Nicholas Vincent-Hill]]></dc:creator>
            <pubDate>Wed, 30 May 2018 11:17:13 GMT</pubDate>
            <atom:updated>2018-05-30T11:22:28.011Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello there!</p><p>I’m about to start the Hack Reactor 13-week immersive program and I thought I would document the experience, some technical challenges I’ll face and overcome, and some of my other thoughts here on Medium.</p><p>A little about me:</p><ol><li>I’m a former trader (equities, commodities, mortgage-backed securities, etc.) looking to pivot into tech.</li><li>I live with my wonderful girlfriend and our urban garden in Oakland, CA.</li><li>I have no idea how to blog and I’m still taking my first steps into the world of programming and software engineering.</li></ol><p>In future posts I will use this medium to enumerate on my experiences during Hack Reactor, my job search and preparation, and perhaps rant my political and philosophical ideas.</p><p>I’ve been building a Bloomberg/Yahoo Finance knock-off with React named <a href="https://shroomberg.herokuapp.com/">Shroomberg</a> to learn asynchronous JavaScript and how to access REST(ful)? API’s. Here’s how I call IEX:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AdqU-oSu-uTo7J4V4rpVlw.png" /></figure><p>Let’s examine the variable declarations:</p><pre>let query = this.state.value;<br>let endpoint = `<a href="https://api.iextrading.com/1.0/stock/$%7Bquery%7D/batch?types=quote,stats,company,news,chart&amp;range=5y`">https://api.iextrading.com/1.0/stock/${query}/batch?types=quote,stats,company,news,chart&amp;range=5y`</a>;</pre><p>Here I get the specific stock ticker from state (stored to state as entered in an input box by the user) and create the required IEX endpoint. This endpoint gives me the quote, key stats, news, and most of the chart data I need.</p><p>Next- the fetch:</p><pre>fetch(endpoint)<br>  .then(response =&gt; {<br>    if (response.ok) {<br>      return response.json();<br>    }<br>   })<br>   .then(responseJson =&gt; {<br>     this.addData(responseJson);<br>   })<br>   .catch(error =&gt; {<br>     console.log(error);<br>     this.setState({ inputClass: &quot;animated shake search red&quot; });<br>     setTimeout(() =&gt; this.setState({ inputClass: &quot;search&quot; }),1000);<br>});</pre><p>If the fetch was <a href="https://developer.mozilla.org/en-US/docs/Web/API/Response/ok">successful</a>, I convert to JSON with .json() and call my addData() function to handle data cleaning and the setState() operation.</p><p>Here is the complete <a href="https://github.com/nvincenthill/stock-quote-app">code</a> and instructions to run my app locally.</p><p>In the future I hope to add this additional functionality to my fledgling app:</p><ol><li>Fuzzy search by name and ticker and some sort of auto-complete feature.</li><li>Add cryptocurrency quote capabilities and associated features (see <a href="http://bitinfocharts.com/">http://bitinfocharts.com/</a>)</li><li>Clean up a variety of bugs and make the site to increase performance and user experience.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ae4e8af79d6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>