<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kingsley Umujeyan</title>
    <description>The latest articles on DEV Community by Kingsley Umujeyan (@kuicpet).</description>
    <link>https://dev.to/kuicpet</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%2F823778%2F1c975a20-a940-48bb-8c85-eeda364d1b79.jpeg</url>
      <title>DEV Community: Kingsley Umujeyan</title>
      <link>https://dev.to/kuicpet</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kuicpet"/>
    <language>en</language>
    <item>
      <title>Building a Github Profile App using ReactJS</title>
      <dc:creator>Kingsley Umujeyan</dc:creator>
      <pubDate>Sat, 07 Jan 2023 12:52:36 +0000</pubDate>
      <link>https://dev.to/kuicpet/building-a-github-profile-using-reactjs-1b8b</link>
      <guid>https://dev.to/kuicpet/building-a-github-profile-using-reactjs-1b8b</guid>
      <description>&lt;p&gt;This was a project built as part of my second semester exams at &lt;a href="https://www.altschoolafrica.com/" rel="noopener noreferrer"&gt;AltSchoolAfrica&lt;/a&gt;. &lt;/p&gt;

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

&lt;p&gt;The task was to build a ReactJS app that fetches my Github portfolio with the following key functionalities&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Show a page with a list of all my repositories on Github&lt;/li&gt;
&lt;li&gt;Show another page linking to each repositories using nested routes while using all the necessary tools in React.&lt;/li&gt;
&lt;li&gt;Implement proper SEO (Search Engine Optimisation)&lt;/li&gt;
&lt;li&gt;Implement Error Boundary functionalities&lt;/li&gt;
&lt;li&gt;Add a 404 page.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can find the source code on &lt;a href="https://github.com/kuicpet/github_user_profile" rel="noopener noreferrer"&gt;Github&lt;/a&gt; and app was hosted on &lt;a href="https://github-kuicpet.vercel.app/" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lets go through the steps I followed in creating this project.&lt;/p&gt;

&lt;h2&gt;
  
  
  ReactJS
&lt;/h2&gt;

&lt;p&gt;ReactJS is an open-source JavaScript library for building user interfaces and creating interactive web applications. React is primarily used for building single-page applications and mobile applications. It uses a declarative, component-based approach to making user interfaces, which makes it easier to build and maintain complex user interfaces. React also makes it easier to create reusable components that can be used across different applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scaffolding the app
&lt;/h2&gt;

&lt;p&gt;The first step was to scaffold the react app using &lt;a href="https://create-react-app.dev/" rel="noopener noreferrer"&gt;create-react-app&lt;/a&gt; using &lt;code&gt;npx create-react-app github_profile&lt;/code&gt; on my terminal after which I changed directory into the project folder and on the terminal ran the command &lt;code&gt;yarn start&lt;/code&gt; to start the development server on &lt;code&gt;http://localhost:3000&lt;/code&gt;&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%2Fjn9k8ki8tmh2wd5vpwa2.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%2Fjn9k8ki8tmh2wd5vpwa2.png" alt="Image description" width="800" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NPM (Node Package Manager) Dependencies&lt;/strong&gt;&lt;br&gt;
The next step was installing the npm dependencies by running the command on the terminal &lt;br&gt;
&lt;code&gt;yarn add react-router-dom styled-components react-icons react-helmet react-error-boundary moment&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;App Folder Structure&lt;/strong&gt;&lt;br&gt;
The next step was creating sub-folders inside the &lt;code&gt;src&lt;/code&gt; folder &lt;br&gt;
namely &lt;code&gt;assets components hooks pages&lt;/code&gt;&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%2Fhhcbhjznztzosyvpsuqm.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%2Fhhcbhjznztzosyvpsuqm.png" alt="Image description" width="800" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;assets&lt;/code&gt; folder to hold image assets, the &lt;code&gt;components&lt;/code&gt; folder to hold reusable components, the &lt;code&gt;hooks&lt;/code&gt; folder to hold logic for api calls and the &lt;code&gt;pages&lt;/code&gt; folder to hold different pages.&lt;/p&gt;
&lt;h2&gt;
  
  
  Continuous Integration and Continuous Development (CI/CD)
&lt;/h2&gt;

&lt;p&gt;I created the project repository on &lt;a href="https://github.com" rel="noopener noreferrer"&gt;Github&lt;/a&gt;, and using the command line on my  terminal pushed the code to github to save and track changes and updates during development.&lt;br&gt;
I also setup the app to be hosted on &lt;a href="http://vercel.com/" rel="noopener noreferrer"&gt;Vercel&lt;/a&gt;, this to make me see the changes both on my local machine and on a hosted link.&lt;/p&gt;
&lt;h2&gt;
  
  
  Building the app
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Components&lt;/strong&gt;&lt;br&gt;
After creating the needed app folder structure,next was to create the reusable components in the components folder as shown in the image below&lt;br&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%2Fearvuqrhahcgwtba3saw.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%2Fearvuqrhahcgwtba3saw.png" alt="Image description" width="800" height="412"&gt;&lt;/a&gt;&lt;br&gt;
I added an &lt;code&gt;index.js&lt;/code&gt; file to export the components from components folder to make my code cleaner when importing these components.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import Button from './Button'
import Card from './Card'
import Header from './Header'
import Footer from './Footer'
import Loader from './Loader'
import SearchBar from './SearchBar'
import Grid from './Grid'
import Meta from './Meta'
import BreadCrumb from './BreadCrumb'
import Paginate from './Paginate'
import Card2 from './Card2'

export {
  Button,
  Card,
  Header,
  Footer,
  Loader,
  SearchBar,
  Grid,
  Meta,
  BreadCrumb,
  Paginate,
  Card2
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To see the detailed code for each component, please check out the &lt;a href="https://github.com/kuicpet/github_user_profile" rel="noopener noreferrer"&gt;repository&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;API&lt;/strong&gt;&lt;br&gt;
Briefly an API (Application Programming Interface) is an interface or set of protocols that provides a way for different applications to interact with each other. An API can allow two applications to communicate with each other and exchange data, making it easier for developers to create applications that work with other applications. APIs can also be used to access data stored in databases or other services.&lt;br&gt;
For this app I made use of the &lt;a href="https://docs.github.com/en/rest?apiVersion=2022-11-28" rel="noopener noreferrer"&gt;Github api&lt;/a&gt;, and then obtained an access token from Github to enable me interact with the api from the react app, please make sure your access token is saved in an &lt;code&gt;.env file&lt;/code&gt; and the environment file &lt;code&gt;.env&lt;/code&gt; added to the &lt;code&gt;.gitignore file&lt;/code&gt; to prevent exposing your access token on github&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%2Fhflrffs6r9g6fmdvu2sx.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%2Fhflrffs6r9g6fmdvu2sx.png" alt="Image description" width="800" height="408"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Custom hooks&lt;/strong&gt;&lt;br&gt;
Next I created custom hooks inside the hooks folder for interacting with the api and making api calls from the Github api endpoints, As seen in the image below, I created 3 custom hooks, &lt;code&gt;useApiFetch.js&lt;/code&gt; to fetch my github repositories, &lt;code&gt;useProfileFetch.js&lt;/code&gt; to fetch my github profile and &lt;code&gt;useRepoFetch&lt;/code&gt; to fetch a single repository using the &lt;code&gt;repoId&lt;/code&gt;&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%2F0zabc0j96nnffnk662iy.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%2F0zabc0j96nnffnk662iy.png" alt="Image description" width="800" height="410"&gt;&lt;/a&gt;&lt;br&gt;
To see the detailed code for each custom hook, please check out the &lt;a href="https://github.com/kuicpet/github_user_profile" rel="noopener noreferrer"&gt;repository&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pages&lt;/strong&gt;&lt;br&gt;
Next was to create the different pages namely &lt;code&gt;Home, NotFound (404),Error, Repos, SingleRepo, SearchResults&lt;/code&gt;, inside the pages folder as shown in the image below&lt;br&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%2F6z6ocwucdjwsn7y47vi8.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%2F6z6ocwucdjwsn7y47vi8.png" alt="Image description" width="800" height="410"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Routing and Error Boundary implementation&lt;/strong&gt;&lt;br&gt;
Routing was implemented using &lt;code&gt;react-router-dom&lt;/code&gt;,while Error boundary was implemented using &lt;code&gt;react-error-boundary&lt;/code&gt;,  both are npm packages for react. The routes created were for the different pages, below is the code for the routing and error-boundary&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Index.js file
import React from 'react'
import ReactDOM from 'react-dom/client'
import { ErrorBoundary } from 'react-error-boundary'
import { BrowserRouter as Router } from 'react-router-dom'
import './index.css'
import App from './App'
import reportWebVitals from './reportWebVitals'
import styled from 'styled-components'


const ErrorFallback = ({ error }) =&amp;gt; {
  return (
    &amp;lt;Container&amp;gt;
      &amp;lt;Content&amp;gt;
        &amp;lt;p&amp;gt;Something went wrong&amp;lt;/p&amp;gt;
        &amp;lt;pre&amp;gt;{error.message}&amp;lt;/pre&amp;gt;
      &amp;lt;/Content&amp;gt;
    &amp;lt;/Container&amp;gt;
  )
}

export const Container = styled.section`
  display: flex;
  flex-direction: column;
  width: 100%;
  align-items: center;
  justify-content: center;
  min-height: 75vh;
`
export const Content = styled.div`
  p {
    font-size: 1.5rem;
    font-weight: 200;
    text-align: center;
    color: black;
    margin: 0.5rem 0;
    //width: 50% ;
    @media screen and (max-width: 400px) {
      font-size: 2rem;
    }
  }
  pre {
    color: red;
    width: 50%;
    text-align: center;
  }
`

const root = ReactDOM.createRoot(document.getElementById('root'))
root.render(
  &amp;lt;React.StrictMode&amp;gt;
    &amp;lt;Router&amp;gt;
      &amp;lt;ErrorBoundary FallbackComponent={ErrorFallback}&amp;gt;
        &amp;lt;App /&amp;gt;
      &amp;lt;/ErrorBoundary&amp;gt;
    &amp;lt;/Router&amp;gt;
  &amp;lt;/React.StrictMode&amp;gt;
)

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals()

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;App.js file
import React from 'react'
import { Route, Routes } from 'react-router-dom'
import { Footer, Header } from './components'
import Home from './pages/Home'
import Repos from './pages/Repos'
import SingleRepo from './pages/SingleRepo'
import NotFound from './pages/NotFound'
import styled from 'styled-components'
import SearchResults from './pages/SearchResults'

const App = () =&amp;gt; {
  return (
    &amp;lt;Container&amp;gt;
      &amp;lt;Header /&amp;gt;
      &amp;lt;Routes&amp;gt;
        &amp;lt;Route exact path='/' element={&amp;lt;Home /&amp;gt;} /&amp;gt;
        &amp;lt;Route exact path='/search/:keyword' element={&amp;lt;SearchResults /&amp;gt;} /&amp;gt;
        &amp;lt;Route exact path='/repos' element={&amp;lt;Repos /&amp;gt;} /&amp;gt;
        &amp;lt;Route exact path='/repos/:repoId' element={&amp;lt;SingleRepo /&amp;gt;} /&amp;gt;
        &amp;lt;Route path='*' element={&amp;lt;NotFound /&amp;gt;} /&amp;gt;
      &amp;lt;/Routes&amp;gt;
      &amp;lt;Footer /&amp;gt;
    &amp;lt;/Container&amp;gt;
  )
}

export const Container = styled.div`
background-color: rgba(255, 255, 255, 0.16);
`

export default App

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Styling&lt;/strong&gt;&lt;br&gt;
For styling, I used styled-components in writing the css for each components and pages,as this saves me time editing bulky, clumsy, and sometimes complex CSS files as the app grows bigger with additional features.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Additional Features&lt;/strong&gt;&lt;br&gt;
In addition to the basic functionality of fetching my Github repositories,and view the individual repository details, I added  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Search Functionality, where you can search for any Github user by their username, &lt;/li&gt;
&lt;li&gt;A Search Results page for displaying the searched Github user profile details.&lt;/li&gt;
&lt;li&gt;Pagination Functionality, to make it easier to view my repositories which enhances the user experience as they don't have to scroll all the way down to view more repositories.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Recent Improvements&lt;/strong&gt;&lt;br&gt;
I recently updated some features to improve the User experience&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;on mobile devices, the font weight was increased to make the descriptions on the repository cards more readable.&lt;/li&gt;
&lt;li&gt;I added a skeleton loading state, to give user feedback as app is loading using the &lt;code&gt;react-loading-skeleton npm package&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Future Additional Features&lt;/strong&gt;&lt;br&gt;
I am hoping to add other features to this app in future, such as &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Authentication Functionality, where a user can sign up and login to view their Github Repositories&lt;/li&gt;
&lt;li&gt;Improve the user interface (UI) and enhance the user experience (UX)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If there is a feature you would like to see, please let me know by adding a comment to this article, thanks.&lt;/p&gt;

&lt;p&gt;You can find the source code on &lt;a href="https://github.com/kuicpet/github_user_profile" rel="noopener noreferrer"&gt;Github&lt;/a&gt; &lt;/p&gt;

</description>
      <category>discuss</category>
    </item>
    <item>
      <title>Let's talk web2 vs web3</title>
      <dc:creator>Kingsley Umujeyan</dc:creator>
      <pubDate>Tue, 01 Mar 2022 22:23:44 +0000</pubDate>
      <link>https://dev.to/kuicpet/lets-talk-web2-vs-web3-31lk</link>
      <guid>https://dev.to/kuicpet/lets-talk-web2-vs-web3-31lk</guid>
      <description>&lt;p&gt;The web was first created in 1989 by &lt;a href="https://en.wikipedia.org/wiki/Tim_Berners-Lee"&gt;Tim Berners-Lee&lt;/a&gt;, who wanted to create a global communication tool that would allow different computer systems to connect easily, read and save documents and at that time the internet was mostly used for academic and government purposes. This was the first iteration of the internet, the version of the internet most of us know today is web2,with web3 creeping into mainstream and with this introduction of web3,people are increasingly interested in the way,it will change the web as we know it.That is why companies like &lt;a href="https://nestcoin.com/"&gt;Nestcoin&lt;/a&gt; and &lt;a href="https://zuri.team/"&gt;Zuri&lt;/a&gt; are empowering developers especially in Africa with the relevant skills and knowledge to be part of those that will change the face of the web by creating programs centered on blockchain and web3 with the &lt;a href="https://blockgames.gg/"&gt;Blockgames&lt;/a&gt; as its first program.&lt;br&gt;
Web2 is the version of the internet dominated by companies that provide services in exchange for your personal data while web3 in contrast refers to decentralized apps that run on the blockchain,these applications allow anyone to participate without monetizing their personal data.so you may ask,what.s is web3 bringing to the table?here are some of the benefits of web3&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Anyone who is in the network has permission to use the service-in other words,permission isn't required.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;No one can block you or deny you access to the service&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Payments are built in viz the native tokens,e.g ether&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Let's make practical comparisons between web2 and web3
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In web2, it is centralized and anyone can be censored whereas web3 is decentralized thus can not be censored as control is not controlled by an individual or companies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Payment services may decide to not allow payments for certain reasons or type of work but with web3 payment applications require no personal data and can't prevent payments.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In web2,servers may have down time,be hacked and personal data breached or lost but web3 servers can't have downtime and cannot be hacked. &lt;br&gt;
This is not an exhaustive list since we are still scraping the surface of web3,however every phase of the internet has its limitations and web3 is not excluded&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scalability: Transactions are slower on web3 compared to web2 because of the decentralized nature of web3.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;User Experience: Interacting with web3 applications would require extra steps,software and education,this could be a hurdle for its adoption&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Accessibility: The lack of integration in modern web browsers make web3 less accessible to most users when compared to web2.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cost: building and developing on web3 can be quite expensive when compared with web2 because it cost money to put a code on the blockchain.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However as more people get to know and learn more about this phase of the internet,the challenges of web3 will be overcome,interested in this new phase,you are still early,join &lt;a href="https://blockgames.gg/"&gt;Blockgames&lt;/a&gt; and kick start your blockchain development journey.&lt;/p&gt;

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