<?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 Jen Tchai on Medium]]></title>
        <description><![CDATA[Stories by Jen Tchai on Medium]]></description>
        <link>https://medium.com/@jentchai?source=rss-67bef6ee30f1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_mNoMBZeBhvZYM4BQ4LFnQ.jpeg</url>
            <title>Stories by Jen Tchai on Medium</title>
            <link>https://medium.com/@jentchai?source=rss-67bef6ee30f1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 15:57:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jentchai/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[What is Next.js?]]></title>
            <link>https://medium.com/@jentchai/what-is-next-js-651dc24f1bb9?source=rss-67bef6ee30f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/651dc24f1bb9</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Jen Tchai]]></dc:creator>
            <pubDate>Mon, 10 Apr 2023 02:42:34 GMT</pubDate>
            <atom:updated>2023-04-10T02:42:34.930Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wJXRp1mUD6XJgl4FA8vZkg.jpeg" /></figure><p>Hello friends, it has been awhile, but I am back with another chapter. This time, I recently started to dive into <a href="https://nextjs.org/">Next.js</a> (v.13) and decided to build my personal portfolio with it. <em>(For the curious, here’s a shameless plug: </em><a href="https://jentchai-portfolio.vercel.app/"><em>https://jentchai-portfolio.vercel.app/</em></a><em>)</em> Here are some of my thoughts and research findings on this framework so far.</p><p>Choosing the appropriate language, tool, or framework can be a daunting task for software developers—there are so many new options constantly being introduced into the web development ecosystem. I am starting to realize that it is crucial to establish a reliable tech stack and make regular assessments whether it continues to be the most suitable for you and your team.</p><p><strong>So, what is Next.js?</strong></p><p><a href="https://nextjs.org/">Next.js</a> is a contemporary JavaScript framework used for crafting modern web applications. This framework is a static site generator that is built on top of React, a popular library for building user interfaces. This means that while you use React to build your app, Next.js can give you the extra features and tools to make the process easier and more powerful. Developed by <a href="https://vercel.com/">Vercel</a>, Next.js enables developers to build high-performing static web applications.</p><p><strong>Pros of using Next.js</strong></p><p>One of the major benefits of Next.js is the ability to provide both server-side and client-side rendering features, which makes it ideal for developing full-stack applications. Server-side rendering means that the server can generate HTML for a page and send it to the client, as opposed to the client generating HTML using JavaScript. This can improve your app’s performance and search engine optimization (SEO), making it faster to load. Additionally, websites and applications built with Next.js can be deployed easily anywhere that supports Node.js.</p><p>Other advantages of using Next.js include easy setup, automatic code splitting, easy development of API endpoints as Node.js serverless functions, built-in zero-configuration TypeScript support, automatic compilation and bundling, and automatic image optimization with the built-in image component. Next.js also makes it easy to import CSS files from a JavaScript file.</p><p>In addition, Next.js ensures that websites and applications have an excellent user experience and can adapt to any device screen size. It also enables the rapid development of MVPs and enhanced applications made possible by pre-built React components, allowing for rapid feedback and product improvement.</p><p><strong>Cons of using Next.js</strong></p><p>Let’s talk about disadvantages: Although Next.js has been through rapid development and addition of several features, it also comes with drawbacks and issues.</p><p>Next.js has a file-based system routing that lacks flexibility, especially when it comes to routing. By default, Next.js uses page-based routing where you specify whether pages should be generated server-side, client-side, or static. While this approach may be suitable for smaller applications, it can become tedious when working on complex applications since it requires writing more code.</p><p>The process of converting a server-side application to Next.js can also take some time and effort, which can be significant depending on the size and scope of your project.</p><p><strong>Next.js Features</strong></p><p>Let’s take a brief look at each of these features:</p><ol><li>File-Based Routing</li><li>Data Fetching</li><li>Streaming</li><li>Additional cool stuff: next/image, next/font, next/link</li></ol><p><strong>File-Based Routing</strong></p><p>Instead of dealing with react-router, Next.js has file-based routing which routes are specified using the directory project structure. You can create a brand new path by adding an entry point to the directory page.</p><p>The app/ directory makes it easy to lay out complex interfaces that maintain state across navigations since the layouts preserve state and interactivity, and they do not re-render. You can also enable advanced routing patterns with nested layouts, and co-locate application code with your routes, like components, tests, and styles.</p><p><strong>Data Fetching</strong></p><p>Next.js 13 brings in a new way to collect data for server-rendered components, called async components. With async components, developers can utilize Promises to render systems using async/await when collecting data. By declaring the component as async and awaiting the response, we can fetch data from an external service or API that returns a Promise.</p><p>The native fetch Web API has also been extended in React and Next.js. It provides a flexible way to fetch, cache, and revalidate data at the component level. In the app directory, you can fetch data inside pages, layouts, and components.</p><p><strong>Streaming</strong></p><p>In the past, users had to wait for the entire page to generate. However, with the new update, the server transmits small UI pieces to the client as they are generated, allowing smaller pieces to load first. Currently, only the app directory supports this feature.</p><p>Users with weaker and slower internet connections will benefit more from this feature. This new feature will improve the user experience by decreasing site loading times.</p><p><strong>Additional Cool Stuff</strong></p><p><em>next/image</em>: The Image component in Next.js, next/image, offers several improvements, including less client-side JavaScript, easier styling and configuration, and enhanced accessibility. In version 12, next/legacy/image and next/future/image have both been changed to next/image in the latest version.</p><p><em>next/font</em>: The new @next/font is a brand new font system that allows the use of custom fonts, such as Google Fonts, without any browser queries, increasing both efficiency and privacy. During build time, CSS and font files are downloaded, along with other static assets.</p><p><em>next/link</em>: &lt;Link&gt; tags will always render &lt;a&gt;, which means there’s no need to manually add &lt;a&gt; tags as a child.</p><p><strong>Conclusion</strong></p><p>Without a doubt, Next.js 13 is filled with interesting tools and features. I am looking forward to following all of the future updates in the official blog: <a href="https://nextjs.org/blog/next-13">https://nextjs.org/blog/next-13</a> . As I am still learning about Next.js, please feel free to leave a comment —what have you learned? Have you built any projects or applications using this framework? Did I miss any points?</p><p>I hope you continue on this learning journey with me, and…until next time, my friends.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=651dc24f1bb9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building A Simple Login System with Authentication and Ruby on Rails]]></title>
            <link>https://medium.com/@jentchai/building-a-simple-login-system-with-authentication-and-ruby-on-rails-27a97025b5ec?source=rss-67bef6ee30f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/27a97025b5ec</guid>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[rails]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Jen Tchai]]></dc:creator>
            <pubDate>Fri, 11 Mar 2022 05:39:04 GMT</pubDate>
            <atom:updated>2022-03-11T05:39:04.046Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5yBFkQ5v_tMDaoVGLEiTgA.png" /><figcaption>The main login page of Calmer.</figcaption></figure><p>For my fourth project in the Flatiron School Software Engineering program, I collaborated with <a href="https://medium.com/u/a00ee56e1fbc">Shani Burde</a> to build <em>Calmer</em>, a yoga application using Ruby on Rails. Rails is a popular web application framework built on the Ruby programming language and is used in many well-known and prominent websites such as Twitter, Hulu, Airbnb, and GitHub.</p><p>The main idea for this app is to improve one’s yoga practice by accessing yoga poses and videos. Features include a user being able to create an account, log in, access a display of yoga poses and videos, and view/write comments about their experiences.</p><p><strong>What is Authentication?</strong></p><p>I was curious to learn more about login and authentication using Rails and built this functionality into <em>Calmer</em>. At its most simple form, authentication involves confirming that a user is who they say they are. For instance, you submit your username and password to Twitter. Twitter’s servers will check to see if your info is correct. If it is, the servers will send a cookie to your browser. Having this cookie will allow you to navigate throughout Twitter without having to constantly enter your info. The server verifies this cookie and lets you load your profile page, comments, and DMs.</p><p>With authentication, a login system looks like this in a Rails application:</p><ol><li>User enters their username and password in the Login form.</li><li>User submits the form which sends a POST request to the /login route on Rails.</li><li>The credentials are verified and set a token (e.g. their user ID) in the session.</li><li>User logs out by removing/deleting their user ID from the session.</li></ol><p>I will use examples of my code from the Calmer app to illustrate parts of this flow of login and authentication.</p><p><strong>Login Functionality</strong></p><p>Initially, I made a SessionsController with a create action. This action will look up a user in the database, verify login info, and then store the user ID in the session. If the user’s credentials (username and/or password) are not found in the database, it will return an Unauthorized error message:</p><figure><img alt="create action code in Sessions Controller" src="https://cdn-images-1.medium.com/max/1024/1*mmvmS_n6Bwkd6ALjDbbiKw.png" /></figure><p>In routes.rb, I linked this create action in order to handle POST requests to /login:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*yjhvBzIbOMOuRjubLGU-TA.png" /></figure><p><strong>Keeping a User Logged In</strong></p><p>At this point, when the user submits the Login form, they will be logged in if the credentials are correct and the user data is saved in state. However, if the user tries refreshing the page, the frontend state may get lost even though the backend knows who the user is. To overcome this issue, I did two things: (1) created a show action in UsersController to be able to find the specific user by the session, and (2) set a /me route in routes.rb to be able to retrieve the user’s credentials from the database:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*yzR13vofwCzESTWvESpgKw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*9gy1c1AMhTwkKdLe9CQdNw.png" /></figure><p><strong>Logout Functionality</strong></p><p>To have the ability to logout, I added a destroy method to SessionsController which will delete the user ID from the session, and also made the corresponding route in routes.rb:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*0nQ4Og-Eg-6NzuE0CcegyQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*tF_JJJTtUc_2JDUCRL-zKw.png" /></figure><p><strong>Closing Remarks</strong></p><p>After completing this project, I learned a considerable amount about authentication (and later authorization). I hope that after reading this, you will also gain more understanding and clarity on this feature as well as inspire you to utilize it in your own projects. As always, feel free to reach out to me with any questions or comments regarding this topic!</p><p>P.S. Check out the repo for <em>Calmer</em> <a href="https://github.com/shaniburde/phase-4-project">here</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27a97025b5ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TypeScript: My first impressions]]></title>
            <link>https://medium.com/@jentchai/typescript-my-first-impressions-71970d1411e6?source=rss-67bef6ee30f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/71970d1411e6</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Jen Tchai]]></dc:creator>
            <pubDate>Thu, 17 Feb 2022 15:15:42 GMT</pubDate>
            <atom:updated>2022-02-17T15:15:42.826Z</atom:updated>
            <content:encoded><![CDATA[<p>Sharing my initial understanding of TypeScript, the stricter version of JavaScript</p><figure><img alt="typescript meme" src="https://cdn-images-1.medium.com/max/687/1*pF4G32V9m63vRBRpY_qORQ.png" /></figure><p>Here is an update: I am currently at the halfway point of my Software Engineering program at Flatiron School and I am feeling mixed emotions. On one hand, I am amazed by how much full-stack development I’ve learned in the past two months. On the other hand, I am a little apprehensive (well, who am I kidding? I’m super terrified) of the job search that lies ahead. Will I apply to 500+ jobs and get ghosted by everyone?</p><p>I told myself that the huge task of applying for jobs needs to be broken down into smaller ones. A few weeks ago I talked with a Software Engineer who suggested that in addition to building projects, I can stand out by getting curious about another language/framework outside of the Flatiron curriculum. I asked him, “Okay, what are you using at your job?” After our Zoom call, I was intrigued by TypeScript and started to do research about it.</p><h3>What is TypeScript anyways?</h3><p>TypeScript is a programming language developed and maintained by Microsoft. It is an expanded superset version of JavaScript that provides additional syntax to JavaScript to support a tighter integration with your editor. TypeScript offers all of JavaScript’s features and an additional layer on top: TypeScript’s strict type system. TypeScript code consists of plain JS code as well as certain keywords and constructs that are specific to TypeScript.</p><p>Since TypeScript generates plain JS code, you can use it with any browser. You can run the TypeScript Compiler with a “tsc” command which takes your .ts file and transpile it to a JavaScript .js file.</p><h3>Why use TypeScript?</h3><p>There are many benefits of using TypeScript. Here are a few:</p><ol><li><strong>Code Suggestions</strong></li></ol><p>TypeScript populates with options as you code which saves a lot of effort in figuring out what should be written in a self-explanatory way. For example (as shown in the below screenshot), TypeScript will suggest the required props:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DkS8WYOIubNbh3a6ZaId2Q.png" /></figure><p>These suggestions pop up because of the defined “Props” interface at the top in Lines 2–5. The “interface” allows you to define custom types and this is really powerful when working with objects.</p><p>2. <strong>Shows you errors ASAP</strong></p><p>Let’s imagine you are baking a vanilla cake with various ingredients and amounts. This time, you accidentally added hot sauce without paying attention, and you put the whole mixture in the oven. After finally slicing it and eating it, you realize that the whole cake is ruined. Without a doubt, you would want to know where you did wrong as soon as possible.</p><p>This is the same as when coding with JavaScript. If your code has an error or is broken, you will not see it until runtime. This is the point where you usually check the browser (console.log) or when the company invested time and money to fix the error. While you are coding, TypeScript tells you what is wrong right then and there with an error popup.</p><p>The main benefit of TypeScript is that it can highlight unexpected behavior and thus lowering the chance of bugs:</p><figure><img alt="TypeScript popup showing error in the code" src="https://cdn-images-1.medium.com/max/700/1*VEj81_Qpn416DpiBxr3DPQ.png" /><figcaption>TypeScript warning you about inconsistencies in your code</figcaption></figure><p>Here is another example of TypeScript catching errors. In this example, the <em>const user</em> is declared to conform to the shape of the new interface at the top of the code by using <em>TypeName</em> syntax (<em>: User</em>) after a variable declaration. If you provide an object that does not match the interface you have provided, TypeScript will warn you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*xxG-XQntk83blKHbB9natA.png" /></figure><p>3. <strong>More primitive types</strong></p><p>There is already a small set of primitive types available in JavaScript: boolean, bigint, null, number, string, symbol, and undefined. TypeScript extends this list with a few more, such as:</p><ul><li>any (allows anything — you can loosely type and opt-out of type checking)</li><li>unknown (ensure someone using this type declares what the type is)</li><li>never (it’s not possible that this type could happen)</li><li>void (a function that returns undefined or has no return value).</li></ul><p>4. Composing types</p><p>With TypeScript, you can create complex types by combining simple ones, and the two of the most common ways to do this are with <em>unions</em> and with <em>generics</em>.</p><p>With a <em>union</em>, you can declare that a type can be one of many types. In the example below, you can declare that MyBool can only be a boolean of either true or false:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/272/1*FujZ2cBtl2vlcKbd_-L3xw.png" /></figure><p>You can also use union types to describe a specific set of string or number literals that a value is allowed to be:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*oz-i1SHK3SUrB-YuNM2eJw.png" /></figure><p>With a <em>generic</em>, you can provide variables to types. A generic is commonly used for arrays to describe the specific values that the array contains:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*g_Jefy5ostmPdEYwi4HkoA.png" /></figure><h3>Closing Remarks</h3><p>These are my first impressions of TypeScript and my understanding of the basics. To me, TypeScript seems to be more reliable and explicit than plain JavaScript because it helps developers evade errors and make rewrites easier. It seems to also focus our attention on how exactly our system is built.</p><p>I will continue to deepen my knowledge of this programming language and hope to one day give it a try! Please feel free to reach out to me if you have any helpful TypeScript resources or if you want to share your experiences. Until next time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71970d1411e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to be less afraid of CSS]]></title>
            <link>https://medium.com/@jentchai/how-to-be-less-afraid-of-css-9e90e0eeeec7?source=rss-67bef6ee30f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e90e0eeeec7</guid>
            <category><![CDATA[web-design]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[Jen Tchai]]></dc:creator>
            <pubDate>Thu, 27 Jan 2022 06:43:45 GMT</pubDate>
            <atom:updated>2022-01-27T06:43:45.914Z</atom:updated>
            <content:encoded><![CDATA[<p>These are my tips for software developers dealing with the dread of the stylesheet language.</p><figure><img alt="CSS is awesome coffee mug" src="https://cdn-images-1.medium.com/max/560/1*50fagxraZmlzQSS6uHvTwg.jpeg" /></figure><p>This morning, I received a Slack message from one of my fellow classmates from the Flatiron School Software Engineering program that read:</p><blockquote>“well can’t avoid it anymore. gotta embrace some CSS.”</blockquote><p>It seems that when it comes to Cascading Styling Sheets (CSS), many software developers share the same feeling of resignation. Some may have a strong dislike for it and try to avoid it.</p><p>For a while now, I wondered why many developers have a negative reaction whenever CSS comes up in mind or discussion. To me, CSS is way easier to learn than vanilla JavaScript or React! Additionally, it is completely satisfying to see visual results on the page.</p><p>But I can understand and empathize with others about the pain. No one remembers everything they learned in CSS, so Google, YouTube, and StackOverflow become your second memory banks. Sometimes things don’t look the way you envisioned. Centering a div — enough said.</p><p>Especially as a frontend developer, it will be difficult to hide from CSS for your entire career. Like anything else, CSS is a learnable skill. How amazing will it be to tell others that you have learned this skill and not flinch? To help you start this journey, I have compiled some tips that I found helpful to make styling less scary:</p><p><strong>Use A Framework</strong></p><p>CSS frameworks are made up of ready-to-use stylesheets for use for standard web design functions (e.g. setting colors, layout, navbars). With a CSS framework, you can accomplish tasks faster and in a more convenient manner. Developers can also quickly generate a UI that is user-friendly and visually appealing.</p><p>Some examples of popular frameworks:</p><ol><li><a href="https://getbootstrap.com/">Bootstrap</a></li><li><a href="https://tailwindcss.com/">Tailwind CS</a>S</li><li><a href="https://get.foundation/">Foundation</a></li><li><a href="https://bulma.io/">Bulma</a></li><li><a href="http://getskeleton.com/">Skeleton</a></li></ol><p><strong>Use Flexbox</strong></p><p>Flexbox is a layout method that was originally designed as a one-dimensional model that deals with one dimension at a time (either row or column). It is much easier to use than floats. It has good browser support and makes it very simple to do traditionally painful CSS things.</p><p>For example, these three lines of code help make an object center perfectly in a square box:</p><figure><img alt="Flexbox code to help center your objects within a box" src="https://cdn-images-1.medium.com/max/530/1*S7RGNlD85olSbP6_f1zeJw.png" /></figure><p>Feel free to take a look at more tricks you can do with Flexbox with this guide: <a href="https://css-tricks.com/snippets/css/a-guide-to-flexbox/">A Guide to Flexbox</a> .</p><p><strong>Organize Your CSS Selectors</strong></p><p>In my experience, I like to write CSS selectors in the same order as the sections on the HTML page. Sometimes I also take it a step further and group selectors by element, class, and ID within each section. Use comments to label sections and separate your CSS to help quickly reference and make life easier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*N4irjBgZ5ER2dew2iLCm2Q.png" /></figure><p><strong>Be a Copycat</strong></p><p>In art, many great painters such as Picasso and Van Gogh learned techniques by copying the works of other artists and eventually refined their own style. The idea that we aren’t creative/technical/smart enough unless we come up with something unique and original can prevent us from actually getting started with our own projects.</p><p>What are your favorite webpage layouts? What looks good? What inspires you? Find simple pages that you can learn from. Take a look into the Developer Tools and learn how each part would contribute to the page design.</p><p>What if you peeked into Developer Tools and your eyes glazed over? Another suggestion is <a href="https://www.frontendmentor.io/">Frontend Mentor</a>, which you can use to practice recreating their webpage designs for free and upload them to GitHub. I like how the challenges are ranked by difficulty level. If you want to pay for the Pro Subscription, you have access to more challenges and the Sketch and Figma designs.</p><figure><img alt="Frontend Mentor for recreating and practicing webpage design" src="https://cdn-images-1.medium.com/max/973/1*7bNc1VoCTVgG5TMqDfaojg.png" /><figcaption>Frontend Mentor website to practice your CSS skills and more</figcaption></figure><p><strong>Closing Remarks</strong></p><p>I hope these tips that I have shared are helpful in reducing the fear and aversion towards CSS. I hope soon when after writing CSS and solving problems, and experiencing that feeling of euphoria when you <em>get it looking right — </em>is unmatched.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e90e0eeeec7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>