<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Techhive.IO</title>
    <description>The latest articles on DEV Community by Techhive.IO (@techhiveio).</description>
    <link>https://dev.to/techhiveio</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%2Forganization%2Fprofile_image%2F1222%2Fb7f74ffc-d8f2-4165-869f-81ff82581604.png</url>
      <title>DEV Community: Techhive.IO</title>
      <link>https://dev.to/techhiveio</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/techhiveio"/>
    <language>en</language>
    <item>
      <title>How to Close a Software Project: The Pillars for Successful Project Delivery</title>
      <dc:creator>Abdul Rahman Zantout</dc:creator>
      <pubDate>Sat, 12 Oct 2019 08:41:45 +0000</pubDate>
      <link>https://dev.to/techhiveio/how-to-close-a-software-project-the-pillars-for-successful-project-delivery-3001</link>
      <guid>https://dev.to/techhiveio/how-to-close-a-software-project-the-pillars-for-successful-project-delivery-3001</guid>
      <description>&lt;p&gt;Software engineering is hard.&lt;/p&gt;

&lt;p&gt;No matter what you hear or read, learning how to develop software might be easy at first. But developing an application or a product takes much more than writing code.&lt;/p&gt;

&lt;p&gt;You need to communicate with the client, get the requirements straight, iterate, improve, and deliver.&lt;/p&gt;

&lt;p&gt;You need to understand what the client needs. You will also need to question your assumptions and to make sure you address the real needs.&lt;/p&gt;

&lt;p&gt;As with any engineering field, crafting proper software requires careful planning, careful execution, smart decision making, and feature prioritization.&lt;/p&gt;

&lt;p&gt;You need the right combination of skills within your team. But most importantly, your team must have the correct mindset and common drive to bring an idea or a product to life.&lt;/p&gt;

&lt;p&gt;A software engineer will face challenges and will be tasked to complete the project during the timeline agreed upon with the client, with high-quality standards by the release date.&lt;/p&gt;

&lt;p&gt;To do so, a software engineer must carefully incorporate a particular methodology to navigate the waves ahead of him successfully.&lt;/p&gt;

&lt;h2&gt;
  
  
  Managing Expectations
&lt;/h2&gt;

&lt;p&gt;Both you and your client should know the outcome and the purpose of the project beforehand. &lt;/p&gt;

&lt;p&gt;What does the client need? What does he or she expect to receive?&lt;/p&gt;

&lt;p&gt;Expectation management is when every detail of the project (the scope of work) is clear, precise, and concise for both you and the client.&lt;/p&gt;

&lt;p&gt;When you define your scope of work, you set the expectations for both your team and the client. You must make sure that every detail related to project requirements is clear and precise.&lt;/p&gt;

&lt;p&gt;Requirements do not change in the middle of the project unless the nature of the project allows it to, which you should be aware of beforehand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting the requirements straight
&lt;/h2&gt;

&lt;p&gt;You're in the middle of the project, and the client decides to redesign part of the website or application. &lt;/p&gt;

&lt;p&gt;Depending on the size and complexity of the request, you could charge your client for the extended scope.&lt;/p&gt;

&lt;p&gt;Whether you do charge them or not, make sure they show you an example of what they expect and what they have in mind. A visualization of what to expect helps your clients express their needs in as clear a manner as possible.&lt;/p&gt;

&lt;p&gt;Designing, and God forbid, implementing the redesign without the client's input beforehand is a waste of resources.&lt;/p&gt;

&lt;h2&gt;
  
  
  Continuous Delivery
&lt;/h2&gt;

&lt;p&gt;Progress bars are created to show you your progress, or the progress of something that you are waiting for its completion (think downloading)&lt;/p&gt;

&lt;p&gt;The same applies to your client.&lt;/p&gt;

&lt;p&gt;Showing progress to your client through continuous delivery and keeping him posted regularly about the status of the project will not only keep the client engaged throughout the project: it will also allow him to provide you feedback, iterate quickly over the features, improve on them, and test them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Locking down the project's scope
&lt;/h2&gt;

&lt;p&gt;The project's scope should be locked down and agreed upon beforehand, with minor room for change. &lt;/p&gt;

&lt;p&gt;Leaving a small room for change might sound counter-intuitive to some clients and developers alike. But this is the surest way to deliver a successful project on the initial time and budget.&lt;/p&gt;

&lt;p&gt;If there is a hard deadline, significant change requests can be left to a second iteration. If they were important, you should have included them in the first iteration. &lt;/p&gt;

&lt;p&gt;Proper communication at the beginning of the project will eliminate ambiguity and surprises along the way.&lt;/p&gt;

&lt;p&gt;Getting the requirements straight before jumping into development and design is the foremost step before kicking off any project. Identifying key stakeholders, doing a risk analysis, and planning your sprints comes second.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Words
&lt;/h2&gt;

&lt;p&gt;Successfully delivering to a client is the surest way to grow your business and reputation. The client will recommend you to other prospects.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Successful projects will breed other projects and prospects.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Anyone can write code, regardless of seniority. But allowing the client to experience the entire software development lifecycle, and delivering smoothly and successfully is the surest way to more successes down the road.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>career</category>
      <category>startup</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Making your blog smarter - How to implement suggestions</title>
      <dc:creator>Abdul Rahman Zantout</dc:creator>
      <pubDate>Tue, 08 Oct 2019 16:22:15 +0000</pubDate>
      <link>https://dev.to/techhiveio/making-your-blog-smarter-how-to-implement-suggestions-ab3</link>
      <guid>https://dev.to/techhiveio/making-your-blog-smarter-how-to-implement-suggestions-ab3</guid>
      <description>&lt;p&gt;One of the most effective methods for promoting your business is content creation.&lt;/p&gt;

&lt;p&gt;You can choose between various methods and mediums through which to publish your insights.&lt;/p&gt;

&lt;p&gt;More often than not, you'll want to choose something simple that can get you going immediately, such as &lt;a href="https://www.medium.com"&gt;Medium&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;However, there's one advantage to building the blog yourself, and that is it allows you to customize the user experience.&lt;/p&gt;

&lt;p&gt;One of the critical elements that can define your readers' experience is how they discover your content.&lt;/p&gt;

&lt;p&gt;To do that, you must be able to suggest relevant content for your readers.&lt;br&gt;
You want your readers to be fully engaged and benefit to the maximum from what you are offering.&lt;/p&gt;

&lt;p&gt;In our &lt;a href="https://techhive.io/our-insights/making-your-blog-smarter-how-to-implement-suggestions"&gt;previous blog post&lt;/a&gt;, we have explored how we can build a powerful blog with &lt;strong&gt;NextJs&lt;/strong&gt; and &lt;strong&gt;Contentful&lt;/strong&gt;, as well as how to integrate Google analytics and to enhance your meta tags.&lt;/p&gt;

&lt;p&gt;In this piece, we explore how we can drive the blog forward by maximizing the value and knowledge ingested by our readers. We also do not want our readers to drop-off after reading one insight or article only.&lt;/p&gt;

&lt;p&gt;This is why, in addition to creating great content, we enhance the user experience. To do so, we make suggestions at the end of every blog post to keep the user engaged.&lt;/p&gt;
&lt;h2&gt;
  
  
  User Experience
&lt;/h2&gt;

&lt;p&gt;When reading a blog post, the reader is usually researching information that would enrich his know-how and his knowledge.&lt;/p&gt;

&lt;p&gt;The user also, more often than that, is interested in knowing more about the topic he is researching and is directly &lt;strong&gt;related&lt;/strong&gt; in content and essence to the article he is currently reading.&lt;/p&gt;

&lt;p&gt;So the logical and straightforward way to suggest related content is by filtering our blog posts by tags and then displaying them.&lt;/p&gt;
&lt;h2&gt;
  
  
  Prerequisite
&lt;/h2&gt;

&lt;p&gt;In this post, we are not walking through the basics of building the blog. This post will, however, expand on the logic that we have already implemented in our previous article.&lt;/p&gt;

&lt;p&gt;So if you didn't go through our previous blog post, you should do so before moving to this one.&lt;/p&gt;

&lt;p&gt;Let's get started!&lt;/p&gt;

&lt;p&gt;The blog we've built utilizes the power of tags fully. We have already labelled every blog post with a set of tags that we define in our headless CMS.&lt;/p&gt;

&lt;p&gt;If you haven't already, I highly encourage you to do so before resuming this article.&lt;/p&gt;
&lt;h2&gt;
  
  
  Fetching the Suggestions
&lt;/h2&gt;

&lt;p&gt;To fetch the suggestions, let's modify our &lt;code&gt;contentful.ts&lt;/code&gt; file to include our newest function:&lt;/p&gt;

&lt;p&gt;For our use case, we want to fetch three suggestions per post and display them at the end of the article.&lt;/p&gt;

&lt;p&gt;Contentful provides us with many efficient ways to query our posts; in our case, by tags.&lt;/p&gt;

&lt;p&gt;As an important note, &lt;strong&gt;you want to make sure to exclude from your suggestions the current post you are reading&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  In theory
&lt;/h3&gt;

&lt;p&gt;Let's explore how our algorithm works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1- User is reading blog post 1
2- We defined an empty suggestions set
3- Fetch blog post 1 tags on load
4- Find 3 blog posts with at least one matching tag
5- Append your result to the suggestions set
6- If you found less than 3 blog posts
7- Then, fetch (3 - result.length) random blog posts
8- Append to suggestions set
9- Return suggestions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Step number 7 is essential, as we do not want more than 3 suggestions per post.&lt;/p&gt;
&lt;h3&gt;
  
  
  In implementation
&lt;/h3&gt;

&lt;p&gt;To fetch each post's suggestions:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;Many things are happening above.&lt;/p&gt;

&lt;p&gt;Remember that in our previous article, we've already included filtering by tags.&lt;/p&gt;

&lt;p&gt;Our current goal is to find &lt;strong&gt;at least one matching tag&lt;/strong&gt; across all our articles and display those.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;'fields.tags.sys.id[in]': tags.length ? tags.join(',') : undefined
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;[in]&lt;/code&gt; allows us to do so, but since &lt;strong&gt;Contentful&lt;/strong&gt; allows us to query by reference in our case, we need to include the ids of the tags that Contentful generates. Those can be found until the &lt;strong&gt;&lt;code&gt;fields.tags.sys&lt;/code&gt;&lt;/strong&gt; field.&lt;/p&gt;

&lt;p&gt;What happens if we have less than 3 posts to display in the suggestions? &lt;/p&gt;

&lt;p&gt;In other words, if the blog post is not related to any other subject you have previously published, or you do not have enough content to display, then it is initially safe to suggest a random set of posts that the user could browse.&lt;/p&gt;

&lt;p&gt;In this case, we query our entire posts collection randomly and append them to the original array.&lt;/p&gt;

&lt;p&gt;Let's start off by excluding the current article (the one we want to fetch the suggestions for), from being fetched again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;'fields.slug[ne]': currentArticleSlug, // exclude current article
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You also want to exclude fetching suggestions that you already fetched by tag.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;'fields.slug[nin]': slugsToExclude, // exclude slugs already fetched
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, we append the random posts with the posts that we fetched by suggestions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;entries = [...entries, ...randomSuggestions.items];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Bonus
&lt;/h3&gt;

&lt;p&gt;We include a helper function to map the data to fit out &lt;strong&gt;BlogPost&lt;/strong&gt; interface&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/**
 * Maps the items fetched by contentful
 * @param entries
 */
private mapData(entries): BlogPost[] {
    return entries.map(({sys, fields}: { sys: any; fields: any }) =&amp;gt; ({
        id: sys.id,
        title: fields.title,
        description: fields.description,
        heroImage: fields.heroImage.fields.file.url,
        slug: fields.slug,
        tags: fields.tags,
        publishedAt: fields.publishDate
            ? new Date(fields.publishDate)
            : new Date(sys.createdAt),
    }));
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Displaying the suggestions
&lt;/h2&gt;

&lt;p&gt;Let's modify our &lt;code&gt;pages/post/index.tsx&lt;/code&gt; to fetch and display the suggestions.&lt;/p&gt;

&lt;p&gt;Let's start first by fetching the data before the view is initialized, i.e: &lt;strong&gt;&lt;code&gt;getInitialProps&lt;/code&gt;&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PostPage.getInitialProps = async ({ query }) =&amp;gt; {
  const contentfulService = new ContentfulService();

  const { post } = query;
  const article = await contentfulService.getPostBySlug(post);
  // map the tags that we have fetched from Contentful
  const tags = article.tags ? article.tags.map(tag =&amp;gt; tag.sys.id) : [];
  // pass the tags to the function we have built
  const suggestedArticles = await contentfulService.fetchSuggestions(
    tags,
    article.slug
  );

  return { article, suggestedArticles };
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that the component is receiving the suggestions, we can now display them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// helper function to display the cards
const renderCards = suggestions =&amp;gt;
  suggestions.map((suggestion, index) =&amp;gt; (
    &amp;lt;Card key={index} info={suggestion} /&amp;gt;
  ));
const PostPage: NextPage = (props: Props) =&amp;gt; {
...
   return (
...
&amp;lt;div className="suggestions"&amp;gt;{renderCards(props.suggestedArticles)}&amp;lt;/div&amp;gt;
...
   );
};

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

&lt;/div&gt;



&lt;p&gt;The final step is to fix how the cards are displayed. Under &lt;code&gt;pages/post/styles.css&lt;/code&gt;, add the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
.suggestions {
  display: flex;
  flex-flow: row;
  padding: 1.5rem 0;
  margin: 1rem auto 1rem 4rem;
  justify-content: flex-start;
}

.suggestions .card {
  margin: 0 1rem;
  height: 450px;
  width: 320px;
}

.suggestions .card:first-of-type {
  margin-left: 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Final words
&lt;/h2&gt;

&lt;p&gt;Congratulations! You have successfully integrated suggestions into your &lt;strong&gt;NextJs&lt;/strong&gt; Blog and powered by &lt;strong&gt;Contentful&lt;/strong&gt; while utilizing the power of static websites!&lt;/p&gt;




&lt;h2&gt;
  
  
  Ready-made Starter Kit
&lt;/h2&gt;

&lt;p&gt;To make things easier for you, we have created a &lt;a href="https://github.com/techhiveIO/nextjs-static-starter-kit"&gt;starter kit&lt;/a&gt; that includes a template and can get you bootstrapped in no time. We even created a script to create your Contentful Content Data automatically and includes everything you have learned so far in building a great Blog.&lt;/p&gt;

&lt;p&gt;Feel free to submit your PRs, issues and don't forget to star our repo ⭐.&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>nextjs</category>
      <category>ux</category>
      <category>react</category>
    </item>
    <item>
      <title>How to use CSS variables with Sass Mixins</title>
      <dc:creator>Ali Al-Obaji</dc:creator>
      <pubDate>Fri, 27 Sep 2019 07:55:54 +0000</pubDate>
      <link>https://dev.to/techhiveio/how-to-use-css-variables-with-sass-mixins-5d8g</link>
      <guid>https://dev.to/techhiveio/how-to-use-css-variables-with-sass-mixins-5d8g</guid>
      <description>&lt;p&gt;CSS Variables and Sass mixins are each potent on their own. With some creativity, we can make them work together towards more flexible and robust solutions.&lt;/p&gt;

&lt;p&gt;On several occasions, the designer I've worked with had used the same colour but with varying opacity. Many of his components were using varying shades of different colours.&lt;/p&gt;

&lt;p&gt;The typical and tedious implementation involves declaring all colour variants as separate variables. We would usually end up with something similar to this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/* Color palette */
:root {
  --color-primary: #16498a;
  --color-primary-a90: rgba(22, 73, 138, 0.9);
  --color-primary-a80: rgba(22, 73, 138, 0.8);
  --color-primary-a70: rgba(22, 73, 138, 0.7);
  --color-primary-a60: rgba(22, 73, 138, 0.6);
  --color-primary-a50: rgba(22, 73, 138, 0.5);
  --color-primary-a40: rgba(22, 73, 138, 0.4);
  --color-primary-a30: rgba(22, 73, 138, 0.3);
  --color-primary-a20: rgba(22, 73, 138, 0.2);
  --color-primary-a10: rgba(22, 73, 138, 0.1);

  --color-secondary: #12284c;
  --color-secondary-a90: rgba(18, 40, 76, 0.9);

  --color-tertiary: #27add5;
  --color-black: #000;
  --color-gray: #ececec;
  --color-light-gray: #f9f9f9;
  --color-danger: #d63939;
  --color-success: #4fc0b0;
  --color-white: #fff;
}

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



&lt;p&gt;Note that I prefer to use CSS Variables instead of standard SASS variables for their dynamic nature. Additionally, they help me write clean, readable, and modular code without having to import sass colour maps every time I want to reference a variable.&lt;/p&gt;

&lt;p&gt;Our typical style guide comes with around 9 different colours and their variants. Our previous approach had several apparent issues. It produced large CSS files and made any slight change to our primary or secondary colours a considerable pain.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;So how can we solve these problems?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The optimal solution would allow us to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Maintain a single source of truth for my colour definitions. Which, in my case, means that I should only have 9 variables for colours.&lt;/li&gt;
&lt;li&gt;Use any opacity variant of any of the brand colours without adding complexity.&lt;/li&gt;
&lt;li&gt;Apply changes to any brand colour by editing just one line of code.&lt;/li&gt;
&lt;li&gt;Fully utilize the power of dynamic CSS Variables.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sass’s rgba mixin
&lt;/h2&gt;

&lt;p&gt;First, I tried using the sass built-in 'RGBA' mixin. It seemed like a pretty straightforward solution.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
border-top: rgba(#16498a, .4); // works.

border-top: rgba(22, 73, 138, 0.4); // works.

border-top: rgba(var(--color-primary), 0.4); // does not work.

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



&lt;p&gt;Sass's RGBA function accepts 4 comma-separated parameters. However, it accepts two parameters if we wish to use hex values. Under the hood, Sass uses RGB/HSL functions to convert the hex colour value into RGB or HSL. Here is, in CSS, what the three examples above compile to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
// border-top: rgba(#16498a, .4); compiles to:
border-top: rgba(22, 73, 138, 0.4);

//border-top: (22, 73, 138, 0.4); compiles to:
border-top: (22, 73, 138, 0.4);

//border-top: rgba(var(--color-primary), 0.4); compiles to: 
border-top: rgba(var(--color-primary), 0.4);

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



&lt;p&gt;The example which used a CSS variable failed. Using SASS's rgba function with CSS variables fails to be rendered correctly. &lt;/p&gt;

&lt;p&gt;According to the &lt;a href="https://www.w3.org/TR/css-variables-1/#syntax"&gt;official CSS spec&lt;/a&gt;, "the values of custom properties are substituted as is when replacing var() references in a property's value". &lt;/p&gt;

&lt;p&gt;However, these values are only interpreted at execution time. Which means that when SASS was being compiled to CSS, var(--color-primary) was not interpreted as a colour value. Instead, the compiler saw a random string and SASS's rgba function failed to be correctly compiled.&lt;/p&gt;

&lt;p&gt;Moreover, this string can be anything as long as it is grammatically correct.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
// For example, this is valid.
--foo: if(x &amp;gt; 5) this.width = 10; 
// This code is obviously useless as a CSS variable. But can be used by javascript at run time.

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



&lt;p&gt;So at compilation time, var(-- color-primary) is not a colour value at all; and it naturally fails to compile. However, lucky for me, it fails gracefully into the native rgba function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
/* Sass will fail to compile this line of code. But it fails gracefully and outputs the exact same line of code.
Now, when the browser interprets this code, it will try to use the native rgba function.
*/
Border-top: rgba(var(--color-primary), 0.4);

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



&lt;h2&gt;
  
  
  The native rgba function
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.w3.org/TR/css-color-4/#rgb-functions"&gt;According to the spec&lt;/a&gt;, the native rgba function only accepts 4 comma-separated values as parameters, which means that we cannot use hex colour values. Maybe we could try to declare our variables as comma-separated RGB values from the get-go.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
:root {
  --color-primary: 22, 73, 138;
}

div {
  border-top: 1px solid rgba(var(--color-primary), 0.4) ;
}

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



&lt;p&gt;This new method worked! We can now use opacity variants of any colour very quickly. &lt;/p&gt;

&lt;p&gt;However, with this method, two new problems arose:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A value such as '22, 73, 138' is not very readable:  this method would require us to convert all my colour values into this format.&lt;/li&gt;
&lt;li&gt;We can no longer edit these values in a colour picker to test them out. Neither my IDE nor chrome dev tools can recognize these values as colours.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This method is time-consuming and is not expressive at all. However, we are getting closer to a cleaner solution&lt;/p&gt;

&lt;h2&gt;
  
  
  The solution
&lt;/h2&gt;

&lt;p&gt;We want to be able to use CSS variables and not have to declare 10 opacity variants for each colour. It seems I have to use comma-separated RGB values, but I also need my code to be expressive and easy to edit.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:root {
  --color-primary: #16498a;
  --color-primary-rgb: 22, 73, 138;
}

h1 {
  color: var(--color-primary);
}

h2 {
  color: rgba(var(--color-primary-rgb), 0.4);
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;By declaring two versions of the same colour, one HEX and one RGB,  we compromised on simplicity to make our solution work This approach increases the number of variables I initially aimed for, but it's a pretty good compromise.&lt;/p&gt;

&lt;p&gt;So, we’ve managed to use CSS variables to create different shades of our colours. However, there is still some room for improvement. With this solution have two issues:&lt;/p&gt;

&lt;p&gt;We still need to convert all our colours from hex to RGB format manually.&lt;/p&gt;

&lt;p&gt;We have to edit multiple variable whenever we need to make a change to any of our colours.&lt;/p&gt;

&lt;p&gt;Here is a function which converts hex colour values to RGB. The function extracts the red, green, and blue levels from any colour and returns them in a comma-separated format.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@function hexToRGB($hex) {
  @return red($hex), green($hex), blue($hex);
}
:root {
    --color-primary: #16498a;
    --color-primary-rgb: #{hexToRGB(#16498a)};
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;With this function, we will no longer need to do the colour conversions manually.&lt;/p&gt;

&lt;p&gt;The solution is now very close to what we set out to achieve. We still want to create a single source of truth for each of my variables.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
@function hexToRGB($hex) {
  @return red($hex), green($hex), blue($hex);
}

$color-primary: #16498a;

:root {
    --color-primary: #{$color-primary};
    --color-primary--rgb: #{hexToRGB($color-primary)};
}

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



&lt;p&gt;Sass functions, mixins, variables, and native CSS variables are all powerful features. However, none of them provides a complete solution on its own. They need to work together to create robust solutions. &lt;/p&gt;

&lt;p&gt;I initially set out to solve the problem of using CSS variables, or custom properties, in sass functions and mixins. With some compromise and much testing, I was able to create a satisfactory solution, which I hope you find useful.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus
&lt;/h2&gt;

&lt;p&gt;To further understand this concept and see an example of how it can be applied, I created this sample project on Stackblitz.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://stackblitz.com/edit/react-jyogzp?file=index.js"&gt;https://stackblitz.com/edit/react-jyogzp?file=index.js&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I built a heatmap to show how a project's repo is progressing. Every box represents a calendar day, and its colour shows whether the codebase grew or shrunk in size. &lt;/p&gt;

&lt;p&gt;The darker a blue tile is, the more code was added to the repo on that day.&lt;br&gt;
Similarly, the darker a red tile is, the more code was removed from the repo on that day.&lt;/p&gt;

&lt;p&gt;Gray tiles represent days when no work was done.&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>angular</category>
      <category>react</category>
    </item>
    <item>
      <title>How to build a powerful blog with NextJS and Contentful</title>
      <dc:creator>Abdul Rahman Zantout</dc:creator>
      <pubDate>Tue, 24 Sep 2019 11:05:52 +0000</pubDate>
      <link>https://dev.to/techhiveio/how-to-build-a-powerful-blog-with-nextjs-and-contentful-1gh9</link>
      <guid>https://dev.to/techhiveio/how-to-build-a-powerful-blog-with-nextjs-and-contentful-1gh9</guid>
      <description>&lt;p&gt;Building a blog that scales can be quite easy if you know where to start.&lt;br&gt;
In this article, we show you how you can build, in a few steps a robust blog, powered by our CMS of choice: Contentful.&lt;/p&gt;

&lt;p&gt;However, if you prefer another CMS, with a couple of short steps, you could integrate with your favourite headless CMS.&lt;/p&gt;

&lt;p&gt;We also explore how to add Google Analytics and generate sitemaps automatically.&lt;/p&gt;

&lt;p&gt;So grab a cup of coffee, and let's get started!&lt;/p&gt;

&lt;p&gt;To build our new blog, we chose a few tools that may or may not be familiar to you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Next.JS&lt;/strong&gt; (V9+) as our main framework,&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;React Markdown&lt;/strong&gt; to parse and display the blog post's content,&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Contentful&lt;/strong&gt; as our Headless CMS,&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Netlify&lt;/strong&gt; for cloud hosting and deployment&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  User Experience
&lt;/h2&gt;

&lt;p&gt;To build a blog that appeals to your users, we need to define the user experience.&lt;/p&gt;

&lt;p&gt;We define our requirements first. The blog has the following primary purposes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A user can see all the blog posts,&lt;/li&gt;
&lt;li&gt;A user can navigate a large number of blog posts using pagination,&lt;/li&gt;
&lt;li&gt;A user can filter by a topic that he is interested in,&lt;/li&gt;
&lt;li&gt;A user should be able to read a blog post&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Navigation on your blog should be user-friendly. First-time readers can scan the topics and tags at a glance. Once they find a blog post that they are willing to read, they can directly navigate to it.&lt;/p&gt;

&lt;p&gt;Users should also have the ability to filter by relevant topics.&lt;/p&gt;

&lt;p&gt;&lt;a href="//images.ctfassets.net/yy0ya4rtm8k6/j4OAoqbxNTa4x01RpBz50/e7455d4d9ecf658c18b27d866ba7d7f1/blog-sketch.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="//images.ctfassets.net/yy0ya4rtm8k6/j4OAoqbxNTa4x01RpBz50/e7455d4d9ecf658c18b27d866ba7d7f1/blog-sketch.jpeg" alt="blog-sketch"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can add other requirements, but this should get you started in thinking about the design.&lt;/p&gt;
&lt;h2&gt;
  
  
  Prerequisite
&lt;/h2&gt;

&lt;p&gt;Make sure you have the latest stable node version and npm or yarn installed.&lt;/p&gt;

&lt;p&gt;For this article, we use &lt;strong&gt;npm&lt;/strong&gt; to install the packages. However, feel free to use yarn or any other packaging manager you are comfortable with.&lt;/p&gt;
&lt;h2&gt;
  
  
  Laying the foundation
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Setting up Next.Js
&lt;/h3&gt;

&lt;p&gt;Getting started is easy. Enter one of the following commands to create your application:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npx create-next-app&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g create-next-app
create-next-app my-next-blog &amp;amp;&amp;amp; cd my-next-blog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Follow the instructions in your terminal, and you should be good to go.&lt;/p&gt;
&lt;h3&gt;
  
  
  Integrating Typescript
&lt;/h3&gt;

&lt;p&gt;The latest version of Next.Js has Typescript directly baked in. &lt;/p&gt;

&lt;p&gt;To enable it, we first install the relevant packages. Navigate to your project, and run:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install --save-dev typescript @types/react @types/node&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;If you haven't already, rename the files within pages from &lt;code&gt;index.js&lt;/code&gt; to &lt;code&gt;index.tsx&lt;/code&gt; and then run the application:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm run dev&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Next.Js automatically creates a &lt;strong&gt;&lt;code&gt;tsconfig.json&lt;/code&gt;&lt;/strong&gt; and sets up your project into Typescript. If you have a components folder, you can delete the folder for now.&lt;/p&gt;

&lt;p&gt;We also want to include the CSS plugin for styling purposes.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install --save @zeit/next-css&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Create a &lt;strong&gt;&lt;code&gt;next.config.js&lt;/code&gt;&lt;/strong&gt; at the root of your project, including the following:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;h2&gt;
  
  
  Application Architecture
&lt;/h2&gt;

&lt;p&gt;Building a robust blog application requires us to think more about our application's architecture.&lt;/p&gt;

&lt;p&gt;In the previous sections, we defined the user experience and formed a rough idea of what the blog will be. &lt;/p&gt;

&lt;p&gt;We should now think about implementation and architecture.&lt;/p&gt;

&lt;p&gt;Next.Js already has a particular default setup when it comes to structuring your pages. All pages to be rendered exist under the &lt;code&gt;pages&lt;/code&gt; folder.&lt;/p&gt;

&lt;p&gt;We also consider SEO, data integration, and routing.&lt;/p&gt;

&lt;p&gt;Let's define our folder structure in the following manner:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- core // contains everything related to fetching the data from our CMS, Google Analytics logic, and any data sharing service/logic, and is shared across the entire application
- shared // contains common components, helper functions
- public // static folder where we can store assets to be directly compiled by Next, this is mainly used to inject the robot.txt file
- assets // contain website specific assets such as images
- interfaces// contain different models
- pages // contains the pages
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Setting up Contentful
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.contentful.com/"&gt;Contentful&lt;/a&gt; is a powerful headless CMS that is easy to use and integrate.&lt;/p&gt;

&lt;p&gt;While you can set up the content models needed using their dashboard, we will opt to build a script that does this process for us.&lt;/p&gt;
&lt;h3&gt;
  
  
  Install the needed packages
&lt;/h3&gt;

&lt;p&gt;Make sure you install the &lt;strong&gt;contentful-cli&lt;/strong&gt; and &lt;strong&gt;contentful-migration&lt;/strong&gt; before moving to the next step:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install contentful-cli contentful-migration --save-dev&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;
&lt;h3&gt;
  
  
  Building your Content Models
&lt;/h3&gt;

&lt;p&gt;Content models allow us to better structure our entries (whether it is a blog, author or tag) by allowing us to specify the structure of the entries. Think of it as an interface for your different entries.&lt;/p&gt;

&lt;p&gt;Create a folder called &lt;code&gt;utils&lt;/code&gt; in your project folder and paste the following:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;To run the script, add the following to your scripts in &lt;strong&gt;package.json&lt;/strong&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": {
...
"populate:contentful": "contentful space migration --space-id &amp;lt;YOUR_SPACE_KEY&amp;gt; utils/contentful.js --yes"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Navigate to your Contentful dashboard to find your space key and token.&lt;/p&gt;

&lt;p&gt;Replace &lt;strong&gt;YOUR_SPACE_KEY&lt;/strong&gt; with your actual space key, and then run the command:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm run populate:contentful&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;The above command should populate your CMS will all the content models we need, without you having to enter them manually.&lt;/p&gt;

&lt;p&gt;Feel free to navigate through your contentful dashboard and add a few posts; it will come in handy as we move on.&lt;/p&gt;

&lt;p&gt;Finally, we need a way to access our space key and token without hardcoding their values.&lt;/p&gt;

&lt;p&gt;To do so, create a &lt;strong&gt;&lt;code&gt;.env&lt;/code&gt;&lt;/strong&gt; file, add your space key and token.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CONTENTFUL_SPACE=&amp;lt;your space key&amp;gt;
CONTENTFUL_TOKEN=&amp;lt;your token&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;We need to do is allow our Next.Js application to read our &lt;code&gt;.env&lt;/code&gt; file. To do so, modify your &lt;code&gt;next.config.js&lt;/code&gt; file to the following:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;Make sure you install &lt;code&gt;dotenv-webpack&lt;/code&gt; by running:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install dotenv-webpack --save&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Great! Now you can safely access your env variables using &lt;code&gt;process.env.VARIABLE&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Next, make sure you install contentful by running:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install contentful&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;We are now ready to start building our new application!&lt;/p&gt;

&lt;h3&gt;
  
  
  Data Models
&lt;/h3&gt;

&lt;p&gt;Let's define our first two models.&lt;/p&gt;

&lt;p&gt;Within the &lt;code&gt;interfaces&lt;/code&gt; folder, create two files:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;author.ts&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// interfaces/author.ts&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;Author&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;company&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;shortBio&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;twitter&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;blog-post.ts&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// interfaces/blog-post.ts&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;BlogPost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;heroImage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;author&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Author&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;publishDate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Notice that in both cases, we are mapping the same data models we created in the Contentful CMS.&lt;/p&gt;
&lt;h2&gt;
  
  
  Integrating Contentful API
&lt;/h2&gt;

&lt;p&gt;Under your &lt;code&gt;core&lt;/code&gt; folder, create &lt;strong&gt;&lt;code&gt;contentful.ts&lt;/code&gt;&lt;/strong&gt; containing the following:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;What we've done here is creating a &lt;code&gt;ContentfulService&lt;/code&gt; that connects to Contentful API, built the appropriate handlers to fetch the data and map it, so it is ready to be consumed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementing the shared components
&lt;/h2&gt;

&lt;p&gt;To make our blog appealing, we need to implement and design a couple of elements that distinguish it from the rest.&lt;/p&gt;

&lt;p&gt;Let's organize every component of our application its folder. For example, the card component and style sheet will be available under the card folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- shared
  - components
    - card
      - index.tsx
      - styles.css
    - meta
      - index.tsx
      - styles.css
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;I prefer this approach because it allows us to modularize our application into a more precise structure further.&lt;/p&gt;

&lt;p&gt;Moreover, it gives us more flexibility in the future when we want to split a more significant component into a small, more compact one.&lt;/p&gt;
&lt;h3&gt;
  
  
  Meta Tags
&lt;/h3&gt;

&lt;p&gt;Let's start with our most important component, the meta tag component.&lt;/p&gt;

&lt;p&gt;The meta tag component includes a &lt;strong&gt;Next.Js Head&lt;/strong&gt;, which is a built-in component that allows you to update the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; of your HTML page. &lt;/p&gt;

&lt;p&gt;Let's first define the tags we want to include in our blog.&lt;/p&gt;

&lt;p&gt;We want to utilize the Open Graph tags (for facebook sharing), as well as the twitter tags, the description of the page and most importantly, the title. Including the page type is also important: we want to differentiate between a page and a blog post.&lt;/p&gt;

&lt;p&gt;We also want to define whether the search engines should index the page or not.&lt;/p&gt;

&lt;p&gt;All of the tags can be dynamic, depending on the page you are it. Having dynamic tags that change according to the page the user is on is excellent for SEO purposes.&lt;/p&gt;

&lt;p&gt;Let's define our &lt;code&gt;Tag&lt;/code&gt; model. Under the interfaces folder, create a &lt;strong&gt;&lt;code&gt;tag.ts&lt;/code&gt;&lt;/strong&gt; containing the following:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;Notice I also added two enums: the &lt;strong&gt;PageType&lt;/strong&gt; and &lt;strong&gt;RobotsContent&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This approach will allow us to easily add the page type and the robots tag into our meta tags while minimizing duplication and human error.&lt;/p&gt;

&lt;p&gt;Under the &lt;code&gt;shared/components&lt;/code&gt; folder, create the &lt;code&gt;index.tsx&lt;/code&gt; file and include the following:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;To avoid duplicate tags in your &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;, you can use the &lt;code&gt;key&lt;/code&gt; property, which guarantees that the tag is rendered only once.&lt;/p&gt;

&lt;h3&gt;
  
  
  Layout
&lt;/h3&gt;

&lt;p&gt;The layout component serves as a container across all pages of the application.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  Card
&lt;/h3&gt;

&lt;p&gt;The card in our case displays the hero image of the blog, the title, description and the call to action. The call to action redirects the user to the blog post.&lt;/p&gt;

&lt;p&gt;First, let's add some functions that help us to pass the dynamic URLs automatically.&lt;/p&gt;

&lt;p&gt;Under the &lt;code&gt;core&lt;/code&gt; folder, create a folder called &lt;code&gt;helper&lt;/code&gt;, and include a &lt;strong&gt;&lt;code&gt;helper.ts&lt;/code&gt;&lt;/strong&gt; file:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Next, under the &lt;code&gt;shared/components&lt;/code&gt; folder, create a &lt;code&gt;card&lt;/code&gt; folder and an &lt;strong&gt;&lt;code&gt;index.tsx&lt;/code&gt;&lt;/strong&gt;:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;As a bonus, let's give it some extra style:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Don't forget to import the styles within your card's &lt;code&gt;index.tsx&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;import './styles.css'&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Paginator
&lt;/h3&gt;

&lt;p&gt;The paginator component helps the user to navigate across a large number of blog posts.&lt;/p&gt;

&lt;p&gt;The paginator has a state that we need to maintain. We need to be able to tell the user on which page he or she is on, as well as display the page they are on in a visually pleasing way.&lt;/p&gt;

&lt;p&gt;The paginator contains a two-way data binding: the user can navigate across pages, and if directly accessed the page through the URL, the paginator should display which page we are on.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Let's style it. Create a file called &lt;code&gt;styles.css&lt;/code&gt; under the paginator folder:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  Our code structure so far
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- core
  - contentful
- pages
  - index.tsx
- interfaces
  - author.ts
  - blog.ts
  - tag.ts
- shared
  - components
     - card
       - index.tsx
       - styles.css
     - layout
       - index.tsx
     - meta
       - index.tsx
     - paginator
       - index.tsx
       - styles.css
   - helpers
     - helper.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Integrating the blog
&lt;/h2&gt;

&lt;p&gt;The main page of the blog will include the cards, pagination, and filer components. There are a few things we need to load at the homepage.&lt;/p&gt;

&lt;p&gt;We need to fetch all the tags, the total number of posts, skip number (for pagination purposes), the limit (number of posts to fetch per page), the page number, and the actual posts on that page.&lt;/p&gt;

&lt;p&gt;All this can be done using the Contentful API we just created.&lt;/p&gt;

&lt;p&gt;Under &lt;code&gt;pages/index.tsx&lt;/code&gt;, let's update our &lt;code&gt;index&lt;/code&gt; page:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;h2&gt;
  
  
  Integrating the blog post
&lt;/h2&gt;

&lt;p&gt;Under the pages folder, create a folder &lt;strong&gt;&lt;code&gt;post&lt;/code&gt;&lt;/strong&gt; , and two files: &lt;strong&gt;&lt;code&gt;index.tsx&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;styles.css&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Let's add the appropriate functions to render the blog post under &lt;code&gt;post/index.tsx&lt;/code&gt;:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Also, the styles:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  Adding the meta tags
&lt;/h2&gt;

&lt;p&gt;Integrating the meta tags deserve a section on their own.&lt;/p&gt;

&lt;p&gt;Remember that we want the meta tags to be dynamic across different posts, but set to a default mode on the main page.&lt;/p&gt;

&lt;p&gt;Our meta-tag component is flexible enough to handle all the meta-tags we throw in it.&lt;/p&gt;

&lt;p&gt;There's one tag in particular that we need to take extra care for, the &lt;strong&gt;&lt;code&gt;robots&lt;/code&gt;&lt;/strong&gt; tag.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;robots&lt;/code&gt; tag helps Search Engines to "know" if a particular page should be indexed or not.&lt;/p&gt;

&lt;p&gt;To include multiple values in &lt;code&gt;robots&lt;/code&gt; tag, let's build a helper function &lt;strong&gt;concatenateStrings&lt;/strong&gt; that concatenates them in a way that is easy for Search Engines Crawlers to parse.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="cm"&gt;/*
 * turns an array of strings into a single string separated by a           
 * comma
export function concatenateStrings(...args: string[]) {
  return args.join(',');
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Default Tags
&lt;/h3&gt;

&lt;p&gt;Next, let's include the default meta tags in a &lt;strong&gt;&lt;code&gt;constants.ts&lt;/code&gt;&lt;/strong&gt; file &lt;code&gt;core&lt;/code&gt; folder:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;We can include here any tags we need, export them and consume them on the right page.&lt;/p&gt;

&lt;p&gt;Let's update our &lt;strong&gt;Layout&lt;/strong&gt; component to accommodate for the new tags.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;And include the &lt;strong&gt;tags&lt;/strong&gt; input under &lt;code&gt;pages/index.tsx&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;defaultMetaTags&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../core/constants&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Layout&lt;/span&gt; &lt;span class="nx"&gt;meta&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;defaultMetaTags&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="c1"&gt;// &amp;lt;-- added&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Layout&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Post Specific Tags
&lt;/h3&gt;

&lt;p&gt;The meta tags on the post are set dynamically. &lt;/p&gt;

&lt;p&gt;In order to do so, navigate to your &lt;code&gt;pages/post/index.tsx&lt;/code&gt; and add the following to your ComponentFunction:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;postMetaTags&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;MetaTags&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// you can set this dynamically later with proces.env&lt;/span&gt;
    &lt;span class="na"&gt;canonical&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`&amp;lt;your domain name&amp;gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
    &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;article&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;description&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`https:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;article&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;heroImage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;robots&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;RobotsContent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;follow&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;,&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;RobotsContent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;article&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;PageType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;article&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Layout&lt;/span&gt; &lt;span class="nx"&gt;metaTags&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;postMetaTags&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="c1"&gt;// &amp;lt;- add this&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Layout&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt;

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

&lt;/div&gt;


&lt;p&gt;Don't forget to include the right imports.&lt;/p&gt;
&lt;h2&gt;
  
  
  Integrating Google Analytics
&lt;/h2&gt;

&lt;p&gt;We want to integrate Google Analytics to gather some useful data from our blog.&lt;/p&gt;

&lt;p&gt;For convenience, we want to track only in a production environment.&lt;/p&gt;

&lt;p&gt;Within the &lt;code&gt;core&lt;/code&gt; folder, create a &lt;strong&gt;gtag.ts&lt;/strong&gt; file that includes the following:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;The above functions allow us to communicate with Google Analytics and use it to track different user interactions with our blog.&lt;/p&gt;

&lt;p&gt;First, let's inject the Google Analytics tag on every page of the application. To do so, create a &lt;strong&gt;document.tsx&lt;/strong&gt; file in the &lt;code&gt;pages&lt;/code&gt; folder containing the following:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Here, we've injected the google-analytics tag in the head of every page, and override the default Document Component of Next.Js.&lt;/p&gt;

&lt;p&gt;Create an &lt;em&gt;__app.tsx&lt;/em&gt;_ in the pages folder. We need to override the default App component provided by Next.Js.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;By listening to the router events, we can record them in Google Analytics so we can analyze them in the future.&lt;/p&gt;

&lt;h2&gt;
  
  
  Automatically generating a sitemap
&lt;/h2&gt;

&lt;p&gt;Every website and blog needs a sitemap to help optimize their SEOs.&lt;/p&gt;

&lt;p&gt;What we need is an automatic post-export process that generates the sitemap and injects it into the production build.&lt;/p&gt;

&lt;p&gt;We need to detect every new blog post that we publish and update the sitemap.&lt;/p&gt;

&lt;p&gt;Let's update our &lt;code&gt;next.config.js&lt;/code&gt; to include the right paths to export:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Under the &lt;code&gt;utils&lt;/code&gt; folder, add the following script:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Add another file &lt;code&gt;post-export.js&lt;/code&gt; that imports the functionality from &lt;code&gt;sitemap.js&lt;/code&gt; and use it in the post-build.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Add &lt;code&gt;DOMAIN_NAME=&amp;lt;your domain name&amp;gt;&lt;/code&gt; to your&lt;code&gt;.env&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;The script automatically reads all the posts fetched by Next.Js, build the sitemap, and injects it into the build folder (the &lt;strong&gt;out&lt;/strong&gt; folder in our case).&lt;/p&gt;

&lt;p&gt;The last step is to run the script after every build and export automatically.&lt;/p&gt;

&lt;p&gt;Let us add the following command to &lt;strong&gt;package.json&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"postexport": "node utils/post-export.js"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We are  ready to set up the website deployment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deploying to Netlify
&lt;/h2&gt;

&lt;p&gt;Deploying a Next.Js project is very easy. You can deploy the project to Now, Netlify or any provider that you prefer.&lt;/p&gt;

&lt;p&gt;However, for our case, we will deploy the blog to Netlify.&lt;/p&gt;

&lt;p&gt;Go to your Netlify dashboard, create a site and connect it to your Github repo (or upload the code using their upload form).&lt;/p&gt;

&lt;p&gt;Set the deployment command to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run export
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Set the directory to "out".&lt;/p&gt;

&lt;p&gt;Also, make sure you connect your Contentful account to Netlify and choose your space. Netlify takes care of the rest. This approach has many advantages, mainly because we are building a static website, so every change in the CMS needs to be reflected on the website. You also do not need to set your environment variables.&lt;/p&gt;

&lt;p&gt;You are done!&lt;/p&gt;

&lt;h2&gt;
  
  
  Final words
&lt;/h2&gt;

&lt;p&gt;Congratulations! You have successfully created a neat blog, with markdown support, integrated Continous Integration and Continous Delivery, and you are ready to launch it to the world!&lt;/p&gt;




&lt;h2&gt;
  
  
  Ready-made Starter Kit
&lt;/h2&gt;

&lt;p&gt;To make things easier for you, we have created a &lt;a href="https://github.com/techhiveIO/nextjs-static-starter-kit"&gt;starter kit&lt;/a&gt; that includes a template and can get you bootstrapped in no time. We even created a script to create your Contentful Content Data automatically. Feel free to submit your PRs, issues and don't forget to star our repo.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to Finish What They Started?</title>
      <dc:creator>Abdul Rahman Zantout</dc:creator>
      <pubDate>Tue, 27 Aug 2019 06:33:41 +0000</pubDate>
      <link>https://dev.to/techhiveio/how-to-finish-an-incomplete-project-292h</link>
      <guid>https://dev.to/techhiveio/how-to-finish-an-incomplete-project-292h</guid>
      <description>&lt;p&gt;So you're a new hire at your new company, you feel excited, and you want to jump right in.&lt;/p&gt;

&lt;p&gt;Your manager briefed you about the project you're about to handle, wished you good luck, and went their way.&lt;/p&gt;

&lt;p&gt;You sit down behind your computer. You launch your editor only to be perplexed by the complexity of the project.&lt;/p&gt;

&lt;p&gt;You find monoliths, unstructured code and no documentation. &lt;/p&gt;

&lt;p&gt;To make things worse, you have a strict deadline to make quick progress and complete the rest of the requirements.&lt;/p&gt;

&lt;p&gt;You sit down for hours. You wrap your head around how the original author thought and coded. &lt;/p&gt;

&lt;p&gt;You try to implement a simple feature, but another break.&lt;/p&gt;

&lt;p&gt;You feel overwhelmed, your manager is understanding, tries to support you in the best way they can,  but there's not much else they can do to help you.&lt;/p&gt;

&lt;p&gt;The deadline is approaching.&lt;/p&gt;

&lt;p&gt;What do you do?&lt;/p&gt;

&lt;h2&gt;
  
  
  Draw a high-level diagram of how the software currently is.
&lt;/h2&gt;

&lt;p&gt;It shouldn't matter if it's a UML diagram or a simple graph. &lt;/p&gt;

&lt;p&gt;Visualizing the software you are working on should take you a few hours to complete, but will save you much more time when making decisions in the future.&lt;/p&gt;

&lt;p&gt;Checking the design and the folder structures might give you a head-start (folder structure is not always a good indicator, however). &lt;/p&gt;

&lt;p&gt;Visualizing what you're working on forces you to think hard about how everything fits together, and most importantly, &lt;strong&gt;how everything should fit together&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try to figure out where do the new features fit in.
&lt;/h2&gt;

&lt;p&gt;Try to add the new features in your new diagram. Worry about improving it later. This is critical, especially if you're on a strict deadline.&lt;/p&gt;

&lt;p&gt;Properly segment the parts of the applications you're working on in a clear and concise matter.  You can, for example, segment by modules or by business features.&lt;/p&gt;

&lt;p&gt;You are most probably dealing with a lot of legacy code: don't let that scare you. You should only care about the I/O of a function, class or module for now. Refactor later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Document.
&lt;/h2&gt;

&lt;p&gt;Think of it as your log.&lt;/p&gt;

&lt;p&gt;Your predecessors probably did not document their code. Start by documenting the parts you are working on. &lt;/p&gt;

&lt;p&gt;Keep your notes brief and straight to the point. &lt;/p&gt;

&lt;p&gt;That way, you engage your mind and realize how everything connects. &lt;/p&gt;

&lt;p&gt;Remember, you are doing this for future you too. So make sure you don't write anything that needs some forethought to figure out later.&lt;/p&gt;

&lt;h2&gt;
  
  
  First impressions last.
&lt;/h2&gt;

&lt;p&gt;The days go by, and you still need time to work on some core functionalities, but you also need to demo your progress.&lt;/p&gt;

&lt;p&gt;Start with the smallest features that make a significant impact.&lt;/p&gt;

&lt;p&gt;You would be surprised how fixing a layout, a dropdown, or even a button can have a positive impact on your client's expectation.&lt;/p&gt;

&lt;p&gt;Remember that you are likely building a product that non-technical people will use, not other developers. &lt;/p&gt;

&lt;p&gt;Some features or fixes might seem trivial for you, especially when you compare it to the complexity of another module or component. &lt;/p&gt;

&lt;p&gt;Such a small fix can go a long way for you, and make a lasting impression on the client.&lt;/p&gt;

&lt;h2&gt;
  
  
  Manage expectations.
&lt;/h2&gt;

&lt;p&gt;Expectations matter. Your manager wants to see progress. &lt;/p&gt;

&lt;p&gt;Telling the truth, even if it might cost you your job (9 out of 10 it won't, so don't worry), is the surest way to manage expectations.&lt;/p&gt;

&lt;p&gt;Most people over-estimate what they can accomplish, give unrealistic deadlines, and often end up facing increasingly stressful situations. &lt;/p&gt;

&lt;p&gt;They end up explaining to their clients and their managers why things went wrong, stress too much to fix the problems without strategizing their next steps and end up being overwhelmed and unproductive.&lt;/p&gt;

&lt;p&gt;Don't be like those people. &lt;/p&gt;

&lt;p&gt;Stay true, trust your abilities, give yourself time. &lt;/p&gt;

&lt;p&gt;If you got stuck on a problem, take a break and solve another.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make sure you set a schedule and stick to it.
&lt;/h2&gt;

&lt;p&gt;Make sure to schedule the requirements you want to tackle.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deadlines work.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Try to give yourself internal deadlines and set personal goals for the project.&lt;/p&gt;

&lt;p&gt;When adding such deadlines and segmenting your requirements into smaller chunks, you feel more confident in delivering progress.&lt;/p&gt;

&lt;h2&gt;
  
  
  Update your schedule daily.
&lt;/h2&gt;

&lt;p&gt;Some days a requirement you are implementing might take you less time to implement than anticipated. Sometimes more.&lt;/p&gt;

&lt;p&gt;With trial and error, you learn how to assess better. &lt;/p&gt;

&lt;p&gt;Make sure you keep your schedule up to date. Updating your schedule forces you to think ahead and plan your steps.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deliver fast, deliver often.
&lt;/h2&gt;

&lt;p&gt;Remember: 1% improvement every day is much better than none at all.&lt;/p&gt;

&lt;p&gt;You want to make sure you deliver fast and often.&lt;/p&gt;

&lt;p&gt;Divide your work into small digestible chunks. This way, you can release bug fixes, features, or even both much more frequently.&lt;/p&gt;

&lt;p&gt;Small, incremental improvements are better than 50 improvements released at once in a longer time frame.&lt;/p&gt;

&lt;p&gt;You also decrease the risk of breaking a working prototype: by working in chunks, you know exactly where to find the problem if the prototype crashes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ask for an extension if you had to
&lt;/h2&gt;

&lt;p&gt;You did everything laid out here, but the project's scope was too big to handle.&lt;/p&gt;

&lt;p&gt;Ask for a time extension and explain your reasons. You will most probably get it. &lt;/p&gt;

&lt;p&gt;Don't be afraid of your client or your manager. They're as human as you are. As long as you stay true, everything should be fine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Words
&lt;/h2&gt;

&lt;p&gt;Getting a new job or promotion is an exciting and potentially pivotal moment in one's career.&lt;/p&gt;

&lt;p&gt;Every new project comes with its own set of challenges and difficulties. &lt;/p&gt;

&lt;p&gt;You have to hit the ground running to prove your value, especially in the face of those difficulties. &lt;/p&gt;

&lt;p&gt;To do so, you need to be organized, efficient, and to manage expectations around yourself. &lt;/p&gt;

&lt;p&gt;All the steps and examples we have explored in this article were adapted for more technical people. However, the main principles of organization and expectations management do apply for the challenges you face in any career or industry.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>career</category>
      <category>management</category>
    </item>
  </channel>
</rss>
