<?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: Smit Thakkar</title>
    <description>The latest articles on DEV Community by Smit Thakkar (@smitthakkar).</description>
    <link>https://dev.to/smitthakkar</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%2F350813%2F54852e24-b117-457a-a9b1-5e2d943b627d.png</url>
      <title>DEV Community: Smit Thakkar</title>
      <link>https://dev.to/smitthakkar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/smitthakkar"/>
    <language>en</language>
    <item>
      <title>10 Best Tools and Practices for Boosting Code Quality in Node.js</title>
      <dc:creator>Smit Thakkar</dc:creator>
      <pubDate>Sat, 30 Sep 2023 06:34:41 +0000</pubDate>
      <link>https://dev.to/smitthakkar/10-best-tools-and-practices-for-boosting-code-quality-in-nodejs-4kde</link>
      <guid>https://dev.to/smitthakkar/10-best-tools-and-practices-for-boosting-code-quality-in-nodejs-4kde</guid>
      <description>&lt;p&gt;As a developer, you understand that writing clean and efficient code is essential for maintaining and scaling your Node.js applications. Code quality not only affects the performance and stability of your application but also makes it easier for your team to collaborate.&lt;/p&gt;

&lt;p&gt;In this blog post, we'll explore the top tools and practices that can significantly improve code quality in your Node.js projects and the advantages they bring.&lt;/p&gt;

&lt;h1&gt;
  
  
  1. Use a Linter: ESLint
&lt;/h1&gt;

&lt;p&gt;Advantage: &lt;em&gt;Code Consistency and Error Prevention&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://eslint.org/"&gt;ESLint&lt;/a&gt; is a powerful static code analysis tool for JavaScript and Node.js. It enforces coding standards, catches syntax errors, and encourages a consistent code style across your team. ESLint helps identify issues early in development, preventing common bugs and ensuring that your code is easy to read and maintain.&lt;/p&gt;

&lt;h1&gt;
  
  
  2. Adopt a Coding Style Guide: Airbnb JavaScript Style Guide
&lt;/h1&gt;

&lt;p&gt;Advantage: &lt;em&gt;Consistency and Collaboration&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Following a coding style guide, such as the &lt;a href="https://github.com/airbnb/javascript"&gt;Airbnb JavaScript Style Guide&lt;/a&gt;, promotes consistency throughout your codebase. This consistency makes it easier for developers to understand and collaborate on the project, leading to higher code quality and maintainability.&lt;/p&gt;

&lt;h1&gt;
  
  
  3. Unit Testing: Jest
&lt;/h1&gt;

&lt;p&gt;Advantage: &lt;em&gt;Bug Prevention and Code Confidence&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://jestjs.io/"&gt;Jest&lt;/a&gt; is a widely used testing framework for Node.js applications. Writing unit tests with Jest ensures that your code behaves as expected. It helps catch regressions and prevents the introduction of new bugs when you make changes. This increased code confidence translates into higher code quality.&lt;/p&gt;

&lt;h1&gt;
  
  
  4. Code Coverage: Istanbul
&lt;/h1&gt;

&lt;p&gt;Advantage: &lt;em&gt;Visibility into Code Quality&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://istanbul.js.org/"&gt;Istanbul&lt;/a&gt; is a code coverage tool that works seamlessly with Jest. It provides insights into which parts of your codebase are covered by tests and which are not. Increasing test coverage helps you identify untested code paths and improves the overall reliability of your application.&lt;/p&gt;

&lt;h1&gt;
  
  
  5. Continuous Integration: Travis CI or CircleCI
&lt;/h1&gt;

&lt;p&gt;Advantage: &lt;em&gt;Automated Code Quality Checks&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Integrate tools like &lt;a href="https://travis-ci.com/"&gt;Travis CI&lt;/a&gt; or &lt;a href="https://circleci.com/"&gt;CircleCI&lt;/a&gt; into your development workflow. These CI/CD platforms automatically run your tests and linters on every code commit. This ensures that code quality checks are an integral part of your development process, preventing low-quality code from entering your codebase.&lt;/p&gt;

&lt;h1&gt;
  
  
  6. Code Reviews
&lt;/h1&gt;

&lt;p&gt;Advantage: &lt;em&gt;Knowledge Sharing and Error Detection&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Regular code reviews are a crucial practice for maintaining code quality. Encourage team members to review each other's code. Code reviews provide an opportunity to share knowledge, identify potential issues, and ensure that code adheres to established coding standards.&lt;/p&gt;

&lt;h1&gt;
  
  
  7. Code Complexity Analysis: SonarQube
&lt;/h1&gt;

&lt;p&gt;Advantage: &lt;em&gt;Identifying Code Smells and Vulnerabilities&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.sonarqube.org/"&gt;SonarQube&lt;/a&gt; is a powerful code quality platform that can analyze code for issues such as code smells, security vulnerabilities, and maintainability problems. It offers valuable insights into improving code quality and security.&lt;/p&gt;

&lt;h1&gt;
  
  
  8. Dependency Management: npm Audit
&lt;/h1&gt;

&lt;p&gt;Advantage: &lt;em&gt;Vulnerability Detection and Mitigation&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Running &lt;code&gt;npm audit&lt;/code&gt; in your Node.js project can help you identify and address known vulnerabilities in your project's dependencies. Keeping your dependencies up-to-date and secure is essential for maintaining high code quality.&lt;/p&gt;

&lt;h1&gt;
  
  
  9. Automated Code Formatting: Prettier
&lt;/h1&gt;

&lt;p&gt;Advantage: &lt;em&gt;Consistent Code Formatting&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://prettier.io/"&gt;Prettier&lt;/a&gt; is an opinionated code formatter that enforces a consistent code style automatically. It eliminates debates about code formatting during code reviews and ensures a uniform codebase.&lt;/p&gt;

&lt;h1&gt;
  
  
  10. Documentation: JSDoc
&lt;/h1&gt;

&lt;p&gt;Advantage: &lt;em&gt;Code Clarity and API Documentation&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://jsdoc.app/"&gt;JSDoc&lt;/a&gt; allows you to document your code with inline comments. Properly documented code is more understandable and maintainable, as it provides context and usage examples for functions, classes, and modules.&lt;/p&gt;

&lt;p&gt;Improving code quality in your Node.js applications is crucial for performance, maintainability, and team collaboration. By adopting these tools and practices, you'll not only prevent bugs and vulnerabilities but also ensure that your codebase remains clean, consistent, and easy to work with. Investing in code quality early in your development process will pay off in the long run by reducing technical debt and enhancing the overall success of your projects.&lt;/p&gt;

&lt;p&gt;Share it with someone who may need it.✨&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>programming</category>
      <category>cleancode</category>
    </item>
    <item>
      <title>Regex Operations in BigQuery</title>
      <dc:creator>Smit Thakkar</dc:creator>
      <pubDate>Thu, 12 Aug 2021 04:47:52 +0000</pubDate>
      <link>https://dev.to/smitthakkar/regex-operations-in-bigquery-2od4</link>
      <guid>https://dev.to/smitthakkar/regex-operations-in-bigquery-2od4</guid>
      <description>&lt;p&gt;BigQuery is taking the analytics industry by a storm. One of the most important use-cases is to extract and transform parts of a string. Below are some of the powerful constructs provided by BigQuery.&lt;/p&gt;

&lt;h2&gt;
  
  
  Regex Constructs
&lt;/h2&gt;

&lt;p&gt;BigQuery provides the following constructs for regex operations&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Construct&lt;/th&gt;
&lt;th&gt;Arguments&lt;/th&gt;
&lt;th&gt;Use&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_contains"&gt;REGEXP_CONTAINS&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;REGEXP_CONTAINS(value, regexp)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Checks if the string contains the regex&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_extract"&gt;REGEXP_EXTRACT&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;REGEXP_EXTRACT(value, regexp[, position[, occurrence]])&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Extract the substring that matches the regex.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_extract_all"&gt;REGEXP_EXTRACT_ALL&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;REGEXP_EXTRACT_ALL(value, regexp)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Return all substrings that match the regex&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_instr"&gt;REGEXP_INSTR&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;REGEXP_INSTR(source_value, regexp [, position[, occurrence, [occurrence_position]]])&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Return 1-based index for the first occurrence of the regex&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_replace"&gt;REGEXP_REPLACE&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;REGEXP_REPLACE(value, regexp, replacement)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Replace all substrings in value&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Source : Google Cloud Platform&lt;/p&gt;

&lt;h2&gt;
  
  
  Table Setup
&lt;/h2&gt;

&lt;p&gt;Let's create a simple table with some string data to play around.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- Create Store
CREATE OR REPLACE TABLE `gcp-tour-276710.thefellowcoder.store`
(
    date DATE,
    details STRING,
    address STRING
)

-- Add values
INSERT INTO `gcp-tour-276710.thefellowcoder.store`
VALUES
('2021-07-14', '&amp;lt;h1&amp;gt;Nike Shoes&amp;lt;/h1&amp;gt;&amp;lt;p&amp;gt;Base: $450 Addon: $20&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Support email: help@nike.com&amp;lt;/p&amp;gt;','Los Angeles, California 90001 '),
('2021-06-13', '&amp;lt;h1&amp;gt;Rebook Shoes&amp;lt;/h1&amp;gt;&amp;lt;p&amp;gt;Base: $150 Addon: $10&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Support email: help@rebook.com&amp;lt;/p&amp;gt;','Sacramento, California 94203 '),
('2021-07-11', '&amp;lt;h1&amp;gt;Adidas Shoes&amp;lt;/h1&amp;gt;&amp;lt;p&amp;gt;Base: $350 Addon: $30&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Support email: help@adidas.com&amp;lt;/p&amp;gt;','Beverly Hills, California 90209 '),
('2021-07-11', '&amp;lt;h1&amp;gt;Carnival All Rounder Shoes&amp;lt;/h1&amp;gt;&amp;lt;p&amp;gt;Base: $250 Addon: $0&amp;lt;/p&amp;gt;','Beverly Hills, California 90209 ')

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Sample Queries
&lt;/h2&gt;

&lt;p&gt;Lets see each of the constructs in action&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  REGEXP_CONTAINS example
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- All stores that have a support email
select * from `gcp-tour-276710.thefellowcoder.store` where REGEXP_CONTAINS(details, r'\S+@\S+\.\S+')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;  REGEXP_EXTRACT example
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- Extract Product Names
select REGEXP_EXTRACT(details, r'&amp;lt;h1&amp;gt;([^&amp;lt;]+)&amp;lt;\/h1&amp;gt;') from `gcp-tour-276710.thefellowcoder.store`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;  REGEXP_EXTRACT_ALL example
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- Extract all prices
select REGEXP_EXTRACT_ALL(details, r'\$(.\d+)') from `gcp-tour-276710.thefellowcoder.store`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;  REGEXP_INSTR example
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- Get index of email
select details, REGEXP_INSTR(details, r'\S+@\S+\.\S+') from `gcp-tour-276710.thefellowcoder.store`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;  REGEXP_REPLACE example
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- Replace all email-ids
select REGEXP_REPLACE(details, r'\S+@\S+\.\S+', 'admin@thefellowcoder.com') from `gcp-tour-276710.thefellowcoder.store`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Common Use-cases:
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Extract part of the string with regex
&lt;/h3&gt;

&lt;p&gt;This is one of the most common use-cases wherein we must extract substring that matches a regex.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- Extract product names from all details
select REGEXP_EXTRACT(details, r'&amp;lt;h1&amp;gt;([^&amp;lt;]+)&amp;lt;\/h1&amp;gt;') from `gcp-tour-276710.thefellowcoder.store`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Replace regex with string
&lt;/h3&gt;

&lt;p&gt;Let's say you want to sanitize the string and remove all special characters from the string.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- remove special characters
select details,REGEXP_REPLACE(details, r'[^0-9a-zA-Z]+',' ') from `gcp-tour-276710.thefellowcoder.store`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Matches any of the regex patterns
&lt;/h3&gt;

&lt;p&gt;check for multiple regex patterns for a string&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- check for pincodes starting with 90/94
select address,REGEXP_EXTRACT(address, r'9[0|4]\d+') as pincode from `gcp-tour-276710.thefellowcoder.store`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Useful regex examples for data cleaning.
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;String&lt;/th&gt;
&lt;th&gt;Regex&lt;/th&gt;
&lt;th&gt;Output&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;h1&amp;gt;Hello World!&amp;lt;/h1&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;h1&amp;gt;([^&amp;lt;]+)&amp;lt;\/h1&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Hello World!&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;p&gt;Support email: &lt;a href="mailto:help@rebook.com"&gt;help@rebook.com&lt;/a&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;\w+@\w+.\w+&lt;/td&gt;
&lt;td&gt;&lt;a href="mailto:help@rebook.com"&gt;help@rebook.com&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rebook ShOes&lt;/td&gt;
&lt;td&gt;(?i)shoes&lt;/td&gt;
&lt;td&gt;ShOes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;This,contains$special\characters&lt;/td&gt;
&lt;td&gt;[^0-9a-zA-Z]+&lt;/td&gt;
&lt;td&gt;This contains special characters&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;String needs to be trimmed.&lt;/td&gt;
&lt;td&gt;^(\s+).*?(\s+)$&lt;/td&gt;
&lt;td&gt;String needs to be trimmed.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Hope you found this post useful,  do check out my &lt;a href="https://thefellowcoder.com/blog/"&gt;blog&lt;/a&gt; for more such content.&lt;/p&gt;

</description>
      <category>regex</category>
      <category>bigquery</category>
    </item>
    <item>
      <title>5 Sites Every Developer Should Follow</title>
      <dc:creator>Smit Thakkar</dc:creator>
      <pubDate>Mon, 01 Mar 2021 17:55:32 +0000</pubDate>
      <link>https://dev.to/smitthakkar/5-sites-every-developer-should-follow-3j64</link>
      <guid>https://dev.to/smitthakkar/5-sites-every-developer-should-follow-3j64</guid>
      <description>&lt;p&gt;&lt;em&gt;“Kubernetes is awesome, I would love to see auto-healing in my systems”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Working with new frameworks is fascinating, but it also births few questions.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;“Are enterprises actually using it?”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;“Is it really worth the switch? my current solution works fine.”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;“The benchmarks on the official site look amazing, it would be great to hear some stories.”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;As developers, we constantly hear about new frameworks, tools, and the most promising managed service cloud has to offer. We are tempted to bring it into our environment but also feel a little skeptical about its origin and the community.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A pattern is an idea that has been useful in one practical context and will probably be useful in others.&lt;br&gt;
– Martin Fowler&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The best way would be to know about the advancements and how other organizations are adopting them.&lt;/p&gt;

&lt;p&gt;Here are my 5 picks that any software enthusiast should follow.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;a href="https://www.thoughtworks.com/radar/platforms"&gt;ThoughtWorks Technology Radar&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;Every six months or so, ThoughtWorks publishes its Technology Radar. What started as an interesting experiment has turned into quite a notable publication.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--C1SPt3M0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/odagph80hs0ql306d3x6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--C1SPt3M0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/odagph80hs0ql306d3x6.png" alt="ThoughtWorks Technology Radar" width="800" height="497"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The radar gives a bird’s eye view of the technologies ThoughtWorks as an Organization plans to adopt. Moreover, you can also make your own radar on their &lt;a href="https://www.thoughtworks.com/radar/byor"&gt;site&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;a href="https://www.infoq.com/microservices"&gt;InfoQ&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;You may have bumped into one of InfoQ’s YouTube channels while searching for Microservices or Distributed Systems. This is an absolute gold mine and you should definitely check out their conferences.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0wFvjVIN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c2trr4je66jgleq49l0w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0wFvjVIN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c2trr4je66jgleq49l0w.png" alt="InfoQ" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Software is changing the world, and our mission is to help dev teams adopt new technologies and practices. InfoQ provides software engineers with the opportunity to share experiences gained using innovator and early adopter stage techniques and technologies with the wider industry. &lt;/p&gt;

&lt;p&gt;– About Us Page (InfoQ.com)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;My personal favorites are &lt;a href="https://www.youtube.com/watch?v=j6ow-UemzBc"&gt;Design Microservice Architectures the Right Way&lt;/a&gt;, &lt;a href="https://www.youtube.com/watch?v=WE9c9AZe-DY"&gt;How Slack Works&lt;/a&gt; and &lt;a href="https://www.youtube.com/watch?v=IO4teCbHvZw"&gt;Scaling Facebook Live Videos to a Billion Users&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If tech conferences like InfoQ excite you, then make sure to check out &lt;a href="https://www.youtube.com/c/GotoConferences/featured"&gt;Goto&lt;/a&gt; and &lt;a href="https://www.youtube.com/c/Devoxx2015/featured"&gt;Devoxx&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;a href="https://news.ycombinator.com/"&gt;HackerNews&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;HackerNews is one of the oldest social platforms for computer science news, games, and entrepreneurship. The site was called “Startup News” at first. And after a few iterations, it’s finally called “HackerNews” (&lt;a href="https://en.wikipedia.org/wiki/Hacker_News"&gt;Complete Story&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ouGn5A06--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jtirp3uok487zuc5to8r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ouGn5A06--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jtirp3uok487zuc5to8r.png" alt="HackerNews" width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It basically curates the latest tech buzz on the internet and is a treat to read, sort of like Reddit for Tech Enthusiasts.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;a href="https://hub.packtpub.com/category/programming/microservices/"&gt;Packt&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;Packt has gone beyond a technical book publisher. It now homes to the latest technology updates via blogs, courses, and also podcasts.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---tGXSo-8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ntvrqmfd0o6e3nr76r6j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---tGXSo-8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ntvrqmfd0o6e3nr76r6j.png" alt="Packt" width="800" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Needless to say, their books are top class and you can also buy a subscription for complete access. I have read their &lt;a href="https://www.packtpub.com/product/professional-cloud-architect-google-cloud-certification-guide/9781838555276"&gt;Google Certification Books&lt;/a&gt;, &lt;a href="https://www.packtpub.com/product/python-programming-blueprints/9781786468161"&gt;Python Programming Books&lt;/a&gt; and they were worth it!&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;a href="https://opensource.com/tags/news"&gt;OpenSource.com&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;We can all agree on one thing, we love open-source. There are more than a thousand open-source projects on &lt;a href="https://github.com/explore"&gt;Github&lt;/a&gt; alone. This site helps in curating the latest open-source projects across platforms.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--01liufXe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o4eq7b9543qu5gyr3lfo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--01liufXe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o4eq7b9543qu5gyr3lfo.png" alt="OpenSource.com" width="800" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This website is backed by RedHat, so it is safe to say the content is trustworthy and reviewed. The curations are a good bag of IOT, Programming and DevOps use cases.&lt;/p&gt;

&lt;p&gt;Are there any other tech sites that you use? Let me know in the comments!&lt;/p&gt;

</description>
      <category>programming</category>
    </item>
    <item>
      <title>Serverless email notifications with Sendgrid</title>
      <dc:creator>Smit Thakkar</dc:creator>
      <pubDate>Thu, 31 Dec 2020 11:34:22 +0000</pubDate>
      <link>https://dev.to/smitthakkar/serverless-email-notifications-with-sendgrid-2aom</link>
      <guid>https://dev.to/smitthakkar/serverless-email-notifications-with-sendgrid-2aom</guid>
      <description>&lt;p&gt;Email notifications have become an integral part of our systems. Common use-cases include sending reports, notifying build success, system failure events, etc. This tutorial demonstrates a solution using Google Cloud Functions to send emails using Sendgrid.&lt;/p&gt;

&lt;h2&gt;
  
  
  Goals
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Scalable&lt;/li&gt;
&lt;li&gt;Ease of content modification&lt;/li&gt;
&lt;li&gt;Reliable delivery&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;p&gt;A sender will provide the trigger a cloud function with params. The cloud function will make a call to Sendgrid which in turn will send emails to the receiver.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyg2lj0caksaqvau06eew.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyg2lj0caksaqvau06eew.png" title="System" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;System&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Setting up a Sendgrid account
&lt;/h2&gt;

&lt;p&gt;You can &lt;a href="https://signup.sendgrid.com/" rel="noopener noreferrer"&gt;Sign up&lt;/a&gt; for a Sendgrid Account to manage our details. It offers a generous &lt;a href="https://sendgrid.com/pricing/" rel="noopener noreferrer"&gt;free plan&lt;/a&gt; which is enough for our demo. Choose the create single sender option, in case you want to use your own domain the instructions can be found &lt;a href="https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/" rel="noopener noreferrer"&gt;here&lt;/a&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhnt42aip4lufz0b9s9az.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhnt42aip4lufz0b9s9az.png" title="Sender Identity Type" alt="Sender Identity Type"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Sender Identity Type&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdj0j5l1ivpjfpqjyttir.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdj0j5l1ivpjfpqjyttir.png" title="Creating a sender" alt="Creating a sender"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Creating a sender&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You’ll receive an email for sender confirmation as configured, click on Verify Single Sender.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fkd6srn9cg9rd87p8a5au.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fkd6srn9cg9rd87p8a5au.png" title="Sender Verification" alt="Sender Verification"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Sender Verification&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Obtaining an API key
&lt;/h2&gt;

&lt;p&gt;Sending emails via APIs is the recommended way for apps rather than SMTP. So, we’ll use the Web APIs which will be called by the SDKs. Let’s get the API Key for our account.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4kfal6zd2dw0o23rhgrf.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4kfal6zd2dw0o23rhgrf.png" title="Choosing the Integration type" alt="Choosing the Integration type"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Choosing the Integration type&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcz90t0t4v0fjz8e9bgij.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcz90t0t4v0fjz8e9bgij.png" title="Choosing the language" alt="Choosing the language"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Choosing the language&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5rriovi2oud8xfoq700f.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5rriovi2oud8xfoq700f.jpg" title="Obtain the API Key" alt="Obtain the API Key"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Obtain the API Key&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Great, now let’s start coding!&lt;/p&gt;
&lt;h2&gt;
  
  
  Library function for Sendgrid
&lt;/h2&gt;

&lt;p&gt;Let’s create a library that will enable us to send emails via Sendgrid. This way our code is decoupled and can be used by a simple library import.&lt;/p&gt;

&lt;p&gt;Install the Sendgrid SDK via npm.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# install Sendgrid dependency
npm install --save @sendgrid/mail
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Now let’s write a library that abstracts the SDK calls of Sendgrid.&lt;/p&gt;


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



&lt;p&gt;Let’s test the lib code with our API Key.&lt;/p&gt;


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


&lt;p&gt;Great! now we have a working library code, let’s use it in our cloud function.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cloud function
&lt;/h2&gt;

&lt;p&gt;Let’s create a simple cloud function that uses this library and sends an email.&lt;/p&gt;


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


&lt;p&gt;Here, we have configured the API Key as an env variable, thus we need to make sure that it is available at runtime. Make sure that the lib code is also part of the deployment, else it will throw an error.&lt;/p&gt;

&lt;p&gt;Sample command to deploy the cloud function&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gcloud functions deploy sendgridDemo --trigger-http --entry-point=sendgridCF \
--region=us-central1 --runtime=nodejs10 --set-env-vars API_KEY='123'

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

&lt;/div&gt;


&lt;p&gt;Once deployed make sure to change the env variable value with the actual Sendgrid API Key.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fm1vwn63x28qpe9ubyajk.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fm1vwn63x28qpe9ubyajk.png" title="Updating env variable" alt="Updating env variable"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Updating env variable&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Testing
&lt;/h2&gt;

&lt;p&gt;Visit the Cloud Function’s Testing tab to test the function. Just click on ‘TEST THE FUNCTION’ to trigger the function.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4lwshrl7e4hcv805tr19.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4lwshrl7e4hcv805tr19.png" title="Testing the cloud function" alt="Testing the cloud function"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Testing the cloud function&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now let’s verify in our mailbox. Sometimes the email appears in spam, so be sure to check there if not received.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fur7i8ejv6w84x2j3474r.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fur7i8ejv6w84x2j3474r.png" title="Inbox" alt="Inbox"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Inbox&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You may wonder that why is ‘Sample Text’ not visible? It seems that  ‘text’ is a fallback in the event the email client does not support HTML emails.&lt;/p&gt;

&lt;p&gt;Thus we can send emails programmatically in a serverless way. Note that because we worked in a library structure, we can extend this and have a similar setup for AWS Lambda.&lt;/p&gt;

&lt;p&gt;All the code samples can be found in our git repository      &lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/thefellowcoder" rel="noopener noreferrer"&gt;
        thefellowcoder
      &lt;/a&gt; / &lt;a href="https://github.com/thefellowcoder/cloud-functions" rel="noopener noreferrer"&gt;
        cloud-functions
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Code samples for cloud functions
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;cloud-functions&lt;/h1&gt;

&lt;/div&gt;

&lt;p&gt;Code samples for cloud functions&lt;/p&gt;

&lt;/div&gt;
&lt;br&gt;
&lt;br&gt;
  &lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/thefellowcoder/cloud-functions" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;Hope you found this tutorial helpful.&lt;/p&gt;

&lt;p&gt;Let us know your thoughts in the comment section below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://thefellowcoder.com/blog/serverless-email-notifications-with-sendgrid/" rel="noopener noreferrer"&gt;Original Article&lt;/a&gt;&lt;/p&gt;

</description>
      <category>serverless</category>
      <category>sendgrid</category>
    </item>
  </channel>
</rss>
