<?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 Bibek Ghimire on Medium]]></title>
        <description><![CDATA[Stories by Bibek Ghimire on Medium]]></description>
        <link>https://medium.com/@bibekg?source=rss-6c487ef0946e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*RsPCvdzRnHNotw29y8bXjQ.jpeg</url>
            <title>Stories by Bibek Ghimire on Medium</title>
            <link>https://medium.com/@bibekg?source=rss-6c487ef0946e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 21:02:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bibekg/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[an immense(ly adorable) sense of responsibility]]></title>
            <link>https://medium.com/@bibekg/an-immense-ly-adorable-sense-of-responsibility-a6f4fbb31daa?source=rss-6c487ef0946e------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6f4fbb31daa</guid>
            <category><![CDATA[dogs]]></category>
            <dc:creator><![CDATA[Bibek Ghimire]]></dc:creator>
            <pubDate>Fri, 25 Nov 2022 10:10:47 GMT</pubDate>
            <atom:updated>2022-11-25T16:21:30.047Z</atom:updated>
            <content:encoded><![CDATA[<p>My mom recently surprised me by getting me/herself/us a puppy. If you had asked her that morning if she wanted a dog, she’d have told you no. I’d been trying to convince her for years that she should get one and I could help tak care of it but to no avail. Somehow though, when she found herself standing beside my cousin and his girlfriend who had just decided to bring home one little pup, she saw his brother trot out and couldn’t resist grabbing him for herself. She called me during their car ride back to her place to surprise me with the news (and boy was I surprised…)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5xVRGdVTZIqlxmZ0.jpeg" /></figure><p>It’s now been four weeks since we welcomed that adorable little cockapoo — now named Kaju (Nepali for Cashew) — into our home and it’s already been quite the journey. As I’d been told by many others who have been through the experience, raising a puppy is a <strong>lot</strong> of work. But this fact turns out to be one of those lessons in life that you can’t expect to properly understand until you experience it yourself.</p><p>Each day with this new teethy bundle of curiosity is filled with incremental steps — or more accurately, leaps — towards falling in love with him. Each time I unfasten his crate’s latch to welcome him to the new day ahead. Each chewy little 4-calorie treat I hand-feed him in my efforts to train him how to <em>be</em> in this world. Each hug and cuddle I give him as he desperately tries to squirm out of my grasp. The love I feel towards him and from him has a depth and purity that I can feel is exquisitely special and worthy of savoring.</p><p>Along with this abundance of love, I feel an immense sense of responsibility and duty. I feel acutely aware that this creature’s existence revolves around us, in the specific case of our pup and us but also in the general case of most dogs and the humans that care for them. We’ve co-evolved with dogs for over 30 millennia such that to take on the role of being a dog owner is to take on the responsibility of equipping them to thrive in a world where they are no longer self-sufficent.</p><p>From this lens, I’ve found it somewhat shocking how lax the process of bringing Kaju into our lives has been. After rushing back to my mom’s to meet him on the day she brought him home, my type A personality immediately kicked in and I immediately started Googling and watching YouTube videos on questions like “what to do on puppy’s first day home”. I had heard somewhere that a puppy’s first few days, weeks, and months in their new home are the most important so I wanted to make sure I was doing everything I could to optimize Kaju’s early experiences.</p><p>A few days ago, I started reading in more depth about raising a puppy by picking up a book recommended by Reddit’s r/puppy101 subreddit, <a href="https://a.co/d/aWSz3fb">Puppy Start Right by Kenneth Martin</a>. I’m still working my way through it but a few of my most salient takeaways so far have been:</p><ul><li>There are fairly specialized methods and principles for training a dog’s behavior and a lot of them are counter-intuitive for humans (e.g. shouting “No!” to dissuade bad behavior is ineffective at best, harmful at worst.)</li><li>Puppies have various explicit phases of development in the first several months of their lives. For example, they have a “fear period” typically from 8–10 weeks and “traumatic experiences to stimuli that induce fear during this sensitive period may be generalized and produce lifelong aversion responses”.</li><li>It’s incredibly important to socialize your puppy with other people, dogs, and environments from an early age. Not doing so drastically increases the risk of behavioral problems later on in life.</li></ul><p>I was surprised to read these essential (and in some cases, urgent!) pieces of information. But more importantly, I was surprised that I was surprised. It felt wrong that I was learning these things only because I was being a proactive dog owner and reading this book. It felt like I and/or my mom should have been <em>required</em> to read something or take a class before even being allowed to bring Kaju home.</p><p>It reminded me of the time I hiked Half Dome in Yosemite, a hike where the last 30 minutes or so involve pulling yourself up a ridiculously steep and slick granite face in a narrow single-file line of dozens of people, using nothing but steel cables installed on either side of you. I’ve never really been fearful as a hiker but that afternoon, I was blown away by how dangerous (albeit breathtaking) of a situation I had found myself in. I remember thinking “How am I allowed to do this without having signed a waiver? Any person in front of me could lose their grip and kick off a domino chain of people falling off this mountain.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X6TV27GxFGHwqXqEDFTUPQ@2x.jpeg" /></figure><p>I kind of feel a similar way about bringing Kaju into our lives. I’m shocked by how little we had to prepare for and demonstrate our readiness for the task ahead and I’m having a fear period of my own about making sure we’re doing everything right.</p><p>But I guess that’s unavoidable. The best we can do is to stay curious, keep learning, and keep doing what’s best for him every step of the way, especially in these early months. I also know that the love I feel around that little furball is going to make it all worth it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Dz8XOcn2bqtJXZcg.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6f4fbb31daa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Balancing creativity and structure]]></title>
            <link>https://medium.com/@bibekg/balancing-creativity-and-structure-1d13ba0d0573?source=rss-6c487ef0946e------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d13ba0d0573</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[bullet-journaling]]></category>
            <category><![CDATA[creativity]]></category>
            <category><![CDATA[habits]]></category>
            <category><![CDATA[notion]]></category>
            <dc:creator><![CDATA[Bibek Ghimire]]></dc:creator>
            <pubDate>Thu, 31 Oct 2019 15:16:16 GMT</pubDate>
            <atom:updated>2019-10-31T15:16:16.047Z</atom:updated>
            <content:encoded><![CDATA[<h3>Digital Bullet Journaling and the Balance of Structure and Creativity</h3><p>I’m an organized and methodical person, almost to a fault. Ever since I caught the productivity bug some time in high school, I’ve loved to analyze the way I spend my time, develop processes around how I come up with and complete tasks, and systems by which I can track my progress. If you’ve read my previous posts like <a href="https://blog.bibekg.com/four-ways-journaling-has-helped-me/">Four ways journaling has helped me</a>, you’ve already gotten a peek into this part of my brain.</p><p>That post culminated with my discovery and implementation of a process called bullet journaling. As a centralized methodology for journaling, short-term productivity, and long-term planning, it checked every box I needed. I bought a nice journal, filled in the pages with the bullet journaling framework, and happily began putting it to use.</p><p>But then came along a little app called <a href="https://notion.so/">Notion</a>. Developed and marketed as an “all-in-one workspace”, Notion challenges the idea that we need numerous apps and systems to manage the complexity of our personal lives, projects, and/or businesses. By pairing a rich set of component building blocks with a refreshing degree of flexibility, Notion enables you to create almost any setup you could need. It’s basically digital Legos for information.</p><p>As soon as I discovered how easy and effective bullet journaling could be when implemented through Notion, I ditched my physical journal and migrated over with a level of enthusiasm I’ve seldom feel about a piece of software.</p><p>If you haven’t experienced the magic of Notion, though, my wordy introduction probably isn’t doing it justice. So let’s start with a quick visual demo. Covering everything in my Notion would probably take a dozen posts so I’ll only highlight the parts I use most and which are most pertinent to the topic of this post.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*m7K40PDMHbBVzK_R" /></figure><p>This is the page where it all begins. Leveraging Notion’s flexibility, I built out this page precisely to my needs but generally following the Bullet Journal framework. Everything from the template buttons (e.g. “+ Add New Week”) to the arrangement of columns is customizable.</p><p>The top row is what I like to call the “interval cascade”. It’s where I split out my life into a number of time durations, each designated its own column: weeks, months, quarters, years and beyond. Doing so allows me to use the longer intervals — months and longer — to plan things from a long-term perspective, then later “cascade” those plans into actionable items at the shortest interval — weeks.</p><p>For example, when a new week is about to start, I’ll hit the custom-built <strong>[+ Add New Week]</strong> button, which generates a new page pre-filled with a template that I designed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cNWZPtkCLk3MHPI8" /></figure><p>I can then click into the linked “Fall ‘19” page or even my “2019” page to peek at what I hoped to achieve during that longer interval. Converting those long-term goals into actionable items for the week, I fill out the “End of Week Targets”, “Tasks”, and whatever plans I’m currently aware of for each day of the week. Then throughout the week, I’ll use this page as my centralized repository for everything: notes, tasks, events, etc. Partway through the week, it might look something like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MckrTGzsCZgJyVSA" /></figure><p>At the end of the week, I’ll drag the week’s page into the “Past Weeks” database, add a few reflective thoughts, and call it a week.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AghN8YzBmkUr_nju" /></figure><p>With this weekly log system + a plethora of other collections set up (e.g. for <a href="https://www.notion.so/bibek/47fa22a75a4b44308cb4f8685a40399f?v=a881c87ad1244224a4149ccad939501a">tracking books I read</a>, how I’m spending my money, and even songs I’m learning on guitar), I entered into a bit of a honeymoon phase with Notion. I boiled down virtually everything in my life into some sort of system or process that I could fit into my interval cascade. These systems helped me power through my final undergrad online course, get my summer internship project scoped and completed, and even manage all the logistics of moving from Mountain House to Pleasanton. On top of that, I excitedly showed Notion, along with an enthusiastic demo of my setup, to anyone who seemed even remotely interested. Offering up my bullet journal template, I even got my team’s product manager at Clever to start using it!</p><p>But as honeymoon phases generally do, this one too was doomed to end.</p><p>After joyously using my Notion setup for over 3 months, I started to encounter problems with my Notion usage patterns that made me much less enthused about opening up my daily logs every evening and setting up my weekly page every Sunday night. It took me a few weeks of easing off the intensity with which I used Notion to start to understand why this was happening.</p><p>When I started my fall internship at Stripe, I was disappointed to learn that I wouldn’t be allowed to use Notion to record anything work-related. So much for an all-in-one workspace. My best alternative was to try to mimic the essential components of my “interval cascade” system in an app I was allowed to use, Dropbox Paper. Although it’s one of the best apps at what it does, Paper isn’t by any means an all-in-one-workspace and still falls far short of Notion in customizability and flexibility.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rBCDplKnpa1t6XQZ" /><figcaption>Dropbox Paper has support for creating templates but its integration into the overall product is far clunkier than that of Notion.</figcaption></figure><p>With all my work-related content going into Dropbox Paper, my Notion usage drastically dropped. At that point, the main things I was focusing on outside of work were <a href="https://blog.bibekg.com/seeing-an-80-minute-commute-as-an-opportunity/">reading, writing</a>, and playing guitar.</p><p>Desperate to keep Notion in my life, I continued to use it for those things. However, since I approached all three of these activities as casual hobbies, the structure of my interval cascade system ended up having the opposite effect from what I intended. Rather than helping me “get things done”, it turned the hobbies that I was passionate about into a sort of job that I developed a quiet distaste toward.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/0*7MguhBOQ2CIoq90M" /><figcaption>In mid-September, I plopped this near the top of my weekly log, hoping it’d inspire me to work on it. Partially due to just being too busy, I didn’t get around to it and had to migrate it to weekly logs all the way into October. Regardless of the initial reason, the guilt of not getting it done built up and diminished my motivation further.</figcaption></figure><p>For example, after finishing reading “Why We Sleep” by Matthew Walker, I was excited to write a post to share my thoughts about it. I made a page in my Notion where I would collect my thoughts and write the post, then started linking to it at the top of my weekly log and in my daily logs as a to-do item. Slowly, my excitement about the post faded and was replaced with guilty apathy about not getting around to writing. Weeks went by as a vicious cycle of negative emotion formed. Every night that I’d go to bed unable to check off that I worked on the post, I’d feel worse, questioning whether I really even wanted to write it. The following day, that confusion and guilt would manifest in a further hampered desire to write.</p><p>Similarly, I’ve been working on writing a song but found that as soon as I started making to-do items for it, I lost both the creative spark and the intrinsic desire to see it through.</p><p>One of my key takeaways from this experience is that structure is a powerful tool but must be wielded carefully when it comes to creative endeavors.</p><p>I also learned that it’s crucial to clearly separate — at the very least in my own mind — my usage of Notion as a centralized repository for my thoughts versus as a productivity tool. While well-scoped projects like an online course or an internship fit both use cases, it’s an entirely different story for creative endeavors that require ample time and opportunity to explore ideas. I still believe that my Notion system is an excellent home for creative ideas to come rest after periods of exploration. It just shouldn’t be used to apply time constraints and structure where it isn’t truly useful.</p><p>Moving forward, I plan to use Notion as a way to document my posts and songs (among many other things) but leave the motivational/productivity aspects to my intrinsic passion towards writing and making music. In just a few days of trying this out, I’ve already seen how obviously beneficial this change is. When writing a new song is motivated by a to-do list item, I feel a pressure to come up with the right chords and lyrics. When it’s motivated by passion, I take my time, exploring melodies and words that may not always sound quite right but every so often turn out to be exactly what I’m looking for.</p><p>After all, what is creativity if not the freedom to fail?</p><p>How do you balance creativity and structure? I’d love to start a conversation about this! Leave your thoughts in the comments below or wherever else I shared this post.</p><p><em>You can find more posts like </em><a href="https://blog.bibekg.com/digital-bullet-journaling-and-the-balance-of-structure-and-creativity/"><em>this one</em></a><em> at my personal blog, </em><a href="https://blog.bibekg.com/"><em>blog.bibekg.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d13ba0d0573" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing XCamp: the UCLA DevX Bootcamp]]></title>
            <link>https://medium.com/ucladevx/introducing-xcamp-the-ucla-devx-bootcamp-b71253adbbac?source=rss-6c487ef0946e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b71253adbbac</guid>
            <category><![CDATA[onboarding]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[test-driven-development]]></category>
            <category><![CDATA[ucla]]></category>
            <category><![CDATA[product-development]]></category>
            <dc:creator><![CDATA[Bibek Ghimire]]></dc:creator>
            <pubDate>Fri, 12 Oct 2018 16:40:09 GMT</pubDate>
            <atom:updated>2018-10-12T16:40:09.197Z</atom:updated>
            <content:encoded><![CDATA[<h4>A short and sweet onboarding program for incoming DevX developers.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CwLlBXsF0YjvEsgAelZUXw.png" /></figure><h4>What is XCamp?</h4><p>XCamp is a 12-hour program across 6 sessions that teaches new DevX developers the foundational skills required to be successful on a collaborative product team.</p><h4>Why is XCamp a thing?</h4><p>For the past 4 quarters of UCLA DevX’s history, developers have gone straight from recruitment into their product teams. This “dive straight into the deep end” approach worked well as DevX sprouted its initial roots because it let the product teams move fast.</p><p>Now that DevX is a bit more established, however, the pitfalls of this approach can no longer be hidden under the move-fast-and-break-things rug. Product managers across DevX’s 8 teams have onboarded new developers onto their teams, only to find that a handful of them are not yet proficient with the high-level skills required as a developer on a large team — for example: git, test-driven development, and deployment.</p><p>XCamp will, therefore, target exactly these skills.</p><ul><li>Using<strong> git and GitHub</strong> is paramount to effectively contributing to a large codebase with numerous collaborators.</li><li>Practicing<strong> test-driven development</strong> is critical to building reliable products whose growth aren’t restricted by avoidable bugs.</li><li>Understanding<strong> deployment architecture</strong> (at a high level) gives you a clearer picture of where your role as a (frontend/backend/data/etc.) developer fits into the overall technical product.</li></ul><h4>What is XCamp NOT?</h4><p>Although XCamp will walk developers through the development of a small subset of an Express/React web application, the focus is not on Express and React but instead on the general skills of web development in a team setting. We chose this approach for two reasons.</p><ol><li>DevX teams use a variety of technologies in their stacks so learning particular technologies may not be useful for all XCamp participants.</li><li>In general, learning the <em>purpose</em> of each of those technologies is more important than learning the technology itself.</li></ol><p>As such, XCamp participants will write Express routes, React components, and SQL queries but only to the extent required to learn the foundational development skills outlined above.</p><p>Finally, the structure and curriculum of XCamp is not set in stone. Just like DevX’s core products, XCamp will undergo a constant cycle of implementation, feedback, and iteration as we improve it session by session and quarter by quarter. So if you have any thoughts or suggestions on how XCamp could be better, don’t hesitate to leave a response below!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b71253adbbac" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ucladevx/introducing-xcamp-the-ucla-devx-bootcamp-b71253adbbac">Introducing XCamp: the UCLA DevX Bootcamp</a> was originally published in <a href="https://medium.com/ucladevx">ucladevx</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[react-schedule-selector]]></title>
            <link>https://medium.com/bruinmeet/react-schedule-selector-6cd5bf1f4968?source=rss-6c487ef0946e------2</link>
            <guid isPermaLink="false">https://medium.com/p/6cd5bf1f4968</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[bruinmeet]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Bibek Ghimire]]></dc:creator>
            <pubDate>Sat, 29 Sep 2018 21:17:44 GMT</pubDate>
            <atom:updated>2018-10-05T03:22:50.694Z</atom:updated>
            <content:encoded><![CDATA[<h4>A versatile, mobile-friendly React UI component for selecting schedule availability.</h4><p>The product I currently work on, BruinMeet, is a UCLA-exclusive dating app with a key twist that differentiates it from others in its space. We believe that the best way to get to know someone is by meeting and interacting with them IRL. For that reason, we ask each person in a match for his or her availability for the next week, find the earliest common time they’re free, then let them know this mutual time.</p><p>To achieve this, however, we needed to develop a UI component that allows the user to specify their availability quickly and easily. Inspired by the popular website that does exactly that, <a href="https://when2meet.com/">when2meet</a>, we ended up with this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E5lJTycHjEpuR1P7qX19Hw.png" /></figure><p>After we released this feature, we noticed that many other projects in <a href="http://ucladevx.com/">UCLA DevX</a> — the umbrella organization which BruinMeet operates under— needed a similar UI component for their products. And thus, react-schedule-selector — an open-source version of this component — was born.</p><p>Check out the <a href="https://github.com/bibekg/react-schedule-selector">GitHub here</a> and play around with a <a href="https://react-schedule-selector.surge.sh/">live demo here</a>.</p><h4>How It Works</h4><p>react-schedule-selector is both easy to use and highly customizable — it’s up to you to choose how much you want to customize it. You can either provide the minimum set of props (selection, onChange) and accept the default values for other props.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ea3ac49280d2a701256e552cbfd3ea24/href">https://medium.com/media/ea3ac49280d2a701256e552cbfd3ea24/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6DtngHjyZP5RBeTI7sYI7A.png" /></figure><p>Or you can customize everything from the time range to the number of days and even the component used to render the date cells (the blue boxes) via a <a href="https://cdb.reacttraining.com/use-a-render-prop-50de598f11ce">render prop</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/075a3be85c7d4c658c61efb14c951f85/href">https://medium.com/media/075a3be85c7d4c658c61efb14c951f85/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KYtaXBl4fGit8Vph5s1k-Q.png" /></figure><h4>Challenge #1: Make it mobile friendly</h4><p>The main feature that makes react-schedule-selector so valuable as an independent component is it’s mobile-friendliness. Using it on a touch-based device is just as easy and intuitive as on a mouse-based device.</p><p>Achieving this, however, is no easy feat. The logic behind determining which cells to select given a starting and ending point is already quite complex for mouse-based devices. Adding touch support adds more complexity on top of that because it requires using separate change handlers (for example, onTouchStart in addition toonMouseDown).</p><p>To make matters worse, unlike mouse events, touch events don’t fire on the element over which they occur. This means that the change handler for onTouchMove doesn&#39;t give you direct context of which date cell the user is currently dragging over. Instead, it gives you a touches array which contains an array of objects with screen coordinates, leaving you to use DOM APIs to map those screen coordinates to the date cell at that location.</p><h4>Challenge #2: Keep it light</h4><p>In the initial versions of this component, I was using <a href="https://momentjs.com/">moment.js</a>, an incredibly powerful library for working with Date objects. With great power, however, comes great bundle size. In order to avoid bogging react-schedule-selector down with this unnecessarily heavy dependency, I chose to go with <a href="https://date-fns.org/">date-fns</a> -- another (more lightweight) library for working with JS Dates that allows you to import just the functions you need and cut my build size by roughly 75%!</p><p>react-schedule-selector has been a core staple of the BruinMeet experience and has already been used to schedule over 200 dates. If you’re ready to take a look for yourself and/or implement it into your own project, head over to the <a href="https://github.com/bibekg/react-schedule-selector">GitHub</a> for installation instructions and more in-depth documentation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6cd5bf1f4968" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bruinmeet/react-schedule-selector-6cd5bf1f4968">react-schedule-selector</a> was originally published in <a href="https://medium.com/bruinmeet">BruinMeet</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy a React/Node App Using TravisCI and AWS]]></title>
            <link>https://medium.com/ucladevx/deploy-a-react-node-app-using-travisci-and-aws-b41e3b09110b?source=rss-6c487ef0946e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b41e3b09110b</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[continuous-deployment]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <dc:creator><![CDATA[Bibek Ghimire]]></dc:creator>
            <pubDate>Sun, 16 Sep 2018 18:07:52 GMT</pubDate>
            <atom:updated>2018-09-16T18:07:52.033Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-OxlAvlle8HjikJP" /><figcaption>“cloudy sky” by <a href="https://unsplash.com/@alexmachado?utm_source=medium&amp;utm_medium=referral">Alex Machado</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Let’s say you have a web app project built with React on the front-end and Node on the back-end API. You have the front- and back-end split up into separate GitHub repositories and you fire both of them up on different ports and have the front-end communicate with the API server.</p><p>Now let’s say you want to deploy your beautiful web app to a public domain, mywebapp.com, so the rest of the world can see your work. There are a handful of ways to do this but in this guide, we’re going to focus on just one: continuous integration/deployment with TravisCI and AWS (S3 + CloudFront + ElasticBeanstalk).</p><p>This setup is pretty common for small- to medium-scale web applications and it’s what the product I work on, <a href="https://bruinmeet.com/">BruinMeet</a>, employs. In addition to a public-facing domain, BruinMeet also has a private “staging” domain to which we deploy to in order to test before releasing changes to the public.</p><p>This tutorial will walk you through the steps of setting up all of this.</p><h4>Why use this approach?</h4><ul><li>Continuous integration allows us to make testing an automatic part of our development process. Every time we push up a commit, TravisCI will run our branch’s tests.</li><li>Continuous deployment lets us make pushing to GitHub and deploying the app (almost) synonymous. Unless tests fail, we can push a commit to our production branch and soon after have our production site reflect those changes — automatically.</li><li>AWS’s ElasticBeanstalk — along with Docker — makes it easy to deploy our Node API server with just a little bit of configuration.</li><li>AWS’s S3 + CloudFront lets us deploy and serve up our front-end super easily, while taking advantage of AWS’s global scale content delivery network (CDN).</li></ul><h4>Alright, I’m convinced but this sounds complicated. Where do I even start? 😣</h4><p>First off, let’s establish the prerequisites before diving into this tutorial. You should:</p><ul><li>have a working knowledge of git and GitHub</li><li>have an AWS account and an AWS IAM user configured with the programmatic access and the permissions: AmazonS3FullAccess, AWSElasticBeanstalkFullAccess, CloudFrontFullAccess, IAMFullAccess(<a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html#id_users_create_console">how to</a>)</li><li>have the AWS CLI <a href="https://docs.aws.amazon.com/cli/latest/userguide/installing.html">installed</a> and <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-quick-configuration">configured</a> with the above IAM user on your machine</li><li>have both your GitHub repositories hooked up to <a href="https://travis-ci.com/signin">TravisCI</a></li></ul><p>I’ve dropped links above for the official AWS documentation on how to get set up. Everything else, we’ll figure out as we go through the tutorial. Alright, with that out of the way, let’s get started.</p><p>Let’s start by looking at how the deployment architecture will look when we’re done. Below is a diagram that shows the paths that a request coming from a browser (or other client) might take.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v6B8sC0v2QDnQOxaaN_zdg.png" /><figcaption>The paths a browser request might take through our eventual setup. You can ignore the AWS Certificate Manager part for now (don’t worry, I’ll explain why it’s there later).</figcaption></figure><p>Say we send a request to <a href="http://www.mywebapp.com/">www.mywebapp.com</a>. This is gonna send a request for the root (/) resource. That request is going to first reach a CloudFront server (called an edge cache). The CloudFront server will then see if it already has the requested content. If it does, it’ll respond with it (which will be the index.html in our case) . If not, it’ll request it from the S3 bucket, cache it, then respond to the user with it. We can then repeat this reasoning for any other resources we bundle with our React app (your main bundle.js, image assets, CSS files, etc.)</p><p>What if we instead send a request to api.mywebapp.com (like our React app might)? This request is going to first meet an ElasticBeanstalk load balancer, which forwards requests to one of the underlying EC2 containers. These underlying EC2 containers are what actually contain the code for our Node server. ElasticBeanstalk’s job is simply to do this forwarding and to (elastically) add or remove containers as our application’s needs change.</p><blockquote>Important to note here is that our API is hosted at the api subdomain rather than a /api route. There are certainly ways to achieve the latter but they will require more work and are outside of the scope of this tutorial.</blockquote><p>With the end goal in mind, let’s get to work on making the magic happen. I’m gonna split the rest of this tutorial into 4 steps.</p><ol><li>Configure the front-end app for continuous deployment to S3 using TravisCI.</li><li>Configure the back-end app for continuous deployment to ElasticBeanstalk using TravisCI and Docker.</li><li>Configure our domain’s DNS settings to point correctly to both the front-end and back-end apps.</li><li>Configure AWS Certificate Manager to enable HTTPS for our domain.</li></ol><h4>Step 1: Configure the front-end app</h4><p>First off, another diagram to keep in mind as we walk through this step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jj6PscVE-xGLNCSXyqEylg.png" /><figcaption>The deployment process that gets kicked off each time we commit and push a change to our repository.</figcaption></figure><p>Most of this <a href="https://en.wikipedia.org/wiki/Sequence_diagram">UML sequence diagram</a> should be fairly intuitive. If you’re entirely unfamiliar with UML sequence diagrams, the TL;DR on the link above is that the vertical axis represents time, each column is a different entity, and the arrows represent communication between entities. The “alt” box on the bottom simply represents a conditional flow, in which we only deploy to S3 if we determine that we want to for this branch.</p><p>Let’s start by setting up our S3 buckets. Open up a terminal session and type the following command to <a href="https://docs.aws.amazon.com/cli/latest/reference/s3api/create-bucket.html">create a new S3 bucket</a>. <strong>Change the bucket name and region values to your preference</strong>.</p><blockquote>Keep in mind that S3 bucket names must be globally unique.</blockquote><pre>aws s3api create-bucket \<br>  --bucket mywebapp-react-production \<br>  --region us-west-2 \<br>  --create-bucket-configuration LocationConstraint=us-west2</pre><p>Running this command will output the URL your S3 bucket will be accessible at. We won’t need it for anything in particular so you can ignore it. If you ever need to see it again, you can find it by going to your bucket, then Properties &gt; Static Website Hosting.</p><p>With the bucket successfully created, let’s <a href="https://docs.aws.amazon.com/cli/latest/reference/s3/website.html">configure it to host a static website</a>. Fortunately, the AWS CLI makes this super easy with the following command. This command’s main job is to make the S3 aware that a request to / is the same as a request to index.html.</p><pre>aws s3 website s3://mywebapp-react-production/ \<br>  --index-document index.html</pre><p>Next, <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteAccessPermissionsReqd.html">make the bucket content publicly accessible</a> by going to the S3 bucket in the AWS console and adding the following configuration under Permissions &gt; Bucket Policy, making sure to <strong>change the bucket name under “Resource” to match your bucket’s name</strong>.</p><pre>{   <br>  &quot;Version&quot;:&quot;2012-10-17&quot;,   <br>  &quot;Statement&quot;:[{  <br>    &quot;Sid&quot;:&quot;PublicReadGetObject&quot;,           <br>    &quot;Effect&quot;:&quot;Allow&quot;,    <br>    &quot;Principal&quot;: &quot;*&quot;,       <br>    &quot;Action&quot;:[&quot;s3:GetObject&quot;],       <br>    &quot;Resource&quot;:[&quot;arn:aws:s3:::mywebapp-react-production/*&quot;]<br>  }] <br>}</pre><p>Once that’s done, <strong>our bucket is set up and ready to host a static website! </strong>✔️</p><p>If you’ve been paying close attention, you’re probably recalling the first diagram and thinking, “Okay great, S3 is set up but what about CloudFront?”</p><p>Setting up CloudFront is a breeze as well. There are two key steps: (1) Create the distribution with the AWS CLI, (2) Configure the error page to redirect to /.</p><p>Start by running the following command to <a href="https://docs.aws.amazon.com/cli/latest/reference/cloudfront/create-distribution.html">create a distribution</a>.</p><pre>aws cloudfront create-distribution \<br>  --origin-domain-name mywebapp-react-production.s3.amazonaws.com \<br>  --default-root-object index.html</pre><p>This will spit out a huge configuration JSON describing your new CloudFront distribution. The key value to note is Distribution.DomainName. For me, this was d3ois221lkhb7q.cloudfront.net. This is the URL that we’ll point our main domain <a href="http://www.mywebapp.com/">www.mywebapp.com</a> at later in the tutorial.</p><p>Next, we’ll force CloudFront to route 404 errors to / since our React app will be responsible for displaying a 404 page on its own (via react-router). To accomplish this, open up <a href="https://console.aws.amazon.com/cloudfront/home">CloudFront in the AWS Console</a> and in the distribution we just made, go to the Error Pages tab, and “Create Custom Error Response” with the following config.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*j9MmJzTE9J9dOW78w910JA.png" /><figcaption>With this in place, if a user goes to <a href="http://www.mywebapp.com/invalid-route,">www.mywebapp.com/invalid-route,</a> it’ll still serve the index.html but the React app’s router will recognize it as a 404 path and show the appropriate 404 page.</figcaption></figure><p><strong>CloudFront setup</strong>. ✔️</p><p>Lastly, let’s add a few new files to our project that will allow us to upload our React app bundle to our S3 bucket whenever we push a commit to a certain branch.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/57950761bfd516cf8f5eab152cb2c334/href">https://medium.com/media/57950761bfd516cf8f5eab152cb2c334/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/56e2cf18b2beac963ddf2e3dcfb972b4/href">https://medium.com/media/56e2cf18b2beac963ddf2e3dcfb972b4/href</a></iframe><p>As you might notice, there are a couple of variables in here that seem to be coming from nowhere (CLOUDFRONT_DIST_ID_STAGING and CLOUDFRONT_DIST_ID_PRODUCTION). <strong>We’ll actually need to define them in the TravisCI settings for this repo under “More Options” &gt; Settings &gt; Environment Variables.</strong></p><p>With our S3 bucket made, CloudFront distribution set up, these new files in our project, and TravisCI env variables set up, our front-end is good to go. Pushing to master should now cause our React app to deploy to the S3 bucket, which is served up by the CloudFront distribution. As such, it should be accessible at both our S3 bucket endpoint and CloudFront domain name.</p><p>A few additional points to consider:</p><ul><li>CloudFront — being a cache — will not automatically detect new versions of your app in S3. As such, if we want changes to be deployed instantly, we’ll need to <a href="https://docs.aws.amazon.com/cli/latest/reference/cloudfront/create-invalidation.html">create an invalidation</a> after deploying to S3. We can either do this in the CloudFront console or programmatically as part of our deployment in deploy.sh.</li><li>As of now, our CloudFront distribution will only accept requests via the HTTP protocol. HTTPS requests simply won’t work. Step 3 of this tutorial will walk through setting that up using AWS Certificate Manager.</li><li>A great optimization to add to our CloudFront distribution is to enable “Compress objects automatically” under Behavior &gt; Default(*) path pattern &gt; Edit. Turning this lets CloudFront use gzip to compress our files for faster transfers to clients.</li></ul><h4>Step 2: Configure the back-end deployment process.</h4><p>The overall process for back-end deployment will be nearly identical to that of the front-end. The only difference is that instead of deploying to S3, we deploy to ElasticBeanstalk. This comes with a few additional tasks but we’ll walk through them step-by-step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rWaL_6mXosb_3Tu46VD0EQ.png" /></figure><p>Let’s first set up our ElasticBeanstalk environment on AWS.</p><p>We’ll start by creating an ElasticBeanstalk application.</p><pre>aws elasticbeanstalk create-application --application-name mywebapp-api</pre><p>We’ll then create the environment.</p><pre>aws elasticbeanstalk create-environment \<br>  --application-name mywebapp-api \<br>  --environment-name production \<br>  --solution-stack-name &quot;<em>64bit Amazon Linux 2018.03 v2.12.0 running Docker 18.03.1-ce</em>&quot;</pre><p>The relationship between an EB application and environment is one-to-many: in other words, one application may have one or more environments. For example, if you want to host both a production and staging version of your application, you’d create an environment for each.</p><p>Lastly, if we need to define environment variables for our EB application, we can do so by navigating to Configuration &gt; Software (Modify) &gt; Environment properties in the <a href="https://us-west-2.console.aws.amazon.com/elasticbeanstalk/home">AWS EB Console</a> for the environment in question.</p><p><strong>ElasticBeanstalk setup.</strong> ✔️</p><p>Now, for the new files.</p><p>First, we’ll need to add some ElasticBeanstalk configuration details to our project. In the root directory of your project, create a new folder named .elasticbeanstalk and in it create a file called config.yml with the following contents:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/04ab36f825c282fec251912431e9510f/href">https://medium.com/media/04ab36f825c282fec251912431e9510f/href</a></iframe><p>Now let’s add the files telling TravisCI to push your code to ElasticBeanstalk.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/896acc83791ba1832f35c472968a4f48/href">https://medium.com/media/896acc83791ba1832f35c472968a4f48/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4873790172af75f25ad5491e74554082/href">https://medium.com/media/4873790172af75f25ad5491e74554082/href</a></iframe><p>The key difference in this deploy script is the configuration of your AWS credentials before deploying since the eb command doesn’t pull it from your environment variables like aws s3 does.</p><p>Okay, now for a new file exclusive to the back-end deployment process, Dockerfile.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/da1db9688e69baf7ed84ad94f5056642/href">https://medium.com/media/da1db9688e69baf7ed84ad94f5056642/href</a></iframe><p>This file defines the steps that a Docker container needs to run to start up the API server. There’s tons more to learn about Docker <a href="https://www.docker.com/what-docker">here</a> if you’re interested but for the sake of this tutorial, we’ll just consider it as a necessary step in ElasticBeanstalk deployment.</p><p>That’s it! We’re done. Now pushing your code to the hooked up branch should automatically kick off a deployment!</p><h4>Step 3: Configure the domain’s DNS settings</h4><p>At this point, your front-end and back-end apps should be deployed and independently functional. The problem is, they aren’t hosted on the domain you want (and therefore can’t even communicate with each other)!</p><p>The React app is hosted at a CloudFront endpoint that looks something liked3ois221lkhb7q.cloudfront.net and the API at an ElasticBeanstalk endpoint that looks like production.nghvu3hx5z.us-west-2.elasticbeanstalk.com.</p><p>To point your domain name at these apps, go to your domain hosting service’s DNS settings and add the following new DNS records, tweaking the URLs you put for value to match your own app’s CloudFront, EB, and domain URL’s. <em>The interface for adding these records varies by hosting service but the general information you need to enter is the same.</em></p><pre># For the React app<br>Record Type: CNAME<br>Host: www<br>Value: d3ois221lkhb7q.cloudfront.net</pre><pre># For the API server<br>Record Type: CNAME<br>Host: api<br>Value: production.nghvu3hx5z.us-west-2.elasticbeanstalk.com</pre><pre># For redirecting mywebapp.com to <a href="http://www.site.com/">www.mywebapp.com</a><br>Record Type: URL Redirect<br>Host: @ # This means the root<br>Value: <a href="http://www.example.com/">http://www.mywebapp.com</a></pre><p>Give the DNS record changes a generous amount of time to propagate through the network (we’re talking on the scale of hours here).</p><h4>Step 4: Configure HTTPS using AWS Certificate Manager</h4><p>At this point, your app should be fully wired up to be accessible via your chosen domain (in other words, navigating to mywebapp.com should work as expected).</p><p>But there’s one small problem. Your site isn’t secure.</p><p>In order to ensure that communication between your site and its users is secure, you’ll need to add HTTPS/SSL support. Fortunately, AWS makes this a breeze.</p><p>Head on over to the Certificate Manager in the AWS Console. Click “<strong>Request a Certificate</strong>” and then “<strong>Request a public certificate</strong>”.</p><p>Under the domain names section, specify both the root and the www subdomain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dijgszF-14lWhqhmy3udrw.png" /></figure><p>Click Next and follow the instructions to validate your certificate.</p><p>Once that’s done, head on over to your CloudFront instance you created earlier. Under the General tab, click Edit. Under the SSL Certificate section, check “Custom SSL Certificate” and select the certificate you just made. Then under the Behaviors tab, select the first Behavior and Edit, selecting “Redirect HTTP to HTTPS”.</p><p>Our React app server is now HTTPS secure. Now let’s secure our API.</p><p>Go to the ElasticBeanstalk console and open up your application environment’s configuration panel. In there, click “Modify” under “Load Balancer”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pHMlKzVOIvn0wkVbi8Kg2g.png" /></figure><p>Finally, click “Add Listener” and create a Load Balancer listener with the following settings, selecting the certificate you just made for the “SSL Certificate” dropdown.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V4rltr53pCeszwNlUpMVnQ.png" /><figcaption>This configuration tells EB to listen for HTTPS messages on port 443, then forward them to the underlying EC2 instances at port 80 using the HTTP protocol. The load balancer serves as a sort of “bouncer” at the door of your API.</figcaption></figure><p>Add the certificate and now your API is secure as well.</p><h4>Done.</h4><p>Whew, that was pretty long but you made it to the end. Congratulations! You now have a web app that’s configured to run tests (and conditionally) deploy to AWS S3/CloudFront and ElasticBeanstalk whenever you push to GitHub. 🎉👏😄</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b41e3b09110b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ucladevx/deploy-a-react-node-app-using-travisci-and-aws-b41e3b09110b">Deploy a React/Node App Using TravisCI and AWS</a> was originally published in <a href="https://medium.com/ucladevx">ucladevx</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Most Expressive Way to Journal is to Unjournal]]></title>
            <link>https://medium.com/@bibekg/the-most-expressive-way-to-journal-is-to-unjournal-283bd8e9b72c?source=rss-6c487ef0946e------2</link>
            <guid isPermaLink="false">https://medium.com/p/283bd8e9b72c</guid>
            <category><![CDATA[journaling]]></category>
            <category><![CDATA[personal-development]]></category>
            <category><![CDATA[writing]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[mindfulness]]></category>
            <dc:creator><![CDATA[Bibek Ghimire]]></dc:creator>
            <pubDate>Sat, 14 Jul 2018 00:48:05 GMT</pubDate>
            <atom:updated>2018-07-14T00:48:05.156Z</atom:updated>
            <content:encoded><![CDATA[<p>For the past five years, I’ve been journaling in various ways. I started off scrawling down a 10-minute stream of consciousness each night into a physical notebook. Eventually I supplemented that by using the digital journaling app, <a href="http://dayoneapp.com/">Day One</a>, to write entries full of photos, location data, and tags for better context and organization. For a while, I even kept a tiny pocket-sized notebook that I used to plan out each day. And more recently, I’ve started a whole new method of habit-building journaling (stay tuned for a post about that soon!)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MHudYHCzDuesetWMwgTWqw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D4eSlXpXtAMDDJm2d8jGsQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*L8mU2DQVrXicwLiwIxPEyw.png" /><figcaption>The variety of approaches I’ve used for journaling</figcaption></figure><p>Through this journey in journaling, I rediscovered a passion for writing that mandatory school essays hadn’t completely snuffed out of me. I found that writing was a really effective way for me to sort through the ocean of thoughts in my mind. For example, for many years, I had a chronic problem of overthinking everything. Using journaling to sort through those thoughts and feelings helped me to significantly quiet my overactive mind. Most importantly, the habit of journaling was there to support me through one of the hardest times of my life: losing my dad. At a time when my mind was at its most chaotic — numb one day, grieving the next — journaling provided me a safe haven to express all the things I couldn’t bring myself to say out loud.</p><p>Eventually, my love for writing combined with my enthusiasm for sharing my ideas and interests encouraged me to start writing publicly, publishing to a personal blog and eventually posting here on Medium. Writing for a public audience, however, drastically changed my approach to writing. I began to spend a lot more time carefully choosing the words and phrases I would use. Although I thoroughly enjoy this challenge of writing articulately and eloquently, I felt this meticulous approach to writing seep where it didn’t belong: my personal journaling.</p><p>I needed to find some way to leave the attention to detail at the door when journaling for myself. Then I found the answer in what has become one of my favorite books, <em>Emotional Agility</em> by Susan David. David describes a style of journaling introduced by Dr. James Pennebaker.</p><blockquote>Set a timer for twenty minutes. Open up your notebook, or create a new document on your computer. When the timer starts, begin writing about your emotional experiences from the past week, month, or year. … Simply go wherever your mind takes you, curiously and without judgement. Write just for yourself and not some eventual reader. Then, throw the paper away (or stick it in a bottle and cast it out to sea) or close the document without saving it.</blockquote><p>Pennebaker’s ideas on “<a href="https://www.psychologytoday.com/us/blog/write-yourself-well/201208/expressive-writing">expressive writing</a>” focuses mainly on gearing your writing towards feelings rather than events. However, the concepts that stuck out most to me were the timer and the eventual deletion of the writing.</p><p>As soon as I read about it in <em>Emotional Agility</em>, I thought to myself, “This is it. This is exactly what I need.” I immediately opened up my laptop, opened a blank document, set my timer, and started writing. I spilled out thoughts into that “Untitled” document that I had never had the courage to write in my physical notebook, emboldened by the knowledge that no eyes — not even my own — would ever read the words I was writing. It was an incredibly liberating experience. I continued this habit for three more nights, after which I thought, “More people should try this…”.</p><p>And so I decided to build a website that promotes this practice and makes it easy and fun to make into a habit. Thus, <a href="https://unjournal.surge.sh/"><strong>Unjournal</strong></a> was born.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eFHvN-ix54aAORy5gKObYg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Orfnvpoxp01LyHiO9w_Seg.png" /><figcaption>Try out Unjournal for yourself at unjournal.surge.sh</figcaption></figure><p>The idea is simple.</p><ol><li>You choose the amount of time you want to write.</li><li>You write.</li><li>Once the timer ends, you confirm that you’re done writing.</li><li>Your words disappear into the digital void. (Try it out to see what this means. 😉)</li></ol><p><a href="https://unjournal.surge.sh/">Give it a shot here</a> and let me know what you think in the discussion section below.</p><p>For those curious about the technical implementation…</p><ul><li>Everything you write stays on your computer and is deleted even from there after you finish writing. In fact, the app doesn’t even have a server or backend.</li><li>The project is fully open source on <a href="https://github.com/bibekg/unjournal">GitHub</a> and I’d be more than happy to accept suggestions and/or help improving it.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=283bd8e9b72c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Becoming BruinMeet Tech Lead]]></title>
            <link>https://medium.com/bruinmeet/becoming-bruinmeet-tech-lead-cc4567ed2688?source=rss-6c487ef0946e------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc4567ed2688</guid>
            <category><![CDATA[tech-lead]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[personal-development]]></category>
            <category><![CDATA[ucla]]></category>
            <dc:creator><![CDATA[Bibek Ghimire]]></dc:creator>
            <pubDate>Wed, 27 Jun 2018 15:44:16 GMT</pubDate>
            <atom:updated>2018-06-27T15:45:37.603Z</atom:updated>
            <content:encoded><![CDATA[<h4>A leap out of my comfort zone, in what turned out to be the right direction</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*koG5mtl7rS1z5HOVuIx1lQ.png" /></figure><p>From September 2017 to April 2018 (~7 months), I worked as front-end developer for <a href="https://www.bruinmeet.com/">BruinMeet</a>. With months of self-learning React and a summer internship behind me, I was in the center of my comfort zone being a code monkey and building out the front-end for the website <a href="https://medium.com/bruinmeet/i-architected-bruinmeets-front-end-these-are-the-technologies-i-used-and-why-ec60a8b5b238">using React, Redux, etc.</a></p><p>So when in April, my team’s product manager asked me if I’d like to fill the void left by our departing tech lead, I had to take a few weeks to make my decision.</p><h4>Deciding If I Should Accept the Position</h4><p>As tech lead, my job description would be something along the lines of:</p><ul><li>convert product specs (details for new features) into developer tasks and assign them to the team</li><li>be the go-to for any developer’s questions about the BruinMeet codebase</li><li>organize hack nights</li></ul><p>On top of being out of my comfort zone, this role worried me because I knew that I have a tendency to get deeply entrenched in my work, often to an unhealthy extent. As a developer, I have often spent such excessive amounts of time on a project or feature addition that I start neglecting other obligations (namely sleep, exercise, etc.). I was afraid that transitioning to the more demanding tech lead role would exacerbate that effect.</p><p>Ultimately, I chose to accept it anyways for the following reasons:</p><ol><li>The fact that I was worrying about these things was a good sign; I could use that awareness to shield myself from those bad habits.</li><li>It was a really good opportunity for growth to try something new and learn how to manage a team.</li></ol><p>and with the following promises to myself:</p><ol><li>I would aim for myself to write as little code as possible and instead just divide, delegate, and assist.</li><li>I wouldn’t let it interfere with the rest of my life goals like exercising and getting enough sleep.</li></ol><h4>Actually Being a Tech Lead</h4><p>Looking back, I’m glad I chose to take on the challenge. From unexpectedly having to hire new developers mid-quarter to learning to stand my ground against a very determined product manager, the tech lead role brought with it a host of new and unfamiliar challenges that helped me grow a lot.</p><p><strong>Challenge #1: Deal with a major team shuffle.</strong></p><p>When our previous tech lead decided to take a break from working on BruinMeet, it not only opened up the position, it also meant we had one less valuable developer. For a web team of only 5 developers, it was a heavy blow. After that, we had more team shuffling as two more developers left and two more joined during our frantic mid-quarter recruitment. All said and done, our team composition had radically transformed in the span of roughly 5 weeks.</p><p>Despite this radical team transformation, we managed to have a pretty productive quarter, largely due to the mentoring system we put in place in which the interns were given their own tasks but were assigned a mentor to go to with any questions they had. On top of that, our remaining veteran developers had reached a level of comfort with the codebase that enabled them to be much more productive than in previous quarters.</p><p><strong>Challenge #2: Balance the rest of my life with my time commitment to BruinMeet.</strong></p><p>One of the first conversations I had after getting offered the tech lead position was with our current tech lead, Jeffrey. I asked him why he was stepping and down, to which he replied, “At some point, I started getting annoyed when I’d see Slack notifications come in. I realized that it was a sign that I wasn’t really enjoying the position.”</p><p>His sentiment resonated pretty strongly with me. Albeit not as frequently and strongly, I’d experienced that apprehension towards the call of duty many times before. I knew that if I wanted to get through the next quarter as tech lead and come out the other side with my sanity intact, I’d need to figure out how to prevent falling victim to the same effect. I immediately made a list of boundaries to set:</p><ul><li>I don’t want it to affect my sleep so I’m going to set a hard cut-off for working on BruinMeet at 10pm, except on hack nights and for serious bugs/issues.</li><li>Hack nights start at 8pm and have a hard deadline of midnight.</li><li>If I ever find that I’m unhappy with how much time I’m spending working, I’ll take a mandatory 30-minute do-nothing session to analyze what needs to change.</li></ul><p>Despite having these guiding principles in my mind, I was far from perfect at maintaining my boundaries. In fact, during our intern hell week toward the end of the quarter, I got so overwhelmed by a combination of BruinMeet pressures and schoolwork that my teammate, Meera, had to tell me to leave the intern hack night and go to a party. I gladly obliged.</p><p>Somehow, I did make it through the quarter and (I think) I’m still sane. In the process, I improved my ability to divide and delegate work instead of taking it on myself and learned how to take on a more oversight-oriented role in the product’s development rather than burying myself in code.</p><p><strong>Challenge #3: Enable a growing and changing team to move fast by improving developer experience.</strong></p><p>When you’re working on a project by yourself, comments and documentation are usually a pretty low priority. You wrote all the code you’re looking at, so you usually know what’s going on. Writing comments and docs would do nothing but slow you down. In a team setting, however, documentation is <strong>incredibly</strong> important in ensuring that more developers actually leads to more productivity.</p><p>During the previous quarter, I worked on a feature dubbed “Match Feedback”. In short, we wanted to ask our users a few questions about their general sentiment towards matches they received that became mutual (i.e. both parties liked each other). Unfortunately, the instructions for the feature were quite vague and omitted details around certain edge cases. At the same time, the existing back-end architecture was completely unfit to accurately represent the concept of a “match” and required a refactor that took several weeks. By the end of the whole fiasco, I realized that we desperately needed to incorporate detailed product specs as a part of our development process and thus advocated for it heavily. Here’s what our first one looked like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t_ulQ2SOo0ZOo9sa17Dx-w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7A6el7UPWKyKWAgvnr4V4w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3u0pgfMlql1NQu4wb5vnEQ.png" /><figcaption>BruinMeet’s first-ever product spec. The wireframe is pretty low-fidelity but as our PM, Dmitri, likes to say “Premature optimization is the root of all evil.”</figcaption></figure><p>One major goal for our team this last quarter was to create mobile (iOS/Android) apps. If we really want to compete with apps like Tinder and Bumble, a solid mobile experience isn’t optional. This is easier said than done, however, due to the fact that the web app is already built out and is running all sorts of experimental app flows. These constant changes to the product’s flow made it difficult for our mobile developers to know how exactly the app should communicate with the API. To elucidate this, another form of documentation I prioritized was clear API docs. This was actually surprisingly easy, via the awesome <a href="http://apidocjs.com/">apidoc</a> library. Annotate your HTTP routes in the Express app (similar to <a href="http://usejsdoc.org/">JSDoc</a> but with server-code-specific tags), run the apidoc compiler, and voila!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8pxzKeZR_bYLVApDGDcD0A.png" /><figcaption>This admin page enables all developers (not just mobile) to understand how the API works and how to use it from their particular client (web, iOS, Android, etc.)</figcaption></figure><p>Aside from documentation, it was also clear that improving our product testing was crucial. It’s incredibly hard to write useful, programmatic tests when you’re constantly changing the flow of the product via experiments. As a tradeoff, we chose to unit test the parts that were easy to unit test (e.g. the matchmaking algorithm), and manually test the rest. But even to manually test our match flow, we needed more tools. Therefore, the next step in improving development experience was to introduce useful admin tools like the ability to create and delete test users and create and delete test matches. Creating users was easy thanks to Facebook’s test user creation dashboard. The other three were implemented as easy-to-use tools in our own admin dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*15XQ35uJG5wMS4EDovfk2g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ENycLMnzV5VNHxyKspw3Q.png" /></figure><p>Our testing methodology still has a long way to go though. For example, we still have pretty low test coverage — a key metric in determining the reliability of a codebase. Once our product flow and API stabilize out, however, writing systematic tests will become a top priority.</p><p>Finally, a critical part of developer experience is developer morale. Getting lost in code can be fun but sometimes you need to peek your head out of the ground and assure yourself that what you’re doing is having an impact. To this end, I pushed for the creation of visualizations of our user base on our admin dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X2N0he1nMo1rEkoY9F2oXw.png" /><figcaption>Yay charts!</figcaption></figure><p>Granted, it’s all pretty basic — and static — information, but you gotta start somewhere. In the near future, we plan to add more charts that enable us to track product metrics over time.</p><p><strong>Challenge #4: Balance the ambitious product goals and pace with the team’s limited time, as well as our technical constraints.</strong></p><p>This balancing act is definitely the most interesting challenge I faced, particularly the part about accommodating the team’s schedules. It’s one that’s unique to the territory. In industry, developers typically work relatively predictable hours and a tech lead doesn’t need to accommodate for things like midterms, class projects, and final exams.</p><p>My approach for dealing with this (which still has much room for improvement) has been to set optimistic deadlines but accept that we may not meet them. At the start of a sprint cycle, I split up our tasks into sub-tasks that I can assign to particular developers (for example, pair one front-end and one back-end developer to work together on one feature). I’d make these assignments some time during the weekend. Then on Mondays, I’d host mandatory “hack nights” during which everyone would get together and start working on their tasks. These hack nights would be a perfect place to discuss implementation details, ask questions, and get a good chunk of work done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*mDqpQJbyx4P1mgCkAhX7Qw.png" /><figcaption>An arguably overoptimistic sprint cycle timeline. Nonetheless, I believe it accelerated our pace versus from it would have been otherwise.</figcaption></figure><p>Making the hack night right after task assignments turned out to be a great design choice. It (somewhat) prevented procrastination and allowed everyone to ask questions and initiate communication within the team early on in the week.</p><p>Despite baking proactiveness right into our development cycle, the 1-week deadline I’d set would rarely be met and I’d be forced to turn it into a 2-week sprint instead. It’s a tradeoff I realized I might have to accept given all of our limited (and often unpredictable) amounts of time to dedicate as college students.</p><p>Another tricky balancing act I had to learn was how to balance technical constraints like technical debt with product goals, the most notable case being our goal to launch our iOS app near the end of the quarter. We had targeted releasing it in week 8 (out of 10) and our mobile developer put in a lot of time and effort to hit that deadline. Unfortunately, I didn’t feel like we were ready for an app launch for one key reason: our API wasn’t stable.</p><p>In an effort to improve our product, we were constantly running A/B tests on core parts of the match flow. Toward the end of the quarter, we ran our most technically intense experiment yet in which we practically flipped the match flow on its head. Given this instability in the product, it simply didn’t make sense to release a mobile app because</p><ol><li>Our solo mobile developer would need to work super hard to try to keep the app up to date with our experiments — or at least prevent it from crashing.</li><li>Even if he could manage that, you have to accept it as a given that any release version of a mobile app will be used forever since there’s almost always some users that won’t update the app.</li></ol><p>Getting around these two facts and building a mobile app resistant to breaking changes requires significant forethought. Therefore, rushing the release without considering these aspects carefully is a recipe for disaster.</p><p>Convincing the team’s PM of this wasn’t easy. He has a tenacity and drive for quick development pace that has largely worked well in the project’s favor. In fact, his ambitious goal-setting practice is probably the #1 reason BruinMeet has been able to achieve the level of success it has. Nevertheless, I knew that I had to stand my ground in this particular situation. So I did. If you were eagerly awaiting the app’s release, you can blame me. 🤪</p><p>In retrospect, I’m really glad I accepted the position. I got to contribute to an awesome product reaching hundreds of UCLA students, learn and tackle some of the challenges that come with team management, and lead an awesome bunch of talented and dedicated developers. Most importantly, I learned that I want my career to involve not just writing code, but also interacting closely with people: the people that write the code, the people that design the product, and the people that use the product.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc4567ed2688" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bruinmeet/becoming-bruinmeet-tech-lead-cc4567ed2688">Becoming BruinMeet Tech Lead</a> was originally published in <a href="https://medium.com/bruinmeet">BruinMeet</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I hiked every weekend this quarter. Here’s why.]]></title>
            <link>https://medium.com/@bibekg/i-hiked-every-weekend-this-quarter-heres-why-600528c53bff?source=rss-6c487ef0946e------2</link>
            <guid isPermaLink="false">https://medium.com/p/600528c53bff</guid>
            <category><![CDATA[habits]]></category>
            <category><![CDATA[los-angeles]]></category>
            <category><![CDATA[hiking]]></category>
            <category><![CDATA[santa-monica]]></category>
            <category><![CDATA[ucla]]></category>
            <dc:creator><![CDATA[Bibek Ghimire]]></dc:creator>
            <pubDate>Tue, 12 Jun 2018 01:15:47 GMT</pubDate>
            <atom:updated>2018-06-12T01:16:10.572Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9mHmrGDTx7bJiRTvbMQx7g@2x.jpeg" /><figcaption>Week 1: Westridge Trailhead, 4.5 miles. Not a bad start.</figcaption></figure><p>For several of the past years, my parents and I talked a lot about taking a family trip to Hawaii. But every time we started thinking about the details, we’d come up with some reason to push it off a little longer. A lot of those reasons were totally valid, a lot of them simply stemmed from the habit of procrastination we had developed.</p><p>Then about a year ago, my dad suddenly passed away and the trip turned from an eventuality to an impossibility.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rn269dZDRhlsgq0zcZeaxg.jpeg" /><figcaption>Week 2: Yosemite Mist Trail, 8.1 miles. Introduced my mom, cousin, and new Nepali friend, Shuvang, to each other and to my all-time favorite trail.</figcaption></figure><p>There was nothing special about Hawaii as our travel destination. What we really wanted out of the trip was to carve out time from all of our busy schedules to spend quality time together as a family. But as we waited and waited for that magical week during which we’d all be free and healthy and ready to go, there was a timer slowly counting down to the moment at which that trip wouldn’t even be an option any more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ByBMEmzJxuZT4ohyn4iZqA@2x.jpeg" /><figcaption>Week 3: Mishe Mokwa Trail in the Santa Monica Mountains, 6.25 miles. Introduced two of my closest friends to each other and found a gem of a hike in the mountains of Malibu.</figcaption></figure><p>We all know we should live our lives doing the things that matter to us but it’s incredibly easy to get lost. Sometimes we get lost in things that don’t matter to us at all. We can usually see through that pretty quickly. But more often, we get lost in things that do matter to us. That’s when it becomes hard to tell how it’s stressing us out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bJryegbS2ve5sS0w9hZNWw.jpeg" /><figcaption>Week 4: Okay, I lied. I technically didn’t hike during the weekend after week 4 but my friend, Monil, offered to go explore a new beach/pier with me and count it anyways.</figcaption></figure><p>For me, that thing was school. As a computer science major taking upper division courses, my typical week involves around 16 hours of class, over 15 hours of outside studying, and anywhere from 10-15 hours of extracurricular clubs, organizations, etc. Add onto that all the other time sinks of college life and you’ve got yourself a stressful-looking calendar.</p><p>As a side note (that I’ll tie back into this point soon), I worked as a software engineering intern over this last summer. What I loved most about working was that it gave me a chance to create a clear distinction between work and the rest of my life. Once I left the office at around 5pm, the rest of the day was mine. Once I left the office on Friday evening, the weekend was mine.</p><p>As a college student, you don’t get the privilege of this clean separation of work and play. Instead, work spills into play, play spills into work, and your time management skills need to work twice as hard to clean up the mess.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LGgWWF3fjDz2xBI0wMwPEg@2x.jpeg" /><figcaption>Week 5: Solstice Canyon, 6.7 miles. Shuvang and I were very close to being lost on this trail as it was about to get dark but we luckily found our way back just before sunset.</figcaption></figure><p>Before this quarter, this meant that my weekends were when I would try to catch up (and sometimes get ahead) on schoolwork, projects, etc. As a result, I was making virtually no time for the other things in my life that mattered to me. I’d started playing guitar about two years ago but hardly found the time to practice, I knew how important running and exercising would be to my health, but I couldn’t fit it into my schedule, and finally… I knew how much I enjoyed hiking but I only got to do once every few months.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M3vRLfg1OWkIf5v05nu_xg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WeoTMZEK7D5UQyg02bc0qw.jpeg" /><figcaption>Week 6: Brushy Peak Regional Preserve, 4.5 miles. Got to bond with mom over a scenic hike through hills home to grazing cows.</figcaption></figure><p>As you can see, I lost sight of so many of the things that mattered to me because I was focused on the other thing (school) that mattered to me as well.</p><p>I decided something had to change so I challenged myself to make a habit out of at least one of those things that I value but didn’t dedicate enough time: hiking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WfRNtjNc5Gr7DmBPjfuQkg.jpeg" /><figcaption>Week 7: Fryman Canyon Park, 3.1 miles. Busy weekend so I had to keep the hike a bit short but done is better than perfect!</figcaption></figure><p>And I mostly succeeded. Aside from one instance (picture above) where I forgot about my challenge until it was already 8pm on Sunday, I managed to squeeze in a hike every weekend.</p><p>Along the way, I discovered the gorgeous Santa Monica Mountains, made a couple of new friends, and got 10 great workouts. Aside from those direct benefits, making a habit out of hiking helped me get better and making and keeping other habits. Around week 5, I also started working out 3–5 times per week (something I’ve struggled to do consistently in the past), and even developed better study habits (motivated by freeing up my weekends to hike stress-free!)</p><p>There were a lot of obstacles along the way though. There are only 24 hours in a day so dedicating more time to hiking meant I had to reduce time spent on other things like studying and partying. The tradeoff ended up better than a zero-sum game as I found that I was able to study more efficiently knowing that I was doing what I enjoyed with the rest of my time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v5n5_d79zQBTD1iqep-4sg.jpeg" /><figcaption>Week 8: Topanga State Park, 3.2 miles. What do you see when the smog over LA clears? UCLA. Ba dum tss. Too bad the smog doesn’t really clear.</figcaption></figure><p>The most important result of this experience was the subtle change in my mindset that while doing well in school is important to me, it’s far from being the <em>only </em>thing that’s important to me. Life is short and there are so many things to experience and enjoy. It’s crucial not to zoom so far into your life as it is now that you don’t see and experience the other things that matter to you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RrAwFPUix_SAA3NDzuiCLQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2YbBS9n50AZPs8Usd3j9hg.jpeg" /><figcaption>Week 9: Sullivan Canyon Park, 9.2 miles. With week 10 projects &amp; homework looming over my head, I needed a long hike to prepare me for the week ahead.</figcaption></figure><p>That’s why I’d like to propose a challenge to you. Think of something you enjoy doing but feel like doesn’t get enough of your time. For the next 10 weeks, set aside time to dedicate towards it. It can be an hour a week, thrice a week, or whatever other amount of time you feel is appropriate. All that matters is that you spend time doing what you love.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X2kWqBOm2_gLNJNjHfgfIA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a8pvwnlRUpp-jkGeSwDGIQ.jpeg" /><figcaption>Week 10: Will Rogers State Park, Inspiration Point, 2.5 miles. Had a final the next day but still needed to hike, so I decided, why not both?</figcaption></figure><p>Lastly, here are a couple more pictures from various hikes that didn’t get included throughout the post.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2oNTMCX2iMqTvmbJu7z3yw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fZ0jjYS-khDbWVyYidWoWQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y87UzRJVZE-GI9Ybu6qy9w.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dkz6vBivVqYlX3CyWGYhuQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jJ9Mvi5dhxHw5XtT178GgA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X0AQR8FW9vufayoUbahUCA.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=600528c53bff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I architected BruinMeet’s front-end. These are the technologies I used and why.]]></title>
            <link>https://medium.com/bruinmeet/i-architected-bruinmeets-front-end-these-are-the-technologies-i-used-and-why-ec60a8b5b238?source=rss-6c487ef0946e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec60a8b5b238</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[immer]]></category>
            <category><![CDATA[flow]]></category>
            <category><![CDATA[styled-components]]></category>
            <dc:creator><![CDATA[Bibek Ghimire]]></dc:creator>
            <pubDate>Wed, 28 Feb 2018 20:38:46 GMT</pubDate>
            <atom:updated>2018-02-28T20:38:46.210Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UfsLW0te2nCRv8JorGENQg.png" /></figure><p>For the last five months, I’ve been working as a web developer for <a href="http://bruinmeet.com/">Bruin Meet — a dating app exclusively for UCLA students</a>. When I came on as a front-end developer, the OG team of three had already built a great product with an impressive user base. My job was to help port the front-end from Handlebars (a server-side templating engine) to React.</p><p>We also chose the following technologies to complement React:</p><ul><li><a href="https://www.styled-components.com/">Styled Components</a></li><li><a href="https://flow.org/">Flow</a></li><li><a href="https://redux.js.org/">Redux</a></li><li><a href="https://github.com/mweststrate/immer">Immer</a></li></ul><p>I’ll talk about what each of these technologies is and how it fits into our front-end. I hope our experience can give you insight on how you can fit these technologies into your own product. Alright, let’s get started.</p><p><strong>Let’s start with Styled Components, a CSS styling framework that “provides visual primitives for the component age.”</strong></p><p>Styled Components allows you to “use the best bits of ES6 and CSS to style your apps without stress.”</p><p>Rather than writing styles in a separate CSS stylesheet that a component imports, you write them alongside the the component in the same JS file. An enormous pro of this is that you can look at a single file to determine everything there is to know about a component, from its logic to its styles. This also facilitates BruinMeet’s design principle of writing components that are highly consistent and modular.</p><p>This practice of writing your styles in your JS file isn’t new though. React’s built-in “inline styles” paradigm can do this out of the box. Where Styled Components beats inline styling is that you write your styles in <em>plain old CSS</em> with JS sprinkled in only as necessary, rather than as an object of key-value pairs.</p><p>Let’s take a look at a basic Text component to see how this plays out.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2e654438405201fd0e653c76dff77da0/href">https://medium.com/media/2e654438405201fd0e653c76dff77da0/href</a></iframe><p>The Text component is defined as a &lt;p&gt; element with the CSS styles specified in the template string. Also, the Text component interfaces exactly like a regular React component. In addition to this familiar interface, styled components are written using plain-old CSS styles and they accept props for customizability. As the earlier description said, “the best bits of ES6 and CSS.”</p><p>One of my favorite results of this ES6-friendly interface is that it allows us to define all of our styles (colors, shadows, breakpoints, you name it) in a centralized “styles” folder, as you can see being imported on line 2 and used on line 8.</p><p>With all these benefits, Styled Components makes the otherwise arduous process of managing styles in a large-scale project an absolute breeze.</p><p><strong>Next, let’s talk about Flow — the static type-checker that most people either swear by or swear at.</strong></p><p>Here’s Flow in action in our CheckboxInput component.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/51cc4bd6fa12f25b09f3e49f6bdc060a/href">https://medium.com/media/51cc4bd6fa12f25b09f3e49f6bdc060a/href</a></iframe><p>Note in particular the PropsType annotations on lines 20–25. These annotations strictly define the props this component accepts. Try passing in anything else and your text editor will scream at you (assuming you’ve configured your editor to show Flow errors inline).</p><p>Flow is ultimately a big tradeoff. In fact, it’s a tradeoff that nearly scared our team away from using it. Annotating all your components, objects, and functions can be a huge headache, especially when Flow starts giving you cryptic errors that require several minutes of scouring Stack Overflow and often even the issues section of the Flow GitHub repository.</p><p>However, in my opinion, it’s a tradeoff that’s well worth making. Here’s what Flow helps with:</p><ol><li>As long as your editor isn’t showing any Flow errors, you can be nearly certain that your code will just work. Bugs that arise will be run-time logical errors, rather than you trying to grab properties from an unexpectedly null object.</li><li>Your codebase becomes self-documenting, making it immensely easier for future developers to come on and understand how to use your components, functions, etc.</li><li>It gradually makes you think in a more type-safe way about how you write your code. With time, you need Flow’s overbearing assistance less and less because you learn how to ensure your data is typed well.</li></ol><p>As UCLA CS Professor Paul Eggert once said on the importance of static typing, “Static type-checking is for programmers that actually care about the reliability of their code. It’s not for programmers who write languages like Python or JavaScript where you don’t need to know much at all, yet your stuff still works.” With the power of Flow, we get to remove JavaScript from that second sentence and make our JavaScript code reliable.</p><p>A few more random notes about Flow:</p><ul><li><strong>Your codebase doesn’t have to be in React for you to use Flow.</strong> Flow, at its core, is nothing more than a static type-checker for JavaScript. Its support for React is top-notch, but it can also help you improve any other JavaScript your codebase may have.</li><li><strong>Flow can be used for sever-side code as well.</strong> A natural progression from the previous bullet, Flow can be applied to your NodeJS server code as well.</li><li><strong>Flow can be implemented incrementally.</strong> If the thought of type-annotating your entire project’s codebase was giving you anxiety, worry not. You can implement Flow as slowly or as quickly as you want.</li></ul><p><strong>Okay, it’s time to talk about React’s trusty sidekick, Redux.</strong></p><p>You rarely ever hear about React without hearing about Redux as well. Redux, as stated on the official website, is “a predictable state container for JavaScript apps”. Something to note about this definition is that it makes no mention of React. Although it pairs amazingly with it, Redux isn’t limited to just React apps. Regardless, the following discussion will assume we are pairing it with React since that’s what we’ve done at BruinMeet.</p><p>Redux’s key selling point is that it creates an application-wide state that can be tapped into by any React component. The best way to explain how React and Redux work in concert is to look at the following diagram:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/259/1*nghG_EcRtJ5qE-ttyUljKg.png" /></figure><p>Redux is a framework that makes this data flow possible.</p><p>In this diagram, the <strong>view</strong> is typically a <strong>React</strong> component.</p><p>An <strong>action</strong> is exactly that — some action that your component requests to perform on the Redux state. It typically looks like { type: &#39;ACTION_NAME&#39;, payload: SOME_DATA }.</p><p>We’ll come back to the <strong>middleware</strong> part in a bit. For now, just assume that part of the diagram doesn’t exist.</p><p>The <strong>reducer</strong> is basically a box that takes in the old state and an action, then returns a new state as a result of performing that action on the old state. One key note here is that <em>Redux is built on the assumption that your reducer returns a completely new copy of your state</em>. In other words, each state that comes out of the reducer must <strong>never</strong> be mutated, even by the view components that receive that state data. Subsequently, the issue of keeping that state immutable is one that’s led to the creation of a handful of third-party libraries. We’ll get a little more in-depth on this problem, and reducers in general, later when we talk about one of those libraries, Immer.</p><p>If you’re writing a React component that you want to be able to tap into your Redux state, you wrap it in a connect() higher-order component. If that jargon doesn’t make sense to you, don’t worry. It didn’t make sense to me for a long time either. In essence, the higher-order component is just a wrapper for your component that gets notified when the application state changes, then passes this new state to its child component.</p><p>Okay, now remember the <strong>middleware</strong> part of that diagram that we forgot existed? It’s time for it to exist.</p><p>Where Redux really shines in the BruinMeet codebase is in the way it uses the thunk middleware. Ignore the weird name. What a Redux thunk middleware does is it allows us to write actions that don’t necessarily need to execute and modify the Redux state immediately.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/06636dac36021f1ff82e452f45b83596/href">https://medium.com/media/06636dac36021f1ff82e452f45b83596/href</a></iframe><p>Instead of returning a typical { type, payload } action, getUser returns a <strong>function</strong> that does two key things (some other things like authentication have been stripped out for simplicity):</p><ol><li>Makes an HTTP request to our API server to retrieve the user object.</li><li>Once it has the user object in response.data.user, it dispatches another (regular) action, getUserSuccess, that puts the user object in the Redux state.</li></ol><p>This usage of Redux creates an elegant interface between the API server and the UI components, as shown on the diagram above. This allows us to design our React components without thinking about server interaction at all. All the React component needs to do is fire off an action, let Redux communicate with the server, then consume the data once Redux receives it from the server and puts it in the applications state. Yay abstraction!</p><p>Now there’s one last part of Redux we have left to look at in depth. Reducers.</p><p>As a reminder from earlier, a reducer is just a function that takes in a state and an action and returns a new state. Take a look at this reducer. It’s a naive implementation of the BruinMeet user reducer, along with one additional, complicated action.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/33a17ded4e25484d009daa13d454a594/href">https://medium.com/media/33a17ded4e25484d009daa13d454a594/href</a></iframe><p>Like I mentioned before, the updated state that a reducer returns may never be mutated. That means we can’t ever modify the state parameter that comes into the reducer since that’s just the output of a previous call to this same reducer. The simplest way to deal with that is to use the ES6 object spread operator, …, to “spread” the old state into the new one, then drop in changes we want to make, like action.payload. This suffices for smaller reducers but what if we need to set state.foo.bar.baz? As you can see in case SOME_NEW_ACTION, it’s a 10-line mess of object spreads just to update a single value. How can we make this less ugly?</p><p>Say hello to Immer.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b64b2630f8ff14696b9133460553e8c7/href">https://medium.com/media/b64b2630f8ff14696b9133460553e8c7/href</a></iframe><p>Although we had to add a little more boilerplate, look at the difference between the two reducers for the SOME_NEW_ACTION action. We reduced 10 lines to 1. As the number of actions the reducer needs to handle grows, the boilerplate will be more than amortized.</p><p>Immer works by abstracting away the work of keeping your state immutable by letting you mutate adraft object instead. Under the hood, it ensures that your modifications to draft don’t touch the original state parameter that comes into the reducer. If you want to learn more about Immer and the cool methods Michel Westrate employed to make it all work, check out his awesome article on Immer <a href="https://hackernoon.com/introducing-immer-immutability-the-easy-way-9d73d8f71cb3">here</a>.</p><p>Well, that’s it. Those are the five core pieces of BruinMeet’s front-end: React, Redux, Immer, Flow, and Styled Components. This suite of technologies has served us well in creating a codebase that’s highly component-based, conveniently self-documenting, and incredibly reliable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec60a8b5b238" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bruinmeet/i-architected-bruinmeets-front-end-these-are-the-technologies-i-used-and-why-ec60a8b5b238">I architected BruinMeet’s front-end. These are the technologies I used and why.</a> was originally published in <a href="https://medium.com/bruinmeet">BruinMeet</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Do nothing]]></title>
            <link>https://medium.com/@bibekg/do-nothing-ae18f1651eb2?source=rss-6c487ef0946e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae18f1651eb2</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[mindfulness]]></category>
            <category><![CDATA[self-improvement]]></category>
            <dc:creator><![CDATA[Bibek Ghimire]]></dc:creator>
            <pubDate>Sun, 25 Feb 2018 22:41:37 GMT</pubDate>
            <atom:updated>2018-02-25T22:41:37.164Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s so rare that we let ourselves just sit and think. Whenever we have free time, we choose from a too-abundant list of activities with which to fill the void. Checking our phones, listening to music, watching YouTube/Netflix, just to name a few. Each of these has its value but another option we almost never consider is to just… do nothing.</p><p>Today I decided to start a habit based on this idea. Once per week, I’m going to go somewhere alone, turn on Do Not Disturb, set my timer for at least 30 minutes, and do absolutely nothing. 30 minutes per week isn’t much but I’m hoping the habit will gradually seep into the rest of my week.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yB1bYGRLgXBYL4SAdLH_tA.jpeg" /><figcaption>My view for 30 minutes this beautiful Sunday afternoon</figcaption></figure><p>So today, I stared at the sky for 30 minutes. I’m not going to lie and say it was some magical, meditative experience. It wasn’t. There were several moments when I wanted to start doing work so I could stop “being unproductive”, pull out my phone and Google something, or even just write down an idea I had. Instead of giving in to any of those temptations, I just reminded myself that I had consciously allotted these 30 minutes to do nothing and I was gonna stick to it. When I wasn’t having urges to quit early though, it was great. I was able to think more creatively and deeply about my ideas than I otherwise would have and I felt incredibly relaxed and refreshed afterward.</p><p>I’ll continue to post more as I practice this habit more but until then, give it a shot yourself. Observe how difficult it is to do nothing and ask yourself why that is. I think the experience can be really insightful.</p><p>To be continued…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae18f1651eb2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>