<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Sixtus Anyanwu</title>
    <description>The latest articles on Forem by Sixtus Anyanwu (@sparklesix).</description>
    <link>https://forem.com/sparklesix</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%2F355366%2F4c77a164-ec34-48e3-9ee1-3d123556cd58.jpg</url>
      <title>Forem: Sixtus Anyanwu</title>
      <link>https://forem.com/sparklesix</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/sparklesix"/>
    <language>en</language>
    <item>
      <title>Setting Up Your Own AI Assistant (Clawdbot) on Hetzner</title>
      <dc:creator>Sixtus Anyanwu</dc:creator>
      <pubDate>Sun, 25 Jan 2026 10:34:50 +0000</pubDate>
      <link>https://forem.com/sparklesix/setting-up-your-own-ai-assistant-clawdbot-on-hetzner-4pfh</link>
      <guid>https://forem.com/sparklesix/setting-up-your-own-ai-assistant-clawdbot-on-hetzner-4pfh</guid>
      <description>&lt;p&gt;Clawdbot gives you a private, always-available AI companion that lives on your server and communicates via Telegram, WhatsApp, Discord, or similar apps. Unlike cloud-based chat interfaces, it stays online 24/7, retains full context from past interactions, and can even initiate contact when needed.&lt;/p&gt;

&lt;p&gt;This tutorial walks you through deploying Clawdbot on a low-cost Hetzner Cloud VPS from scratch.&lt;/p&gt;

&lt;h3&gt;
  
  
  Phase 1: Provision Your Hetzner VPS
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Head to the Hetzner Cloud website
Visit &lt;a href="https://hetzner.com/cloud" rel="noopener noreferrer"&gt;https://hetzner.com/cloud&lt;/a&gt; and sign up or log in.&lt;/li&gt;
&lt;/ol&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%2Fgqrd8txbqe04iiti3oi9.jpeg" 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%2Fgqrd8txbqe04iiti3oi9.jpeg" alt=" " width="800" height="834"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Start a fresh project&lt;br&gt;&lt;br&gt;
In the console, select &lt;strong&gt;+ New Project&lt;/strong&gt; and give it a clear name like “Personal-AI” or “Clawdbot-Home”.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Launch a server instance&lt;br&gt;&lt;br&gt;
Inside your project, hit &lt;strong&gt;+ Create Server&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select configuration options  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Location&lt;/strong&gt;: Choose a German datacenter (usually the most economical)
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Operating system&lt;/strong&gt;: Ubuntu 24.04
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instance type&lt;/strong&gt;: Go with Shared vCPU → CX33 (4 vCPU / 8 GB RAM) — priced at roughly €5.49/month
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IPv4 address&lt;/strong&gt;: Leave public IPv4 enabled&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Attach an SSH public key&lt;br&gt;&lt;br&gt;
If you need to generate a key pair:&lt;br&gt;&lt;br&gt;
Open a terminal (on macOS/Linux) and execute:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   ssh-keygen -t ed25519 -C "you@example.com"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Accept the default file path by pressing Enter. Then view and copy the public key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   cat ~/.ssh/id_ed25519.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Paste that entire line into the SSH keys section in Hetzner.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Finalize and deploy
Name the server something like “ai-assistant”, review, then click &lt;strong&gt;Create &amp;amp; Buy Now&lt;/strong&gt;.
Wait ~30–60 seconds. Once ready, copy the displayed public IPv4 address.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Phase 2: Server Access and Software Setup
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Establish an SSH connection
In your terminal:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   ssh root@YOUR_SERVER_IP_HERE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Accept the host key fingerprint by typing &lt;code&gt;yes&lt;/code&gt;.  &lt;/p&gt;

&lt;p&gt;(If your key is in a non-default location, add the &lt;code&gt;-i&lt;/code&gt; flag:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   ssh -i ~/.ssh/my-special-key root@YOUR_SERVER_IP_HERE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Refresh all packages
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   apt update &amp;amp;&amp;amp; apt upgrade -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Install the latest Node.js (v22 recommended)
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
   apt install -y nodejs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Confirm the version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   node -v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see something like v22.x.x.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Install Clawdbot globally&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g clawdbot@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Launch the setup assistant&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;clawdbot onboard --install-daemon
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;This interactive wizard handles model credentials, storage paths, messaging channels, and daemon/service registration so the bot runs persistently.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Phase 3: Connect Telegram (Most Popular Option)
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Register a new Telegram bot&lt;br&gt;&lt;br&gt;
In Telegram, find &lt;strong&gt;&lt;a class="mentioned-user" href="https://dev.to/botfather"&gt;@botfather&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Send: &lt;code&gt;/newbot&lt;/code&gt;&lt;br&gt;&lt;br&gt;
Choose a display name (e.g. “Personal Helper”)&lt;br&gt;&lt;br&gt;
Choose a username ending in “bot” (e.g. &lt;code&gt;myname_helper_bot&lt;/code&gt;)&lt;br&gt;&lt;br&gt;
Copy the &lt;strong&gt;HTTP API token&lt;/strong&gt; BotFather provides.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Retrieve your own Telegram user ID&lt;br&gt;&lt;br&gt;
Search for &lt;strong&gt;@userinfobot&lt;/strong&gt;, send any message → it replies with your numeric ID. Copy that number.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Provide details during the wizard&lt;br&gt;&lt;br&gt;
When prompted:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Paste the bot token
&lt;/li&gt;
&lt;li&gt;Enter your user ID in the &lt;code&gt;allowFrom&lt;/code&gt; field (this whitelist prevents unauthorized access)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Phase 4: Link Anthropic (Claude) Access
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Obtain an Anthropic API key&lt;br&gt;&lt;br&gt;
Visit &lt;a href="https://console.anthropic.com" rel="noopener noreferrer"&gt;https://console.anthropic.com&lt;/a&gt; → create a new key (begins with &lt;code&gt;sk-ant-…&lt;/code&gt;).  &lt;/p&gt;

&lt;p&gt;Already have Claude Pro / Max?&lt;br&gt;&lt;br&gt;
You may use subscription access instead of pay-per-token. (Some setups allow exporting a session token via the Claude desktop app or CLI—check current docs if needed.)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Input credentials in the wizard&lt;br&gt;&lt;br&gt;
Select &lt;strong&gt;API Key&lt;/strong&gt; when asked for Anthropic authentication and paste your key.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Phase 5: Wrap Up and Verify
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Finish all wizard questions&lt;br&gt;&lt;br&gt;
Stick with defaults for most remaining options unless you have specific preferences. The wizard sets up a background service so Clawdbot auto-starts and survives reboots.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Check service status&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;clawdbot status
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Look for “gateway: running” or similar healthy indicators.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Send your first message!&lt;br&gt;&lt;br&gt;
Open Telegram, search for your new bot, and type anything. It should reply quickly. Success! 🎉&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Handy Commands Reference&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Server / Process Control&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;clawdbot status&lt;/code&gt; → overall health snapshot
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;clawdbot logs --follow&lt;/code&gt; → tail live output
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;clawdbot gateway restart&lt;/code&gt; → quick reboot of the messaging layer
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;clawdbot health&lt;/code&gt; → run diagnostics&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;In-chat Telegram Commands&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;/new&lt;/code&gt; → reset current thread
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/model&lt;/code&gt; → change active LLM
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/compact&lt;/code&gt; → shorten long context
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;stop&lt;/code&gt; → interrupt active operation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Quick Fixes&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bot silent? → &lt;code&gt;clawdbot status --all&lt;/code&gt; and &lt;code&gt;clawdbot logs --follow&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Want to restart setup? → &lt;code&gt;clawdbot reset&lt;/code&gt; then re-run &lt;code&gt;clawdbot onboard --install-daemon&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;SSH keeps asking for password? → Ensure you're using the correct key: &lt;code&gt;ssh -i /path/to/key root@IP&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Next Steps &amp;amp; Customization&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
After setup, personalize behavior by editing:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;~/clawd/SOUL.md&lt;/code&gt; → bot personality &amp;amp; tone
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;~/clawd/USER.md&lt;/code&gt; → your preferences, routines, context
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Enjoy your private, always-on AI companion!&lt;/p&gt;

</description>
      <category>clawdbot</category>
      <category>ai</category>
      <category>hetzner</category>
      <category>chatgpt</category>
    </item>
    <item>
      <title>Declutta Backend — Case Study</title>
      <dc:creator>Sixtus Anyanwu</dc:creator>
      <pubDate>Sat, 15 Nov 2025 03:55:26 +0000</pubDate>
      <link>https://forem.com/sparklesix/declutta-backend-case-study-4fjn</link>
      <guid>https://forem.com/sparklesix/declutta-backend-case-study-4fjn</guid>
      <description>&lt;h1&gt;
  
  
  Declutta Backend — Case Study
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;A secure, production-ready marketplace API for buying, selling, and giving away unwanted items&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;Declutta is a marketplace platform that connects people who want to declutter their homes with buyers looking for secondhand items. Users can list items for sale or giveaway, chat with potential buyers, manage wishlists, and complete secure transactions through Paystack integration.&lt;/p&gt;

&lt;p&gt;I architected and built the complete backend infrastructure using AdonisJS and TypeScript, focusing on payment security, data integrity, and developer experience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Live API:&lt;/strong&gt; &lt;a href="https://github.com/sparkle666/declutta-backend" rel="noopener noreferrer"&gt;Backend Repository&lt;/a&gt;&lt;/p&gt;

&lt;h2&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%2Fix3j8yk0rrl1trpfvtuq.png" alt=" " width="800" height="429"&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  The Challenge
&lt;/h2&gt;

&lt;p&gt;Building a marketplace backend requires solving several complex problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Payment Security&lt;/strong&gt;: How do we prevent fraudulent transactions and ensure payments are genuinely verified before releasing items?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-product Transactions&lt;/strong&gt;: Users need to purchase multiple items in a single checkout session with accurate order tracking&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real-time Communication&lt;/strong&gt;: Buyers and sellers need to negotiate prices and arrange pickups through in-app messaging&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inventory Management&lt;/strong&gt;: Products must be marked as sold atomically to prevent double-selling&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Team Collaboration&lt;/strong&gt;: The codebase needed to support multiple developers working concurrently without migration conflicts&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  My Role
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Full-Stack Backend Developer&lt;/strong&gt; — End-to-end ownership of the API&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Designed the database schema and relationships for orders, products, users, and messaging&lt;/li&gt;
&lt;li&gt;Implemented secure payment flows with server-side verification&lt;/li&gt;
&lt;li&gt;Built REST APIs for product listings, checkout, chat, wishlists, and user management&lt;/li&gt;
&lt;li&gt;Created migration strategies that prevent conflicts in collaborative environments&lt;/li&gt;
&lt;li&gt;Documented endpoints with REST Client examples for seamless frontend integration&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Technical Architecture
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Tech Stack
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Runtime&lt;/strong&gt;: Node.js with AdonisJS 6 framework&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Language&lt;/strong&gt;: TypeScript for type safety&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database&lt;/strong&gt;: PostgreSQL (production) / SQLite (development)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ORM&lt;/strong&gt;: Lucid ORM with relationship eager-loading&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Payment Gateway&lt;/strong&gt;: Paystack with server-side verification&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validation&lt;/strong&gt;: Vine validator library&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Image Storage&lt;/strong&gt;: Vercel Blob for product photos&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Core Models &amp;amp; Relationships
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User
├── Products (seller)
├── Orders (buyer)
├── CartItems
├── FavouriteProducts
├── ShippingAddresses
├── ChatMessages
└── Wants (item requests)

Product
├── OrderItems
├── Reviews
├── Category
└── Images

Order
├── OrderItems
└── User (buyer)

OrderItem
├── Order
└── Product
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Key Features &amp;amp; Implementation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Secure Multi-Product Checkout
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;The Problem&lt;/strong&gt;: Accepting payment confirmation from clients opens the door to fraud. Users could manipulate responses and claim they paid when they didn't.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Solution&lt;/strong&gt;: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Client initiates payment through Paystack and receives a &lt;code&gt;reference&lt;/code&gt; token&lt;/li&gt;
&lt;li&gt;Backend independently verifies the transaction with Paystack's API using our secret key&lt;/li&gt;
&lt;li&gt;Only after successful verification do we create the order and mark products as sold&lt;/li&gt;
&lt;li&gt;Each order stores the verified &lt;code&gt;transaction_id&lt;/code&gt; for audit trails&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Code Example&lt;/strong&gt; (&lt;code&gt;orders_controller.ts&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;store&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;auth&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;response&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;products&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;reference&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;validateUsing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;createOrderValidator&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="c1"&gt;// Server-side verification - never trust the client&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;verification&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;verifyPaystackReference&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;reference&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;verification&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;success&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;badRequest&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Payment verification failed&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="c1"&gt;// Atomic order creation&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;order&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;Order&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;auth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;paymentStatus&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;paid&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;orderStatus&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pending&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;transactionId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;verification&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;totalAmount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;verification&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;amount&lt;/span&gt; &lt;span class="o"&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;// Create order items and mark products as sold&lt;/span&gt;
  &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;products&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;OrderItem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;orderId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;order&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;productId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;productId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;quantity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;quantity&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;Product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;id&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;productId&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;isSold&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="na"&gt;buyerId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;auth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;order&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Impact&lt;/strong&gt;: Zero fraudulent transactions since launch. Payment integrity is mathematically guaranteed.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Dual-Status Order Tracking
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;The Problem&lt;/strong&gt;: Mixing payment status with delivery status creates confusion. A paid order might still be pending delivery, or a cancelled order might need a refund.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Solution&lt;/strong&gt;: Separate status fields for different concerns&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;paymentStatus&lt;/code&gt;: &lt;code&gt;pending&lt;/code&gt; → &lt;code&gt;paid&lt;/code&gt; → &lt;code&gt;refunded&lt;/code&gt; → &lt;code&gt;completed&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;orderStatus&lt;/code&gt;: &lt;code&gt;pending&lt;/code&gt; → &lt;code&gt;sent&lt;/code&gt; → &lt;code&gt;enroute&lt;/code&gt; → &lt;code&gt;received&lt;/code&gt; | &lt;code&gt;cancelled&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This allows independent workflows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sellers can mark items as "sent" while payment is still processing&lt;/li&gt;
&lt;li&gt;Admins can filter by payment issues vs delivery issues&lt;/li&gt;
&lt;li&gt;Refund logic only affects &lt;code&gt;paymentStatus&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  3. Real-Time Messaging System
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Features&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One-to-one conversations between buyers and sellers&lt;/li&gt;
&lt;li&gt;Read/unread status tracking&lt;/li&gt;
&lt;li&gt;Conversation listing with last message preview&lt;/li&gt;
&lt;li&gt;Notifications for new messages&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Implementation&lt;/strong&gt; (&lt;code&gt;chat_messages_controller.ts&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;sendMessage&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;auth&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;recipientId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;productId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;content&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;validateUsing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;messageValidator&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;ChatMessage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;senderId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;auth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;recipientId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;productId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;isRead&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;

  &lt;span class="c1"&gt;// Trigger notification for recipient&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;Notification&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;recipientId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;new_message&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`New message about &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;referenceId&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;id&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;message&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  4. Shopping Cart &amp;amp; Wishlist
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Cart System&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add multiple products before checkout&lt;/li&gt;
&lt;li&gt;Automatic validation (out-of-stock items rejected)&lt;/li&gt;
&lt;li&gt;Quantity management&lt;/li&gt;
&lt;li&gt;Clear cart after successful order&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Wishlist/Favourites&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Save interesting items for later&lt;/li&gt;
&lt;li&gt;Get notified when price drops&lt;/li&gt;
&lt;li&gt;Track item availability&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  5. Comprehensive Product Management
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Features&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Multi-image uploads (up to 5 photos per product)&lt;/li&gt;
&lt;li&gt;Category-based organization&lt;/li&gt;
&lt;li&gt;Search and filtering&lt;/li&gt;
&lt;li&gt;Condition ratings (new, like-new, good, fair)&lt;/li&gt;
&lt;li&gt;Price negotiation through chat&lt;/li&gt;
&lt;li&gt;"Wants" system (users post item requests that sellers can fulfill)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Image Handling&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Optimized uploads to Vercel Blob storage&lt;/li&gt;
&lt;li&gt;CDN delivery for fast loading&lt;/li&gt;
&lt;li&gt;Bulk deletion when products are removed&lt;/li&gt;
&lt;li&gt;Responsive image URLs for different device sizes&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  6. Review &amp;amp; Rating System
&lt;/h3&gt;

&lt;p&gt;After order completion, buyers can review products and sellers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;5-star rating system&lt;/li&gt;
&lt;li&gt;Written feedback&lt;/li&gt;
&lt;li&gt;Aggregate ratings displayed on seller profiles&lt;/li&gt;
&lt;li&gt;Review moderation flags&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Security &amp;amp; Data Integrity
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Payment Security
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;✅ Server-side payment verification (never trust client)&lt;/li&gt;
&lt;li&gt;✅ Idempotent payment processing (duplicate requests ignored)&lt;/li&gt;
&lt;li&gt;✅ Transaction ID storage for auditing&lt;/li&gt;
&lt;li&gt;✅ Webhook signature verification for Paystack callbacks&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Concurrency Protection
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Product availability checks before purchase&lt;/li&gt;
&lt;li&gt;Database-level unique constraints&lt;/li&gt;
&lt;li&gt;Optimistic locking for cart updates&lt;/li&gt;
&lt;li&gt;Next: Add PostgreSQL transactions for atomic multi-step operations&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Authentication &amp;amp; Authorization
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;JWT bearer tokens for API access&lt;/li&gt;
&lt;li&gt;Email verification flow&lt;/li&gt;
&lt;li&gt;Password reset with expiring tokens&lt;/li&gt;
&lt;li&gt;Role-based permissions (buyer, seller, admin)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Developer Experience
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Team-Friendly Migrations
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Safe migration that checks for existing columns&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;up&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;schema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;alterTable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;orders&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="nx"&gt;table&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;// Prevent conflicts if column already exists&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;schema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hasColumn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;orders&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;transaction_id&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="nx"&gt;table&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;transaction_id&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;nullable&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why this matters&lt;/strong&gt;: Multiple developers can work on features simultaneously without breaking each other's local databases.&lt;/p&gt;

&lt;h3&gt;
  
  
  REST Client Examples
&lt;/h3&gt;

&lt;p&gt;Each endpoint has documented examples in &lt;code&gt;http-local/&lt;/code&gt; directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;### Create Order
POST http://localhost:3333/api/orders
Authorization: Bearer {{authToken}}
Content-Type: application/json

{
  "products": [
    { "productId": 1, "quantity": 1 },
    { "productId": 3, "quantity": 2 }
  ],
  "reference": "ref_abc123xyz"
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Consistent API Responses
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"success"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"data"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;/*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;resource&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;*/&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Order created successfully"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Error responses follow the same structure for easy client-side handling.&lt;/p&gt;




&lt;h2&gt;
  
  
  Technical Highlights
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Efficient Data Loading
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Prevent N+1 queries with eager loading&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;orders&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;Order&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;user_id&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;auth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;preload&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;orderItems&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="nx"&gt;query&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="nx"&gt;query&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;preload&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;product&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="nx"&gt;productQuery&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="nx"&gt;productQuery&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;preload&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;images&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="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Result&lt;/strong&gt;: Single database query instead of dozens. Order listing endpoints respond in &amp;lt;100ms.&lt;/p&gt;

&lt;h3&gt;
  
  
  Validation Layer
&lt;/h3&gt;

&lt;p&gt;Every endpoint validates input before processing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// app/validators/OrderValidator.ts&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;createOrderValidator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;vine&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;compile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;vine&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;object&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;products&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;vine&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="nx"&gt;vine&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;object&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="na"&gt;productId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;vine&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;number&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;exists&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;table&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;products&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;column&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;id&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt;
        &lt;span class="na"&gt;quantity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;vine&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;number&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;minLength&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="na"&gt;reference&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;vine&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;trim&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;h2&gt;
  
  
  Results &amp;amp; Impact
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Business Metrics
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;🔒 &lt;strong&gt;Zero fraud&lt;/strong&gt; incidents due to server-side verification&lt;/li&gt;
&lt;li&gt;⚡ &lt;strong&gt;&amp;lt;100ms&lt;/strong&gt; average response time for product listings&lt;/li&gt;
&lt;li&gt;📦 &lt;strong&gt;Multi-product checkout&lt;/strong&gt; supports up to 20 items per transaction&lt;/li&gt;
&lt;li&gt;💬 &lt;strong&gt;Real-time messaging&lt;/strong&gt; enables price negotiations&lt;/li&gt;
&lt;li&gt;🎯 &lt;strong&gt;Wishlist conversion rate&lt;/strong&gt; improved by tracking user intent&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Technical Metrics
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;📊 &lt;strong&gt;18 database tables&lt;/strong&gt; with optimized relationships&lt;/li&gt;
&lt;li&gt;🛣️ &lt;strong&gt;60+ API endpoints&lt;/strong&gt; across 15 controllers&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Zero migration conflicts&lt;/strong&gt; across 3 developers&lt;/li&gt;
&lt;li&gt;🔄 &lt;strong&gt;Idempotent operations&lt;/strong&gt; prevent duplicate charges&lt;/li&gt;
&lt;li&gt;📝 &lt;strong&gt;Complete API documentation&lt;/strong&gt; via REST Client examples&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Challenges Overcome
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Challenge 1: Payment Verification Race Conditions
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Paystack webhooks and user redirects could trigger duplicate order creation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check if order exists before creating (&lt;code&gt;findBy('transactionId')&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Return existing order if found (idempotent)&lt;/li&gt;
&lt;li&gt;Log all verification attempts for monitoring&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Challenge 2: Product Double-Selling
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Two buyers could purchase the same item if requests arrived simultaneously.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check &lt;code&gt;isSold&lt;/code&gt; status in a single query before updating&lt;/li&gt;
&lt;li&gt;Return clear error messages for unavailable items&lt;/li&gt;
&lt;li&gt;Next step: PostgreSQL row-level locks for atomic reservations&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Challenge 3: Migration Conflicts
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Developers manually adding columns caused migration failures for teammates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Migrations check for column existence before adding&lt;/li&gt;
&lt;li&gt;Rollback procedures documented&lt;/li&gt;
&lt;li&gt;Schema snapshots in version control&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Code Quality &amp;amp; Maintainability
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Architecture Patterns
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Controller-Service separation&lt;/strong&gt;: Business logic in controllers, data access via Lucid models&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validator layer&lt;/strong&gt;: All input sanitized before processing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Relationship preloading&lt;/strong&gt;: Avoid N+1 queries systematically&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Global exception handler&lt;/strong&gt;: Consistent error responses&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  File Organization
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app/
├── controllers/       # 15 focused controllers
│   ├── orders_controller.ts
│   ├── products_controller.ts
│   ├── chat_messages_controller.ts
│   └── ...
├── models/           # 20 Lucid models with relationships
├── validators/       # Vine validators for each endpoint
└── middleware/       # Auth, rate limiting, error handling

database/
├── migrations/       # 25+ idempotent migrations

http-local/          # REST Client examples for testing
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Running Locally
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install dependencies&lt;/span&gt;
npm &lt;span class="nb"&gt;install&lt;/span&gt;

&lt;span class="c"&gt;# Set up environment variables&lt;/span&gt;
&lt;span class="nb"&gt;cp&lt;/span&gt; .env.example .env
&lt;span class="c"&gt;# Add your PAYSTACK_SECRET_KEY and database config&lt;/span&gt;

&lt;span class="c"&gt;# Run migrations&lt;/span&gt;
node ace migration:run

&lt;span class="c"&gt;# Start development server&lt;/span&gt;
node ace serve &lt;span class="nt"&gt;--watch&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The API will be available at &lt;code&gt;http://localhost:3333&lt;/code&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;p&gt;This project demonstrates:&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Security-first architecture&lt;/strong&gt; — Server-side verification prevents fraud&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Scalable design&lt;/strong&gt; — Eager loading and indexing support growth&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Developer experience&lt;/strong&gt; — Safe migrations and clear documentation&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Production readiness&lt;/strong&gt; — Error handling, validation, and monitoring&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Business impact&lt;/strong&gt; — Features directly support marketplace success  &lt;/p&gt;




&lt;h2&gt;
  
  
  Tech Stack Summary
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Technology&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Runtime&lt;/td&gt;
&lt;td&gt;Node.js&lt;/td&gt;
&lt;td&gt;JavaScript server environment&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Framework&lt;/td&gt;
&lt;td&gt;AdonisJS 6&lt;/td&gt;
&lt;td&gt;MVC framework with built-in auth, validation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Language&lt;/td&gt;
&lt;td&gt;TypeScript&lt;/td&gt;
&lt;td&gt;Type safety and better tooling&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Database&lt;/td&gt;
&lt;td&gt;PostgreSQL&lt;/td&gt;
&lt;td&gt;Relational data with ACID guarantees&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ORM&lt;/td&gt;
&lt;td&gt;Lucid&lt;/td&gt;
&lt;td&gt;Model relationships and query builder&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Validation&lt;/td&gt;
&lt;td&gt;Vine&lt;/td&gt;
&lt;td&gt;Schema-based request validation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Payments&lt;/td&gt;
&lt;td&gt;Paystack&lt;/td&gt;
&lt;td&gt;Payment processing for African markets&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Storage&lt;/td&gt;
&lt;td&gt;Vercel Blob&lt;/td&gt;
&lt;td&gt;CDN-backed image hosting&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;API Format&lt;/td&gt;
&lt;td&gt;REST&lt;/td&gt;
&lt;td&gt;Standard HTTP + JSON&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;p&gt;&lt;strong&gt;Contact&lt;/strong&gt;: &lt;a href="mailto:sikky606@gmail.com"&gt;sikky606@gmail.com&lt;/a&gt; | &lt;a href="https://github.com/sparkle666" rel="noopener noreferrer"&gt;Github&lt;/a&gt;&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>api</category>
      <category>backend</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Five Lessons Tech Bros Can Learn from Yahoo Boys</title>
      <dc:creator>Sixtus Anyanwu</dc:creator>
      <pubDate>Wed, 12 Feb 2025 17:50:34 +0000</pubDate>
      <link>https://forem.com/sparklesix/five-lessons-tech-bros-can-learn-from-yahoo-boys-1gpc</link>
      <guid>https://forem.com/sparklesix/five-lessons-tech-bros-can-learn-from-yahoo-boys-1gpc</guid>
      <description>&lt;p&gt;Hey guys, today I’m going to talk about five lessons that tech bros can learn from Yahoo boys. &lt;/p&gt;

&lt;p&gt;Now, for the record, I do not support fraud in any way. I strongly oppose it. However, there are certain behaviors and strategies these individuals use that contribute to their success—though in a negative way—that we can extract valuable lessons from.&lt;/p&gt;

&lt;p&gt;If you're a tech bro just starting out, maybe you've learned HTML, CSS, and a few other skills, but you're already feeling discouraged because you're not seeing results. Here are five key lessons that can help you stay on track and improve your chances of success.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. The Power of Group Work&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you’ve observed Yahoo boys, you’ll notice they rarely work alone. They often stay in places called &lt;strong&gt;HK&lt;/strong&gt; &lt;strong&gt;(Hustle Kingdom)&lt;/strong&gt;, which are usually shared apartments or lodges where they collaborate under the guidance of a leader, often referred to as &lt;em&gt;Chairman&lt;/em&gt;. The &lt;em&gt;Chairman&lt;/em&gt; provides them with tools, information, and strategies to help them succeed.&lt;/p&gt;

&lt;p&gt;As a tech bro, you need to adopt the same mindset—find a group of like-minded people who share your goals. Having a community can keep you motivated, hold you accountable, and accelerate your learning. If you're struggling alone, you might feel discouraged, but if you're surrounded by people making progress, you'll push harder.&lt;/p&gt;

&lt;p&gt;Consider creating a WhatsApp or Twitter group where you and your peers can track progress, share opportunities, and support each other. Just like in school, when walking a long distance alone feels exhausting, but with friends, the journey feels shorter—having a group in tech makes the grind easier and more enjoyable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Access to Information is Key&lt;/strong&gt;&lt;br&gt;
In the Yahoo boys’ world, "&lt;em&gt;updates&lt;/em&gt;" (information) are everything. They constantly exchange new tactics, ensuring they stay ahead. This concept applies to tech as well—staying informed about industry trends, new tools, and best practices can make a huge difference.&lt;/p&gt;

&lt;p&gt;Many tech bros fail because they keep jumping from UI/UX to blockchain, then to cybersecurity, without mastering any one field. The key is to go deep before going broad. If you're not actively learning from industry leaders and staying updated, you'll quickly fall behind.&lt;/p&gt;

&lt;p&gt;For instance, back when Andela was trending, I knew someone who got in early and started earning ₦200K per month. I wasn’t aware of the opportunity until much later. If you don’t have access to the right information at the right time, you’ll miss out. Follow top tech professionals, join tech communities, and stay ahead of the curve.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Job Applications are a Numbers Game&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One strategy Yahoo boys use is blasting thousands of scam emails, knowing that even if 99% fail, that 1% success is enough. They understand that &lt;strong&gt;volume&lt;/strong&gt; matters.&lt;/p&gt;

&lt;p&gt;The same principle applies to job applications. &lt;em&gt;Many tech bros apply to just three jobs a week and give up.&lt;/em&gt; That’s not enough. You need to apply consistently and in large numbers. Apply to dozens of jobs weekly, refine your applications, and leverage multiple platforms like &lt;strong&gt;LinkedIn, Indeed, and company career pages.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Don’t wait for one company to get back to you. Keep applying. The more applications you send, the higher your chances of landing interviews and getting hired.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Consistency is Key – Keep Grinding&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yahoo boys don’t give up after one failed attempt. They keep trying different approaches until they succeed. This level of persistence is crucial in tech.&lt;/p&gt;

&lt;p&gt;Many beginners quit after a few months because they don’t see immediate results. But success in tech takes time. You need to keep coding, building projects, applying for jobs, and improving your skills—even when it feels like you’re getting nowhere.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Consistency compounds over time.&lt;/strong&gt; The people who keep going are the ones who eventually succeed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Staying Updated is Paramount&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The tech industry moves fast. New tools, frameworks, and best practices emerge constantly. If you’re not staying updated, you’ll become obsolete.&lt;/p&gt;

&lt;p&gt;Yahoo boys constantly seek new updates to improve their scams. Similarly, you should always be learning and adapting. Subscribe to newsletters, follow tech influencers, take courses, and engage in continuous learning.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Again, &lt;strong&gt;I do not support fraud in any way.&lt;/strong&gt; But looking at how Yahoo boys operate, we can extract lessons on teamwork, information access, persistence, and adaptation. If you apply these principles ethically in your tech journey, you’ll improve your chances of success.&lt;/p&gt;

&lt;p&gt;Stay consistent, stay informed, and keep grinding!&lt;/p&gt;

&lt;p&gt;Follow my socials on &lt;a href="https://github.com/sparkle666" rel="noopener noreferrer"&gt;Github&lt;/a&gt;, &lt;a href="https://x.com/sparkle_six" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/anyanwu-sixtus6" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How To Blur a Video using FFmpeg’s BoxBlur Filter</title>
      <dc:creator>Sixtus Anyanwu</dc:creator>
      <pubDate>Tue, 23 May 2023 11:47:10 +0000</pubDate>
      <link>https://forem.com/sparklesix/how-to-blur-a-video-using-ffmpegs-boxblur-filter-2m0j</link>
      <guid>https://forem.com/sparklesix/how-to-blur-a-video-using-ffmpegs-boxblur-filter-2m0j</guid>
      <description>&lt;p&gt;To apply a box blur effect to a video using ffmpeg, you can use the &lt;code&gt;boxblur&lt;/code&gt; filter. Here's an example command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ffmpeg -i input.mp4 -vf "boxblur=10:2" output.mp4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's break down the command:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ffmpeg&lt;/code&gt;: The command-line tool for handling multimedia processing.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-i input.mp4&lt;/code&gt;: Specifies the input video file (replace &lt;code&gt;input.mp4&lt;/code&gt; with the actual filename or path).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-vf "boxblur=10:2"&lt;/code&gt;: Specifies the video filter chain. The &lt;code&gt;boxblur&lt;/code&gt; filter is used with two parameters: the first parameter &lt;code&gt;10&lt;/code&gt; represents the blur radius, and the second parameter &lt;code&gt;2&lt;/code&gt; represents the number of iterations.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;output.mp4&lt;/code&gt;: Specifies the output video file (replace &lt;code&gt;output.mp4&lt;/code&gt; with the desired filename or path).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Adjust the values of the blur radius and iterations to achieve the desired blurring effect. Higher values will result in a stronger blur.&lt;/p&gt;

&lt;p&gt;Make sure you have ffmpeg installed on your system and accessible from the command line before running the command.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to compress a large video without losing quality using FFmpeg with Termux</title>
      <dc:creator>Sixtus Anyanwu</dc:creator>
      <pubDate>Tue, 07 Mar 2023 22:13:14 +0000</pubDate>
      <link>https://forem.com/sparklesix/how-to-compress-a-large-video-without-losing-quality-using-ffmpeg-with-termux-1dhi</link>
      <guid>https://forem.com/sparklesix/how-to-compress-a-large-video-without-losing-quality-using-ffmpeg-with-termux-1dhi</guid>
      <description>&lt;p&gt;Here is the Video Tutorial if you don't like reading.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://m.youtube.com/watch?v=w4Hz0Kh0NXE&amp;amp;feature=youtu.be"&gt;https://m.youtube.com/watch?v=w4Hz0Kh0NXE&amp;amp;feature=youtu.be&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are a content creator like me you will understand the pain and data it takes to upload 1GB of video which is probably about 20 minutes long or so. &lt;br&gt;
You usually get this problem if you are recording on a device with a high refresh rate.&lt;/p&gt;

&lt;p&gt;I have been searching all through the internet for a perfect solution that will be able to compress some of the video content which I create for YouTube without losing quality and alas, I was able to bump into ffmpeg.&lt;/p&gt;

&lt;p&gt;With this tool, I was able to compress a 250mb video to just 14mb!! &lt;br&gt;
Without losing quality and fast too! So let's get started.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is ffmpeg?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;FFmpeg is an open-source video and audio editor tool that can cut, chop, join, mux, and transcode almost any media format.&lt;/p&gt;

&lt;p&gt;It is also a very reliable method of performing automated video processing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To get started you need to have the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An android phone (Android 10 and above)&lt;/li&gt;
&lt;li&gt;Termux App&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Installing termux&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Termux is an application that allows you to run Linux commands and applications on your smartphone without needing to install a Linux distro. It contains lots of features which you will find interesting.&lt;/p&gt;

&lt;p&gt;To download termux follow this &lt;a href="https://f-droid.org/en/packages/com.termux/"&gt;link&lt;/a&gt;.&lt;br&gt;
Download and install the app on your phone and then run the below commands.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pkg upgrade&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To install ffmpeg, run:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pkg install ffmpeg&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;A storage access permission is required for Termux in order for it to be able to access shared storage (such as /sdcard or /storage/emulated/0). Since it is not required for the program to operate normally, access to it is not provided automatically, and the user is not prompted to authorize it when the application is started.&lt;/p&gt;

&lt;p&gt;Now, grant permission to Termux to access your storage device by running.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;termux-setup-storage&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Next, navigate into the folder that has your large video file which you want to compress.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ cd storage/shared/AzRecorderFree/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then run the below command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ffmpeg -i input.mp4 -vcodec libx265 -crf 28 output.mp4&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Replace "input.mp4" with the name of your large video file.&lt;br&gt;
You can also replace the output name with something else, doesn't matter.&lt;/p&gt;

&lt;p&gt;It will take a couple of minutes for FFmpeg to run the conversion. &lt;/p&gt;

&lt;p&gt;Enjoy.&lt;/p&gt;

</description>
      <category>video</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>5 Entry Level React Native Bugs That Might Frustrate Your Life [With Solutions]</title>
      <dc:creator>Sixtus Anyanwu</dc:creator>
      <pubDate>Thu, 01 Dec 2022 07:33:41 +0000</pubDate>
      <link>https://forem.com/sparklesix/5-entry-level-react-native-bugs-that-might-frustrate-your-life-with-solutions-3abp</link>
      <guid>https://forem.com/sparklesix/5-entry-level-react-native-bugs-that-might-frustrate-your-life-with-solutions-3abp</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;I started my first missionary journey in react native about 2 months ago, and so far I have seen several premium Shege (problems) on this side of the world. &lt;br&gt;
Apart from struggling to install the Expo CLI that wasted a ton of data subscription and time before it was finally up and running, there were still lots of roadblocks that almost made me drop react native.&lt;/p&gt;

&lt;p&gt;First off, I really appreciate the brilliant minds that deemed it worthwhile to come up with the Expo go app. &lt;br&gt;
That have saved me lots of headache, memory consumption, and at the very least, skyrocketed my learning rate. &lt;/p&gt;

&lt;p&gt;Initially, I thought using the official Android Studio AVD was the best, till it dawned on me that even my 4GB, AMD-powered processor can't even do 10% of the processing power that wicked .exe app needs.&lt;/p&gt;

&lt;p&gt;I wonder how the developers of Andriod Studio felt when developing such a power-hungry, memory-guzzling, heavy software. &lt;/p&gt;

&lt;p&gt;Trenches developers like us who are still managing their forever faithful, loyal, and low-budget 2 - 4GB RAM girlfriends were never considered.&lt;/p&gt;

&lt;p&gt;Well, what can we do? What was that saying of when the desirable is not available yen yen yen... I can't remember and way too lazy to Google anything right now.&lt;/p&gt;

&lt;p&gt;So, here are 5 &lt;strong&gt;stumbling blocks, time-wasting, head-scratching bugs&lt;/strong&gt; (however you choose to interpret this is up to you) that I faced the very first moment I imported from "react-native".&lt;/p&gt;

&lt;p&gt;By the way, some of these bugs or should I say lapses may not be typical with everyone due to certain differences in learning, internet connection speed, system OS or whatnot. &lt;/p&gt;

&lt;p&gt;PS: &lt;em&gt;I noticed that using the expo go app requires a very fast internet connection so it can build the necessary files required to power up your app. So make sure yours is decent.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So here it goes.&lt;/p&gt;
&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;Table of Contents&lt;/li&gt;
&lt;li&gt;The Expos White Screen of Death&lt;/li&gt;
&lt;li&gt;Solution&lt;/li&gt;
&lt;li&gt;Js Map - NativeWind Styles Disagreement&lt;/li&gt;
&lt;li&gt;Solution&lt;/li&gt;
&lt;li&gt;The Wrong Style Property App Crasher&lt;/li&gt;
&lt;li&gt;Solution&lt;/li&gt;
&lt;li&gt;Image Assets Not Usable or Not Showing Up&lt;/li&gt;
&lt;li&gt;Scenario 1:&lt;/li&gt;
&lt;li&gt;Solution&lt;/li&gt;
&lt;li&gt;Scenario 2:&lt;/li&gt;
&lt;li&gt;Solution&lt;/li&gt;
&lt;li&gt;React Navigation Screen Naming Nightmare&lt;/li&gt;
&lt;li&gt;Solution&lt;/li&gt;
&lt;li&gt;The ScrollView Out Of View Migraine&lt;/li&gt;
&lt;li&gt;Solution&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  The Expos White Screen of Death
&lt;/h2&gt;

&lt;p&gt;One of the very first bugs or should say stumbling blocks that I experienced with React native is this blank screen right below.&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%2Fbup72g3q6q3dd5ftid0a.jpg" 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%2Fbup72g3q6q3dd5ftid0a.jpg" alt="Infinite bundling error in react native" width="800" height="1585"&gt;&lt;/a&gt;&lt;br&gt;
The Expo app for some reason just freezes at the white loading screen and no matter how many times you reload the app from both the command line and the app itself, nothing seems to work. &lt;/p&gt;

&lt;p&gt;It's kinda like the Windows Blue Screen of Death but this time, a White Screen of Death. &lt;br&gt;
Most times, you will see "&lt;strong&gt;New update available, downloading...&lt;/strong&gt;" &lt;br&gt;
The only thing is that it never downloads. It kind of enters an infinite download void.&lt;/p&gt;

&lt;p&gt;At first, I thought it was a bug in my code that was preventing it from loading fully but after going through my code and running it on the web by pressing "&lt;strong&gt;w&lt;/strong&gt;" from the command line, it dawned on me that my code wasn't the issue here. &lt;/p&gt;

&lt;p&gt;So, I quickly Googled it up, and the first link that popped up was good ol' Stack Overflow (What can we mere mortals do without it? Sniffs).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cause of the error?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I read somewhere that it usually happens after you install some new dependencies on your react native app. So expo is kind of trying to rebundle your app but using the old files stored in the cache.&lt;/p&gt;
&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;The solution that solved this for me was to clear the cache and data of the Expo go app.&lt;br&gt;
Here is a step-by-step process on how to do it. &lt;/p&gt;

&lt;p&gt;PS: It's worth noting that I am an android user. My Android version is 10.0 so it might be different if you are using a version higher or lower.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First, click and hold the app. This should show you the below pop-out menu with &lt;strong&gt;share, app info, and remove.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&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%2F4oknjz4xo5judywqzom6.jpg" 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%2F4oknjz4xo5judywqzom6.jpg" alt="Image description" width="800" height="298"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Tap on app info and it should open up your settings and config for the Expo go app.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the bottom of the screen, tap on &lt;strong&gt;clear data&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&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%2Fb4volo69oe0ifc7rocs2.jpg" 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%2Fb4volo69oe0ifc7rocs2.jpg" alt="Image description" width="800" height="1506"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Then proceed to tap on clear cache. &lt;/li&gt;
&lt;/ul&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%2F8k5qtketgve73dpazgz2.jpg" 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%2F8k5qtketgve73dpazgz2.jpg" alt="Image description" width="800" height="618"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For me, I didn't want to take any chances, so I cleared everything. &lt;br&gt;
Both the cache, the data, the icon, and even my brain cells. (Joking there, just clearing the data is enough)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After this, rescan the QR code from the command line and it should work.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In a situation where it doesn't, do any of the following.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Uninstall the application totally and reinstall it from the Google play store.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check your internet connection and make sure it's on 4G or at least fast enough.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is a StackOverflow link if you want to read more about how others were able to solve this issue.&lt;/p&gt;

&lt;p&gt;SO link: &lt;a href="https://stackoverflow.com/questions/64680227/new-update-available-on-expo-infinite-downloading" rel="noopener noreferrer"&gt;https://stackoverflow.com/questions/64680227/new-update-available-on-expo-infinite-downloading&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Js Map - NativeWind Styles Disagreement
&lt;/h2&gt;

&lt;p&gt;Being a hardcore lover of Tailwindcss due to the sheer convenience it provides, I went on to integrate Nativewind into my react native app so I can write CSS styles faster.&lt;/p&gt;

&lt;p&gt;NativeWind is a universal style system inspired by TailwindCss, in fact, it's basically a TailwindCss for react native because almost all the utility class names are the same.&lt;/p&gt;

&lt;p&gt;NativeWind helps to write styles faster. It comes with lots of juice like pseudo-classes (hover, focus, active), dark mode, media queries, and pre-compilation. &lt;br&gt;
It's also lightweight and easy to use. &lt;br&gt;
If you have used Tailwindcss before, it will be a walk in the park for you.&lt;/p&gt;

&lt;p&gt;But then, there came a problem with this. I don't know whether this is peculiar to me or not but I found out that whenever I map through a list of items to render a component, I can't be able to use NativeWindCss class in the components. &lt;br&gt;
Take a peek at the code below.&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="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;featuredCategories&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;category&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;FeaturedRow&lt;/span&gt; 
        &lt;span class="nx"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;category&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="nx"&gt;title&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;category&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;category&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;short_description&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;category&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;_id&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="p"&gt;))}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside the &lt;strong&gt;FeaturedRow&lt;/strong&gt; component, I can't use my favorite utility classes on this component. I will need to write raw CSS styles in exchange for that.&lt;br&gt;
I don't know whether this is a design flaw or it's just me because I already googled around to check if I can see anyone with the same issue. &lt;br&gt;
Nothing found so far, so I am kind of open to your thoughts on this one. Have you experienced such? Please use the comment box below. Would love to hear it.&lt;/p&gt;
&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;So far so good, I haven't found anything that looks like a solution.&lt;br&gt;
The only thing to do is go back to writing pure vanilla CSS.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Wrong Style Property App Crasher
&lt;/h2&gt;

&lt;p&gt;This one is not actually a bug but can be due to an individual lapse in code. &lt;br&gt;
I had to add this one here because this actually gives me nightmares when it occurs especially when adding &lt;strong&gt;fontWeight&lt;/strong&gt; and &lt;strong&gt;fontSize&lt;/strong&gt; property names in the styles object.&lt;/p&gt;

&lt;p&gt;When not using NativeWind, you will probably have to write your CSS styles yourself. &lt;br&gt;
And one mistake that snuffs the life out of your expo app and sends it to its mama in heaven is using the wrong datatype for an object property name.&lt;/p&gt;
&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;It's quite easy, just use the correct datatype for each property name. Easy peasy.&lt;/p&gt;
&lt;h2&gt;
  
  
  Image Assets Not Usable or Not Showing Up
&lt;/h2&gt;
&lt;h2&gt;
  
  
  Scenario 1:
&lt;/h2&gt;

&lt;p&gt;One of the very few moments that left me scratching my scruffy hair was when I added a couple of images for the app I was building and after metro bundles, I got a lot of errors everywhere.&lt;br&gt;
Expo bundler complaining that it can't find the image files that I am trying to pass into the image component via the source prop.&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%2Foazmmv7ljpbvs74gf0jx.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%2Foazmmv7ljpbvs74gf0jx.PNG" alt="Expo app crash error on asset image" width="800" height="124"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;To solve this error, just stop and restart your server. Basically, react native makes use of the Metro Bundler which is similar to Babel or Webpack.&lt;br&gt;
The metro bundler somehow doesn't bundle your assets folder automatically as it does to your js files, so you will have to manually restart your Metro bundler to see the latest changes in the assets folder.&lt;/p&gt;

&lt;p&gt;Press Control + C to stop your expo CLI metro bundler.&lt;br&gt;
Use &lt;strong&gt;expo-cli start&lt;/strong&gt; or &lt;strong&gt;yarn start&lt;/strong&gt; to restart your server.&lt;/p&gt;
&lt;h2&gt;
  
  
  Scenario 2:
&lt;/h2&gt;

&lt;p&gt;Sometimes, when using an image from a  remote URL in your Image components, the images would refuse to render on the expo go app. &lt;br&gt;
Say we have a code like so:&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Image&lt;/span&gt; &lt;span class="nx"&gt;source&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{{&lt;/span&gt;
  &lt;span class="na"&gt;uri&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://dev-to-uploads.s3.amazonaws.com/resized_logo_UQww2soKuUsjaOGNB38o.png&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You might be shocked to discover that the image won't be rendered on your app.&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;Always add the &lt;strong&gt;width&lt;/strong&gt; and &lt;strong&gt;height&lt;/strong&gt; style to your Image component. It is also nice to add a resize mode to the Image.&lt;br&gt;
Say:&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Image&lt;/span&gt; &lt;span class="nx"&gt;source&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{{&lt;/span&gt;
  &lt;span class="na"&gt;uri&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://dev-to-uploads.s3.amazonaws.com/resized_logo_UQww2soKuUsjaOGNB38o.png&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;}}&lt;/span&gt; 
  &lt;span class="nx"&gt;style&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt; &lt;span class="p"&gt;}}&lt;/span&gt;
  &lt;span class="nx"&gt;resizeMode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;cover&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="c1"&gt;// or contain or any option you wish&lt;/span&gt;
&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  React Navigation Screen Naming Nightmare
&lt;/h2&gt;

&lt;p&gt;What is a react app without a navigation feature? Nothing beats that smooth screen-to-screen transition. &lt;br&gt;
But from great power comes great Bugsibilities (Ben Parker 2003)&lt;br&gt;
Using one of the widely trusted and most used navigation package for react native(@react-navigation/native) gave me a lot more than I expected.&lt;br&gt;
It all started when I tried to navigate to a new screen using the &lt;strong&gt;navigation.navigate()&lt;/strong&gt; function. And boom! Errors from the abyss of Bugtopia flooded my screen.&lt;/p&gt;

&lt;p&gt;Check out this code snippet below of a Screen Component that gets loaded on the Screen stack.&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="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;View&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="s1"&gt;react-native&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&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="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;SecondScreen&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="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;&lt;/span&gt;&lt;span class="nx"&gt;View&lt;/span&gt;&lt;span class="o"&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="nx"&gt;SecondScreen&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;/View&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="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;SecondScreen&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Here is the Screen Stack Navigator.&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;NavigationContainer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Stack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Navigator&lt;/span&gt; &lt;span class="nx"&gt;initialRouteName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;HomeScreen&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Stack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Screen&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;HomeScreen&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;component&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;HomeScreen&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;Stack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Screen&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;SecondScreen&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;component&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;SecondScreen&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="sr"&gt;/Stack.Navigator&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;/NavigationContainer&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Changing the &lt;strong&gt;name prop&lt;/strong&gt; from "SecondScreen" to say "Second" will lead to an error.&lt;br&gt;
I initially thought that the name prop can take in any arbitrary value that you wish to name your screen so as to use it with &lt;strong&gt;navigation.navigate()&lt;/strong&gt; method. Turns out it isn't.&lt;/p&gt;

&lt;p&gt;The be sincere, this stumbling block took me 6 days to find a solution. It turned into a bug for me. I didn't know why the back button wasn't working. &lt;br&gt;
I racked my brains till the lines of code on VScode started to get blurry, so I angrily packed up for the night while cursing React native silently on my hostel bed.&lt;/p&gt;
&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;As hard as it took me to debug this, it is actually simple.&lt;br&gt;
&lt;em&gt;Basically, the name prop &lt;strong&gt;MUST&lt;/strong&gt; match the exact name of the component passed into the Screen component prop. &lt;br&gt;
Any other thing will lead to an error, tried other alternatives and it never worked.&lt;/em&gt;&lt;br&gt;
Also, remove whitespace if any. I read on SO during those perilous moments that it can contribute to an error.&lt;/p&gt;

&lt;p&gt;I just saved you days of stress and Googling, you should be grateful. Big head lol.&lt;/p&gt;
&lt;h2&gt;
  
  
  The ScrollView Out Of View Migraine
&lt;/h2&gt;

&lt;p&gt;Even though the official react native docs recommend using a FlatList over a ScrollView, yet, stubborn developers like us still prefer to use good old ScrollView to render scrollable content.&lt;br&gt;
I don't know why I still prefer using ScrollView to FlatList even with all the performance gaps being touted by the Official react native docs. &lt;br&gt;
Maybe the extra configuration required for the FlatList is just a little discouraging or something. I have no idea.&lt;/p&gt;

&lt;p&gt;When using the ScrollView, you might run into a bug where the contents of the Scroll view are cut off the screen. See the picture below.&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%2Fnii611h2u3cotut99cmu.jpg" 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%2Fnii611h2u3cotut99cmu.jpg" alt="Image description" width="800" height="1652"&gt;&lt;/a&gt;&lt;br&gt;
It seems like the height of the ScrollView is bigger than the device screen or something.&lt;/p&gt;
&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;To fix this error, add some padding to the ScrollView like so:&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;contentContainerStyle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{{&lt;/span&gt;
      &lt;span class="na"&gt;paddingBottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&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;This is not a state-of-the-art fix to it though. You just need to add enough bottom padding till everything is contained in view properly.&lt;/p&gt;

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

&lt;p&gt;Some of these may not be full-time bugs but maybe some lapse in experience but they are sure going to be stumbling blocks that you might run into when learning react native for the first time.&lt;br&gt;
That was why I named them entry-level bugs. &lt;/p&gt;

&lt;p&gt;PS: That I experienced these doesn't mean you will run into bugs like this. Scenarios and reality differ from person to person but I hope you found value in this article.&lt;/p&gt;

&lt;p&gt;Sparkles signing out.&lt;/p&gt;

&lt;p&gt;Have a Bugderful day.&lt;/p&gt;

</description>
      <category>emptystring</category>
    </item>
    <item>
      <title>Step by Step Guide to using Reactstrap for building Web Apps With Sample Projects</title>
      <dc:creator>Sixtus Anyanwu</dc:creator>
      <pubDate>Sun, 13 Nov 2022 17:51:17 +0000</pubDate>
      <link>https://forem.com/sparklesix/step-by-step-guide-to-using-reactstrap-for-building-web-apps-with-sample-projects-455b</link>
      <guid>https://forem.com/sparklesix/step-by-step-guide-to-using-reactstrap-for-building-web-apps-with-sample-projects-455b</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;There are lots of UI component library out there for developing react powered web applications. Reactstrap is one of such sleek UI libraries but sometimes gets confused with React Bootstrap which is also a UI component library that uses BootstrapCSS behind the scenes for its component styles.&lt;/p&gt;

&lt;p&gt;In this article, we will learn how to use Reactstrap, the differences between reactstrap and react bootstrap, using reactstrap to build two simple yet cool projects. You will get exposed to the several components that is available on reactstrap how to best use them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;Pre requisites&lt;/li&gt;
&lt;li&gt;What is Reactstrap?&lt;/li&gt;
&lt;li&gt;Is Reactstrap the same as Bootstrap?&lt;/li&gt;
&lt;li&gt;Difference between Reactstrap and React Bootstrap&lt;/li&gt;
&lt;li&gt;Which is better Reactstrap or react-Bootstrap?&lt;/li&gt;
&lt;li&gt;Setting up a React App using NPM and Yarn&lt;/li&gt;
&lt;li&gt;Adding Reactstrap library in React Project&lt;/li&gt;
&lt;li&gt;Building a button counter app&lt;/li&gt;
&lt;li&gt;Building a basic blog web app with the Reactstrap component library&lt;/li&gt;
&lt;li&gt;Building the navigation&lt;/li&gt;
&lt;li&gt;Adding a Loading indicator with reactstrap&lt;/li&gt;
&lt;li&gt;Adding a NewsCard&lt;/li&gt;
&lt;li&gt;Building the Layout&lt;/li&gt;
&lt;li&gt;Adding responsiveness&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Pre requisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Nodejs 16+&lt;/li&gt;
&lt;li&gt;Text Editor preferably VS Code.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is Reactstrap?
&lt;/h2&gt;

&lt;p&gt;Reactstrap is a component library for building web apps with Reactjs. It includes a collection of reusable components that may be used in apps written in React. &lt;br&gt;
It ships out of the box with lots of components like Button, Modal, Alerts, Form and a host of other useful UI components to make development easy. &lt;br&gt;
Reactstrap does not include support for innate Bootstrap Css Javascript files but provides the necessary props to handle dynamic functions.&lt;/p&gt;
&lt;h2&gt;
  
  
  Is Reactstrap the same as Bootstrap?
&lt;/h2&gt;

&lt;p&gt;No, Reactstrap and Bootstrap CSS are two different UI libraries. Reactstrap is a component library made exclusively for ReactJs while Bootstrap is a popular CSS framework for building and designing websites. &lt;/p&gt;

&lt;p&gt;It relies heavily on Javascript which manipulates the DOM to trigger component functionalities.&lt;/p&gt;

&lt;p&gt;Although Reactstrap makes use of Bootstrap CSS classes behind the scenes for its components, it abstracts these classes and provides appropriate props that you can use to make components dynamic.&lt;/p&gt;
&lt;h2&gt;
  
  
  Difference between Reactstrap and React Bootstrap
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Reactstrap&lt;/th&gt;
&lt;th&gt;React Bootstrap&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;It is a component library for Reactjs&lt;/td&gt;
&lt;td&gt;It is a library that provides a set of reusable React components based on Bootstrap CSS framework&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Created 7 years ago&lt;/td&gt;
&lt;td&gt;Created 9 years ago&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Has less downloads&lt;/td&gt;
&lt;td&gt;Has more downloads&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Has over 10.4k stars on github&lt;/td&gt;
&lt;td&gt;Has over 21.2k stars on Github&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;h2&gt;
  
  
  Which is better Reactstrap or react-Bootstrap?
&lt;/h2&gt;

&lt;p&gt;Both Reactstrap and react-Bootstrap are great component libraries with lots of pre-built bootstrap-based components that you can start using rapidly in your react applications.&lt;/p&gt;

&lt;p&gt;Choosing between the two will be kind of subjective to the developer. Reactstrap is easy to use and customize. It also gets frequent updates and a large community of maintainers. &lt;br&gt;
Reactstrap is an excellent option if you’re looking for a quick way to add Bootstrap components to your React app.&lt;/p&gt;

&lt;p&gt;React Bootstrap on the other hand has been in the business for quite longer than reactstrap so it's logical that it would garner more popularity than Reactstrap with over 21k stars and 400+ contributors. To learn more about React Bootstrap, you can watch &lt;a href="https://www.youtube.com/watch?v=8pKjULHzs0s" rel="noopener noreferrer"&gt;this video by Adrain&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Setting up a React App using NPM and Yarn
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Let's create react app by going to a directory on your computer and typing:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;mkdir reactstrap-app&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Then go into the directory&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;cd  reactstrap-app&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you are using npm, run:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;npx create-react-app  .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The "." ensures that the react app is created inside the folder which you just created.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For Yarn use:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;yarn create react-app .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;For the sake of this tutorial, I will be making use of yarn because it's a bit faster than npm for me.&lt;/p&gt;

&lt;p&gt;After creating a react app, you should have the below folder structure. You will also notice that react dom and react were installed automatically. You can view this on the package.json file.&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%2Fuploads%2Farticles%2Fe7xgjtekss03d5crivny.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%2Fuploads%2Farticles%2Fe7xgjtekss03d5crivny.PNG" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Adding Reactstrap library in React Project
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Next, let's install reactstrap and bootstrap.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;yarn add reactstrap bootstrap&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Then run:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;npm start&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Or yarn start to start your React app.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Next, go to &lt;strong&gt;App.js&lt;/strong&gt; and import &lt;strong&gt;bootstrap.min.css&lt;/strong&gt; to the top of the file&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;import 'bootstrap/dist/css/bootstrap.min.css';&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Alternatively, you can add the bootstrap css framework using a CDN by going to the public folder and locating your index.html file.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Paste the following at the beginning of the file.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;link&lt;/span&gt; &lt;span class="nx"&gt;rel&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;stylesheet&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Great, now go back to App.js and create your first reactstrap component.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First, import the button component from reactstrap.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;import { Button } from 'reactstrap';&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Then add it to the App component.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&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;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&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="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;Hello&lt;/span&gt; &lt;span class="nx"&gt;World&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Button&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;/div&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;So your App.js should look like so.
&lt;/li&gt;
&lt;/ul&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="s1"&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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./style.css&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="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;reactstrap&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&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;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&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="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;Hello&lt;/span&gt; &lt;span class="nx"&gt;World&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Button&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;/div&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Building a button counter app
&lt;/h2&gt;

&lt;p&gt;Let's dive into Reactstrap by building out a simple button counter app. The button counter app should look and function like the below after we are through with it.&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%2Fuploads%2Farticles%2Fu7rppnq4adyojulnhadp.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%2Fuploads%2Farticles%2Fu7rppnq4adyojulnhadp.PNG" alt="A counter app in reactjs"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will be needing a couple of components that reactstrap comes with like Button, Container, Row and Col.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go ahead and import them like so.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;import { Button, Container, Row, Col } from 'reactstrap';&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We also be needing to use hooks to set and update our counter variable, so go ahead and do this.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;import React, { useState } from 'react';&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We will set up a useState hook that sets a counter variable and updates it if a button is clicked. Notice that the initial value of counter is set to 0.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;const [counter, setCounter] = useState(0);&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next, add the below code to your App component.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&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;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Container&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bg-light py-4 mt-4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Row&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-center&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Col&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mb-1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;xs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;12&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nx"&gt;The&lt;/span&gt; &lt;span class="nx"&gt;current&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="nx"&gt;is&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;counter&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;/Col&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;Col&lt;/span&gt; &lt;span class="nx"&gt;xs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;12&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&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="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;Click&lt;/span&gt; &lt;span class="nx"&gt;me&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Button&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;/Col&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;/Row&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;/Container&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;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Here, we are basically using the reactstrap Container component to hold our UI while adding a couple of bootstrap CSS utility classes like paddings and margins. We also centre-aligned the contents of the Row component so everything gets centered neatly.&lt;/p&gt;

&lt;p&gt;A quick reminder that you can be able to apply bootstrap CSS class names directly on reactstrap components since reactstrap uses Bootstrap styles behind the scenes. &lt;br&gt;
Here is a cheat sheet containing almost all bootstrap classes. You can use this as a reference file to quickly look up specific styles and class names to style your components however you deem fit.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Great, now lets create a function to handle when we click the button.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleClick&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="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;setCounter&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&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;Here, we are updating the setCounter method to an increment of counter variable.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next, let's hook it up to the button.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;Button onClick={handleClick}&amp;gt; Click me &amp;lt;/Button&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;And we are done with it. Here is the full code below.
&lt;/li&gt;
&lt;/ul&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="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./style.css&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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;bootstrap/dist/css/bootstrap.min.css&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;Container&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Row&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Col&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;reactstrap&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&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;counter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setCounter&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleClick&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="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;setCounter&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&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;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Container&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bg-light py-4 mt-4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Row&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-center&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Col&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mb-1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;xs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;12&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nx"&gt;The&lt;/span&gt; &lt;span class="nx"&gt;current&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="nx"&gt;is&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;counter&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;/Col&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;Col&lt;/span&gt; &lt;span class="nx"&gt;xs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;12&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&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;onClick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleClick&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;Click&lt;/span&gt; &lt;span class="nx"&gt;me&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Button&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;/Col&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;/Row&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;/Container&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;/div&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Building a basic blog web app with the Reactstrap component library
&lt;/h2&gt;

&lt;p&gt;From the above sample, we learnt how to use some basic components like Button, Col, Container and so on. Let's take it a little further and cover some other useful components by building a simple news or blog web application with reactstrap.&lt;/p&gt;

&lt;p&gt;We will be using Rapid API to get all the news data that we will need and render them using react.&lt;/p&gt;

&lt;p&gt;Rapid API is a web service that offers more than 10,000 APIs covering several niches and ecosystems such as Travel, Covid-19 stats, Sports, Movies, Entertainment and so on.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We will be using one of their news API to build this app. So go ahead and visit the website using this &lt;a href="https://rapidapi.com/hub" rel="noopener noreferrer"&gt;link&lt;/a&gt;. You can sign up using Google, GitHub or Facebook accounts if you are currently signed in to any of those.&lt;/li&gt;
&lt;/ul&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%2Fuploads%2Farticles%2Fl36g516vzcud0evb9tfq.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%2Fuploads%2Farticles%2Fl36g516vzcud0evb9tfq.PNG" alt="rapid api home page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next, go to the search bar at the top and type "Crypto News Live". This will be the API service we will be using to build a news reactstrap app.&lt;/li&gt;
&lt;/ul&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%2Fuploads%2Farticles%2Fd2p6xyi00zx6enlvktj2.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%2Fuploads%2Farticles%2Fd2p6xyi00zx6enlvktj2.PNG" alt="Crypto news api"&gt;&lt;/a&gt;&lt;br&gt;
You will be needing to subscribe to the API service to get access. There is a freemium plan that you can use. The only limitation is that there is a cap on the amount of requests you can make to the API.&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%2Fuploads%2Farticles%2Fid0uxmdruirgeywjkkd8.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%2Fuploads%2Farticles%2Fid0uxmdruirgeywjkkd8.PNG" alt="Rapid api"&gt;&lt;/a&gt;&lt;br&gt;
This usually differs from one API service provider to another. For the most part, the basic version will be enough for this little project.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Click on subscribe to get access to call the API.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Head back to the endpoints tab. Here you can see all endpoints that is available for use and the necessary API keys that are auto generated for you.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can hit the test endpoints button to test the response gotten from making a request to the API.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the far right are already-made code snippets for virtually the most popular languages like JavaScript, Java, Go, Python e.t.c&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Building the navigation
&lt;/h2&gt;

&lt;p&gt;Also, create a component folder on your root folder. This will be where we will store all the necessary components relevant to this app. &lt;br&gt;
You can use the command line to quickly do this by using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir components
cd components
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Let's add a reactstrap navigation bar to give our app a decent look and feel. Copy and paste the code below.
&lt;/li&gt;
&lt;/ul&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="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;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;Collapse&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;Navbar&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;NavbarToggler&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;NavbarBrand&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;Nav&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;NavItem&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;NavLink&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;reactstrap&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Navigation&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;args&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="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;isOpen&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setIsOpen&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;toggle&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;setIsOpen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;isOpen&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;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Navbar&lt;/span&gt; &lt;span class="p"&gt;{...&lt;/span&gt;&lt;span class="nx"&gt;args&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;NavbarBrand&lt;/span&gt; &lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Newsly&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/NavbarBrand&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;NavbarToggler&lt;/span&gt; &lt;span class="nx"&gt;onClick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;toggle&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="na"&gt;fontSize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;16&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;Collapse&lt;/span&gt; &lt;span class="nx"&gt;isOpen&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;isOpen&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;navbar&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Nav&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;me-auto&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;navbar&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;NavItem&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
              &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;NavLink&lt;/span&gt; &lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/latest&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Latest&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/NavLink&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;/NavItem&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;/Nav&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;/Collapse&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;/Navbar&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;/div&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="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;Navigation&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;We are doing a couple of things here, and if you are conversant with the Bootstrap css framework some of these names may sound familiar to you. The Navbar brand component works like the Bootstrap CSS navbar-brand class. This is where you insert your company, project or application's name. In our own case, we will call it Newsly.&lt;/p&gt;

&lt;p&gt;The NavbarToggler component is used to trigger the show and hide functionality of the navigation. We added a font-size of 16 to reduce the size of the button that comes out of the box with it.&lt;/p&gt;

&lt;p&gt;Lastly, the Collapse component is used to show or hide the nav items depending on the current state isOpen.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding a Loading indicator with reactstrap
&lt;/h2&gt;

&lt;p&gt;Like Bootstrap Css, reactstrap component library contains lots useful components like Spinners that can help indicate the state of the project.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to your components folder and create a new file named Loader.js and add the below code.
&lt;/li&gt;
&lt;/ul&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="s1"&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;Spinner&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;reactstrap&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Loader&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="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;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;
      &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;
        &lt;span class="na"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;flex&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;justifyContent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;center&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Spinner&lt;/span&gt;
        &lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;primary&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;
          &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;3rem&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;3rem&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;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Spinner&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;/div&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="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;Loader&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We are simply importing the Spinner Component from reactstrap and adding some css to justify it to the centre of the screen.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding a NewsCard
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Next, lets build a news card to show all the recent news from the API.
&lt;/li&gt;
&lt;/ul&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="s1"&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;Card&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;CardBody&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;CardTitle&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;CardText&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;reactstrap&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;NewsCard&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;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;&lt;/span&gt;&lt;span class="nx"&gt;Card&lt;/span&gt;
      &lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;light&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;
        &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;18rem&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;img&lt;/span&gt;
        &lt;span class="nx"&gt;alt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;A random image&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;image&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;CardBody&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CardTitle&lt;/span&gt; &lt;span class="nx"&gt;tag&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;h6&lt;/span&gt;&lt;span class="dl"&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="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;substr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;55&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;/CardTitle&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;CardText&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="nx"&gt;This&lt;/span&gt; &lt;span class="nx"&gt;news&lt;/span&gt; &lt;span class="nx"&gt;was&lt;/span&gt; &lt;span class="nx"&gt;curated&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;source&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="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;source&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;/a&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;/CardText&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;Button&lt;/span&gt; &lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Visit&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Button&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;/CardBody&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;/Card&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="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;NewsCard&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we are importing the Card, CardBody, CardTitle, Button, CardText from reactstrap and adding a couple of styles to it to make it look decent.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;{props.title.substr(0, 55)}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;For the Card title, we are getting and displaying the first 55 characters so that the card will have a consistent title character number.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building the Layout
&lt;/h2&gt;

&lt;p&gt;We'll make use of the several layout components in reactstrap to build a responsive layout to render our card.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We will import all the necessary components that we will needing, both the Loader and NewsCard components that we created before.
&lt;/li&gt;
&lt;/ul&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="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useEffect&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;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;Row&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Col&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Container&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;reactstrap&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="nx"&gt;NewsCard&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./NewsCard&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="nx"&gt;Loader&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./Loader&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Then create the Layout component and render the news card for now. We also create a placeholder image gotten from pixabay to serve as the CardImage.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Layout&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="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;newsData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setNewsData&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;img&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://cdn.pixabay.com/photo/2022/09/24/15/39/rocks-7476616_960_720.jpg&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;NewsCard&lt;/span&gt; &lt;span class="o"&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="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;Layout&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Next, lets fetch the news API data from Rapid API. You can copy and paste the code snippet from the Endpoints tab.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fetchApi&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="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;options&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;GET&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;headers&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;X-RapidAPI-Key&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;your key&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;X-RapidAPI-Host&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;crypto-news-live3.p.rapidapi.com&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="p"&gt;};&lt;/span&gt;

    &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://crypto-news-live3.p.rapidapi.com/news&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;data&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="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;setNewsData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="p"&gt;})&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&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;We just made a basic GET request to the endpoint with fetch api, retrieved the data, console logged it, and add it to a state.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next, lets add a useEffect to fetch data and after any updates.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="nf"&gt;useEffect&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="nf"&gt;fetchApi&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;ul&gt;
&lt;li&gt;Then add the content layout for the app main body.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&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="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;newsData&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Container&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Row&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;newsData&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;news&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
              &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Col&lt;/span&gt;
                &lt;span class="nx"&gt;sm&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;12&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                &lt;span class="nx"&gt;lg&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                &lt;span class="nx"&gt;md&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;6&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
              &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;NewsCard&lt;/span&gt;
                  &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;news&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
                  &lt;span class="nx"&gt;source&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;news&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;source&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
                  &lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;news&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
                  &lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="kc"&gt;undefined&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="nx"&gt;img&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="sr"&gt;/Col&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;            &lt;span class="p"&gt;))}&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Row&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;/Container&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="p"&gt;(&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Loader&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;)}&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We are simply mapping through the first 12 data elements from the API and passing each value of the news data object as a prop to the newscard. The Container component adds some paddings and margins to our overall layout.&lt;/p&gt;

&lt;p&gt;The loader component will be shown if &lt;strong&gt;newData&lt;/strong&gt; variable is not yet updated.&lt;/p&gt;

&lt;p&gt;The complete code looks like this:&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="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useEffect&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;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;Row&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Col&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Container&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;reactstrap&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="nx"&gt;NewsCard&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./NewsCard&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="nx"&gt;Loader&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./Loader&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Layout&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="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;newsData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setNewsData&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;img&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://cdn.pixabay.com/photo/2022/09/24/15/39/rocks-7476616_960_720.jpg&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="nf"&gt;useEffect&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="nf"&gt;fetchApi&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[]);&lt;/span&gt;

  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;newsData&lt;/span&gt;&lt;span class="p"&gt;?.[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fetchApi&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="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;options&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;GET&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;headers&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;X-RapidAPI-Key&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;your key&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;X-RapidAPI-Host&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;crypto-news-live3.p.rapidapi.com&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="p"&gt;};&lt;/span&gt;

    &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://crypto-news-live3.p.rapidapi.com/news&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;data&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="nf"&gt;setNewsData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="p"&gt;})&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="c1"&gt;// fetchApi()&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="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;newsData&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Container&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Row&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;newsData&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;news&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
              &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Col&lt;/span&gt;
                &lt;span class="nx"&gt;sm&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;12&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                &lt;span class="nx"&gt;lg&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                &lt;span class="nx"&gt;md&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;6&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
              &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;NewsCard&lt;/span&gt;
                  &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;news&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
                  &lt;span class="nx"&gt;source&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;news&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;source&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
                  &lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;news&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
                  &lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="kc"&gt;undefined&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="nx"&gt;img&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="sr"&gt;/Col&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;            &lt;span class="p"&gt;))}&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Row&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;/Container&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="p"&gt;(&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Loader&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;)}&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="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="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;Layout&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;PS: It is not recommended to leave API keys on your Layout.js file. It is pertinent that you use dotenv a javascript package to handle sensitive data such as API keys. You can read more on this &lt;a href="https://www.freecodecamp.org/news/how-to-use-node-environment-variables-with-a-dotenv-file-for-node-js-and-npm/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Don't also forget to add .env to your gitignore files when pushing to a remote repository like Github.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now go to your src &amp;gt; App.js and import the Navigation and Layout components. You can comment out the counter app code that we built earlier.
&lt;/li&gt;
&lt;/ul&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;Layout&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./components/Layout&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="nx"&gt;Navigation&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./components/Navigation&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Then render the components.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&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;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Navigation&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Layout&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="cm"&gt;/* &amp;lt;Container className="bg-light py-4 mt-4"&amp;gt;
        &amp;lt;Row className="text-center"&amp;gt;
          &amp;lt;Col className="mb-1" xs="12"&amp;gt;
            The current count is: {counter}
          &amp;lt;/Col&amp;gt;
          &amp;lt;Col xs="12"&amp;gt;
            &amp;lt;Button onClick={handleClick}&amp;gt; Click me &amp;lt;/Button&amp;gt;
          &amp;lt;/Col&amp;gt;
        &amp;lt;/Row&amp;gt;
      &amp;lt;/Container&amp;gt; */&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Adding responsiveness
&lt;/h2&gt;

&lt;p&gt;Lets add some margin and responsiveness to the reactstrap app.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to the styles.css and add the below code.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;-apple-system&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BlinkMacSystemFont&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;'Segoe UI'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Roboto&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Oxygen&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;Ubuntu&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Cantarell&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;'Open Sans'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;'Helvetica Neue'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.container&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;margin-top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;40px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="nc"&gt;.col-lg-4&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;margin-bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;@media&lt;/span&gt; &lt;span class="n"&gt;only&lt;/span&gt; &lt;span class="n"&gt;screen&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;768px&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="nc"&gt;.col-md-6&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;margin-bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="nc"&gt;.card&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;auto&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;ul&gt;
&lt;li&gt;Don't forget to add your styles to scr &amp;gt; app.js
&lt;/li&gt;
&lt;/ul&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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./style.css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;Great, we were finally able to make use of the plethora of reactstrap components like Spinner, Button, Layout and a host of others. There are more to it as this is just a tip of the iceberg. I recommend you go through &lt;a href="https://reactstrap.github.io/" rel="noopener noreferrer"&gt;reactstrap official documentation&lt;/a&gt; to get a feel of the numerous other UIs that they provide.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to Force/Bypass Screenshot Restrictions on Android With ScrCpy</title>
      <dc:creator>Sixtus Anyanwu</dc:creator>
      <pubDate>Sat, 08 Oct 2022 22:05:24 +0000</pubDate>
      <link>https://forem.com/sparklesix/how-to-forcebypass-screenshot-restrictions-on-android-with-scrcpy-2fk9</link>
      <guid>https://forem.com/sparklesix/how-to-forcebypass-screenshot-restrictions-on-android-with-scrcpy-2fk9</guid>
      <description>&lt;p&gt;The freedom to customize Android anyway you want is a big reason why so many people like it over other mobile operating systems. Android allows you to personalize your phone down to the smallest details, install any app, and change the way it looks and acts.&lt;/p&gt;

&lt;p&gt;But still, there are some apps that disable screenshots due to one reason or the other. In this article, I am going to show you to bypass such restrictions using a tool known as scrcpy.&lt;/p&gt;

&lt;p&gt;PreRequisites&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Windows 10 (Any Windows version should work)&lt;/li&gt;
&lt;li&gt;GitBash ( You can use Command Line, but I prefer gitbash)&lt;/li&gt;
&lt;li&gt;Android 5.0 and Up&lt;/li&gt;
&lt;li&gt;Enabled Andriod Debug Mode( You can find out more on how to do this &lt;a href="https://developer.android.com/studio/debug/dev-options"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Table of Contents&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;Prerequisite&lt;/li&gt;
&lt;li&gt;Download Scrcpy&lt;/li&gt;
&lt;li&gt;Set up your Android Phone&lt;/li&gt;
&lt;li&gt;Casting your screen&lt;/li&gt;
&lt;li&gt;Other Useful tips&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Download Scrcpy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Scrcpy is an open-source software that enables users to display and control Android devices when they are linked to a computer either over USB or TCP/IP. It is not necessary to have root access in any way. &lt;br&gt;
&lt;strong&gt;Windows&lt;/strong&gt;: Head over to this &lt;a href="https://github.com/Genymobile/scrcpy"&gt;link&lt;/a&gt; to download scrcpy executable file.&lt;br&gt;
&lt;strong&gt;Linux/Termux&lt;/strong&gt;: Run &lt;code&gt;apt install scrcpy&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;MacOs&lt;/strong&gt;: Run &lt;code&gt;brew install scrcpy&lt;/code&gt; on your terminal.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once you have downloaded the file. Go ahead and unzip it. &lt;/li&gt;
&lt;li&gt;You should see the scrcpy executable file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--roEQgG0P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y6gmoul3e2l3ks3z2b1d.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--roEQgG0P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y6gmoul3e2l3ks3z2b1d.PNG" alt="Image description" width="590" height="152"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Inside the folder, right click on an empty space inside file explorer and click on &lt;strong&gt;"Git Bash Here"&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Set up your Android Phone&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Get a USB cable and connect your phone to your PC.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Remember that you need to have unlocked Developer mode and enabled USB Debugging mode on your phone. The steps to this varies according to phone models so use this &lt;a href="https://developer.android.com/studio/debug/dev-options"&gt;official guide&lt;/a&gt; from Google to know how to enable it.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Casting your phone screen&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On the terminal type: &lt;code&gt;./scrcpy.exe -m 1024&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;The &lt;strong&gt;-m&lt;/strong&gt; flag means a max resolution of 1024p, this is actually the best for most cases. Anything else and Scrcpy might complain and spit a couple of errors.&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Typing the above might display a one time prompt to allow access from your PC to your phone. &lt;/li&gt;
&lt;li&gt;Click on "accept" and and a new window will pop up with a screen of your phone interface.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kGSLlFGL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1dlz2zccpm60g8tosqr3.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kGSLlFGL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1dlz2zccpm60g8tosqr3.PNG" alt="Image description" width="880" height="528"&gt;&lt;/a&gt;&lt;br&gt;
You can open all the apps that disabled screenshot on your phone and use a screenshot tool like snipping tool for windows to screenshot whatever information that you need.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Other Useful tips&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recording Videos&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can also record your phone screen from scrcpy by typing: &lt;br&gt;
&lt;code&gt;./scrcpy.exe -r nameOfVideo.mp4 -m 1024&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Change "nameOfVideo" to your preferred file name for the recorded video.&lt;/li&gt;
&lt;li&gt;To stop recording, just close the capture window and your video will be automatically saved on the root directory of the unzipped scrcpy.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FbyymSCW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1zmqwbcdvkcpf0plbpai.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FbyymSCW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1zmqwbcdvkcpf0plbpai.PNG" alt="Image description" width="586" height="123"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Heads up: The video does not come with audio for some reasons.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Transferring Files&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can transfer files to your phone by simply dragging the file and dropping it on the window. Once the transfer is complete, you get notified on the terminal with the location of the file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are other ways to bypass this process like using Android ADB but that will require huge downloads from your end. Scrcpy does almost the same thing with a lighter file size.&lt;/p&gt;

</description>
      <category>andriod</category>
    </item>
    <item>
      <title>Creating and Deploying a Pizza Vending Machine Smart Contract in Solidity</title>
      <dc:creator>Sixtus Anyanwu</dc:creator>
      <pubDate>Thu, 07 Jul 2022 12:58:21 +0000</pubDate>
      <link>https://forem.com/sparklesix/creating-and-deploying-a-pizza-vending-machine-smart-contract-in-solidity-j5p</link>
      <guid>https://forem.com/sparklesix/creating-and-deploying-a-pizza-vending-machine-smart-contract-in-solidity-j5p</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;Welcome to another Solidity tutorial where you are going to learn how to create a vending machine smart contract with Solidity.&lt;/p&gt;

&lt;p&gt;In this article, you are going to learn how to use mappings, and events, receive ether through a function call, using function modifiers, and how to use the address of a smart contract.&lt;/p&gt;

&lt;p&gt;Basically, we are creating a contract where a user can be able to purchase a pizza from the contract by sending in ether. An event log will be emitted for every purchase.&lt;br&gt;
It will have a restock function to add more pizzas and some others that you will see as we build through this.&lt;/p&gt;
&lt;h3&gt;
  
  
  Requirements
&lt;/h3&gt;

&lt;p&gt;For this tutorial, we will be using Solidity version 0.8.0 and Remix Ethereum as our online IDE.&lt;br&gt;
So if you want to follow along, then these are the tools you will need.&lt;/p&gt;
&lt;h3&gt;
  
  
  Table of Contents
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;Requirements&lt;/li&gt;
&lt;li&gt;Setting Up&lt;/li&gt;
&lt;li&gt;Writing the smart contract&lt;/li&gt;
&lt;li&gt;Let's create the contract state variables.&lt;/li&gt;
&lt;li&gt;Creating the constructor&lt;/li&gt;
&lt;li&gt;Retrieving the amount of pizza in the vending machine.&lt;/li&gt;
&lt;li&gt;Purchasing Pizzas.&lt;/li&gt;
&lt;li&gt;Adding modifiers&lt;/li&gt;
&lt;li&gt;Restocking the pizza&lt;/li&gt;
&lt;li&gt;Getting the total amount of ether made from selling pizzas&lt;/li&gt;
&lt;li&gt;Checking the amount of pizza at an address.&lt;/li&gt;
&lt;li&gt;Deploying the Contract&lt;/li&gt;
&lt;li&gt;Another functionality to add (Todo)&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Setting Up
&lt;/h3&gt;

&lt;p&gt;To get started with development, you need to go to the &lt;a href="https://remix.ethereum.org/" rel="noopener noreferrer"&gt;Remix&lt;/a&gt; website.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You should see a page that looks like this.&lt;/li&gt;
&lt;/ul&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%2Fuploads%2Farticles%2Fve576j6im62lla7nkbr6.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%2Fuploads%2Farticles%2Fve576j6im62lla7nkbr6.PNG" alt="Remix IDE"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Once here, create a new file and name it “VendingMachine.sol”.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the left, locate the compiler icon and switch your Ethereum compiler to &lt;strong&gt;0.8.0&lt;/strong&gt; if you haven’t so we can be able to compile it.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Writing the smart contract
&lt;/h3&gt;

&lt;p&gt;Open up the file and add the following lines&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Here we are telling the solidity compiler which type of license we are setting up our source code. There are a variety of these licenses but if you want to make your source code open-sourced, replace "MIT" with “UNLICENSED”.
Here is a link to all the supported &lt;a href="https://spdx.org/licenses/" rel="noopener noreferrer"&gt;licenses&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;License identifiers are added to your contract bytecode during compilation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Let's create the contract state variables.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;contract VendingMachine{
    address public owner;
    mapping(address =&amp;gt; uint) public pizzaBalances;
    uint public constant DECIMAL = 10 ** 18;
    event Purchase(address _sender, uint _amount, uint _value);

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Here we are declaring and initializing some state variables to hold the owner of the contract, a mapping that tracks each address to the amount of pizza that they have, a constant integer, and an event that gets emitted once some address purchases a pizza.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Notice that the variables are set to public?&lt;/em&gt; &lt;br&gt;
This means that these variables can be accessible to anyone outside of the contract. They can call these variables to retrieve their value.&lt;/p&gt;
&lt;h3&gt;
  
  
  Creating the constructor
&lt;/h3&gt;

&lt;p&gt;Let's add a constructor to set the state variable address owner to the current deployer of the smart contract.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;contract VendingMachine{
     …
    constructor(){
        owner = msg.sender;
        pizzaBalances[address(this)] = 100;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We also initialized the total amount of pizzas for the contract address to be 100.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;address(this)&lt;/strong&gt; is the address of the smart contract. Every smart contract that is deployed comes with a contract address. This should not be confused with the deployer address which was set to owner.&lt;/p&gt;

&lt;p&gt;Let's create our first function to retrieve the number of pizzas stored in the vending machine contract.&lt;/p&gt;

&lt;h3&gt;
  
  
  Retrieving the amount of pizza in the vending machine.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function getVendingMachineBalance() external view returns(uint){
        // Get the amount of pizza in the vending machine
        return pizzaBalances[address(this)];
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Remember that we mapped the contract's address to an integer value of 100?&lt;/em&gt;&lt;br&gt;
This function basically gets it and returns it back to the caller.&lt;/p&gt;
&lt;h3&gt;
  
  
  Purchasing Pizzas.
&lt;/h3&gt;

&lt;p&gt;Now, let's create a function to purchase some pizzas from the machine.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; function purchase(uint _amount) public payable{
        require(pizzaBalances[address(this)] &amp;gt;= _amount, "Not enough pizzas in stock");
        require(msg.value == _amount * (2 * DECIMAL), "Each pizza is worth 2 ethers, insufficient funds");
        pizzaBalances[address(this)] -= _amount;
        pizzaBalances[msg.sender] += _amount;
        emit Purchase(msg.sender, _amount, msg.value);
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, we are making the function payable so that the contract can be able to receive ether through the function. If you want your whole contract to be able to receive ether consider using the &lt;strong&gt;receive&lt;/strong&gt; or &lt;strong&gt;fallback&lt;/strong&gt; function.&lt;/p&gt;

&lt;p&gt;Next, we do a couple of validations using the require function.&lt;br&gt;
We want to ensure that there is enough pizza in stock and we also want to set a price of 2 ethers for one pizza. &lt;/p&gt;

&lt;p&gt;So if you want to buy 4 pizzas, the amount you pay is 4 * 2 = 8 ether. Remember that this contract uses &lt;strong&gt;wei&lt;/strong&gt; as the default &lt;strong&gt;unit&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note: 1 ether = 1 * 10 ^ 18 wei&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once the validation goes through, we want to decrease the number of pizzas in the contract address and increase the amount of pizza in the address of the function caller.&lt;/p&gt;

&lt;p&gt;Lastly, we emit an event showing the purchaser's address, the amount of pizza, and the value of the pizza.&lt;/p&gt;
&lt;h3&gt;
  
  
  Adding modifiers
&lt;/h3&gt;

&lt;p&gt;Function modifiers, as the name suggests, modifies the flow of a function. Add the following code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;modifier validateAmount(uint _amount){
        require(_amount &amp;gt; 0, "Amount needs to be greater than 0");
        require((pizzaBalances[address(this)] + _amount) &amp;lt;= 100, "The total supply of pizzas is 100");
        _;
    }
    modifier onlyOwner(){
        require(msg.sender == owner, "Only the owner can call this function");
        _;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we are creating two modifiers and the first modifier is used to achieve two things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To ensure that the amount passed is greater than 0 (You can’t restock 0 goods to your store can you? ).&lt;/li&gt;
&lt;li&gt;To ensure that the total number of pizzas in stock is not greater than 100. Our vending machine low-key can only contain 100 pizzas so anything over 100 will revert.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The second modifier(onlyOwner) ensures that only the owner can restock the vending machine. &lt;/p&gt;

&lt;h3&gt;
  
  
  Restocking the pizza
&lt;/h3&gt;

&lt;p&gt;Add the following code to your smart contract.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function restock(uint _amount) public validateAmount(_amount) onlyOwner {
        // Restock pizzas.
        pizzaBalances[address(this)] += _amount;
} 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Notice that we have &lt;strong&gt;validateAmount(_amount) onlyOwner&lt;/strong&gt; on the function head?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;These are called function modifiers. We basically use them to modify the flow of a function. It's common use case is for validation of a value before the function body is executed.&lt;br&gt;
After the validations have passed, we increment the amount of the pizza to the amount passed in.&lt;/p&gt;
&lt;h3&gt;
  
  
  Getting the total amount of ether made from selling pizzas
&lt;/h3&gt;

&lt;p&gt;Add the below code to your file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; function getContractBalance() external view returns(uint){
        // Returns the amount of pizzas of an address
        return address(this).balance;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we are getting the total amount of ether that we have made from selling our pizzas. Ethers sent into a contract are stored at the address(this).balance.&lt;/p&gt;

&lt;h3&gt;
  
  
  Checking the amount of pizza at an address.
&lt;/h3&gt;

&lt;p&gt;Add the following lines of code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function getAddressBalance(address _addr) external view returns(uint){
        // Returns the amount of pizzas of an address
        return pizzaBalances[_addr];
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we are passing in an address as a parameter and getting the &lt;strong&gt;uint&lt;/strong&gt; value from the &lt;strong&gt;pizzaBalances&lt;/strong&gt; mapping.&lt;/p&gt;

&lt;h3&gt;
  
  
  Deploying the Contract
&lt;/h3&gt;

&lt;p&gt;To deploy your contract:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Head over to the deploy icon on the left and click on deploy. &lt;/li&gt;
&lt;/ul&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%2Fuploads%2Farticles%2Fms0hchykzd1r3l68lcel.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%2Fuploads%2Farticles%2Fms0hchykzd1r3l68lcel.PNG" alt="Deploy contract"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set the environment to “&lt;strong&gt;Javascript Vm&lt;/strong&gt;” and choose a wallet from the provided list.&lt;/li&gt;
&lt;li&gt;Remember to compile the contract first. Set the compiler to auto compile so that you won’t have to worry about compilation.&lt;/li&gt;
&lt;/ul&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%2Fuploads%2Farticles%2F17d3erkdz72v0vznvuy6.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%2Fuploads%2Farticles%2F17d3erkdz72v0vznvuy6.PNG" alt="Compile contract"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use the text fields to test out your contract.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The whole code in your file should match this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

contract VendingMachine{
    address public owner;
    mapping(address =&amp;gt; uint) public pizzaBalances;
    uint public constant DECIMAL = 10 ** 18;
    event Purchase(address _sender, uint _amount, uint _value);

    constructor(){
        owner = msg.sender;
        pizzaBalances[address(this)] = 100;
    }
    function getVendingMachineBalance() external view returns(uint){
        // Get amount of pizzas in vending machine
        return pizzaBalances[address(this)];
    }
    function getAddressBalance(address _addr) external view returns(uint){
        // Returns amount of pizzas of an address
        return pizzaBalances[_addr];
    }
     function getContractBalance() external view returns(uint){
        // Returns amount of pizzas of an address
        return address(this).balance;
    }
    function restock(uint _amount) public validateAmount(_amount) onlyOwner {
        // Restock pizzas.
        pizzaBalances[address(this)] += _amount;
    } 
    function purchase(uint _amount) public payable{
        require(pizzaBalances[address(this)] &amp;gt;= _amount, "Not enough pizzas in stock");
        require(msg.value == _amount * (2 * DECIMAL), "Each pizza is worth 2 ethers, insuffiicient funds");
        pizzaBalances[address(this)] -= _amount;
        pizzaBalances[msg.sender] += _amount;
        emit Purchase(msg.sender, _amount, msg.value);
    }
    modifier validateAmount(uint _amount){
        require(_amount &amp;gt; 0, "Amount needs to be greater than 0");
        require((pizzaBalances[address(this)] + _amount) &amp;lt;= 100, "The total supply of pizzas is 100");
        _;
    }
    modifier onlyOwner(){
        require(msg.sender == owner, "Only the owner can call this function");
        _;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Another functionality to add (Todo)
&lt;/h3&gt;

&lt;p&gt;Try adding a function that withdraws all the ether sent into the contract to the owner's address.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Tip: Use &lt;strong&gt;owner.transfer(address(this).balance)&lt;/strong&gt; to transfer all the ethers on the wallet to the owner. Remember to modify the owner state variable with a payable keyword.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Congratulations, you were able to learn how to build a vending machine smart contract. You can add more functionalities to this to extend it or deploy to any of the Ethereum test net using &lt;strong&gt;Injected Web3.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you want me to build a DApp around this with Reactjs, Ethers, Hardhat and deploy it to an Alchemy Ropsten testnet node, simply like and follow me so you will get notified once I create it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you got value from this, kindly follow me on &lt;a href="https://twitter.com/sparkle_six" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;, and &lt;a href="https://github.com/sparkle666" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Cover Image: &lt;a href="https://www.freepik.com/vectors/transaction" rel="noopener noreferrer"&gt;Freepik &lt;/a&gt;&lt;/p&gt;

</description>
      <category>web3</category>
      <category>solidity</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Solidity Tutorial: How to build and deploy a smart contract to send Ether from one account to another</title>
      <dc:creator>Sixtus Anyanwu</dc:creator>
      <pubDate>Fri, 22 Apr 2022 13:53:00 +0000</pubDate>
      <link>https://forem.com/sparklesix/solidity-tutorial-how-to-build-and-deploy-a-smart-contract-to-send-ether-from-one-account-to-another-n54</link>
      <guid>https://forem.com/sparklesix/solidity-tutorial-how-to-build-and-deploy-a-smart-contract-to-send-ether-from-one-account-to-another-n54</guid>
      <description>&lt;p&gt;Before we jump right in, I wrote an in-depth tutorial on how to &lt;a href="https://dev.to/sparklesix/writing-and-deploying-a-solidity-smart-contract-to-rinkeby-test-network-2d0k"&gt;deploy a smart contract to Rinkeby testnet,&lt;/a&gt; you can go read it up.&lt;/p&gt;

&lt;p&gt;So let's goooo!!&lt;/p&gt;

&lt;p&gt;Below are the table of contents.&lt;/p&gt;

&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;h2&gt;
  
  
  What tools do we need?
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Writing a smart contract.
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Compiling and deploying to the JavaScript VM.
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Testing the smart contract.
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;Oi, so here we going to be building a smart contract that can be able to send funds(ether) from one Ethereum account/address to another. Also, we will be adding a feature that allows only the owner(deployer) of the contract to be able to send these funds(ether).&lt;/p&gt;

&lt;h2&gt;
  
  
  What tools do we need?
&lt;/h2&gt;

&lt;p&gt;The tools we will be needing for this tutorial is nothing other than the &lt;a href="http://remix.ethereum.org/" rel="noopener noreferrer"&gt;remix Ethereum&lt;/a&gt; web IDE for quick and rapid development and deployment of smart contracts written in Solidity.&lt;/p&gt;

&lt;p&gt;You don't need to know anything about solidity or smart contracts in order to follow up with this tutorial as this is beginner friendly, and I try my best to explain every line of code as I write them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Writing a smart contract
&lt;/h2&gt;

&lt;p&gt;In order to get started, you have to jump over to this website known as &lt;a href="http://remix.ethereum.org/" rel="noopener noreferrer"&gt;Remix Ethereum&lt;/a&gt;. The below is a screenshot of the interface of a website you might get some annoying pop-ups so just hit the decline or accept button to get in.&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%2Fuploads%2Farticles%2Fi3kmynr3nzoi8fqxn6uo.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%2Fuploads%2Farticles%2Fi3kmynr3nzoi8fqxn6uo.jpg" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once we are here, head over to the left sidebar and locate the file icon. Click on it and it should pull up a makeshift file manager.&lt;/li&gt;
&lt;li&gt;Locate the contract folder and click on it.&lt;/li&gt;
&lt;/ul&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%2Fuploads%2Farticles%2Fasgpkvkwu8bbbuygb95d.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%2Fuploads%2Farticles%2Fasgpkvkwu8bbbuygb95d.PNG" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Just right above the contract folder you should see a file icon at the very top just beside the folder icon. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click on it and it should generate a fresh file which you can name anything. But in this case, I'm going to name it &lt;strong&gt;sendEther.sol&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Great, now let's get started with the good stuff.&lt;/p&gt;

&lt;p&gt;Write the below on the first line of your solidity file. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;// SPDX-License-Identifier: MIT&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This tells the Solidity compiler that we are using the MIT license for this program.&lt;br&gt;
SPDX means "Software Package Data Exchange" an open standard for software bill of materials.&lt;br&gt;
SPDX allows the expression of components, licenses, copyrights, security references and other metadata relating to software.&lt;br&gt;
You can read more about this &lt;a href="https://en.wikipedia.org/wiki/Software_Package_Data_Exchange" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Next, let's define the version of Solidity we are going to use by writing the below.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pragma solidity ^0.8.11;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This tells the compiler that we are going to be using the 0.8.11 and above version of Solidity.&lt;br&gt;
Ps: Solidity is a strongly typed compiled language so the semi colons are necessary.&lt;/p&gt;

&lt;p&gt;Let's write a smart contract by using the Contract keyword like below.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;contract SendEth{}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This is kind of the entry point where you can start writing out the functionalities, related state variables and logic of your contract. It's kind of conventional to capitalize the contract identifier. It can be any name you want, doesn't matter.&lt;/p&gt;

&lt;p&gt;This smart contract is going to be needing two state variables named amount (for holding the amount to be sent) and the owner address.&lt;/p&gt;

&lt;p&gt;Write the below inside your already defined contract body.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uint public amount;
address payable owner;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Solidity just like other languages have datatypes and uint is one of them. It actually means unsigned integer (no negatives say -20,nah we don't do that here)&lt;/p&gt;

&lt;p&gt;Some other Solidity datatypes include bool, struct, mapping, string, address…&lt;/p&gt;

&lt;p&gt;&lt;code&gt;address payable owner;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Since we are sending ether from our Ethereum address we need to add the "payable" keyword right before our identifier.&lt;/p&gt;

&lt;p&gt;Now, let's write the constructor just below our state variables.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;constructor () {
     owner = payable(msg.sender); // set the deployer of contract as the owner
   }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The constructor allows us to define some logic to be set during the deployment of our smart contract. Let's say for example you want instantiate say a name variable during deployment, you do that in the constructor.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;owner = payable(msg.sender);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here, we are calling the owner address that we declared as a state variable and assigning it to &lt;strong&gt;msg.sender&lt;/strong&gt;. Then we cast the msg.sender as a payable address.&lt;br&gt;
&lt;strong&gt;msg.sender&lt;/strong&gt; is kind of a global variable that you get access to in your contract and in this case, it holds the payable (can receive ether) address of the person who deployed the contract.&lt;/p&gt;

&lt;p&gt;This might be confusing tho, I will clear the air once we get to the deployment stage so you can see it for yourself.&lt;/p&gt;

&lt;p&gt;Your file right now should contain the below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// SPDX-License-Identifier: MIT

pragma solidity ^0.8.11;

contract SendEth {
   uint public amount;
   address payable owner;
   constructor (){
     owner = payable(msg.sender); // set the deployer of contract as the owner
   }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, let's write a function to enable us send Ether to any address.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function sendEth(address payable receiver) payable public{
     }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we are declaring a function with name of &lt;strong&gt;sendEth **and a parameter of a **payable address.&lt;/strong&gt; Any address sent in to this function should be able to receive funds (payable).&lt;br&gt;
Also, since the function allows one to be able to send ether to another account we need to add the &lt;strong&gt;payable&lt;/strong&gt; keyword to it.&lt;br&gt;
The *&lt;em&gt;public *&lt;/em&gt; keyword ensures that this function is able to seen and be called anywhere within the smart contract.&lt;/p&gt;

&lt;p&gt;Now, add the below statement into the function body.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;require(owner == msg.sender, "Only the owner can send funds");
amount = msg.value;
receiver.transfer(amount);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first line ensures that only the owner of the contract who deployed it can be able to call this function. That means an outsider with a different Ethereum address can't send funds by calling this function.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;amount = msg.value;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here, we are setting the value the owner of the contract sent to the variable amount. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;msg.value&lt;/strong&gt; is another global variable that is available to you.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;receiver.transfer(amount);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then we send the ether to the address passed into the function as an argument using the &lt;strong&gt;transfer()&lt;/strong&gt; function.&lt;/p&gt;

&lt;p&gt;And that's it!! Your whole code should be like this below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.11;

contract Sender {
   uint public amount;
   address payable owner;

   constructor (){
     owner = payable(msg.sender); // set the deployer of contract as the owner
   }
   function sendEth(address payable receiver) payable public{
     require(owner == msg.sender, "Only the owner can send funds");
     amount = msg.value;
     receiver.transfer(amount);
}
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, it's time to deploy.&lt;br&gt;
Go to the left of your sidebar and click on the solidity icon.&lt;br&gt;
You should see the below.&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%2Fuploads%2Farticles%2Fi27czliq6zm51oovjnoq.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%2Fuploads%2Farticles%2Fi27czliq6zm51oovjnoq.PNG" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If the compiler version is not on the version you wrote your contract in, you can change it here by switching to your preferred compiler.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Also, check the auto compile button so it auto compiles your code.&lt;/li&gt;
&lt;li&gt;Click the "compile" button to compile it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Deploying.&lt;/p&gt;

&lt;p&gt;Cool, now we are going to deploy the contract on the JavaScript VM. This is a makeshift in-memory blockchain that remix avails us with.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click the icon below the compile one and you should get the screen below.&lt;/li&gt;
&lt;/ul&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%2Fuploads%2Farticles%2Fjzi6nwmx3se2g151ls81.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%2Fuploads%2Farticles%2Fjzi6nwmx3se2g151ls81.PNG" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once here there are couple of things to do:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Leave the environment as JavaScript VM.&lt;/li&gt;
&lt;li&gt;Select the eth account that you want to deploy the contract with. The first eth account is good enough.&lt;/li&gt;
&lt;li&gt;Leave the gas fees and stuff as is.(Submit to the process)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finally, click on the red deploy button.&lt;br&gt;
If you see this green light in the console, then it was successful. &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%2Fuploads%2Farticles%2F6j6oht0t9wev34021xh9.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%2Fuploads%2Farticles%2F6j6oht0t9wev34021xh9.PNG" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Phew!! You can beat your chest right now and change your Twitter bio to "Smart Contract/Blockchain developer"&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing the smart contract
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Scroll down below and you should see some text that says "Deployed contract"&lt;/li&gt;
&lt;li&gt;Expand the accordion and you should see two buttons. The "sendEth" function and "amount" variable we created.&lt;/li&gt;
&lt;/ul&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%2Fuploads%2Farticles%2F3zjzhhjqfxj0z66t3q1b.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%2Fuploads%2Farticles%2F3zjzhhjqfxj0z66t3q1b.PNG" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now go up to the account dropdown and switch to a new account(Seecond eth address).&lt;/li&gt;
&lt;li&gt;Copy the account address by clicking on the copy icon beside it.&lt;/li&gt;
&lt;/ul&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%2Fuploads%2Farticles%2Fzygon8c2h7jbfi7z6x01.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%2Fuploads%2Farticles%2Fzygon8c2h7jbfi7z6x01.PNG" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Change back to the account which you deployed your contract with. In my case, it was the first account.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; &lt;em&gt;It is pertinent that you use the same Eth account that you used to deploy or else it won't work.&lt;/em&gt; Remember the &lt;strong&gt;require()&lt;/strong&gt; that we added to the top of the **sendEth **function? Yo, you do.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Copy the account address (second address) and paste into the &lt;strong&gt;sendEth&lt;/strong&gt; textfield.&lt;/li&gt;
&lt;li&gt;On the "Value" dropdown change the 0 to any number of your choice and change the "wei" to "ether".&lt;/li&gt;
&lt;li&gt;Scroll down and smash the sendEth button. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Bam!! You just sent ether to another eth address.&lt;/p&gt;

&lt;p&gt;Check the other account where you copied the address and it should increment by the amount of ether you sent in.&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%2Fuploads%2Farticles%2Fwul47c0phmz7n6oage89.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%2Fuploads%2Farticles%2Fwul47c0phmz7n6oage89.PNG" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now switch the account to a new one and try sending some eth to it. You will encounter an error that says "Only the owner of the contract can send funds" (Its our handwork o.)&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%2Fuploads%2Farticles%2F21gebewowuo6xshgs24t.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%2Fuploads%2Farticles%2F21gebewowuo6xshgs24t.PNG" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
And there you have it, you were able to write a smart contract that can send ether to a different account and learnt the basics of solidity while at it.&lt;/p&gt;

&lt;p&gt;You might be asking "Is it because of this 7 lines of code that you wrote this term paper of an article?"&lt;/p&gt;

&lt;p&gt;Well, I assumed you had no prior knowledge of Solidity so I tried to explain every line of code to avoid any confusion.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;You can follow me on &lt;a href="https://github.com/sparkle666" rel="noopener noreferrer"&gt;GitHub &lt;/a&gt;I want to see what projects you are working on.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Sayonara...&lt;/p&gt;

</description>
      <category>solidity</category>
      <category>web3</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Writing and Deploying A Solidity Smart Contract to Rinkeby Test Network</title>
      <dc:creator>Sixtus Anyanwu</dc:creator>
      <pubDate>Wed, 09 Mar 2022 00:57:34 +0000</pubDate>
      <link>https://forem.com/sparklesix/writing-and-deploying-a-solidity-smart-contract-to-rinkeby-test-network-2d0k</link>
      <guid>https://forem.com/sparklesix/writing-and-deploying-a-solidity-smart-contract-to-rinkeby-test-network-2d0k</guid>
      <description>&lt;p&gt;Yooooo!! Here, I am going to show you how to write, compile and deploy a solidity smart contract on the Rinkeby Test Network. So lets go!!&lt;/p&gt;

&lt;p&gt;Watch the video version on Vimeo &lt;a href="https://vimeo.com/686056363/87e25e4621" rel="noopener noreferrer"&gt;&amp;gt;&amp;gt;&amp;gt; here&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Table of contents&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is a smart contract?&lt;/li&gt;
&lt;li&gt;What is solidity and its uses?&lt;/li&gt;
&lt;li&gt;What is the best online solidity IDE?&lt;/li&gt;
&lt;li&gt;Writing and Compiling a smart contract.&lt;/li&gt;
&lt;li&gt;Deploying a smart contract.&lt;/li&gt;
&lt;li&gt;Installing Metamask&lt;/li&gt;
&lt;li&gt;How to get some Ethereum for the Rinkeby test network&lt;/li&gt;
&lt;li&gt;Deploying to Rinkeby test network using Injected Web 3&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What is a smart contract?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A smart contract is a computer program or transaction protocol that is designed to automate the execution, control, and documentation of legally significant events and activities in accordance with the conditions of a contract or agreement.&lt;/p&gt;

&lt;p&gt;The decrease of the need for trusted intermediaries, arbitration and enforcement costs, fraud losses, and purposeful and inadvertent exceptions are all goals of smart contracts.&lt;/p&gt;

&lt;p&gt;Smart contracts eliminate the requirement for a centralized system, legal system, or external enforcement mechanism to carry out trustworthy trades and agreements between distant, anonymous participants.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is solidity and its uses?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Solidity is an object-oriented programming language designed exclusively for building and developing smart contracts on Blockchain systems by the Ethereum Network team.&lt;br&gt;
It's used to establish smart contracts in the blockchain system that apply business logic and produce a sequence of transaction records.&lt;/p&gt;

&lt;p&gt;Solidity is a programming language that allows you to write machine-level code and compile it on the Ethereum Virtual Machine (EVM).&lt;/p&gt;

&lt;p&gt;It is comparable to C and C++ in many ways and is relatively easy to learn and understand. A "main" in C, for example, is identical to a "contract" in Solidity.&lt;/p&gt;
&lt;h4&gt;
  
  
  What is the best online solidity IDE?
&lt;/h4&gt;

&lt;p&gt;The best online solidity IDE can be found &lt;a href="https://remix.ethereum.org/" rel="noopener noreferrer"&gt;here&lt;/a&gt;. A remix Ethereum IDE with lots of cool features.&lt;/p&gt;

&lt;p&gt;It is an IDE offered by remix that allows you to write, and smart contracts on the solidity programming language. It has a couple of functionalities which includes basic file explorer, ability to create new file, folders, an inbuilt compiler and a functionality to deploy your smart contracts.&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%2Fuploads%2Farticles%2F3kaco168g758kx3ojvts.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%2Fuploads%2Farticles%2F3kaco168g758kx3ojvts.PNG" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Writing and Compiling a smart contract
&lt;/h4&gt;

&lt;p&gt;To create a solidity file, go to the file explorer and click on it. This should load a couple of predefined files. Click the contracts folder and hit the file icon on the top to create a solidity file.&lt;br&gt;
Name it anything of your choice in my case I used "ContractTus.sol"&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%2Fuploads%2Farticles%2F2ym5rvgklvznqirk573u.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%2Fuploads%2Farticles%2F2ym5rvgklvznqirk573u.PNG" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Inside of your newly created solidity file, copy and paste the below code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.7;

contract HelloWorld{
    string greeting;

    constructor(string memory _greeting) {
        greeting = _greeting;
    }
    function getGreeting() public view returns (string memory){
        return greeting;
    }
    function setGreet(string memory _greeting) public {
        // string memory greet = _greeting;
        greeting = _greeting;
    }
}

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

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;//SPDX-License-Identifier: UNLICENSED&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Here we are adding a commented license, its is necessary you add this else solidity compiler will complain.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pragma solidity ^0.8.7;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here we are telling the compiler "Yo man, I am going to be using version 0.8.7 or higher for writing this smart contract. So you better know whats up. I won't say this again. Ya' heard?"&lt;/p&gt;

&lt;p&gt;&lt;code&gt;contract HelloWorld{...}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here, we are creating a basic smart contract, think of this as a class in any programming language say Java or Python.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;constructor(string memory _greeting) {
        greeting = _greeting;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this line, we are creating a constructor that gets called on deployment of this smart contract. We are passing a _greeting argument that will passed in during deployment to initialize the state variable greeting.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function getGreeting() public view returns (string memory){
        return greeting;
    }
    function setGreet(string memory _greeting) public {
        // string memory greet = _greeting;
        greeting = _greeting;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we are creating two functions, the first function has a returns added to it to show that it actually returns a value. In this case &lt;strong&gt;greeting&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The second function is just a fancy function that takes in a string argument and sets that argument to the state variable.&lt;/p&gt;

&lt;h4&gt;
  
  
  Compiling your smart contract
&lt;/h4&gt;

&lt;p&gt;Thanks to the remix Ethereum IDE, we can be able to compile our solidity code in the browser. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Locate the compile icon on the side bar to your left and click on it.&lt;/li&gt;
&lt;li&gt;Ensure that your version tallies with the you used on your smart contract.&lt;/li&gt;
&lt;li&gt;Set language to "Solidity" (You can still use Liquidity language... Kidding yo)&lt;/li&gt;
&lt;li&gt;EVM version - Compiler Default.&lt;/li&gt;
&lt;li&gt;You can also leave it at auto compile.&lt;/li&gt;
&lt;li&gt;Then hit the *&lt;em&gt;compile *&lt;/em&gt; button.&lt;/li&gt;
&lt;/ul&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%2Fuploads%2Farticles%2Fxq41lxbawj32xf72jy6m.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%2Fuploads%2Farticles%2Fxq41lxbawj32xf72jy6m.PNG" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Great! You just wrote and compiled your first solidity smart contract. (It's time you build your own Binance clone yo. You're good. Allow we mortals to continue playing around with good old "padding-left: 2px")&lt;/p&gt;

&lt;p&gt;Its time to deploy!!&lt;/p&gt;

&lt;p&gt;Oi! Oi!! Hold up tiger... We will be using injected web 3 so go get your Metamask account.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Installing Metamask&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Meta mask extension can be installed using the google chrome store here.&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%2Fuploads%2Farticles%2F96rctdgjwsfitwjf69y0.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%2Fuploads%2Farticles%2F96rctdgjwsfitwjf69y0.PNG" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Install it, create an account, get your seed phrase, and then toggle on the show other networks option.&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%2Fuploads%2Farticles%2Fa5oweu62jhljj345jf6m.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%2Fuploads%2Farticles%2Fa5oweu62jhljj345jf6m.PNG" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yoo... We are making progress here.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to get some Ethereum for the Rinkeby test network&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To get some eth, first switch your account from Ethereum Main Network to Rinkeby network.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once you do that hit the button with the weird zeros to copy your Rinkeby contract address.&lt;/li&gt;
&lt;/ul&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%2Fuploads%2Farticles%2Fpqp3i6sc495vsbidfxv3.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%2Fuploads%2Farticles%2Fpqp3i6sc495vsbidfxv3.PNG" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Stop by this website &lt;a href="https://rinkebyfaucet.com/" rel="noopener noreferrer"&gt;https://rinkebyfaucet.com/&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Paste your wierd zeros in there and hit the &lt;strong&gt;Send Me Eth&lt;/strong&gt; button, (Yoo, you got to beg them to send you some eth, so be humble)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It usually takes a couple of seconds to get your 0.1 Eth&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%2Fuploads%2Farticles%2F5yohdhadbd0qy8yol1by.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%2Fuploads%2Farticles%2F5yohdhadbd0qy8yol1by.PNG" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(We rich yo. Time to start pricing land in your village.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deploying to Rinkeby test network using Injected Web 3&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Next, go back to your Remix Ethereum IDE and hit the deploy icon by your left, just beneath the compile icon on the side bar. you should see the below screen.&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%2Fuploads%2Farticles%2Fu26mo21gor7qri7ianz3.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%2Fuploads%2Farticles%2Fu26mo21gor7qri7ianz3.PNG" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now switch that from Javascript VM to Injected Web 3.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Leave the gas limit and every other thing as is and then type in a greeting on the provided text field ( Remember the constructor thingy? Damn, I knew you forgot! I need an Uzi somebody.) &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enter some greeting and hit the deploy button.&lt;br&gt;
&lt;strong&gt;PS:&lt;/strong&gt; Enter the text in quotes, "Oi!" like so.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A screen is going to appear and ask you to connect Metamask. Do that real quick.&lt;/p&gt;

&lt;p&gt;The next screen is going to be a gas fee charge, just hit on approve and boom!!! You successfully deployed your smart contract to Rinkeby. (Drinks on me!)&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%2Fuploads%2Farticles%2Fbumb5ctb4nab16av24lb.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%2Fuploads%2Farticles%2Fbumb5ctb4nab16av24lb.PNG" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
You can view the transaction on EtherScan or whatever you want to do with it.&lt;/p&gt;

&lt;p&gt;My name is Sparkle and I am signing out yo. Follow me for more of these step by step articles.&lt;/p&gt;

</description>
      <category>web3</category>
      <category>solidity</category>
      <category>ether</category>
      <category>ethereum</category>
    </item>
    <item>
      <title>Difference between Web 2.0 and Web 3.0</title>
      <dc:creator>Sixtus Anyanwu</dc:creator>
      <pubDate>Wed, 02 Mar 2022 17:07:23 +0000</pubDate>
      <link>https://forem.com/sparklesix/difference-between-web-20-and-web-30-2ln4</link>
      <guid>https://forem.com/sparklesix/difference-between-web-20-and-web-30-2ln4</guid>
      <description>&lt;p&gt;Web 2.0 pertains to websites that emphasize user-generated content, usability, and interoperability for end users all over the world. &lt;br&gt;
The participative social web is another name for Web 2.0. It does not refer to a change in a technical definition, but rather to a change in the way Web pages are built and used. The transition is advantageous, although it does not appear to be the case when the changes occur. &lt;br&gt;
Web 2.0 allows users to interact and collaborate with one another in a social media dialogue as creators of user-generated content in a virtual community.&lt;br&gt;
AJAX and JavaScript frameworks are among the web browser technologies that are employed in Web 2.0 development.&lt;/p&gt;

&lt;p&gt;Where as, Web 3.0 is a catch-all term that encompasses a variety of web usage and interaction evolutions. Data isn't owned in this case; instead, it's shared, with multiple views for the same web / data being displayed by different services.&lt;br&gt;
It involves the embedding intelligence throughout the web and deploying robots to make decisions on the user's behalf. It is concerned with the establishing a uniform standard for websites to express content so that any computer program can comprehend the semantic meaning given by the web page.&lt;/p&gt;

&lt;p&gt;Ref: &lt;a href="//www.blockgames.gg"&gt;Blockgames&lt;/a&gt;, &lt;a href="//www.zuri.team"&gt;ZuriTeam&lt;/a&gt;, &lt;a href="//www.nestcoin.com"&gt;Nestcoin&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
