<?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: Ukpai Chukwuemeka</title>
    <description>The latest articles on DEV Community by Ukpai Chukwuemeka (@aimes).</description>
    <link>https://dev.to/aimes</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%2F205246%2Ffef2a7c0-66bf-4740-9e39-c7267590bb97.jpg</url>
      <title>DEV Community: Ukpai Chukwuemeka</title>
      <link>https://dev.to/aimes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aimes"/>
    <language>en</language>
    <item>
      <title>Testing React Native Applications: Best practices and Frameworks</title>
      <dc:creator>Ukpai Chukwuemeka</dc:creator>
      <pubDate>Tue, 26 Aug 2025 06:55:28 +0000</pubDate>
      <link>https://dev.to/aimes/testing-react-native-applications-best-practices-and-frameworks-5hca</link>
      <guid>https://dev.to/aimes/testing-react-native-applications-best-practices-and-frameworks-5hca</guid>
      <description>&lt;p&gt;Testing is a habit — one that not every developer possesses.&lt;/p&gt;

&lt;p&gt;Imagine driving through a busy intersection with no traffic lights.&lt;/p&gt;

&lt;p&gt;Chaos, right ?&lt;/p&gt;

&lt;p&gt;That’s exactly what software without testing feels like.&lt;/p&gt;

&lt;p&gt;Testing is an integral part of software development.&lt;/p&gt;

&lt;p&gt;For React Native applications, it ensures your features work as expected — and continue to do so as your app grows.&lt;/p&gt;

&lt;p&gt;Yet many developers skip tests because “it works on my machine” or due to tight deadlines.&lt;/p&gt;

&lt;p&gt;Just like you go to the gym to stay fit, testing keeps your codebase healthy.&lt;/p&gt;

&lt;p&gt;I’ll admit, I have written my fair share of tests and then stopped.&lt;/p&gt;

&lt;p&gt;Until I realized that many of the bugs I kept missing were the direct result of extending functionality and refactoring without proper test coverage.&lt;/p&gt;

&lt;p&gt;Those hidden bugs eventually slipped into production.&lt;/p&gt;

&lt;p&gt;In this article, we’ll explore testing strategies, best practices, coverage, and frameworks you can use to catch bugs before they ever reach production.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Testing Matters
&lt;/h2&gt;

&lt;p&gt;Every app has moving parts — logic, APIs, components, and user flows. Without automated tests, changes can unintentionally break those parts.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnhsqj4vgv8yfbijh4a7j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnhsqj4vgv8yfbijh4a7j.png" alt="Photo by Ukpai Chukwuemeka" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
A good test suite helps you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prevent regressions.&lt;/li&gt;
&lt;li&gt;Document expected behavior.&lt;/li&gt;
&lt;li&gt;Increase confidence when refactoring.&lt;/li&gt;
&lt;li&gt;Ship features faster and safer.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Testing Frameworks for React Native
&lt;/h2&gt;

&lt;p&gt;There are several testing tools commonly used in react native applications, including:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Jest&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The default testing framework in React Native.&lt;br&gt;
Fast, supports mocking, and integrates with libraries like react-test-renderer and @testing-library/react-native.&lt;br&gt;
Great for unit and integration tests.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. React Native Testing Library (RNTL)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A library built on top of @testing-library.&lt;br&gt;
Encourages testing components the way users interact with them (via text, roles, and accessibility labels).&lt;br&gt;
Example: getByText("Submit") instead of checking internal props.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Detox&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A powerful E2E testing framework for React Native.&lt;br&gt;
Automates user flows on real devices or emulators.&lt;br&gt;
Ensures your app behaves correctly in real-world scenarios.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Cypress (for Web/Expo Web)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If your React Native project also targets web via Expo, Cypress is a great choice for browser-based E2E testing.&lt;/p&gt;
&lt;h2&gt;
  
  
  Test Coverage
&lt;/h2&gt;

&lt;p&gt;Coverage helps track which parts of your code are tested. Common metrics include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Statements — how many statements in the code are executed.&lt;/li&gt;
&lt;li&gt;Branches — whether conditional paths (if, switch, ternary) are tested.&lt;/li&gt;
&lt;li&gt;Functions — coverage of function calls.&lt;/li&gt;
&lt;li&gt;Lines — percentage of lines run during tests.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Best Practices for Testing React Native&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Whether it’s unit tests, integration tests, or E2E tests, almost every testing framework follows this Arrange → Act → Assert (AAA) pattern.&lt;/p&gt;

&lt;p&gt;You should also make more obvious what the SUT (subject under test) is.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example: AAA in Action&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;fireEvent&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="s2"&gt;@testing-library/react-native&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Button&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Text&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="s2"&gt;react-native&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;GreetingButton&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setMessage&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Say Hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;onPress&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello, World!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Text&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;message&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;/Text&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;it shows greeting after button press&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;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Arrange&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;getByText&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;render&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;GreetingButton&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c1"&gt;// Act&lt;/span&gt;
  &lt;span class="nx"&gt;fireEvent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;press&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;getByText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Say Hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="c1"&gt;// Assert&lt;/span&gt;
  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;getByText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello, World!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toBeTruthy&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;h2&gt;
  
  
  Best Practices
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Test behavior, not implementation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Focus on what the user sees and does, rather than the internal details of your component. This makes tests more robust and less prone to breaking when you refactor code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Keep tests fast&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Unit tests should execute quickly to encourage frequent running. Slow tests discourage developers from running them regularly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Mock external dependencies&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;APIs, AsyncStorage, native modules, and other side-effect-prone dependencies should be mocked. This prevents flaky tests and ensures your tests run reliably.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Use CI/CD pipelines&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Automate your tests using tools like GitHub Actions, Bitrise, or CircleCI. This ensures regressions are caught before code is merged.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Don’t chase 100% coverage blindly&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Focus on critical paths and meaningful coverage rather than trying to hit 100% line coverage. High coverage doesn’t always mean high-quality tests.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Use snapshots wisely&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Snapshots are useful for catching unintended changes in UI, but avoid overusing them for implementation details. Also update snapshots intentionally when UI changes are expected.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Use Husky (optional)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Husky can enforce pre-commit hooks to run tests or linting before commits. This is helpful, but optional — only adopt it if your team finds it useful.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://medium.com/@ukpai/pre-deployment-checklist-setting-up-husky-1f38310e9598" rel="noopener noreferrer"&gt;How to Setup Husky&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

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

&lt;h2&gt;
  
  
  React Native Test Setup
&lt;/h2&gt;

&lt;p&gt;If you would like to start testing a new or an existing react native app.&lt;/p&gt;

&lt;p&gt;It’s very easy&lt;/p&gt;

&lt;p&gt;Plus any of the popular frameworks (like Jest for unit testing or Detox for end-to-end testing) can be integrated seamlessly.&lt;/p&gt;

&lt;h2&gt;
  
  
  How To Create a New React Native Project
&lt;/h2&gt;

&lt;p&gt;To create a new project, you can use the official React Native Community CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;npx&lt;/span&gt; &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;react&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;native&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;community&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;cli&lt;/span&gt; &lt;span class="nx"&gt;init&lt;/span&gt; &lt;span class="nx"&gt;rntesting&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;Once the setup is complete, open the newly created folder in your favorite IDE (such as VS Code) and you’re ready to start adding tests.&lt;/p&gt;

&lt;p&gt;By default, projects created with the Community CLI come with Jest preinstalled and configured, so you can immediately run tests with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;run&lt;/span&gt; &lt;span class="nx"&gt;test&lt;/span&gt;
&lt;span class="nx"&gt;yarn&lt;/span&gt; &lt;span class="nx"&gt;run&lt;/span&gt; &lt;span class="nx"&gt;test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s update a few things to help us write and run our test.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;test:nowatch&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;jest --watchAll=false&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;test:coverage&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;jest --coverage --watchAll=false&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;test:update:snapshot&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;npm test -- -u&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We would update our &lt;strong&gt;jest.config.js&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;preset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-native&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// use the react-native preset&lt;/span&gt;
  &lt;span class="na"&gt;transformIgnorePatterns&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;node_modules/(?!(@react-native|react-native|react-native-reanimated|react-native-image-picker)/)&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// add any other packages that need to be transformed&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;setupFiles&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./jestSetup.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// your custom setup file&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;moduleNameMapper&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s1"&gt;.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;jest-transform-stub&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// mock static assets&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;fakeTimers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;enableGlobally&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// use fake timers for all tests&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;collectCoverageFrom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;src/**/*.{js,jsx,ts,tsx}&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// your source files&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;!src/assets/**&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// exclude assets&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;!src/**/*.d.ts&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// exclude types&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;!src/**/index.{js,ts,tsx}&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// exclude barrel index files&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;testMatch&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;**/__tests__/**/*.{js,jsx,ts,tsx}&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// look for tests in __tests__&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;**/?(*.)+(spec|test).{js,jsx,ts,tsx}&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// or files ending in .test/.spec&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;collectCoverage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// enable coverage collection&lt;/span&gt;
  &lt;span class="na"&gt;coverageThreshold&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// set coverage thresholds&lt;/span&gt;
    &lt;span class="na"&gt;global&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// set to 100% or your desired threshold&lt;/span&gt;
      &lt;span class="na"&gt;functions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// set to 100% or your desired threshold&lt;/span&gt;
      &lt;span class="na"&gt;lines&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// set to 100% or your desired threshold&lt;/span&gt;
      &lt;span class="na"&gt;statements&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// set to 100% or your desired threshold&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the next time you run coverage you should be able to see your code coverage and a coverage folder would be generated.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;run&lt;/span&gt; &lt;span class="nx"&gt;test&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;coverage&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To view the report in your browser open up the index.html file under rntesting/coverage/lcov-report/index.html .&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/Mr-emeka/rntesting/tree/AAA-with-testing-library/react-native-react-test-renderer" rel="noopener noreferrer"&gt;Github Repo Link&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;We all dream of the fancy job with good pay but the harsh reality you are not ready to write test :).&lt;/p&gt;

&lt;p&gt;Likewise teams that invest in tests build software that lasts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do you want to practice?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can fork the repo, experiment, and add your own test cases. Let’s help each other write better, more reliable apps !&lt;/p&gt;

&lt;p&gt;Cheers and happy testing!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/pen-with-paper/windows-android-development-setup-2025-e6ba0b94eddf" rel="noopener noreferrer"&gt;Windows Android Development Setup&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://reactnative.dev/docs/getting-started-without-a-framework" rel="noopener noreferrer"&gt;React Native Get Started Without a Framework&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://testing-library.com/docs/react-native-testing-library/intro" rel="noopener noreferrer"&gt;React Native Testing Library&lt;/a&gt;&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>testing</category>
      <category>programming</category>
      <category>javascript</category>
    </item>
    <item>
      <title>telegram webhook</title>
      <dc:creator>Ukpai Chukwuemeka</dc:creator>
      <pubDate>Sun, 19 Jan 2025 11:19:03 +0000</pubDate>
      <link>https://dev.to/aimes/telegram-webhook-3p0</link>
      <guid>https://dev.to/aimes/telegram-webhook-3p0</guid>
      <description>&lt;p&gt;Unlike polling, which repeatedly requests updates from Telegram, webhook allow Telegram to push updates directly to your server, reducing server resource usage and improving efficiency.&lt;br&gt;
In a previous article, I explained how to set up a Telegram bot using Node.js, where we implemented polling to fetch updates repeatedly. While this setup works well, webhooks are a better alternative if you’re looking to scale, even if you’re not currently experiencing rate limits, switching to webhook ensures your bot runs more efficiently and can handle increased traffic with less strain on your server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Considerations for Telegram Webhook
&lt;/h2&gt;

&lt;p&gt;When using webhook, it’s crucial to understand the following:&lt;/p&gt;

&lt;h2&gt;
  
  
  Allowed Ports
&lt;/h2&gt;

&lt;p&gt;Telegram supports only four ports for webhooks. While the reason for this limitation is still unclear to me, it might change in the future. For now, these are the supported ports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;443&lt;/strong&gt; (recommended for HTTPS)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;80&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;88&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;8443&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Either of these ports must be free and accessible for the webhook to function correctly. If you don’t explicitly specify a port, the webhook will default to using port &lt;strong&gt;8443&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Server Limits
&lt;/h2&gt;

&lt;p&gt;Since only four ports are allowed, you cannot run more than four apps using webhook on the same server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before diving into the setup, ensure you have the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Node.js Installed:&lt;/strong&gt; Download and install Node.js from nodejs.org if you haven’t already.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Telegram Account:&lt;/strong&gt; You’ll need a Telegram account to obtain a bot token and interact with your bot.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Ngrok for HTTPS URL:&lt;/strong&gt; Telegram requires an HTTPS endpoint for webhooks. Use Ngrok to expose your local server to the internet.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;You can find full code on &lt;a href="https://dub.sh/tg-webhook" rel="noopener noreferrer"&gt;Github&lt;/a&gt; .&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Setting Up Telegram Webhook (Node.js Example)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Import the Telegram Bot API
const TelegramBot = require('node-telegram-bot-api');

// Replace with your bot token
const token = 'your telegram token'; // Check out my article on how to get a bot token from @BotFather on Telegram

const WEB_HOOK_URL = 'https://localhost:3000/telegram-bot-webhook'; 
// NOTE: It won't work on localhost, so use a tunneling service like ngrok.

// Create a bot that uses a webhook
const bot = new TelegramBot(token, {
  webHook: {
    port: 88, // Allowed ports for Telegram webhook: 443, 80, 88, 8443
  },
});

// Initialize the webhook
const initWebHook = async () =&amp;gt; {
  const webhookInfo = await bot.getWebHookInfo();
  if (webhookInfo.url !== WEB_HOOK_URL) {
    await bot.setWebHook(WEB_HOOK_URL, {
      max_connections: 100,
    });
  }
};
initWebHook();

// Listen for any message
bot.on('message', (msg) =&amp;gt; {
  const chatId = msg.chat.id;

  // Simple command handling
  if (msg.text.toLowerCase() === '/start') {
    bot.sendMessage(chatId, 'Welcome! How can I assist you today?', {
      reply_markup: {
        keyboard: [['/start', '/help']],
      },
    });
  } else if (msg.text.toLowerCase() === 'hello') {
    bot.sendMessage(chatId, `Hello, ${msg.from.first_name}!`);
  } else {
    bot.sendMessage(chatId, "I'm not sure how to respond to that.");
  }
});

// Export the bot module
module.exports = bot;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Telegram Webhook Route
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const express = require("express");
const app = express();
const bot = require("./bot");

// parse json body  for post request
app.use(express.json());

app.get("/", (req, res) =&amp;gt; {
  res.send("Hello World");
});

app.post("/telegram-bot-webhook", (req, res) =&amp;gt; {
  bot.processUpdate(req.body);
  res.sendStatus(200);
});

app.listen(process.env.PORT || 3000, () =&amp;gt; {
  console.log("Server is running on port 3000");
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Switching to webhook eliminates telegram rate-limiting issue and improves your bot’s efficiency. Just ensure you configure your server properly, use the allowed ports, and secure your connection with HTTPS.&lt;/p&gt;

&lt;p&gt;Kindly follow me to get notified on my next post 📫.&lt;/p&gt;

</description>
      <category>telegram</category>
      <category>telegrambot</category>
      <category>javascript</category>
      <category>polling</category>
    </item>
    <item>
      <title>do not be racist to yourself</title>
      <dc:creator>Ukpai Chukwuemeka</dc:creator>
      <pubDate>Sun, 19 Jan 2025 10:53:24 +0000</pubDate>
      <link>https://dev.to/aimes/do-not-be-racist-to-yourself-54pn</link>
      <guid>https://dev.to/aimes/do-not-be-racist-to-yourself-54pn</guid>
      <description>&lt;p&gt;&lt;strong&gt;Let’s be real for a second. We all face external barriers — judgment, bias, societal nonsense. But honestly? The biggest roadblock isn’t “out there.” It’s inside. Yup, it’s that little voice in your head, the one that loves to whisper things like, “You’re not good enough,” or, “Why even bother?” You know the one I’m talking about.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here’s the crazy part. We’re quick to call out racism or injustice when it comes from other people, right? But when it’s our own thoughts doing the damage, we just… let it slide. Why? Think about it. If someone else said, “You’ll never make it because of where you’re from” or “You’re not smart enough for this,” you’d be furious. So why let your inner voice get away with that kind of nonsense?&lt;br&gt;
Listen, the color of your skin shouldn’t limit you, and neither should your mindset. Where you grew up? How much money you had (or didn’t have)? The mistakes you’ve made? None of that defines you — unless you let it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now, let’s talk about your life for a minute. Be honest. How much time do you spend scrolling through your phone, liking random posts, making money for people who’ve figured out the game while you sat there doubting yourself? Ouch, right? And it’s not just individuals — businesses fall into this trap, too, holding themselves back instead of going all-in.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;But here’s the good news regrets don’t belong here, Only lessons. Think about those superstars you admire. They’re not some magical breed of humans. They made bold moves, invested in themselves, and shut down that inner critic.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;And guess what? You’ve got that same potential. Yeah, you. Don’t let that voice in your head tell you otherwise. Success doesn’t come from being perfect — it comes from showing up, putting in the work, and believing you’re worth it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;So, the big question is: Are you ready to silence that voice and unlock the future that’s been waiting for you? Because trust me, it’s ready when you are.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before you go, don’t forget to clap 👏 and follow.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>personalgrowth</category>
      <category>reflections</category>
      <category>selfawareness</category>
    </item>
    <item>
      <title>Safeguarding Your Users: A Simple Guide to Preventing CSRF Attacks</title>
      <dc:creator>Ukpai Chukwuemeka</dc:creator>
      <pubDate>Fri, 06 Sep 2024 16:55:00 +0000</pubDate>
      <link>https://dev.to/aimes/safeguarding-your-users-a-simple-guide-to-preventing-csrf-attacks-5ai7</link>
      <guid>https://dev.to/aimes/safeguarding-your-users-a-simple-guide-to-preventing-csrf-attacks-5ai7</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9j1kq2n66yd886f62iuv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9j1kq2n66yd886f62iuv.png" alt="Safeguarding Your Users: A Simple Guide to Preventing CSRF Attacks" width="800" height="240"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Cross-Site Request Forgery (CSRF) is a common web security vulnerability in which an unsuspecting user is tricked into unknowingly performing actions they did not intend to.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A CSRF attack is like a trickster convincing someone to do something they wouldn't normally do.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmx42ha9hxcstrpp6swc4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmx42ha9hxcstrpp6swc4.png" alt="Diagram illustration showing how CSRF Attack works from educative.io" width="800" height="483"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A classic example of a Cross-Site Request Forgery (CSRF) attack is a hacker slipping a malicious link into your email, hoping you will click it without realizing the danger. When you do, your browser might unknowingly send a request to a website you are already logged into, carrying out actions like making unauthorized purchases, transfers, withdrawals, or changing your password.&lt;/p&gt;




&lt;h2&gt;
  
  
  Types of CSRF attacks 
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Client-Side Attacks:&lt;/strong&gt; These attacks exploit vulnerabilities on the client side. They often involve injecting malicious scripts that alter the DOM, change styles or pictures, or even add external forms to other applications&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Server-Side Attacks:&lt;/strong&gt; These attacks target vulnerabilities on the server side of an application. They involve exploiting weak authentication mechanisms, insecure session management, or other vulnerabilities to forge requests for authenticated users.&lt;/p&gt;




&lt;h2&gt;
  
  
  Client Side CSRF Prevention Measure
&lt;/h2&gt;

&lt;p&gt;While server-side measures are generally considered the most effective way to prevent Cross-Site Request Forgery (CSRF), implementing client-side restrictions can provide an additional layer of defense.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CAPTCHA (Completely Automated Public Turing Test to Tell Computers and Humans Apart)&lt;/strong&gt;: While &lt;code&gt;CAPTCHA&lt;/code&gt; can be a frustrating experience, it's a valuable tool in the fight against Cross-Site Request Forgery (CSRF). By requiring users to complete a simple task difficult for bots to mimic, CAPTCHA helps verify that a human is behind the request, making it harder for attackers to exploit vulnerable client-side applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Content Security Policy (CSP):&lt;/strong&gt; Integrating a content security policy (CSP) is one of the effective ways to prevent CSRF attacks, cross-site scripting (XSS), and injection attacks on the client side. It acts like a digital shield, strictly controlling which resources your application can load. By using directives like &lt;code&gt;script-src&lt;/code&gt; and &lt;code&gt;style-src&lt;/code&gt;. You can specify where styles and scripts load up from.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;head&amp;gt;
  &amp;lt;meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'nonce-random-string'; style-src 'self' 'nonce-random-string'; img-src 'self' https://yourdomain.com"&amp;gt;
&amp;lt;/head&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;meta http-equiv="Content-Security-Policy" content="..."&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the specific meta tag that defines the CSP.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;http-equiv="Content-Security-Policy"&lt;/code&gt; This attribute specifies that the meta tag defines the content security policy for the page.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;content="..."&lt;/code&gt; This attribute holds the CSP directive, usually a string of semicolon-separated rules.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;default-src 'self'&lt;/code&gt; This directive sets the default source for all resources (scripts, stylesheets, images, etc.) to be &lt;code&gt;'self'&lt;/code&gt; only. This means resources can only be loaded from the same domain as the current webpage.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;script-src&lt;/code&gt; This directive specifically defines allowed sources for scripts. &lt;br&gt;
(a) &lt;code&gt;'self'&lt;/code&gt; Allows scripts from the same domain as the webpage.&lt;br&gt;
(b) &lt;code&gt;'nonce-XYZ'&lt;/code&gt; Allows scripts with a "nonce" attribute set to the unique value &lt;code&gt;"XYZ"&lt;/code&gt; usually generated on the server.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;style-src&lt;/code&gt; Similar to scripts, this directive defines allowed sources for stylesheets &lt;br&gt;
(a) &lt;code&gt;'self'&lt;/code&gt; Allows stylesheets from the same domain as the webpage.&lt;br&gt;
(b) &lt;strong&gt;&lt;code&gt;'nonce-ABC'&lt;/code&gt;&lt;/strong&gt; Allows stylesheets with a "nonce" attribute set to the unique value &lt;code&gt;"ABC"&lt;/code&gt; usually generated on the server.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;img-src&lt;/code&gt; This directive defines allowed sources for images. &lt;br&gt;
(a) &lt;code&gt;'self'&lt;/code&gt; Allows images from the same domain as the webpage.&lt;br&gt;
(b) &lt;code&gt;https://yourdomain.com&lt;/code&gt; Allows images from a specific external domain, ensuring it uses a secure HTTPS connection.&lt;/p&gt;



&lt;p&gt;In &lt;strong&gt;Next.js 13&lt;/strong&gt; and later, adding a list of remote patterns for images or other documents in the &lt;code&gt;next.config&lt;/code&gt; file under the hood adds an img-src directive using the domains added.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# typical next.config file specifying allowed sources for images
const nextConfig = { 
   images: {
    remotePatterns: [
      {
        protocol: "https",
        hostname: "google.com",
      },
      {
        protocol: "https",
        hostname: "avatar.vercel.sh",
      },
      {
        protocol: "https",
        hostname: "lh3.googleusercontent.com",
      },
      {
        protocol: "https",
        hostname: "avatars.githubusercontent.com",
      },

    ],
  },
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Input validation:&lt;/strong&gt; Hackers can send malicious scripts and contents through form inputs that aren't adequately validated and sanitized. Validating inputs is another preventive measure to consider when safeguarding your client-side application from CSRF attacks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. HTTP Strict Transport Security (HSTS):&lt;/strong&gt; Enforcing strict HTTPS connections can help prevent CSRF attacks, but this would only be able to prevent attacks that rely on HTTP.&lt;/p&gt;




&lt;h2&gt;
  
  
  Server-Side CSRF Prevention Measure
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;CORS (cross-origin resource sharing):&lt;/strong&gt; CORS is a mechanism that allows a client-side application to make requests to the server-side application on a different domain. It's also a crucial security measure for preventing CSRF attacks. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Synchronizer Token Pattern (STP):&lt;/strong&gt; The Synchronizer Token Pattern, or STP for short, is like a secret handshake between your web server and your users' browsers. When a user signs in or starts a new session, it generates and stores a CSRF token in the server sessions, and on forms. The token is sent back to the server on each user request for verification. However, as your user grows, this could lead to potential memory issues if not configured properly. It is also one of the measures to prevent CSRF attacks on the server side.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Double Submit Cookie:&lt;/strong&gt; The Double Submit Cookie pattern is another measure to consider against preventing CSRF attacks on the server side. It works by storing a CSRF token in cookies and including the same token in a hidden field, preferably inside a form. When the server receives a form submission, it validates the submission by checking if the CSRF token in cookies matches the token stored in the hidden field. This helps to ensure that the form submission originated from the user's browser and not from an attacker.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Checking the HTTP Referer Header:&lt;/strong&gt; Checking the HTTP referer header is like showing a store clerk your ID to prove you are of age. This helps prevent underage purchases. Similarly, on the server, this involves checking the referer header to verify that a request is coming from a legitimate source. This simple security measure can help prevent Cross-Site Request Forgery (CSRF) attacks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
While these measures can help prevent CSRF attacks, it is important to remember that the digital landscape is constantly evolving. Other threats, like XSS attacks, also pose significant risks. As developers, our responsibility extends beyond creating functional products to ensuring their security. By diligently implementing defenses against CSRF and other attacks, we can safeguard our users' data and protect our businesses from potential harm.&lt;/p&gt;

&lt;p&gt;Check out your application CSP status using the links below:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://csp-evaluator.withgoogle.com" rel="noopener noreferrer"&gt;csp-evaluator&lt;/a&gt;&lt;br&gt;
&lt;a href="https://observatory.mozilla.org/" rel="noopener noreferrer"&gt;observatory by Mozilla&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>security</category>
      <category>webdev</category>
      <category>software</category>
      <category>csrf</category>
    </item>
    <item>
      <title>Set up a monorepo using pnpm workspace</title>
      <dc:creator>Ukpai Chukwuemeka</dc:creator>
      <pubDate>Thu, 05 Sep 2024 18:40:16 +0000</pubDate>
      <link>https://dev.to/aimes/set-up-a-monorepo-using-pnpm-workspace-d2a</link>
      <guid>https://dev.to/aimes/set-up-a-monorepo-using-pnpm-workspace-d2a</guid>
      <description>&lt;p&gt;In the previous article, we discussed how a monorepo structure could be package-centric or app-centric, depending on your project needs. Well, in this particular article, we will set up a monorepo using pnpm and take the app-centric route.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  What's Pnpm? 
&lt;/h2&gt;

&lt;p&gt;Pnpm is a new generation of package management tools; it works just like NPM and yarn but offers some advantages.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## install pnpm
npm install -g pnpm # install pnpm globally
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a new directory or clone an existing repository&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir monorepo # creates a new folder

or

git clone repository-link # clones a git repository (note: replace the link with repository URL)`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's change our current directory to the recently created directory or cloned repo.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd monorepo # change directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, we are going to initialize the package manager with pnpm.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pnpm init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Optional:&lt;/strong&gt; Initialize git if the directory wasn't cloned from GitHub or GitLab.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
git init # initializes git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch .gitignore
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add node_modules and common build output folders to exclude pushing them to your repository.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# .gitignore  

node_modules  
dist  
build
.env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once all this is done, you can open your folder in your favorite code editor. If you use Visual Studio Code, you can open up the folder by using the command below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;code . # opens up the folder in vs code
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;code . didn't work &lt;a href="https://medium.com/r/?url=https%3A%2F%2Fabhishekthatguy.medium.com%2Fhow-to-fix-visual-studio-code-with-the-terminal-code-command-not-working-95ce0f9c23a2" rel="noopener noreferrer"&gt;fix here&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Set up the workspace
&lt;/h2&gt;

&lt;p&gt;To set up a workspace, create a new file pnpm-workspace.yaml&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch pnpm-workspace.yaml # creates a new file 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the configuration below to the workspace file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# pnpm-workspace.yaml

packages:
 - 'apps/*'
 - 'packages/*'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This configuration tells pnpm that your workspace includes all directories in the apps and packages folders.&lt;/p&gt;




&lt;p&gt;Create the apps and packages directory&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir -p apps packages
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will break down our apps into two &lt;strong&gt;&lt;code&gt;apps/website&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;apps/api&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;**&lt;code&gt;apps/website&lt;/code&gt; **The website directory, which we will configure using NextJS. To configure this, we need to change our current working directory to apps.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd apps

pnpm create next-app website
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;&lt;code&gt;apps/api&lt;/code&gt;&lt;/strong&gt; The api directory, which we will configure using NestJs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# monorepo/apps (current working directory)

nest new api --package-manager=pnpm # creates a new NestJS project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Create a Shared UI Library
&lt;/h2&gt;

&lt;p&gt;Great job! You have got your apps set up. Now, let's take things to the next level by creating a shared UI library. This is where the magic of monorepos starts to shine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;packages/library&lt;/code&gt;&lt;/strong&gt; The library directory will contain our shared UI components.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# monorepo 

cd packages 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir library &amp;amp;&amp;amp; cd library &amp;amp;&amp;amp; pnpm init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# monorepo/packages/library/package.json 
{
  "private": true,  
  "name": "library",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" &amp;amp;&amp;amp; exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note we declare it as private by setting privateproperty to true; this is because we don't want to publish it to NPM or somewhere else, but rather just reference and use it locally within our workspace.&lt;/p&gt;

&lt;p&gt;In our library folder, we will install the following: React as a dependency and TypeScript as a development dependency.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# monorepo

pnpm add --filter library react  
pnpm add --filter library typescript -D
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;&lt;code&gt;--filter library&lt;/code&gt;&lt;/strong&gt; in the installation command, tells pnpm to install these NPM packages locally to the library package. &lt;/p&gt;

&lt;p&gt;To keep things simple, we will make use of the TypeScript compiler to compile our package. We could have a more comprehensive arrangement for bundling numerous files together, using something like Rollup or Vite.&lt;/p&gt;

&lt;p&gt;To use the TypeScript compiler, we are going to create a tsconfig.json file at the root of our library directory and add the configuration below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# monorepo/packages/library/tsconfig.json 
{  
  "compilerOptions": {  
    "jsx": "react-jsx",  
    "allowJs": true,  
    "esModuleInterop": true,  
    "allowSyntheticDefaultImports": true,  
    "module": "commonjs",  
    "outDir": "./dist"  
  },  
  "include": ["."],  
  "exclude": ["dist", "node_modules", "**/*.spec.ts"]  
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, we will update the package.json file main property to match the output directory specified in &lt;strong&gt;&lt;code&gt;tsconfig.json&lt;/code&gt;&lt;/strong&gt; and also add a build script.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# monorepo/packages/library/package.json 
{
  "private": true,
  "name": "library",
  "version": "1.0.0",
  "description": "",
  "main": "dist/index.js",
  "scripts": {
    "build": "rm -rf dist &amp;amp;&amp;amp; tsc"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "react": "^18"
  },
  "devDependencies": {
    "typescript": "^5.5.4"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Creating our first shared library UI component
&lt;/h2&gt;

&lt;p&gt;Let us create a simple select component first Create the file in our library directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# monorepo/packages/library 

touch Select.tsx
# monorepo/packages/library/Select.tsx 

function CustomSelect(props: any) {  
   return &amp;lt;select onChange={(e) =&amp;gt; props.onChange(e)}&amp;gt;
            {props.children}
          &amp;lt;/select&amp;gt;;  
}

export default CustomSelect;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We also want to have a public API where we export components to be used outside of our library package. To achieve this, we will create an index.tsx file and export the Select component we just created.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# monorepo/packages/library 

touch index.tsx
# monorepo/packages/library/index.tsx 

export * from './Select';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Building our library
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pnpm --filter library build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Consuming our library package from the NextJs app
&lt;/h2&gt;

&lt;p&gt;Congratulations! You just created your own shared UI library component. To use this library inside our NextJS app in the apps directory, you can add it using pnpm or manually.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pnpm add library --filter website --workspace
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This adds the library package as a website dependency&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "name": "website",
  "version": "0.1.0",
  "private": true,
  ...,
  "dependencies": {
    "library": "workspace:*",
    ...
  },
  "devDependencies": {
    ...  
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We are almost done. Let us update the library dependency value to &lt;strong&gt;&lt;code&gt;"workspace:*"&lt;/code&gt;&lt;/strong&gt;. This means we want to resolve the package locally rather than from a registry like NPM, and * means we want to always use the latest version.&lt;/p&gt;

&lt;p&gt;Now to use our Select Component, all we have to do is import it.&lt;/p&gt;

&lt;p&gt;Start up the development server to see the component in action.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pnpm --filter website dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Setting up scripts for the monorepo
&lt;/h2&gt;

&lt;p&gt;In our root &lt;strong&gt;&lt;code&gt;package.json&lt;/code&gt;&lt;/strong&gt; file, we are going to add some scripts to make our workflow easier.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# monorepo/package.json

"scripts": {
 "dev": "pnpm run - parallel - filter \"./apps/**\" dev",
 "build": "pnpm run - recursive - filter \"./apps/**\" build",
 "test": "pnpm run - recursive - filter \"./apps/**\" test",
 "lint": "pnpm run - recursive - filter \"./apps/**\" lint"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Congratulations! We did it. This process shows how to set up a monorepo using pnpm. For a real project, I would recommend using any of the monorepo tools available; I mentioned a few in my previous post. They offer some advantages over pnpm.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/Mr-emeka/monorepo-pnpm" rel="noopener noreferrer"&gt;GitHub Repository&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Hire Me
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://dub.sh/aimes" rel="noopener noreferrer"&gt;Portfolio&lt;/a&gt; &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Understanding Monorepo: A Deeper Dive</title>
      <dc:creator>Ukpai Chukwuemeka</dc:creator>
      <pubDate>Sat, 31 Aug 2024 19:46:49 +0000</pubDate>
      <link>https://dev.to/aimes/understanding-monorepo-a-deeper-dive-8lh</link>
      <guid>https://dev.to/aimes/understanding-monorepo-a-deeper-dive-8lh</guid>
      <description>&lt;p&gt;Hey Devs! , In our previous chat, we talked about monorepos.&lt;/p&gt;

&lt;p&gt;If you missed the previous chat Understanding Monorepo, here’s a quick recap; A monorepo is one big repository that houses all of your projects. These projects, packages, or libraries are typically linked by common rationale or business requirements.&lt;/p&gt;

&lt;p&gt;Now, you might be thinking, Why would I want to put all my projects into one big repository? Fair question!&lt;/p&gt;

&lt;p&gt;In this post we will be diving a little deeper into the rabbit hole, so grab your favorite caffeinated brew.&lt;/p&gt;

&lt;p&gt;Let us look at some of the benefits of monorepo:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Benefits of monorepo&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Code Sharing:&lt;/strong&gt; It is super easy to share code, packages, and libraries in a monorepo, the copy-and-paste marathons between projects are no more You can write it once and use it across all platforms. You can even publish directly to a public registry.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Code Reuse:&lt;/strong&gt; Monorepo makes your work efficient, the clever little function you wrote at 2 AM. You can reuse it across apps, packages, or libraries inside a monorepo with just a quick import.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Sharing Types:&lt;/strong&gt; As a typescript fan, your types can now roam free across your codebase like happy little electrons.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Easy Bugs Fix:&lt;/strong&gt; In a monorepo, resolving bugs across multiple projects is easy. It eliminates the need to hop between repositories like a caffeinated kangaroo.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Faster Development:&lt;/strong&gt; Words on the street is that monorepos are flipping software development on its head. Some folks are saying it is like strapping a rocket to your development process — you build, ship, and tweak faster than ever.&lt;/p&gt;

&lt;p&gt;Monorepos are pretty sweet, right? But hold up monorepos aren’t all unicorns and rainbows. They’ve got their challenges too.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Monorepo Challenges&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Managing a large codebase can be complex, especially for new team members.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Merging changes and resolving conflicts can be more difficult if not well configured.&lt;br&gt;
Specialized tools are often needed to manage monorepos effectively.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cloning a large monorepo codebase might take a lot of time, especially with bad connectivity, but i guess this doesn’t count.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A monorepo requires a more sophisticated CI setup.&lt;br&gt;
Lastly, it requires you to think about large-scale changes.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Choosing the Right Monorepo Tool&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To mitigate the challenges and fully leverage the benefits of monorepos, selecting the right tools is crucial and there are various tools out there. These tools are also what makes monorepo tick. Some popular options include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;NX:&lt;/strong&gt; A versatile, smart, and fast-build system with features like caching and parallel execution.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Bazel:&lt;/strong&gt; Google’s build system on steroids, A high-performance build system, especially suitable for large-scale projects, it is open source and i believe it is owned and used by Google internally too.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;NPM, Pnpm, and Yarn:&lt;/strong&gt; The holy trinity of JavaScript package managers, they are popular package managers that can be used in monorepo setups. I think this too can be challenging to manage.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Turbo Repo:&lt;/strong&gt; A modern monorepo tool with a focus on performance and developer experience. Vercel’s new kid on the block&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Lerna:&lt;/strong&gt; The OG monorepo tool with a focus on flexibility.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Rush stack:&lt;/strong&gt; Microsoft’s scalable monorepo manager.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Git submodules:&lt;/strong&gt; A more traditional approach, but can be challenging to manage. Also for those who like to keep it old-school.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Monorepo structure&lt;/strong&gt;&lt;br&gt;
There are two types of monorepo structures, and the structure is determined by what you plan on building or your use case.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Package-centric&lt;/strong&gt; is used for developing and publishing an organized collection of reusable packages. This is a common setup in the open-source world and can be seen in repositories such as Angular, React, Vue, and many others. Those repos are characterized by most commonly having a packages folder which are then commonly published to some public registry such as NPM.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;App-centric&lt;/strong&gt; is used mainly for developing applications and products. This is a common setup in companies. Such repos are characterized by having an apps and packages or libs folder, where the apps folder contains the buildable and deployable applications, while the packages or libs folder contains libraries that are specific to one or multiple applications that are being developed within the monorepo. You can still also publish some of these libs to a public registry.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Your Thoughts on Monorepos&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Do you think the benefits of monorepos outweigh the challenges? Have you had experience using monorepos in your projects? Share your thoughts and experiences in the comments below.&lt;/p&gt;

&lt;p&gt;In our next post, we will dive deeper by setting up a monorepo using just pnpm.&lt;/p&gt;

&lt;p&gt;Stay tuned! Happy coding!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Understanding Monorepo</title>
      <dc:creator>Ukpai Chukwuemeka</dc:creator>
      <pubDate>Thu, 22 Aug 2024 10:16:05 +0000</pubDate>
      <link>https://dev.to/aimes/understanding-monorepo-1m0j</link>
      <guid>https://dev.to/aimes/understanding-monorepo-1m0j</guid>
      <description>&lt;p&gt;Hey there, fellow devs! Ever felt like you’re drowning in a sea of repositories? Well, let me introduce you to monorepo. It might just be your new best friend.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a monorepo?
&lt;/h2&gt;

&lt;p&gt;So picture this: instead of juggling a lot of different repositories, you only need one big repository that houses all of your projects. That is a monorepo, in a nutshell. But do not get it twisted; it is not the same as that monolithic architecture we all love to hate.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fskwe2gwvh1vlqoovav7j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fskwe2gwvh1vlqoovav7j.png" alt="mono repo illustration from the web" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I recently discovered monorepo and was pleasantly impressed by it. Monorepo has existed since the early 2000s! and tech behemoths like Google and Facebook have been employing them for years. Talk about arriving late to the party.&lt;/p&gt;

&lt;p&gt;Monorepos are not entirely the new kid on the block, but they’ve recently gained much attention. And why is that? As our initiatives become increasingly connected, we will require smarter methods to keep everything under control.&lt;/p&gt;

&lt;h2&gt;
  
  
  Do you want to see monorepos in action? You can check out the list below:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;React Email (GitHub: &lt;a href="https://github.com/resend/react-email" rel="noopener noreferrer"&gt;resend/react-email&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Highstorm (GitHub: &lt;a href="https://github.com/chronark/highstorm" rel="noopener noreferrer"&gt;chronark/highstorm&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Dub (GitHub: &lt;a href="https://github.com/dubinc/dub" rel="noopener noreferrer"&gt;dubinc/dub&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;React (GitHub: &lt;a href="https://github.com/facebook/react" rel="noopener noreferrer"&gt;Facebook/react&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Angular (GitHub: &lt;a href="https://github.com/angular/angular" rel="noopener noreferrer"&gt;angular/angular&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Did you look at the list and still could not spot why they are monorepos?
&lt;/h2&gt;

&lt;p&gt;Well, here is how you can easily spot a monorepo. If you’re browsing through a repository and notice multiple packages or apps inside, there is a big chance you just stumbled upon a monorepo. It’s that simple.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh68ftkekwjmz4e6dzxp6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh68ftkekwjmz4e6dzxp6.png" alt="React Repository from github" width="720" height="193"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Stick around, and we will dig into why they are awesome, how to set up one, and the tools that make them tick. Trust me, whether you are a newbie or a seasoned pro, this monorepo stuff could seriously up your game.&lt;/p&gt;

&lt;p&gt;Ready to dive in? Let’s go!&lt;/p&gt;

</description>
      <category>monorepo</category>
      <category>beginners</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>Pre-deployment Checklist: Setting up Husky 🐶</title>
      <dc:creator>Ukpai Chukwuemeka</dc:creator>
      <pubDate>Mon, 12 Aug 2024 10:36:47 +0000</pubDate>
      <link>https://dev.to/aimes/pre-deployment-checklist-setting-up-husky-4i2k</link>
      <guid>https://dev.to/aimes/pre-deployment-checklist-setting-up-husky-4i2k</guid>
      <description>&lt;p&gt;As developers, we have all felt the sting of build and test failures after pushing our code. I’ve found that having a pre-deployment checklist can save a lot of headaches. In this article, we will set up Husky to automate crucial checks before committing and pushing code using the pre-commit and pre-push hooks in a Node.js project. This would help us catch potential issues early in the development process.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe55rxswvr50evchwbh28.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe55rxswvr50evchwbh28.png" alt="build failing" width="668" height="474"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, I know what you’re thinking aren’t there CI/CD pipelines for this kind of thing? And you’re right, there are. But here’s my take: why push code that’s destined to break when you can catch those pesky errors before they ever leave your machine? It’s like giving your code a quick once-over before it heads out the door. Trust me, your future self (and your team) will thank you.&lt;/p&gt;

&lt;p&gt;To get started, create a new directory or clone an existing repository&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir website # creates a new folder
or 
git clone repository # clones a git repository
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd website #change directory 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm init -y # Initializes a new Node.js project with default settings
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We also need to initialize git (assuming it's already a git repository; there would be no need for this)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git init  # initializes a new GitHub repository
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once these steps are completed, install Husky as a dev dependency; &lt;em&gt;hence the -D.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We don’t want to push our &lt;em&gt;node_modules&lt;/em&gt; and environment variable (&lt;em&gt;.env&lt;/em&gt;) files, so we create a &lt;em&gt;.gitignore&lt;/em&gt; file and add &lt;em&gt;node_modules&lt;/em&gt; to it.&lt;/p&gt;

&lt;p&gt;PS: You can go ahead and add files you don't want to push online, like your environment variable.&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 husky@latest -D   # installs husky as dev dependencies

touch .gitignore &amp;amp;&amp;amp; echo node_modules &amp;gt;&amp;gt; .gitignore   # create a new file called .gitignore and writes node_modules into the file

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

&lt;/div&gt;



&lt;p&gt;Once the previous steps are completed, We can go ahead and initialize Husky&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx husky init # initializes husky in the project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Husky creates a new &lt;em&gt;.husky&lt;/em&gt; directory&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmwmmwp52b0lkkcycuy9u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmwmmwp52b0lkkcycuy9u.png" alt="Folder Structure" width="460" height="347"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Inside this directory, we are going to create our two new hooks: &lt;em&gt;pre-commit&lt;/em&gt; and &lt;em&gt;pre-push&lt;/em&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch .husky/pre-commit &amp;amp;&amp;amp; touch .husky/pre-push # creates 2 new files inside the .husky directory

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

&lt;/div&gt;



&lt;p&gt;Inside the &lt;em&gt;pre-commit&lt;/em&gt; hook file, we are going to run our test&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fodzrhjr3oc4neflsvucm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fodzrhjr3oc4neflsvucm.png" alt="Pre Commit File" width="600" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and in the &lt;em&gt;pre-push&lt;/em&gt;, we want to run our application build&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fluetipcbbglq9ti8xdya.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fluetipcbbglq9ti8xdya.png" alt="Pre Push File" width="542" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: This is just an example, and in your case, you can decide to lint your commit messages, code, run tests, etc. upon committing or pushing.&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You can also implement this using Git pre-commit and pre-push hooks. Check out the article below by &lt;a href="https://benkaythe1st.medium.com/" rel="noopener noreferrer"&gt;Benjamin Chibuzor-Orie&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://faun.pub/how-to-automate-tests-on-each-push-to-the-repository-378fdcca7f8e" rel="noopener noreferrer"&gt;How to run tests automatically on each push to the repository&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;By setting up Husky with these &lt;em&gt;pre-commit&lt;/em&gt; and &lt;em&gt;pre-push&lt;/em&gt; hooks, you’ve added an extra layer of quality assurance to your development process. This simple setup can save you time and prevent embarrassing mistakes from making their way into your repository. Remember, you can customize these hooks to fit your project’s specific needs. Happy coding!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>The Developer's Pre-Deployment Checklist: Catching Bugs Before They Fly</title>
      <dc:creator>Ukpai Chukwuemeka</dc:creator>
      <pubDate>Mon, 05 Aug 2024 13:42:34 +0000</pubDate>
      <link>https://dev.to/aimes/the-developers-pre-deployment-checklist-catching-bugs-before-they-fly-4h7</link>
      <guid>https://dev.to/aimes/the-developers-pre-deployment-checklist-catching-bugs-before-they-fly-4h7</guid>
      <description>&lt;p&gt;In high-stakes professions like aviation and surgery, checklists are essential tools for reducing errors and improving outcomes. They serve as structured reminders of critical steps, ensuring that nothing is overlooked. During my experience as a front-end developer, I've learned the hard way how easily bugs can slip through the cracks, bugs that could cost a company thousands of dollars. This is where the importance of checklists in development comes into play.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Importance of Checklists in Development&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Reduce Human error&lt;/strong&gt;&lt;br&gt;
Developers are humans, and humans make mistakes. A checklist helps ensure that all necessary steps are completed, reducing the likelihood of missing critical tasks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Ensure Consistency Across Team Members&lt;/strong&gt;&lt;br&gt;
Checklists standardize processes, ensuring that every team member follows the same steps. This consistency is crucial, especially in larger teams where different developers might have varying levels of experience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Improve Code Quality and reliability.&lt;/strong&gt;&lt;br&gt;
By systematically checking each part of the code, developers can catch potential issues early, leading to higher-quality, more reliable software.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Save Time and Resources in the Long Run&lt;/strong&gt;&lt;br&gt;
While it might seem like an extra step, using a checklist can save significant time and resources by preventing bugs that would be costly to fix post-deployment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Integrating Checklists into Your Workflow&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In today's software engineering processes, we can use tools like Continuous Integration/Continuous Deployment (CI/CD) and Husky to automate parts of the checklist, ensuring code quality and consistency. However, having a personal checklist before pushing code is equally important.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Pre-Deployment Checklist&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Code Review&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ensure that at least one other team member reviews all code.&lt;/li&gt;
&lt;li&gt;Address any feedback or requests for changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Testing&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run all unit tests and ensure they pass.&lt;/li&gt;
&lt;li&gt; Perform integration tests to verify the interaction between different parts of the application.&lt;/li&gt;
&lt;li&gt;Conduct end-to-end tests to simulate real-world user scenarios.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Linting and Formatting&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run the linter to catch syntax and style issues.&lt;/li&gt;
&lt;li&gt;Ensure code is formatted correctly using a tool like Prettier.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Performance Checks&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Analyze the performance of the new code and ensure it meets the application's performance benchmarks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. Security Review&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check for common security vulnerabilities.&lt;/li&gt;
&lt;li&gt;Ensure that sensitive data is handled properly and securely.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;6. Dependency Updates&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Verify that all dependencies are up-to-date and compatible with the codebase.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;7. Documentation&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Update any relevant documentation to reflect changes in the codebase.&lt;/li&gt;
&lt;li&gt;Ensure comments and documents are clear and informative.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;8. Final Verification&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Manually test the application to catch any issues that automated tests might have missed.&lt;/li&gt;
&lt;li&gt;Verify that all necessary environment variables and configuration settings are correctly set.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By incorporating such a checklist into your workflow, you can catch bugs before they fly, ensuring a smoother deployment process and a more robust application. While tools and automation are invaluable, nothing beats the diligence and thoroughness of a well-prepared developer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Share Your Checklist&lt;/strong&gt;&lt;br&gt;
Every development team has unique needs and workflows. What does your pre-deployment checklist look like? Share your checklist in the comments below, and let's learn from each other's best practices. Your insights could help fellow developers improve their processes and deliver better software.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>developer</category>
      <category>learning</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Data Structure 102: Types of Data Structure</title>
      <dc:creator>Ukpai Chukwuemeka</dc:creator>
      <pubDate>Tue, 05 Jul 2022 14:31:45 +0000</pubDate>
      <link>https://dev.to/aimes/data-structure-102-types-of-data-structure-4c5j</link>
      <guid>https://dev.to/aimes/data-structure-102-types-of-data-structure-4c5j</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In my previous post &lt;a href="https://dev.to/mremeka/data-structures-101-introduction-to-data-structures-and-algorithms-4k5e"&gt;Data Structure 101&lt;/a&gt; we were able to understand what data-structure is and algorithm&lt;/p&gt;

&lt;p&gt;On that note, we would be looking at the types of data-structure.&lt;br&gt;
There are two main types of data structures, These includes;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Primitive Data Structure&lt;/strong&gt; - They store the data of only one type. &lt;br&gt;
Examples of primitive data structure are integer, character, float.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Non-Primitive Data Structure&lt;/strong&gt; - is a type of data structure that can store the data of more than one type. Non primitive data structure are classified into two i.e., linear and non-linear data structure&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LINEAR DATA STRUCTURE&lt;/strong&gt;&lt;br&gt;
Elements are stored in a sequential order. Examples; Arrays, Queues, Stacks and Linked Lists.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NON-LINEAR DATA STRUCTURE&lt;/strong&gt;&lt;br&gt;
Elements are not stored in sequential order. Examples; trees and graphs are non-linear data structures.&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Data Structures 101: Introduction to Data Structures and Algorithms.</title>
      <dc:creator>Ukpai Chukwuemeka</dc:creator>
      <pubDate>Mon, 20 Jun 2022 17:27:34 +0000</pubDate>
      <link>https://dev.to/aimes/data-structures-101-introduction-to-data-structures-and-algorithms-4k5e</link>
      <guid>https://dev.to/aimes/data-structures-101-introduction-to-data-structures-and-algorithms-4k5e</guid>
      <description>&lt;h2&gt;
  
  
  What is Data Structure?
&lt;/h2&gt;

&lt;p&gt;A data structure is a named location that can be used to store and organise data. And, an algorithm is a collection of steps to solve a particular problem.&lt;/p&gt;

&lt;p&gt;Learning data structures and algorithms allow us to write efficient and optimised computer programs.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is an Algorithm?
&lt;/h2&gt;

&lt;p&gt;An algorithm is a set of well-defined instructions to solve a particular problem. It takes a set of inputs and produces the desired output. &lt;br&gt;
&lt;strong&gt;For example;&lt;/strong&gt;&lt;br&gt;
An algorithm to add two numbers:&lt;br&gt;
Take two number inputs&lt;br&gt;
Add numbers using the + operator&lt;br&gt;
Display the result &lt;/p&gt;

&lt;h2&gt;
  
  
  Qualities of Good Algorithms
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Input and output should be defined precisely.&lt;/li&gt;
&lt;li&gt;Each step in the algorithm should be unambiguous.&lt;/li&gt;
&lt;li&gt;Algorithms should be the most effective among many different ways to solve a problem.&lt;/li&gt;
&lt;li&gt;An algorithm shouldn't include computer code. Instead, the algorithm should be written in such a way that it can be used in different programming languages.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;With this knowledge, we can choose the most appropriate data structures for specific projects.&lt;/p&gt;

</description>
      <category>dsa</category>
      <category>algorithms</category>
      <category>software</category>
      <category>programming</category>
    </item>
    <item>
      <title>Web 3.0 vs Web 2.0</title>
      <dc:creator>Ukpai Chukwuemeka</dc:creator>
      <pubDate>Mon, 07 Mar 2022 05:57:00 +0000</pubDate>
      <link>https://dev.to/aimes/web-30-vs-web-20-5073</link>
      <guid>https://dev.to/aimes/web-30-vs-web-20-5073</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft65uww5tr7yvlat9fdp4.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft65uww5tr7yvlat9fdp4.jpeg" alt="Image description" width="600" height="529"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hi, I recently ventured into the web3 space and would like to share with you the difference between web3.0 and web2.0&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Web3.0
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Web3.0&lt;/strong&gt; is a fast growing iteration of world wide web based on blockchain technology. Web3 has to do with websites using blockchain technologies.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What's Web2.0
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Web2.0&lt;/strong&gt; is an iteration of world wide web but without blockchain technology.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpfyq7rwotdousc8a32gt.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpfyq7rwotdousc8a32gt.jpg" alt="Image description" width="687" height="500"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Web3.0 vs Web2.0&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Web 3.0 will provide access to connected data in a decentralised way &lt;strong&gt;VS&lt;/strong&gt; Web2.0, which primarily stores data in centralised locations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Web 3.0 payment apps require no personal data and can't prevent payments &lt;strong&gt;VS&lt;/strong&gt; Web2.0 Payment service may decide to not allow payments for certain types of work.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Web 3.0 is decentralised, which means rather than controlled by governments and corporations, as is the case with today’s internet, it's not &lt;strong&gt;VS&lt;/strong&gt; Web2.0 is centralised; data can be manipulated by individuals, governments and corporations.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Some examples of web 3.0 applications&lt;/strong&gt;&lt;br&gt;
Let’s look at some examples of web 3.0:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://bitcoin.org/en/" rel="noopener noreferrer"&gt;Bitcoin&lt;/a&gt; – The original cryptocurrency has been around for more than ten years, and the protocol itself is decentralised, although not all of its ecosystem is.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://diasporafoundation.org/" rel="noopener noreferrer"&gt;Diaspora&lt;/a&gt; – Non-profit, decentralised social network&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://opensea.io/" rel="noopener noreferrer"&gt;OpenSea&lt;/a&gt; – A marketplace for buying and selling NFTs, itself built on the Ethereum blockchain&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://uniswap.org/" rel="noopener noreferrer"&gt;Uniswap&lt;/a&gt; – Decentralised cryptocurrency exchange&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Examples of web 2.0 applications&lt;/strong&gt;&lt;br&gt;
Web 2.0 applications are not decentralised, data can be manipulated, some examples of web 2.0:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Facebook&lt;/li&gt;
&lt;li&gt;Dev.to &lt;/li&gt;
&lt;li&gt;Twitter&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://blockgames.gg/" rel="noopener noreferrer"&gt;Blockgames&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://nestcoin.com/" rel="noopener noreferrer"&gt;Nestcoin&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://zuri.team/" rel="noopener noreferrer"&gt;Zuri&lt;/a&gt;&lt;/p&gt;

</description>
      <category>web3</category>
      <category>web2</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
