<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Joseph Jude</title>
    <description>The latest articles on Forem by Joseph Jude (@jjude).</description>
    <link>https://forem.com/jjude</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1824%2FcrpCjEUN.jpg</url>
      <title>Forem: Joseph Jude</title>
      <link>https://forem.com/jjude</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/jjude"/>
    <language>en</language>
    <item>
      <title>What’s your take on the coming decade?</title>
      <dc:creator>Joseph Jude</dc:creator>
      <pubDate>Wed, 06 Jan 2021 04:21:43 +0000</pubDate>
      <link>https://forem.com/jjude/what-s-your-take-on-the-coming-decade-21h6</link>
      <guid>https://forem.com/jjude/what-s-your-take-on-the-coming-decade-21h6</guid>
      <description>&lt;p&gt;The last two decades have been about convenience. Developers converted every activity into algorithms and then into apps, improving our lives in tangible ways.&lt;/p&gt;

&lt;p&gt;Now that convenience is covered, most would upgrade to the next level in the hierarchy of wants. I suspect that level is “experience.”&lt;/p&gt;

&lt;p&gt;Joseph Pine and James Gilmore wrote of the emerging experience economy in a HBR article. They published a book later on the same topic.&lt;/p&gt;

&lt;p&gt;Joseph &amp;amp; James predicted that “the next competitive battleground lies in staging experiences” We witness the competition playing out in some areas already.&lt;/p&gt;

&lt;p&gt;I wrote my take on this here: &lt;a href="https://jjude.in/expdevto"&gt;https://jjude.in/expdevto&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What is your take?&lt;/p&gt;

</description>
      <category>future</category>
    </item>
    <item>
      <title>I coded for a year. Here are ten lessons</title>
      <dc:creator>Joseph Jude</dc:creator>
      <pubDate>Fri, 16 Aug 2019 12:29:56 +0000</pubDate>
      <link>https://forem.com/jjude/i-coded-for-a-year-here-are-ten-lessons-1b5c</link>
      <guid>https://forem.com/jjude/i-coded-for-a-year-here-are-ten-lessons-1b5c</guid>
      <description>&lt;p&gt;&lt;em&gt;Read the full article at my &lt;a href="https://www.jjude.com/one-year-coding/"&gt;site&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I coded daily for a year. I skipped when we went on holidays and Sundays. Even when I skipped, I got back to the streak as quickly as possible.&lt;/p&gt;

&lt;p&gt;Here are ten lessons I learned in this year of coding.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;I am privileged&lt;/li&gt;
&lt;li&gt;Make it a morning routine&lt;/li&gt;
&lt;li&gt;Build something you need&lt;/li&gt;
&lt;li&gt;Default choices make you productive&lt;/li&gt;
&lt;li&gt;Keep a swipe file (backlog)&lt;/li&gt;
&lt;li&gt;Separate thinking and doing&lt;/li&gt;
&lt;li&gt;Dope vs. Discipline&lt;/li&gt;
&lt;li&gt;Everything takes more time than planned&lt;/li&gt;
&lt;li&gt;Can't do without the internet&lt;/li&gt;
&lt;li&gt;Obsess over fundamentals; not techniques and tools&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>coding</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Mastering sales as a CTO</title>
      <dc:creator>Joseph Jude</dc:creator>
      <pubDate>Sat, 07 Apr 2018 02:02:07 +0000</pubDate>
      <link>https://forem.com/jjude/mastering-sales-as-a-cto-b49</link>
      <guid>https://forem.com/jjude/mastering-sales-as-a-cto-b49</guid>
      <description>&lt;p&gt;&lt;em&gt;Read the full article at my &lt;a href="https://jjude.com/cto-sales/"&gt;site&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Two years back, I became a CTO of an offshore IT services company. Part of the job is to get on sales calls to build trust in the minds of prospects to do business with us.&lt;/p&gt;

&lt;p&gt;When I started attending sales calls, I thought I could just say we are a well established IT services company and prospects will just sign-up for our services. How naive!&lt;/p&gt;

&lt;p&gt;Now I prepare relentlessly. &lt;strong&gt;Preparation builds confidence and confidence wins trust&lt;/strong&gt;. I prepare by asking questions. Here are some questions that help me prepare for sales calls.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What are we selling?&lt;/li&gt;
&lt;li&gt;How are we different?&lt;/li&gt;
&lt;li&gt;What are the objections?&lt;/li&gt;
&lt;li&gt;Have we practiced together?&lt;/li&gt;
&lt;li&gt;Who is the prospect?&lt;/li&gt;
&lt;li&gt;Do we have examples?&lt;/li&gt;
&lt;li&gt;What can go wrong?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once I'm prepared, I am ready for the calls. I take a note and a pen with me for calls. As the call proceeds, I take notes. &lt;strong&gt;I listen for signals&lt;/strong&gt;. I scribble anything that will help me during the course of the call.&lt;/p&gt;

&lt;p&gt;After every call, I write notes about the call. I note down what went well as well as what went wrong.&lt;/p&gt;

&lt;p&gt;The more we prepare, play, and retrospect together, we get better together.&lt;/p&gt;

&lt;p&gt;When we strive together, we thrive together. And then we become lucky. Because one-half of life is luck; the other half is preparation.&lt;/p&gt;

</description>
      <category>learning</category>
      <category>career</category>
      <category>leadership</category>
    </item>
    <item>
      <title>I have seen the future of jobs and it is Hollywood model</title>
      <dc:creator>Joseph Jude</dc:creator>
      <pubDate>Thu, 25 Jan 2018 12:07:27 +0000</pubDate>
      <link>https://forem.com/jjude/i-have-seen-the-future-of-jobs-and-it-is-hollywood-model-i55</link>
      <guid>https://forem.com/jjude/i-have-seen-the-future-of-jobs-and-it-is-hollywood-model-i55</guid>
      <description>&lt;p&gt;&lt;em&gt;This is summary of the post I posted at my &lt;a href="https://jjude.com/future-of-jobs/" rel="noopener noreferrer"&gt;blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A.R. Rahman and Danny Boyle came together first for the popular movie Slumdog Millionaire. The movie won eight Academy Awards and seven BAFTA awards. Since then they have worked together many times.&lt;/p&gt;

&lt;p&gt;As players in Hollywood, Rahman and Danny Boyle don't work for each other. In fact, they don't work for anyone. "They are &lt;strong&gt;jobless&lt;/strong&gt;," says Antonio Paraiso in his &lt;em&gt;&lt;a href="https://www.youtube.com/watch?v=1HIVBmjtt5g" rel="noopener noreferrer"&gt;Porto Business School lecture&lt;/a&gt;&lt;/em&gt; discussing the Hollywood model of working. As he explains in his lecture, they &lt;strong&gt;have a career, not jobs&lt;/strong&gt;. They don't work for a company, they work on interesting projects.&lt;/p&gt;

&lt;p&gt;In the traditional IT business, companies hire employees for &lt;strong&gt;long-term&lt;/strong&gt;. They may undergo training or work on client projects or stay on "bench" or retrained or asked to leave. It is common to see employees working in the same company for decades. As long as they work in a company, employees work only on &lt;strong&gt;projects within the company&lt;/strong&gt; that employs them.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.jjude.com%2Ffuture-of-jobs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.jjude.com%2Ffuture-of-jobs.png" alt="Future of Jobs"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hollywood flips this model. &lt;/p&gt;

&lt;p&gt;No studio employs director or musician or editor on a long-term basis. As Antonio says, those in Hollywood &lt;strong&gt;don't have jobs; they work on projects&lt;/strong&gt;. Studios identify a project and bring together a suitable team for that project. The team works together as long as needed to complete the project—whether it is six months or three years. Members may come and go as needed. Some members may work exclusively on a project; some may work on many projects simultaneously. They work together to &lt;strong&gt;create value for themselves and others&lt;/strong&gt;. Some get paid; some take a share in profit. When that project is completed, they move on. They may or may not work together again.&lt;/p&gt;

&lt;h2&gt;
  
  
  Governments embrace Hollywood Model for their premier projects
&lt;/h2&gt;

&lt;p&gt;The government of India (GoI) adopted this model for &lt;a href="https://uidai.gov.in/" rel="noopener noreferrer"&gt;&lt;strong&gt;UIDAI&lt;/strong&gt;&lt;/a&gt; project, the largest biometric ID system. Once GoI identified the project, it appointed &lt;a href="https://en.wikipedia.org/wiki/Nandan_Nilekani" rel="noopener noreferrer"&gt;Nandan Nilekani&lt;/a&gt; to head project implementation.&lt;/p&gt;

&lt;p&gt;GoI also brought-in &lt;a href="https://www.linkedin.com/in/amitranjanprofile/" rel="noopener noreferrer"&gt;Amit Ranjan&lt;/a&gt;, &lt;strong&gt;co-founder of Slideshare&lt;/strong&gt; on the same model.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Taavi_Kotka" rel="noopener noreferrer"&gt;Taavi Kotka&lt;/a&gt; was the managing director of the largest software development company in the Baltic region. The government of Estonia appointed him as CIO to architect the popular e-residency program of Estonia.&lt;/p&gt;

&lt;h2&gt;
  
  
  Time for companies to embrace this model is now
&lt;/h2&gt;

&lt;p&gt;Technology is penetrating into every domain. Newer technologies like blockchain and newer regulations like GDPR are emerging at a pace never seen before. Such changes &lt;strong&gt;disrupt but open enormous opportunities&lt;/strong&gt;. It is not possible for any company to develop necessary talents in-house to exploit these opportunities. Only way companies can thrive is to embrace this Hollywood style of project-based value creation.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it means for developers
&lt;/h2&gt;

&lt;p&gt;Until now, if you graduated from an engineering college you could get into a software company. Once you got into a company, if you worked hard you had a good chance of growing up in that company.&lt;/p&gt;

&lt;p&gt;Not any more.&lt;/p&gt;

&lt;p&gt;Dorie Clark is an author of two books on this subject — "Reinventing You" and "Stand Out". She identified three foundational techniques to stand out in a noisy world. She writes in her &lt;a href="https://hbr.org/2017/01/what-you-need-to-stand-out-in-a-noisy-world" rel="noopener noreferrer"&gt;HBR article&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;These are &lt;strong&gt;social proof&lt;/strong&gt;, which gives people a reason to listen to you; &lt;strong&gt;content creation&lt;/strong&gt;, which allows them to evaluate the quality of your ideas; and your &lt;strong&gt;network&lt;/strong&gt;, which allows your ideas to spread.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Your network plays an important role if you want to work in Hollywood model. Who-knows-whom is an important aspect in this model. Still you need to create a portfolio and put it out in public. This in-turn will enlarge your network, as new people will come in contact with your work.&lt;/p&gt;

&lt;p&gt;Under the guise of scientific management, holistic expertise degraded into narrow specialization. As the world becomes collaborative, we all should develop inter-disciplinary skills. Specifically, we should become "T" shaped experts — with deep expertise in few areas and basic understanding of other associated areas.&lt;/p&gt;

&lt;p&gt;As Robert Heinlein said:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. &lt;strong&gt;Specialization is for insects&lt;/strong&gt;."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Peter Merel reframed it for developers like this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A programmer should be able to fix a bug, market an application, maintain a legacy, lead a team, design an architecture, hack a kernel, schedule a project, craft a class, route a network, give a reference, take orders, give orders, use configuration management, prototype, apply patterns, innovate, write documentation, support users, create a cool web-site, email efficiently, resign smoothly. Specialization is for recruiters.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Gospel for some, tragedy for others
&lt;/h2&gt;

&lt;p&gt;Hollywood model won't be a good news for all. History will repeat. Those who can adapt will succeed. Others might pop up in a song.&lt;/p&gt;

&lt;p&gt;The winner takes it all&lt;br&gt;
The loser has to fall&lt;br&gt;
It's simple and it's plain&lt;br&gt;
Why should I complain&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Read the full post at my &lt;a href="https://jjude.com/future-of-jobs/" rel="noopener noreferrer"&gt;blog&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>career</category>
    </item>
    <item>
      <title>What is a multi-tenant system?</title>
      <dc:creator>Joseph Jude</dc:creator>
      <pubDate>Fri, 17 Nov 2017 13:18:22 +0000</pubDate>
      <link>https://forem.com/jjude/what-is-a-multi-tenant-system-bpd</link>
      <guid>https://forem.com/jjude/what-is-a-multi-tenant-system-bpd</guid>
      <description>&lt;p&gt;&lt;em&gt;This post was first posted on my &lt;a href="https://prudentdevs.club/mts/" rel="noopener noreferrer"&gt;blog&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It is no coincidence that designers of software systems are called architects. Software architects have borrowed quite a lot of concepts from civil engineering. Multi-tenancy is one such concept borrowed from civil engineering. Much like in civil engineering, software &lt;strong&gt;multi-tenancy optimizes resource utilization, but offers flexibility of customization&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Let us understand the concept from civil engineering first.&lt;/p&gt;

&lt;p&gt;I was born in an independent house. Small house, yet independent. We styled it whatever way we wanted it. We partitioned the house into two and had a cow shed on one side and a living space on the other. We didn't have to seek permission from our neighbors to do that. We had the &lt;strong&gt;freedom&lt;/strong&gt; to do whatever we wanted within our plot of land. That freedom had a cost. If we had any issue with any utilities (say water) we had to handle it ourselves.&lt;/p&gt;

&lt;p&gt;When I went to college, I lived in a hostel. Each of us had an independent room. We could bring our own furniture. Some of us brought bare minimum to get through four years, while few rich kids brought luxurious furniture. The college took care of the maintenance and repairs. While we were allowed to bring our own furniture, we couldn't modify the rooms, not even the color of the walls. &lt;strong&gt;The rooms did not represent us&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;After few years in job, I bought a flat. Each of the 200 owners have the same layout but each of us have filled our homes with our own style of furniture. Some of them have &lt;strong&gt;customized&lt;/strong&gt; even further. They have a sound-proof room for audio recording! Like in our hostels, the maintenance and repair is by a common agency.&lt;/p&gt;

&lt;p&gt;Now let us understand the concept from software engineering perspective.&lt;/p&gt;

&lt;p&gt;Let us talk with examples from software industry.&lt;/p&gt;

&lt;p&gt;Say that I want to host my own email and document server. After much search I choose &lt;a href="https://owncloud.com/" rel="noopener noreferrer"&gt;owncloud&lt;/a&gt;&lt;sup id="fnref1"&gt;1&lt;/sup&gt;. I install it on my own server. I create one account for myself and I use it. This is a &lt;strong&gt;single-user, single-tenant system&lt;/strong&gt;. I'm the user as well as the tenant. I can make whatever modification I want on the system. &lt;/p&gt;

&lt;p&gt;Want to host it on a separate domain? Check.&lt;br&gt;
What to change the colors in the system? Check.&lt;br&gt;
What to pick and choose modules? Check.&lt;/p&gt;

&lt;p&gt;As I get used to this system, I want to share the calendar with my wife and family. I create individual accounts for each of them. Now the system becomes &lt;strong&gt;multi-user, but it is still single-tenant&lt;/strong&gt;. Each user can customize few features, like calendar name, but they can't pick and choose a functionality. If my sister wants to sync this calendar with her gmail calendar, she can't. Why? Because if I enable it, it will be enabled for all and I don't want to confuse my father with a new option. There is no option to enable it only for one user or set of users.&lt;/p&gt;

&lt;p&gt;Now my colleagues Martin and Bob are impressed with how I manage my family schedule and they want to do the same. I could install owncloud in their own server. They will get the freedom to customize the way they want. But they don't want the headache of managing their servers and monitoring them. So they ask me to manage for them. They also tell me, they don't want to share their data with anyone else. They ask me if I could set up independent data storage for them. It doesn't stop. Martin wants only calendar facility and want to access the system via schedules.martinfamily.com. Bob on the other hand, wants to access the system from familyroom.bob.com. As indicated by the url, he wants to store family documents in addition to using calendar. He wants AWS S3 to be his data store. I can setup all of these because Owncloud supports multi-tenancy. They are pleased with the setup and invite all their family members to use the system. They decide to pay me for my service. I charge them according to the usage instead of a flat rate. (I wish I could end the story like the fairy tales: I lived happily ever after in Hawaii :-) ). This setup is now a &lt;strong&gt;multi-user, multi-tenant system&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;As you can understand, not all web applications have to be multi-user system and not all multi-user web-applications have to be multi-tenant system. All solutions are contextual. An architect has to select the right approach for a given set of requirement.&lt;/p&gt;

&lt;p&gt;Architecting a multi-tenant system is &lt;strong&gt;more complicated&lt;/strong&gt; than architecting a multi-user system. There are two models of architecting a multi-tenant system: instance replication and data-segregation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foe1t97ycsvfvg6bc7y3w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foe1t97ycsvfvg6bc7y3w.png" alt="Multi-tenancy Models" width="800" height="469"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In &lt;strong&gt;instance replication model&lt;/strong&gt;, the system spins a new instance for every tenant. This is easier to start, but hard to scale. It becomes a nightmare when 100s of tenants signup.&lt;/p&gt;

&lt;p&gt;In &lt;strong&gt;data-segregation model&lt;/strong&gt;, the application is shared between tenants but data of each tenant is stored in separate data stores. Separate data stores could be separate databases or separate schema within the same database.&lt;/p&gt;

&lt;p&gt;To support such data-segregation, there has to be an additional &lt;strong&gt;management layer&lt;/strong&gt; in the system architecture to provision a separate data-store every time a tenant signs up. Multi-tenancy includes customized UI for each tenant, selective subscription of services, and metered billing. This management layer is responsible for all of these functions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm55grxq5vzd2ik43gy54.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm55grxq5vzd2ik43gy54.png" alt="Multi-tenancy Architecture" width="761" height="534"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By now it should be obvious that multi-tenant systems are not appropriate for every web-application. A multi-user architecture is sufficient enough for a B2C (business-to-customer) web-application. A multi-tenant architecture should be considered for a B2B (business-to-business) application.&lt;/p&gt;

&lt;p&gt;Even though a multi-tenant architecture is a complex one, &lt;strong&gt;data privacy regulations like GDPR will force most B2B SAAS applications to become a multi-tenant system&lt;/strong&gt;. If you are building a new B2B SAAS application, you better start with a multi-tenancy architecture.&lt;/p&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;I have no connection with owncloud. This is only an example. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Descriptive analytics in Javascript</title>
      <dc:creator>Joseph Jude</dc:creator>
      <pubDate>Sun, 17 Sep 2017 15:59:04 +0000</pubDate>
      <link>https://forem.com/jjude/descriptive-analytics-in-javascript</link>
      <guid>https://forem.com/jjude/descriptive-analytics-in-javascript</guid>
      <description>&lt;p&gt;&lt;em&gt;This was published in my &lt;a href="https://jjude.com/descriptive-analytics-in-js/" rel="noopener noreferrer"&gt;blog&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.jjude.com%2Fdesc-analytics.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.jjude.com%2Fdesc-analytics.png" alt="Descriptive Analytics in Javascript"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Descriptive analytics is usually the first step in data analytics exercise. As the name suggests, it &lt;strong&gt;describes&lt;/strong&gt; a dataset. It answers the question, "&lt;strong&gt;what happened&lt;/strong&gt;".&lt;/p&gt;

&lt;p&gt;Any data set can be &lt;strong&gt;described&lt;/strong&gt; with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;summary factors like mean and mode;&lt;/li&gt;
&lt;li&gt;spread factors like standard deviation;&lt;/li&gt;
&lt;li&gt;shape or pattern factors like standard distribution. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let us talk with an example. Let us say that following are the unit sales figures for two sales managers for the last 6 weeks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;43,41,42,46,41,41&lt;/li&gt;
&lt;li&gt;32,34,68,62,28,30&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What do these numbers tell? In total, they both sold 254 items, which means they both are equally competitive. Their average is 42.3, which again says they both are equal in caliber. &lt;/p&gt;

&lt;p&gt;The standard deviation paints a different picture. The &lt;strong&gt;standard deviation measures concentration of data around the mean&lt;/strong&gt;. The standard deviation for the first manager is 1.8, while the second one is 16.2. What does this mean? The first manager is consistent week after week in meeting his target, but the second manager is not. If all else remain the same, then this data indicates that the first sales manager is more dependable than the second one.&lt;/p&gt;

&lt;p&gt;Now let us look at calculating these descriptive analytics for any dataset, using &lt;strong&gt;Javascript&lt;/strong&gt;. The web is replete with Python tutorials, not much of Javascript. If developers are already using Node.js to develop web-application or they use Javascript for designing front-end development, they shouldn't have to use another language only for computing statistics.&lt;/p&gt;

&lt;p&gt;We will use two packages for this purpose. The first one, &lt;a href="https://www.npmjs.com/package/csvtojson" rel="noopener noreferrer"&gt;&lt;strong&gt;csvtojson&lt;/strong&gt;&lt;/a&gt;, is to read csv records and convert them into json values. The second one, &lt;a href="https://www.npmjs.com/package/simple-statistics" rel="noopener noreferrer"&gt;&lt;strong&gt;simple-statistics&lt;/strong&gt;&lt;/a&gt;, is to compute statistics. Refer the &lt;a href="https://simplestatistics.org/docs/" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; for all the features of this package. In this post, we are using only the essential functions.&lt;/p&gt;

&lt;p&gt;Simple Statistics takes an array of values and computes statistics. Computing sum, mean, and standard deviation for the above two sales values goes like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ node
&amp;gt; const stats = require('simple-statistics');
&amp;gt; const first=[43,41,42,46,41,41];
&amp;gt; const second=[32,34,68,62,28,30];
&amp;gt; stats.sum(first)
254
&amp;gt; stats.sum(second)
254
&amp;gt; stats.mean(first)
42.333333333333336
&amp;gt; stats.mean(second)
42.333333333333336
&amp;gt; stats.standardDeviation(first)
1.7950549357115015
&amp;gt; stats.standardDeviation(second)
16.224124698183942
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Too often when we learn a subject, we get neatly arranged examples. It is like &lt;a href="https://www.jjude.com/are-you-learning-a-new-domain-visit-its-zoo/" rel="noopener noreferrer"&gt;going to the zoo&lt;/a&gt;. But the real-world is complex.&lt;/p&gt;

&lt;p&gt;Recently, I analyzed sales figures for a large e-commerce company. There were about 150000 records. I couldn't glance through the numbers to make sense. I loaded all the data and analyzed through simple statistics package. It showed me how different real-world sales figures compared to the neatly arranged values we get while learning.&lt;/p&gt;

&lt;p&gt;Here is the code I wrote to load the data and describe the data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const csv = require('csvtojson');
const stats = require('simple-statistics');

let salesData = [];
let totalRows = 0;

const data = csv()
  .fromFile('sales.csv')
  .on('json', (jsonObj, rowIndex) =&amp;gt; {
    totalRows = rowIndex;
    salesData.push(parseFloat(jsonObj['Sales'].replace(',', '')));
  })
  .on('done', () =&amp;gt; {
    descriptiveStats();
    process.exit(1);
  });

function descriptiveStats() {
  console.log('descriptiveStats of ' + totalRows + ' rows');
  console.log('Min: ', stats.min(salesData));
  console.log('Max: ', stats.max(salesData));
  console.log('Mean : ', stats.mean(salesData));
  console.log('Median: ', stats.median(salesData));
  console.log('Mode: ', stats.mode(salesData));
  console.log('standardDeviation: ', stats.standardDeviation(salesData));
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The results are:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Min:  -33116.58
Max:  70049.89
Mean:  316.117162163024
Median:  159.53
Mode:  0.01
standardDeviation:  777.6360644532846
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The sales engine is completely messy for them. Each of the descriptive statistics element says only one thing: there is no consistency in their sales.&lt;/p&gt;

&lt;p&gt;A good book to understand descriptive statistics and in general numbers, is from "The Economist", aptly titled &lt;a href="https://www.amazon.com/dp/1576601447?tag=jjude-20" rel="noopener noreferrer"&gt;Numbers Guide&lt;/a&gt;. If you want to understand standard deviation, read &lt;a href="http://datapigtechnologies.com/blog/index.php/understanding-standard-deviation-2/" rel="noopener noreferrer"&gt;Understanding Standard Deviation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I will continue to write about machine learning and data analytics using Javascript. If that interests you, please subscribe from my &lt;a href="https://jjude.com/descriptive-analytics-in-js/" rel="noopener noreferrer"&gt;blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>analytics</category>
    </item>
    <item>
      <title>Guidelines for picking tech-stack for startups</title>
      <dc:creator>Joseph Jude</dc:creator>
      <pubDate>Mon, 31 Jul 2017 02:16:22 +0000</pubDate>
      <link>https://forem.com/jjude/guidelines-for-picking-tech-stack-for-startups</link>
      <guid>https://forem.com/jjude/guidelines-for-picking-tech-stack-for-startups</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.jjude.com%2Fguidelines-for-startup-tech-stack.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.jjude.com%2Fguidelines-for-startup-tech-stack.jpg" alt="Guidelines for choosing tech stack for startups"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One of the best &lt;a href="https://hbr.org/2016/03/clayton-christensen-what-ill-miss-about-andy-grove" rel="noopener noreferrer"&gt;anecdote on consulting&lt;/a&gt; comes from Professor Clayton Christensen. Andy Grove, Intel chief, asked the professor what his theory of disruption means for Intel. Instead of giving a direct answer, the professor taught Andy Grove, "&lt;strong&gt;how to think&lt;/strong&gt;" about the problem. I have followed this method for decision making. Instead of seeking answers, I seek "how to think" about a particular problem. Such method has helped me make decision in varying situations. In the similar vein, let me give three guidelines to design tech-stacks for startups.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pick the right tool for the job
&lt;/h3&gt;

&lt;p&gt;When a fly invaded his meeting, President Obama &lt;a href="http://nypost.com/2014/12/31/obama-shows-hes-so-fly-swats-pest-in-oval-office/" rel="noopener noreferrer"&gt;rolled up a magazine and whacked the fly&lt;/a&gt;. He didn't ask for a gun or call up his army generals, or punch-in nuclear codes. He picked a near-by magazine, rolled it, and whacked it himself.&lt;/p&gt;

&lt;p&gt;I'm often asked if .Net is better or Python is better or node.js is better for building a startup product. If there is a technology co-founder, my advise is always to &lt;strong&gt;start with the stack that they know&lt;/strong&gt;. Later as the product grows, add what is needed, or move to a more suitable stack. &lt;a href="https://marco.org/" rel="noopener noreferrer"&gt;Marco Arment&lt;/a&gt; coded backend for his popular &lt;a href="https://overcast.fm/" rel="noopener noreferrer"&gt;overcast&lt;/a&gt; podcast player in PHP because that is what he knew. Later when it grew he &lt;a href="http://highscalability.com/blog/2015/2/2/marco-arment-uses-go-instead-of-php-and-saves-money-by-cutti.html" rel="noopener noreferrer"&gt;switched to Golang&lt;/a&gt;. Likewise, Twitter was originally written in Ruby and then switched to Scala.&lt;/p&gt;

&lt;p&gt;As it should be clear now, the &lt;strong&gt;right stack changes as the startup goes through its growth stages&lt;/strong&gt;. &lt;/p&gt;

&lt;h3&gt;
  
  
  Build for iteration and feedback
&lt;/h3&gt;

&lt;p&gt;Startup is all about &lt;strong&gt;validating ideas quickly&lt;/strong&gt;. So choose a tech-stack that gives you this advantage. Validating ideas quickly is not only about tech-stack. It is also about company's &lt;a href="https://en.wikipedia.org/wiki/DevOps" rel="noopener noreferrer"&gt;devops&lt;/a&gt; process. It is also about having probes in the application to give you operational insights. This combination of &lt;strong&gt;tech-stack, devops, and application analytics help validating ideas quickly&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Most technology teams in &lt;strong&gt;startups don't invest in devops and application analytics&lt;/strong&gt;. Lack of devops and analytics limits their agility and speed, more than the tech-stack.&lt;/p&gt;

&lt;h3&gt;
  
  
  Decide well or fast
&lt;/h3&gt;

&lt;p&gt;Every business executive has to take ton of decisions. Lack of data complicates the decision making. I use a rule-of-thumb to help me decide. I ask myself, is this something &lt;strong&gt;money can solve at a later time?&lt;/strong&gt; There are few problems that money can't solve. &lt;/p&gt;

&lt;p&gt;Company &lt;strong&gt;culture is one problem that more money can't solve&lt;/strong&gt;. In fact, money amplifies what is already there. So if a company starts with a sexist, dishonest, authoritarian culture, more money later won't turn the culture around later. Uber is an example.&lt;/p&gt;

&lt;p&gt;However, lot of problems can be solved by bringing more money. &lt;strong&gt;Logo, website design, and tech-stack are some of the problems that money can solve&lt;/strong&gt;. As I said earlier, Twitter switched from Ruby to Scala. Dropbox is experimenting with Golang. Facebook invested in writing its own compiler for PHP.&lt;/p&gt;

&lt;p&gt;If more money can solve a problem, choose to iterate fast. You shouldn't wait on more data. Decide by your gut feel and most probably it will work out ok. If not, bring in more money to solve that problem.&lt;/p&gt;

&lt;p&gt;If more money won't solve a problem, think deep. If needed, get outside help. Talk to people who have already solved the problem. These decisions will have lasting impact on the company. Getting them wrong will be a disaster for the founders and the company.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;You can read the full article on &lt;a href="https://jjude.com/stacks-for-startups/" rel="noopener noreferrer"&gt;my blog&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>design</category>
      <category>startup</category>
    </item>
    <item>
      <title>Getting started with React.js and Typescript</title>
      <dc:creator>Joseph Jude</dc:creator>
      <pubDate>Thu, 22 Jun 2017 16:31:21 +0000</pubDate>
      <link>https://forem.com/jjude/getting-started-with-reactjs-and-typescript</link>
      <guid>https://forem.com/jjude/getting-started-with-reactjs-and-typescript</guid>
      <description>&lt;p&gt;&lt;em&gt;I posted this originally in my &lt;a href="https://jjude.com/react-with-tsc/" rel="noopener noreferrer"&gt;blog&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;React.js is a Javascript UI library by Facebook. In this guide, we will wire it up with Typescript to display a "Hello World" on the browser page.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Want to learn basics of Typescript? Read my &lt;a href="https://www.jjude.com/ts/" rel="noopener noreferrer"&gt;guide&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.jjude.com%2Freact-tsc.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.jjude.com%2Freact-tsc.svg" alt="React with Typescript"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm assuming you have already installed &lt;a href="https://nodejs.org/en/" rel="noopener noreferrer"&gt;node.js&lt;/a&gt;. In this post, I use &lt;a href="https://yarnpkg.com/" rel="noopener noreferrer"&gt;yarn&lt;/a&gt; package manager from Facebook. But everything will work with &lt;a href="https://www.npmjs.com" rel="noopener noreferrer"&gt;npm&lt;/a&gt;, the default package manager for node.js.&lt;/p&gt;

&lt;p&gt;It is a commonly accepted practice to have all the Typescript sources under a directory named &lt;code&gt;src&lt;/code&gt; and compile final output in a directory named &lt;code&gt;build&lt;/code&gt;. So let us create those directories.&lt;/p&gt;

&lt;p&gt;Go to terminal and issue &lt;code&gt;mkdir src build&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Let us initiate a new node.js project. &lt;code&gt;yarn init -y&lt;/code&gt; comamnd will create a new node.js project with default values. We need to add few modules for our program. Let us add them. Issuse the following commands one by one.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add react react-dom
yarn add -D typescript webpack ts-loader @types/react @types/react-dom

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

&lt;/div&gt;



&lt;p&gt;The -D in the second command indicates that the modules should be installed as development dependencies, which means they won't be installed in production. &lt;/p&gt;

&lt;p&gt;Let us understand the modules we have installed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;react&lt;/code&gt; and &lt;code&gt;react-dom&lt;/code&gt; are the core react modules. Without them, our program won't work;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;typescript&lt;/code&gt; is the superset of Javascript;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;webpack&lt;/code&gt; is a module bundler, which means it efficiently combines multiple Javascript files to create single Javascript file. This improves performance of the application.&lt;/li&gt;
&lt;li&gt;Webpack knows to combine Javascript files. But we are using Typescript. That's why we need &lt;code&gt;ts-loader&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;@types/react&lt;/code&gt; and &lt;code&gt;@types/react-dom&lt;/code&gt; contain type definitions for the &lt;code&gt;react&lt;/code&gt; and &lt;code&gt;react-dom&lt;/code&gt; modules.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By now, your &lt;code&gt;package.json&lt;/code&gt; should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "name": "01-react-tsc",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "author": "Joseph Jude",
  "scripts": {},
  "devDependencies": {
    "@types/react": "^15.0.30",
    "@types/react-dom": "^15.5.0",
    "ts-loader": "^2.1.0",
    "typescript": "^2.3.4",
    "webpack": "^3.0.0"
  },
  "dependencies": {
    "react": "^15.6.1",
    "react-dom": "^15.6.1"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We want to invoke &lt;code&gt;webpack&lt;/code&gt; without prefixing with its path (&lt;code&gt;./node_modules/webpack&lt;/code&gt;). Let us install it globally so that we can invoking it directly. Issue &lt;code&gt;yarn global add webpack&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We need a config file to use &lt;code&gt;webpack&lt;/code&gt;. Let us add the config file, named &lt;code&gt;webpack.config.js&lt;/code&gt;. The config file is self-documented with comments.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var path = require("path");

var config = {
  /*
   * index.tsx represents the entry point to your web application. Webpack will
   * recursively go through every "require" statement in index.tsx and
   * efficiently build out the application's dependency tree.
   */
  entry: ["./src/index.tsx"],

  /*
   * The combination of path and filename tells Webpack what name to give to
   * the final bundled JavaScript file and where to store this file.
   */
  output: {
    path: path.resolve(__dirname, "build"),
    filename: "bundle.js"
  },

  /*
   * resolve lets Webpack now in advance what file extensions you plan on
   * "require"ing into the web application, and allows you to drop them
   * in your code.
   */
  resolve: {
    extensions: [".ts", ".tsx", ".js", ".json"]
  },

  module: {
    /*
     * Each loader needs an associated Regex test that goes through each
     * of the files you've included (or in this case, all files but the
     * ones in the excluded directories) and finds all files that pass
     * the test. Then it will apply the loader to that file.
     */
    loaders: [
      {
        test: /\.tsx?$/,
        loader: "ts-loader",
        exclude: /node_modules/
      }
    ]
  },
  // When importing a module whose path matches one of the following, just
  // assume a corresponding global variable exists and use that instead.
  // This is important because it allows us to avoid bundling all of our
  // dependencies, which allows browsers to cache those libraries between builds.
  externals: {
    "react": "React",
    "react-dom": "ReactDOM"
  },
};

module.exports = config;

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

&lt;/div&gt;



&lt;p&gt;We need to add &lt;code&gt;tsconfig.json&lt;/code&gt; file for Typescript. Copy paste the following code. If you have chosen to use different directory names, change these directory names in the &lt;code&gt;outDir&lt;/code&gt; and &lt;code&gt;include&lt;/code&gt; section.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "compilerOptions": {
    "outDir": "./build/",
    "sourceMap": true,
    "noImplicitAny": true,
    "module": "commonjs",
    "target": "es5",
    "jsx": "react"
  },
  "include": [
    "./src/**/*"
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only one more step before we get into programming react.js library. We need to add a build step in the script section of &lt;code&gt;package.json&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"scripts": {
  "build": "webpack"
},
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we can run &lt;code&gt;yarn run build&lt;/code&gt; and it will invoke webpack, which in turn will compile Tyepscript files and combine them into a single file.&lt;/p&gt;

&lt;p&gt;Now that we have all the setup done, let us move on to create our application files.&lt;/p&gt;

&lt;p&gt;Create an &lt;code&gt;index.html&lt;/code&gt; in root directory with the following content. Here we are using the cdn version of &lt;code&gt;react&lt;/code&gt; files. The &lt;code&gt;bundle.js&lt;/code&gt; will be created by the webpack in the subsequent steps. Not the empty &lt;code&gt;div&lt;/code&gt; tag with &lt;code&gt;main&lt;/code&gt; as the &lt;code&gt;id&lt;/code&gt;. This will be used by the react library to display the message -- for now, it is going to be &lt;code&gt;Hello World&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;

&amp;lt;head&amp;gt;
  &amp;lt;meta charset="utf-8"&amp;gt;
  &amp;lt;title&amp;gt;Getting started with ReactJS and Typescript&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
  &amp;lt;div id="main"&amp;gt;&amp;lt;/div&amp;gt;

  &amp;lt;!-- we pick from cdn so can be cached by browsers --&amp;gt;
  &amp;lt;script src="https://unpkg.com/react@15/dist/react.min.js"&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script src="https://unpkg.com/react-dom@15/dist/react-dom.min.js"&amp;gt;&amp;lt;/script&amp;gt;

  &amp;lt;!-- compiled file for this project --&amp;gt;
  &amp;lt;script src="build/bundle.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let us create our logic file. Create &lt;code&gt;index.tsx&lt;/code&gt; file in &lt;code&gt;src&lt;/code&gt; directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import * as React from "react";
import * as ReactDOM from "react-dom";

ReactDOM.render(
    &amp;lt;h1&amp;gt;Hello World&amp;lt;/h1&amp;gt;,
    document.getElementById("main")
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we are importing the main modules of &lt;code&gt;react&lt;/code&gt;. &lt;code&gt;ReactDom.render&lt;/code&gt; has two parameters -- what to display and where to display. We are going to display &lt;code&gt;Hello World&lt;/code&gt; as a title within &lt;code&gt;h1&lt;/code&gt; tags. We are going to display it in the empty &lt;code&gt;div&lt;/code&gt; that we created.&lt;/p&gt;

&lt;p&gt;By now your directory structure should like like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.
â”œâ”€â”€ build
â”œâ”€â”€ index.html
â”œâ”€â”€ package.json
â”œâ”€â”€ src
â”‚Â Â  â””â”€â”€ index.tsx
â”œâ”€â”€ tsconfig.json
â”œâ”€â”€ webpack.config.js
â””â”€â”€ yarn.lock
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Time to execute. Issue &lt;code&gt;yarn run build&lt;/code&gt; at the terminal. Now &lt;code&gt;webpack&lt;/code&gt; will compile the application file and create &lt;code&gt;bundle.js&lt;/code&gt;. If you open &lt;code&gt;index.html&lt;/code&gt; in the browser, you will see &lt;code&gt;Hello World&lt;/code&gt; as a header.&lt;/p&gt;

&lt;p&gt;You can download the entire code from the &lt;a href="https://gitlab.com/jjude/reactjs-exercises" rel="noopener noreferrer"&gt;repository&lt;/a&gt;. Then run &lt;code&gt;yarn install&lt;/code&gt; (or &lt;code&gt;npm install&lt;/code&gt;) to install all the dependencies. Then execute with &lt;code&gt;yarn run build&lt;/code&gt; (or &lt;code&gt;npm run build&lt;/code&gt;).&lt;/p&gt;

</description>
      <category>react</category>
      <category>typescript</category>
    </item>
    <item>
      <title>Four Cs of dev.to (What I like and what I suggest)</title>
      <dc:creator>Joseph Jude</dc:creator>
      <pubDate>Thu, 25 May 2017 07:30:27 +0000</pubDate>
      <link>https://forem.com/jjude/four-cs-of-devto-what-i-like-and-what-i-suggest</link>
      <guid>https://forem.com/jjude/four-cs-of-devto-what-i-like-and-what-i-suggest</guid>
      <description>&lt;p&gt;I have come to enjoy dev.to. As I mentioned in a &lt;a href="https://news.ycombinator.com/item?id=13849504"&gt;Hackernews&lt;/a&gt; comment, dev.to has become one of the site, I visit daily. &lt;/p&gt;

&lt;p&gt;While taking my morning walk, I thought about what I get out of Dev.to and what I would like to see in dev.to. Keep in mind that I don’t know the future roadmap of Dev.to and I’m not in any position to influence the future direction. This is an opinion of a happy and a regular reader.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Content&lt;/em&gt;: Dev.to is full of user generated content. Almost all of the content is useful in your day to day work, meaning they are all "how-to" articles. My &lt;a href="http://getpocket.com/"&gt;Pocket&lt;/a&gt; reading list is full of articles from dev.to.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BzMRy9IU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.jjude.com/2017-05-devto.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BzMRy9IU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.jjude.com/2017-05-devto.jpg" alt="dev.to articles in pocket"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Community&lt;/em&gt;: Because of high quality content, dev.to has built a valuable developer community around it. There are architects, product managers, and beginners. There are developers who use all programming languages. This diversity brings with it, its own depth. I love to interact with the community and learn from them. So far, I've not read a "&lt;a href="https://en.wikipedia.org/wiki/RTFM"&gt;RTFM&lt;/a&gt;" type of a condescending comment, which is prevalent in developer community.&lt;/p&gt;

&lt;p&gt;Content and community around it are the two factors I have enjoyed with dev.to. I hope they keep these tight as they scale. It is a challenge, but I hope Ben and team are able to meet the challenge.&lt;/p&gt;

&lt;p&gt;As I said in a previous para, I was thinking about how else the portal can be useful (not necessarily monetized, but useful). These are the two aspects that came to my mind.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Collaboration&lt;/em&gt;: As the community grows, why should it limit itself to passive consumption and few answers to question? Why can't the community collaborate for each other's benefit?&lt;/p&gt;

&lt;p&gt;"Hey, I'm stuck in debugging this java code. Can anyone help?"&lt;br&gt;
"I'm self-publishing a book on d3.js. Would anyone review if the content is technically correct?"&lt;br&gt;
"Can we have a digital hackathon?"&lt;/p&gt;

&lt;p&gt;And so on.&lt;/p&gt;

&lt;p&gt;The collaborative work itself can happen outside dev.to. But it can enable searching for people. Taking the second question in the above list, dev.to can enable searching for people who have worked in d3.js and shown willingness to collaborate.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Commerce&lt;/em&gt;: Most developers are altruists (at-least the ones who come to dev.to. Today there is no money to be made there; why would they come there, otherwise?), but we have bills to pay. When we collaborate, we like to get paid. Again, the deals can happen outside of the portal; but the portal can have all the essential elements to support commerce.&lt;/p&gt;

&lt;p&gt;Coming to think of it, there could be a marketplace within dev.to. Every market place wants a community built around it, because people buy from people they know and trust, aka community. If so, why can't dev.to go from community and to commerce? It can also partner with other marketplaces like &lt;a href="https://market.ionic.io/"&gt;Ionic marketplace&lt;/a&gt; and &lt;a href="http://market.envato.com/"&gt;Evanto market&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Today dev.to is simple and there is certain attractiveness in simplicity. I hope these changes won't break that simplicity.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally posted in &lt;a href="https://www.jjude.com/dev-to/"&gt;my blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>opinion</category>
      <category>meta</category>
    </item>
    <item>
      <title>What we can learn from Jack Ma and Derek Sivers about building our career</title>
      <dc:creator>Joseph Jude</dc:creator>
      <pubDate>Tue, 09 May 2017 16:25:17 +0000</pubDate>
      <link>https://forem.com/jjude/what-we-can-learn-from-jack-ma-and-derek-sivers-about-building-our-career</link>
      <guid>https://forem.com/jjude/what-we-can-learn-from-jack-ma-and-derek-sivers-about-building-our-career</guid>
      <description>&lt;p&gt;Now-a-days I'm either the oldest or one of the older member in any meetup. So juniors walk up to me all the time and ask for career advice. In this video, I answer one such question.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=dcpLmoXnSUI"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AVTCtl-Z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.jjude.com/2017-04-splst-vlog.jpg" alt="Specialist or Generalist"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Watch the video or read the transcript below&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;There was one question that occupied my mind in the early part of my career. That question was: Should I specialize in a single technology or learn as many business functions as I could learn? After all, my friends were choosing to build their career on SAP or Oracle Forms, or Java.&lt;/p&gt;

&lt;p&gt;I’m going to be honest with you. I didn’t find the answer easily. I found it through lot of experimentation. &lt;/p&gt;

&lt;p&gt;In the last few years, I’ve listened to popular entrepreneurs answering this question. I was pleasantly surprised that their advice confirms what I found through trail and error.&lt;/p&gt;

&lt;p&gt;First is Jack Ma, the owner of Alibaba. He says in &lt;a href="https://www.youtube.com/watch?v=cESSaKQYfnU"&gt;this video&lt;/a&gt; in the early part of your career, learn as many things as you possibly can. Then as you age, focus on your strengths and build on them.&lt;/p&gt;

&lt;p&gt;Let me read out to you what another successful entrepreneur has to say on this. He is Derek Sivers. I came to know about Derek through his TED talks. He is the founder of CD Baby. He sold it for 22 million dollars and donated all the money to charity.&lt;/p&gt;

&lt;p&gt;In his podcast interview with Tim Ferriss, he talked about how he started his career. He didn’t have any lofty goals back then. He just wanted to be a professional musician and he started as one playing in a pig show. He said &lt;a href="https://sivers.org/2015-12-ferriss"&gt;this about starting a career&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When you’re earlier in your career I think the best strategy is you just say yes to everything, every piddly little gig, you just never know what are the lottery tickets.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;What I have found working, and what these two entrepreneurs say is this: Learn as much as possible in the early part of your career. If you get a chance to work in marketing department, do it. If your company asks you to develop a server application, develop it. If you come across an opportunity to sell, sell. Do this for about 10 years. By doing this, you would learn quite a lot about most of the business functions. You will also know what you like the most and what comes easily to you.&lt;/p&gt;

&lt;p&gt;Once you find what you like and what you comes naturally to you, dive deep into it. Become master of those skills. That way you will have a rich life. When I say rich, I don’t necessarily mean money, but satisfying life.&lt;/p&gt;

&lt;p&gt;For me, I found out that I love technology and teaching. That is exactly what I am doing through this blog and my new vlog. &lt;/p&gt;

&lt;p&gt;Good luck finding what you like and what comes naturally to you.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Posted originally in my &lt;a href="https://www.jjude.com/specialize-or-generalize/"&gt;blog&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;

</description>
      <category>career</category>
    </item>
    <item>
      <title>Any leads to get started with remote jobs?</title>
      <dc:creator>Joseph Jude</dc:creator>
      <pubDate>Sun, 19 Feb 2017 17:02:00 +0000</pubDate>
      <link>https://forem.com/jjude/any-leads-to-get-started-with-remote-jobs</link>
      <guid>https://forem.com/jjude/any-leads-to-get-started-with-remote-jobs</guid>
      <description>&lt;p&gt;How to get started with remote jobs (full time or part time)? How did you get started with remote jobs?&lt;/p&gt;

</description>
      <category>discuss</category>
    </item>
    <item>
      <title>How to dockerize a hapijs application</title>
      <dc:creator>Joseph Jude</dc:creator>
      <pubDate>Thu, 26 Jan 2017 15:59:35 +0000</pubDate>
      <link>https://forem.com/jjude/how-to-dockerize-a-hapijs-application</link>
      <guid>https://forem.com/jjude/how-to-dockerize-a-hapijs-application</guid>
      <description>&lt;p&gt;Docker has drastically enhanced how we develop and deploy web applications. With docker, we can isolate our development environment and resemble the production environment as close as possible. When our development environment resembles the production environment, we deploy with confidence. &lt;/p&gt;

&lt;p&gt;We can even go a step further. With automated tests, and few other tools, we can automate the deployment. That brings ease and confidence — for us, for our teams, and for our clients. &lt;strong&gt;In software development, ease and confidence is value&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In this tutorial, I'm going to show you how to dockerize an existing hapijs application.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://hapijs.com/"&gt;Hapijs&lt;/a&gt; is a nodejs framework from Walmart. They use it to power their e-commerce system. If you require an introduction to hapijs, you can read my &lt;a href="https://jjude.com/hapi-with-tsc/"&gt;introductory post&lt;/a&gt; about hapijs.&lt;/p&gt;

&lt;p&gt;First, we are going to create a simple hapijs application. To do that let us create the &lt;code&gt;package.json&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "name": "sample-hapijs-inside-docker",
  "version": "1.0.0",
  "description": "Hapijs app in docker container",
  "main": "index.js",
  "scripts": {
      "start": "node src/server.js",
      "test": "echo \"Error: no test specified\" &amp;amp;&amp;amp; exit 1"
  },
  "author": "Joseph Jude",
  "license": "ISC",
  "dependencies": {
    "hapi": "14.0.0"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a common &lt;code&gt;package.json&lt;/code&gt; file. I want you to notice just two lines here.&lt;/p&gt;

&lt;p&gt;We are using a start script: &lt;code&gt;node src/server.js&lt;/code&gt;. It will become clear as we go along. Just keep this in mind. &lt;/p&gt;

&lt;p&gt;Also, notice that we are using hapijs version 14.&lt;/p&gt;

&lt;p&gt;Now let us create the &lt;code&gt;server.js&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const Hapi = require('hapi');

const server = new Hapi.Server();
server.connection({ port: 8080 });

server.route({
    method: 'GET',
    path: '/',
    handler: function (request, reply) {
        reply('Hello, docker!');
    }
});

server.start((err) =&amp;gt; {

    if (err)
        throw err;

    console.log('Server running at:', server.info.uri);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nothing special here. We instantiate a Hapi server at port 8080 and print &lt;code&gt;Hello docker&lt;/code&gt; when the server comes up.&lt;/p&gt;

&lt;p&gt;We can pull an existing nodejs docker container and build our application on top of it. Or, we can build a container from scratch. We are going to build it from scratch.&lt;/p&gt;

&lt;p&gt;We are going to use &lt;a href="https://alpinelinux.org/"&gt;alpine&lt;/a&gt; as the base OS for our container. Why alpine? Alpine is both small and secure.&lt;/p&gt;

&lt;p&gt;We are going to create a text file named &lt;code&gt;Dockerfile&lt;/code&gt; in the same directory where we created the above two files. &lt;code&gt;Dockerfile&lt;/code&gt; contains the instructions to build the container. &lt;/p&gt;

&lt;p&gt;So our directory structure looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;├── Dockerfile
├── package.json
└── server.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let us build the &lt;code&gt;Dockerfile&lt;/code&gt; step by step. It looks like this to start with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM alpine:3.4
RUN apk update &amp;amp;&amp;amp; apk upgrade
RUN apk add nodejs
RUN rm -rf /var/cache/apk/*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What does these lines mean?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Line 1&lt;/strong&gt;: We are basing our container from alpine&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Line 2&lt;/strong&gt;: Update the OS&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Line 3&lt;/strong&gt;: Add nodejs&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Line 4&lt;/strong&gt;: remove apk cache    &lt;/p&gt;

&lt;p&gt;If we build a container with these lines, we will get a nodejs container. We want a hapijs one. So let us go on.&lt;/p&gt;

&lt;p&gt;Remember, we already created a &lt;code&gt;package.json&lt;/code&gt; and &lt;code&gt;server.js&lt;/code&gt; files. Let us copy them into the container. Append these lines to &lt;code&gt;Dockerfile&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;COPY . /src
RUN cd /src; npm install
EXPOSE 8080
CMD ["node", "/src/server.js"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let me explain these lines.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Line 1&lt;/strong&gt;: We are instructing the docker engine to copy the entire directory to a folder src within the docker container.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Line 2&lt;/strong&gt;: Install the required dependencies. This will install hapijs.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Line 3&lt;/strong&gt;: Notice that in the &lt;code&gt;server.js&lt;/code&gt; we are running the hapijs server at 8080. In this line we instruct docker to expose 8080 port to the outside world, so that we can access the server from our host machine.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Line 4&lt;/strong&gt;: Lastly we instruct docker to run the server with the command &lt;code&gt;node /src/server.js&lt;/code&gt;. Commands and parameters are given in the fashion as in this line.&lt;/p&gt;

&lt;p&gt;Our complete &lt;code&gt;Dockerfile&lt;/code&gt; looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM alpine:3.4
RUN apk update &amp;amp;&amp;amp; apk upgrade
RUN apk add nodejs
RUN rm -rf /var/cache/apk/*

COPY . /src
RUN cd /src; npm install
EXPOSE 8080
CMD ["node", "/src/server.js"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can build the container. Open the terminal and issue this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker build -t jjude/hapi .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Docker needs a dockerfile to build a container. We can either provide the full path or instruct to use the dockerfile in the current directory. We are instructing the build process to use the Dockerfile from the current directory.&lt;/p&gt;

&lt;p&gt;It is also a good practice to tag the container with &lt;code&gt;&amp;lt;user_name&amp;gt;/&amp;lt;application_name&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;When you issue this command, it will start pulling the necessary components (os, nodejs, hapijs) from the web and build a container. You will start seeing the output that goes like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Sending build context to Docker daemon 5.632 kB
Step 1/8 : FROM alpine:3.4
 ---&amp;gt; 0766572b4bac
Step 2/8 : RUN apk update &amp;amp;&amp;amp; apk upgrade
 ---&amp;gt; Using cache
 ---&amp;gt; edfde7516f9b
Step 3/8 : RUN apk add nodejs
 ---&amp;gt; Running in 4d786fc5787b
(1/4) Installing libgcc (5.3.0-r0)
(2/4) Installing libstdc++ (5.3.0-r0)
(3/4) Installing libuv (1.9.1-r0)
(4/4) Installing nodejs (6.7.0-r0)
Executing busybox-1.24.2-r13.trigger
OK: 41 MiB in 15 packages
 ---&amp;gt; 25426b5e81e2
Removing intermediate container 4d786fc5787b
Step 4/8 : RUN rm -rf /var/cache/apk/*
 ---&amp;gt; Running in 2db1ab7c47b5
 ---&amp;gt; efbdf59a5e3a
Removing intermediate container 2db1ab7c47b5
Step 5/8 : COPY . /src
 ---&amp;gt; f67db160cffb
Removing intermediate container b452bcf97da6
Step 6/8 : RUN cd /src; npm install
 ---&amp;gt; Running in eebeb5c18070
sample-hapijs-inside-docker@1.0.0 /src
`-- hapi@14.0.0
  +-- accept@2.1.3
  | `-- boom@4.2.0
  +-- ammo@2.0.3
  | `-- boom@4.2.0
  +-- boom@3.2.2
  +-- call@3.0.4
  | `-- boom@4.2.0
  +-- catbox@7.1.3
  | +-- boom@4.2.0
  | `-- joi@10.2.0
  +-- catbox-memory@2.0.4
  +-- cryptiles@3.1.1
  | `-- boom@4.2.0
  +-- heavy@4.0.3
  | +-- boom@4.2.0
  | `-- joi@10.2.0
  +-- hoek@4.1.0
  +-- iron@4.0.4
  | `-- boom@4.2.0
  +-- items@2.1.1
  +-- joi@9.2.0
  | +-- isemail@2.2.1
  | `-- moment@2.17.1
  +-- kilt@2.0.2
  +-- mimos@3.0.3
  | `-- mime-db@1.26.0
  +-- peekaboo@2.0.2
  +-- shot@3.4.0
  | `-- joi@10.2.0
  +-- statehood@4.1.0
  +-- subtext@4.3.0
  | +-- boom@4.2.0
  | +-- content@3.0.3
  | | `-- boom@4.2.0
  | +-- pez@2.1.4
  | | +-- b64@3.0.2
  | | +-- boom@4.2.0
  | | `-- nigel@2.0.2
  | |   `-- vise@2.0.2
  | `-- wreck@10.0.0
  |   `-- boom@4.2.0
  `-- topo@2.0.2

npm WARN sample-hapijs-inside-docker@1.0.0 No repository field.
 ---&amp;gt; e04821112bdf
Removing intermediate container eebeb5c18070
Step 7/8 : EXPOSE 8080
 ---&amp;gt; Running in 6889ad302d2f
 ---&amp;gt; adfd88fe97ca
Removing intermediate container 6889ad302d2f
Step 8/8 : CMD node /src/server.js
 ---&amp;gt; Running in dcde9b8ab986
 ---&amp;gt; 07786de22668
Removing intermediate container dcde9b8ab986
Successfully built 07786de22668
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It should end with &lt;code&gt;Successfully built&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;We have the container. You can check it by issuing &lt;code&gt;docker images&lt;/code&gt;. It should show something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
jjude/hapi          latest              07786de22668        23 minutes ago      41.1 MB
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, the basic container that can execute our &lt;code&gt;server.js&lt;/code&gt; is of 41.1 MB.&lt;/p&gt;

&lt;p&gt;Now we need to bring up this container (run it). Issue this command &lt;code&gt;docker run -p 8080:8080 -d jjude/hapi&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;What does this command do? &lt;/p&gt;

&lt;p&gt;We are running our container &lt;code&gt;jjude/hapi&lt;/code&gt; and binding the container port 8080 to the host port 8080. &lt;/p&gt;

&lt;p&gt;What if you want to use a different port, say 9000? You can do that with &lt;code&gt;-p 9000:8080&lt;/code&gt;. The format goes like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-p &amp;lt;host port&amp;gt;:&amp;lt;container port&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will come back to the terminal command prompt. How to check if our little server is running?&lt;/p&gt;

&lt;p&gt;Issue a &lt;code&gt;curl&lt;/code&gt; command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl http://localhost:8080
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should output this:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;That's it. We successfully dockerised our sample hello docker program.&lt;/p&gt;

&lt;p&gt;What if you want to go into the container and play around? Docker provides an option to enter into a running container. To do that, we need to know the id of the running container. Issue &lt;code&gt;docker ps&lt;/code&gt;. It will show an output like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CONTAINER ID        IMAGE               COMMAND                 CREATED             STATUS              PORTS                    NAMES
2fb1cb0abb92        jjude/hapi          "node /src/server.js"   23 minutes ago      Up 23 minutes       0.0.0.0:8080-&amp;gt;8080/tcp   cocky_hawking
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first parameter is the container id. Copy it and issue the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker exec -it 2fb1cb0abb92 /bin/sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use the correct container id from the previous output. &lt;/p&gt;

&lt;p&gt;Now you are into the container. You can stop and restart the server. The source code lives in &lt;code&gt;/src/&lt;/code&gt; folder. &lt;/p&gt;

&lt;p&gt;You can checkin these three files (package.json, server.js, Dockerfile) to a repository and ask a member of your team to checkout the repository and build the container. It will work &lt;strong&gt;exactly&lt;/strong&gt; the same way. That's the magic of Docker!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Interested in learning hapijs with typescript? Subscribe to my &lt;a href="https://jjude.com/hapijs"&gt;newsletter&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally posted at &lt;a href="https://www.jjude.com/hapijs-on-docker/"&gt;jjude.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>hapijs</category>
      <category>docker</category>
    </item>
  </channel>
</rss>
