<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Osayuki Raymond Okhuarobo on Medium]]></title>
        <description><![CDATA[Stories by Osayuki Raymond Okhuarobo on Medium]]></description>
        <link>https://medium.com/@osayukiraymond?source=rss-b6e3eaaa58ce------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*NVQUAOd5T49oHwsTn0SJ6g.jpeg</url>
            <title>Stories by Osayuki Raymond Okhuarobo on Medium</title>
            <link>https://medium.com/@osayukiraymond?source=rss-b6e3eaaa58ce------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 12:12:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@osayukiraymond/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[HOW TO TEST THE USHAHIDI PLATFORM FOR ACCESSIBILITY]]></title>
            <link>https://osayukiraymond.medium.com/how-to-test-the-ushahidi-platform-for-accessibility-343022dffed7?source=rss-b6e3eaaa58ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/343022dffed7</guid>
            <category><![CDATA[screen-reader]]></category>
            <category><![CDATA[ushahidi]]></category>
            <category><![CDATA[inclusivity]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[accessibility]]></category>
            <dc:creator><![CDATA[Osayuki Raymond Okhuarobo]]></dc:creator>
            <pubDate>Sun, 10 Mar 2024 09:40:42 GMT</pubDate>
            <atom:updated>2024-03-30T06:39:03.550Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Symbol depicting an accessible area" src="https://cdn-images-1.medium.com/max/1024/1*HqxYIbJbkv3wtjccaZO0Bg.jpeg" /></figure><p>In today’s world, it is crucial to prioritize accessibility to create inclusive digital products. A simple Google search defines accessibility as <strong>“the quality of being easy to obtain or use”</strong>.<strong> </strong>The <a href="https://developer.mozilla.org/en-US/docs/Learn/Accessibility/What_is_accessibility">MDN Web Docs</a> defines accessibility as <strong>“the practice of making your websites usable by as many people as possible”</strong>.<strong> </strong>Accessibility ensures that people with disabilities can perceive, understand, navigate, and interact with digital content effectively. The Ushahidi platform aims to provide accessible services to all users, regardless of their abilities.</p><p>While we often associate accessibility with accommodating people with disabilities, it extends beyond that. Here is a closer look:</p><ol><li><strong>Broad Scope:</strong> Accessibility encompasses various groups like people with disability, mobile device users, users with slow network connections, and everyone else.</li><li><strong>Legal Considerations:</strong> In some countries, providing accessible sites is legally mandated. Countries like <a href="https://commonlook.com/international-web-accessibility-standards/">Australia, Canada, China, India, Israel, USA, United Kingdom</a>, etc.</li></ol><h3>About Ushahidi</h3><p><a href="https://www.ushahidi.com/about/our-story/">Ushahidi</a> is a global not-for-profit technology company that develops integrated tools and services to enable people to generate solutions and mobilize communities for good. They build their open-source software to strengthen communities and improve lives, empowering users to rapidly and purposefully gather, analyze, respond and act on data and information. The name Ushahidi comes from the Swahili word for <strong>testimony</strong> related to shahidi, the word for witness.<strong> </strong>It was chosen to reflect how Ushahidi’s technology gave voice to the people of Kenya during a time of <a href="https://en.wikipedia.org/wiki/2007%E2%80%932008_Kenyan_crisis">social and political unrest</a>.</p><h3>The Ushahidi Platform</h3><p>The Ushahidi Platform is an open-source software application that helps you to collect data information important to you, your community, organization or institution via these data sources: Web, Mobile, SMS and Email. It also helps you to manage and analyze the data information that you have collected.</p><h3>Who Is the Ushahidi Platform For?</h3><p>The platform has been a tool traditionally used by Crisis Responders, Human Rights Reporters, and Citizens &amp; Governments Reporters. However, anyone can use the uniqueness of Ushahidi.</p><h3>Testing The Ushahidi Platform for Accessibility</h3><p>The Ushahid Platform’s <a href="https://github.com/ushahidi/platform">backend API</a> is built on the PHP stack using the Laravel framework. The <a href="https://github.com/ushahidi/platform-client">frontend</a> web client is built with Javascript using modern Angular 14+, HTML, CSS and the Angular material library for styling. The mobile client is built using the Ionic framework.</p><p>Before you begin testing, make sure you have the following:</p><ul><li><strong>Access to Ushahidi Platform</strong>: You can find how to gain access to the backend API <a href="https://docs.ushahidi.com/platform-developer-documentation/v/set-up-the-developer-environment-for-ushahidi/set-up-your-developer-environment/setting-up-the-api-with-docker">here</a>, and the web client <a href="https://docs.ushahidi.com/platform-developer-documentation/v/set-up-the-developer-environment-for-ushahidi/set-up-your-developer-environment/setting-up-the-platform-client-for-development">here</a>.</li><li><strong>Screen Reader Software</strong>: Install a screen reader (such as <a href="https://support.freedomscientific.com/Downloads/JAWS">JAWS</a>, <a href="https://www.nvaccess.org/download/">NVDA</a>, or Apple’s <a href="https://www.apple.com/voiceover/info/guide/_1121.html">VoiceOver</a>) for testing.</li><li><strong>Keyboard</strong>: Use a keyboard to navigate the platform without a mouse.</li><li><strong>Colour Contrast Checker</strong>: Use a tool like WebAIM’s Color Contrast Checker to verify colour contrast.</li><li><strong>Browser Developer Tools</strong>: Use inspectors to examine HTML structure and styles.</li></ul><p>Use the below steps to test the Ushahidi Platform for accessibility:</p><ol><li><strong>Keyboard Navigation</strong></li></ol><ul><li><strong>Tab Navigation</strong>: Press the <em>tab</em> key to navigate through the platform. Ensure that focus moves logically from one interactive element to another (buttons, links, form fields).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*znLJSBa_XLmtib_NacbBQw.png" /><figcaption>Arrow points to the current element in focus when the tab key is pressed</figcaption></figure><ul><li><strong>Keyboard Shortcuts</strong>: Test any keyboard shortcuts provided by Ushahidi. Ensure they are consistent and well-documented. However, as at the time of writing this post, there were no keyboard shortcuts provided by the Ushahidi team.</li></ul><p>2. <strong>Screen Reader Testing</strong></p><ul><li><strong>Page Structure</strong>: Use the screen reader to verify that headings, landmarks (such as navigation menus), and other structural elements are correctly announced.</li><li><strong>Alt Text</strong>: Inspect images and ensure they have descriptive alternative text (alt text).</li><li><strong>Form Fields</strong>: Test form fields (input fields, checkboxes, radio buttons) to ensure they are labelled well and announced by the screen reader.</li><li><strong>Focus Indication</strong>: Verify that focus is appropriately indicated when navigating through interactive elements.</li></ul><p>3. <strong>Colour and Contrast</strong></p><ul><li><strong>Colour Contrast</strong>: Use the colour contrast checker to verify that text has sufficient contrast against its background.</li><li><strong>Color-Only Information</strong>: Ensure that information conveyed through colour (e.g., error messages) is also available in text.</li></ul><p>4. <strong>Automated Testing</strong></p><p>Use tools like Lighthouse or <a href="https://chromewebstore.google.com/detail/axe-devtools-web-accessib/lhdoppojpmngadmnindnejefpokejbdd?pli=1">Axe</a> to perform automated checks. Look for issues related to:</p><ul><li><strong>HTML Structure</strong>: Detect missing headings, improper nesting, or redundant elements.</li><li><strong>Contrast</strong>: Highlight low-contrast text.</li><li><strong>ARIA Usage</strong>: Flag incorrect ARIA implementation.</li><li><strong>Keyboard Accessibility</strong>: Identify elements lacking keyboard focus.</li></ul><p>5. <strong>Forms and Error Handling</strong></p><ul><li><strong>Form Validation</strong>: Submit forms with invalid data and verify that error messages are clear and descriptive.</li><li><strong>Error Handling</strong>: Test error handling scenarios (e.g., server errors, timeouts) and ensure users receive informative messages.</li></ul><h3>Conclusion</h3><p>In conclusion, ensuring the accessibility of the Ushahidi platform is essential for creating an inclusive digital experience. By following the testing steps outlined in this documentation, we contribute to a more user-friendly and equitable online environment. Remember that accessibility is an ongoing commitment, and regular checks are crucial to maintaining an accessible platform.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=343022dffed7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Counter app built using Reactjs and Firebase]]></title>
            <link>https://osayukiraymond.medium.com/counter-app-built-using-reactjs-and-firebase-26a55f1d4903?source=rss-b6e3eaaa58ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/26a55f1d4903</guid>
            <category><![CDATA[firebaseauthentication]]></category>
            <category><![CDATA[usecontext]]></category>
            <category><![CDATA[usereducer]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[custom-hook]]></category>
            <dc:creator><![CDATA[Osayuki Raymond Okhuarobo]]></dc:creator>
            <pubDate>Tue, 10 Jan 2023 19:54:12 GMT</pubDate>
            <atom:updated>2023-01-10T20:05:08.883Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a web application built using Reactjs and Firebase, which allows users to perform basic counter operations, such as increment, decrement, reset and setValue. Additionally, it provides Firebase authentication functionalities for user registration, login and logout. The application is designed to make use of several React libraries, such as react-router-dom, react-error-boundary, react-helmet-async, Context API and CSS. This allows the application to be efficient, reusable and easy to manage.</p><p>First of all,</p><p><a href="https://en.wikipedia.org/wiki/React_(JavaScript_library)"><strong>What is React?</strong></a></p><p>React is a JavaScript library used for building user interfaces based on UI components. A React application is usually built around a single HTML element, called the <strong>root element.</strong></p><pre>&lt;body&gt;<br>  &lt;div id=&quot;root&quot;&gt;&lt;/div&gt;<br>&lt;/body&gt;</pre><p>Elements are then rendered to the root element with the ReactDOM.render() method:</p><pre>ReactDOM.createRoot(document.getElementById(&quot;root&quot;));<br>root.render(<br>  &lt;React.StrictMode&gt;<br>    &lt;App /&gt;<br>  &lt;/React.StrictMode&gt;<br>);</pre><h3><strong>Creating a React application</strong></h3><p>To create a React app, you must first have Nodejs installed;</p><figure><img alt="NodeJs" src="https://cdn-images-1.medium.com/max/191/1*GP7LzXF9YZ4JY7k_auxadQ.png" /></figure><p>this is a prerequisite for creating a React app. Next, open you CLI (Command Line Interface) and navigate to the desktop folder, then run the code below:</p><pre>npx create-react-app counter-app</pre><p>then navigate into the ‘counter-app’ folder and run</p><pre>npm run start</pre><h3><strong>Overview</strong></h3><p>A counter application is a basic program that displays a default count of zero (“0”). It allows the user to input a numerical value, as well as to increment, decrement, and reset the count. The application features a navigation bar that includes an active state, which can be used to navigate to the home page, the 404 error page, the Error Boundary page, the CounterWithCustomHook, and the CounterWithReducer page. This provides an easy and intuitive way for the user to navigate through the different sections of the application quickly.</p><p>Its functionality is limited to keep the app simple in nature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ql-t9GPQYrwcASlBNCbDOA.png" /></figure><p>As mentioned above, his web application is constructed using Reactjs, <a href="https://reactrouter.com/en/main">React Router</a>, <a href="https://reactjs.org/docs/error-boundaries.html">React Error Boundary</a>, <a href="https://www.freecodecamp.org/news/react-helmet-examples/">React Helmet Async</a>, the <a href="https://reactjs.org/docs/hooks-reference.html#usecontext">Context API</a>, <a href="https://firebase.google.com/docs/auth/web/start">Firebase Authentication</a>, and <a href="https://www.w3schools.com/css/">CSS</a>. The technology stack comprises of widely adopted libraries, frameworks and technologies of React ecosystem.</p><h3><strong>Features of the app</strong></h3><p>The primary features of the application include increment, decrement, reset, and setValue capabilities. These capabilities were implemented using both a <a href="https://reactjs.org/docs/hooks-custom.html">custom hook</a> and a <a href="https://reactjs.org/docs/hooks-reference.html#usereducer">useReducer</a>. This implementation approach resulted in the creation of two distinct pages, one for the custom hook and the other for the useReducer.</p><p><strong>Counter with reducer</strong></p><p>A reducer function was created to handle the increment, decrement, reset, and setValue operations. This function serves as a centralized location to manage the state transitions of these functionalities.</p><pre>import { useReducer } from &quot;react&quot;;<br><br>//create a custom reducer hook<br><br>const useCounterReducer = () =&gt; {<br>    const initialState = {<br>        count: 0,<br>    };<br>    <br>    //set up reducer for state management<br>    const reducer = (state, action) =&gt; {<br>        switch (action.type) {<br>            case &quot;increment&quot;:<br>                return { ...state, count: state.count + 1 };<br>            case &quot;decrement&quot;:<br>                return { ...state, count: state.count - 1 };<br>            case &quot;reset&quot;:<br>                return { ...state, count: initialState.count };<br>            case &quot;setValue&quot;:<br>                return { ...state, count: action.payload };<br>            default:<br>                return state;<br>        }<br>    };<br><br>    //create a reducer hook<br>    const [state, dispatch] = useReducer(reducer, initialState);<br>    <br>    //return the state and dispatch<br>    return [state, dispatch];<br>};<br><br>export default useCounterReducer;</pre><p>Once created, the reducer function was imported into the CounterWithReducer component, which utilized its functionality to manage the state of the counter app.</p><pre>import { useRef } from &quot;react&quot;;<br>import useCounterReducer from &quot;../hooks/reducer&quot;;<br>import &quot;../assets/css/style.css&quot;;<br><br>function CounterWithReducer() {<br>  const [state, dispatch] = useCounterReducer({ count: 0 });<br>  const inputRef = useRef(null);<br><br>  const increment = () =&gt; {<br>    dispatch({ type: &quot;increment&quot; });<br>  };<br><br>  const decrement = () =&gt; {<br>    if (state.count &gt; 0) {<br>      dispatch({ type: &quot;decrement&quot; });<br>    } else {<br>      return state.count;<br>    }<br>  };<br><br>  const reset = () =&gt; {<br>    dispatch({ type: &quot;reset&quot; });<br>  };<br><br>  const setValue = () =&gt; {<br>    if (inputRef.current.value === &quot;&quot;) {<br>      return state.count;<br>    } else {<br>      dispatch({ type: &quot;setValue&quot;, payload: Number(inputRef.current.value) });<br>      inputRef.current.value = &quot;&quot;;<br>    }<br>  };<br><br>  return (<br>      &lt;main className=&quot;content&quot;&gt;<br>        &lt;p className=&quot;counter-value&quot;&gt;your count is: &lt;span&gt;{state.count}&lt;/span&gt;&lt;/p&gt;<br>        &lt;div className=&quot;set-value-input&quot;&gt;<br>          &lt;input<br>            ref={inputRef}<br>            type={&quot;number&quot;}<br>            placeholder={&quot;Enter number here&quot;}<br>            name=&quot;value&quot;<br>          /&gt;<br>          &lt;button onClick={setValue}&gt;Set Value&lt;/button&gt;<br>        &lt;/div&gt;<br>        &lt;div className=&quot;buttons&quot;&gt;<br>          &lt;button className=&quot;btn&quot; onClick={increment}&gt;<br>            Increase<br>          &lt;/button&gt;<br>          &lt;button className=&quot;btn&quot; onClick={decrement}&gt;<br>            Decrease<br>          &lt;/button&gt;<br>          &lt;button className=&quot;btn reset&quot; onClick={reset}&gt;<br>            Reset<br>          &lt;/button&gt;<br>        &lt;/div&gt;<br>      &lt;/main&gt;<br>  );<br>}<br><br>export default CounterWithReducer;</pre><p>The result of this integration is that the CounterWithReducer component is now able to manage the state of the counter app by utilizing the functionality provided by the reducer function. This includes the ability to increment, decrement, reset, and set the value of the count, which provides the basic functionality of the counter application. See below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*usie71ceBoaXj3JKN0oCFA.gif" /></figure><p><strong>Counter with custom hook</strong></p><p>A custom hook function was developed to manage the increment, decrement, reset, and setValue operations. This custom hook serves as a reusable piece of logic that encapsulates the functionalities, enabling it to be easily shared across different components.</p><pre>import { useRef, useState } from &quot;react&quot;;<br><br>const useCounter = () =&gt; {<br>    const [count, setCount] = useState(0);<br><br>    const inputRef = useRef(null);<br><br>    const increment = () =&gt; {<br>        setCount(prev =&gt; prev + 1)<br>    };<br><br>    const decrement = () =&gt; {<br>        if (count &gt; 0) {<br>            setCount(prev =&gt; prev - 1)<br>        } else {<br>            return <br>        }<br>    };<br><br>    const reset = () =&gt; {<br>        setCount(0);<br>    };<br><br>    const setValue = () =&gt; {<br>        if (inputRef.current.value === &quot;&quot;) {<br>            return count;<br>        } else {<br>            setCount(Number(inputRef.current.value));<br>            inputRef.current.value = &quot;&quot;;<br>        }<br>    };<br><br>    return [count, increment, decrement, reset, setValue, inputRef];<br>}<br><br>export default useCounter;</pre><p>Once created, the custom hook function was imported into the CounterWithCustomHook component, which utilized its functionality to manage the state of the counter app. This made it easy for the CounterWithCustomHook component to share the same state management logic as the custom hook and have the same set of functionalities as the custom hook</p><pre>import &quot;../assets/css/style.css&quot;;<br>import useCounter from &quot;../hooks/useCounter&quot;;<br><br>function CounterWithCustomHook() {<br>  const [count, increment, decrement, reset, setValue, inputRef] =<br>    useCounter();<br><br>  return (<br>    &lt;main className=&quot;content&quot;&gt;<br>      &lt;p className=&quot;counter-value&quot;&gt;custom hook count is: &lt;span&gt;{count}&lt;/span&gt;&lt;/p&gt;<br>      &lt;div className=&quot;set-value-input&quot;&gt;<br>        &lt;input<br>          ref={inputRef}<br>          type={&quot;number&quot;}<br>          placeholder={&quot;Enter number here&quot;}<br>          name=&quot;value&quot;<br>        /&gt;<br>        &lt;button onClick={setValue}&gt;Set Value&lt;/button&gt;<br>      &lt;/div&gt;<br>      &lt;div className=&quot;buttons&quot;&gt;<br>        &lt;button className=&quot;btn&quot; onClick={increment}&gt;<br>          Increase<br>        &lt;/button&gt;<br>        &lt;button className=&quot;btn&quot; onClick={decrement}&gt;<br>          Decrease<br>        &lt;/button&gt;<br>        &lt;button className=&quot;btn reset&quot; onClick={reset}&gt;<br>          Reset<br>        &lt;/button&gt;<br>      &lt;/div&gt;<br>    &lt;/main&gt;<br>  );<br>}<br><br>export default CounterWithCustomHook;</pre><p>The result of this integration is that the CounterWithCustomHook component is now able to manage the state of the counter app by utilizing the functionality provided by the custom hook. This includes the ability to increment, decrement, reset, and set the value of the count, which provides the basic functionality of the counter application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*dj7B96vV7rzaFS6_lGKNng.gif" /></figure><h3><strong>Other features</strong></h3><p>The application appears to be standard at first glance. However, to enhance the functionality of the app, Firebase was integrated. To implement Firebase, the web application was first registered on the Firebase console (see this <a href="https://console.firebase.google.com/">link</a> for further information). Afterwards, a configuration file was created to pass in the Firebase configuration settings and initialize the application</p><pre>import { initializeApp } from &quot;firebase/app&quot;;<br>import { getAuth, GoogleAuthProvider } from &quot;firebase/auth&quot;;<br><br>// Firebase configuration<br>const firebaseConfig = {<br>  apiKey: process.env.REACT_APP_FIREBASE_API_KEY,<br>  authDomain: process.env.REACT_APP_FIREBASE_AUTH_DOMAIN,<br>  projectId: process.env.REACT_APP_FIREBASE_PROJECT_ID,<br>  storageBucket: process.env.REACT_APP_FIREBASE_STORAGE_BUCKET,<br>  messagingSenderId: process.env.REACT_APP_FIREBASE_MESSAGING_SENDER_ID,<br>  appId: process.env.REACT_APP_FIREBASE_APP_ID,<br>};<br><br>// Initialize Firebase<br>const app = initializeApp(firebaseConfig);<br><br>//Authentication instance for email and password<br>export const auth = getAuth(app);<br><br>//Google authentication provider<br>export const googleProvider = new GoogleAuthProvider();</pre><p><strong>useContext</strong></p><p>To maintain a clean and organized codebase, the Context API was employed to create and provide a context object that includes callback functions for user authentication. This includes functionality for signing up with email and password, logging in with email and password, logging out, and signing in or signing up with Google. By utilizing the Context API, these functions can be easily shared and accessed across different components in the application, while keeping the codebase organized and manageable.</p><pre>import { createUserWithEmailAndPassword, onAuthStateChanged, signInWithEmailAndPassword, signInWithRedirect, signOut } from &quot;firebase/auth&quot;;<br>import { createContext, useEffect, useState } from &quot;react&quot;;<br>import { auth } from &quot;../assets/config/firebase&quot;;<br><br><br>export const AuthContext = createContext();<br><br><br>export function AuthProvider({ children }) {<br>    const [currentUser, setCurrentUser] = useState()<br>    const [loading, setLoading] = useState(true)<br><br>    //set sign up context provider<br>    function signup(auth, email, password) {<br>        return createUserWithEmailAndPassword(auth, email, password)<br>    }<br>    <br>    //set log in context provider<br>    function login(auth, email, password) {<br>        return signInWithEmailAndPassword(auth, email, password)<br>    }<br><br>    //set log out context provider<br>    function logout() {<br>        return signOut(auth)<br>    }<br><br>    //set google sign in context provider<br>    function googleSignIn(auth, googleProvider) {<br>        return signInWithRedirect(auth, googleProvider)<br>    }<br><br>    //value to be passed to the context provider<br>    const value = {<br>        currentUser,<br>        signup,<br>        googleSignIn,<br>        login,<br>        logout,<br>    }<br><br>    return(<br>        &lt;AuthContext.Provider value={value}&gt;<br>            {!loading &amp;&amp; children}<br>        &lt;/AuthContext.Provider&gt;<br>    )<br>}</pre><p>The useEffect hook was utilized to pass an observer function into the provider which monitors changes to the authenticated state of the user. It returns an unsubscribe function, which stops listening for updates when the hook is no longer in use. This ensures that the observer function only listens when the component is actively in use and prevents any unnecessary updates or resource usage when the component is not active. With the use of useEffect, the user&#39;s authentication state changes can be captured and acted upon seamlessly, while also preserving performance.</p><pre> useEffect(() =&gt; {<br>        const unsubscribe = onAuthStateChanged(auth,   ( user) =&gt; {<br>            setCurrentUser(user)<br>            setLoading(false)<br>        })<br>        <br>        return unsubscribe<br>    }, [])</pre><p>The context object, containing the authentication functions, is then wrapped around the entire application, providing easy access to the functionalities for all components in the app. This also enables reusability, as the same context object can be used in other parts of the application without the need to rewrite the same code.</p><p>With the introduction of the Context API, a registration page was developed to allow users to sign up using their email and password or their Google accounts, which are then sent to Firebase for validation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QNroBwCvxNKD-pwbFGvmFA.png" /></figure><p>Once the user has successfully signed up, they are redirected to the login page where they can enter their credentials to gain access to the application. While this process is underway, the application sends a mail to the user’s email address containing a link for authentication. The user needs to click on the link to confirm the email is theirs, this verifies the authenticity of the email address and authenticate the user. This feature provides an extra layer of security for the application and ensures that only legitimate users are granted access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i40BLmVFi2owZBpEIO77DQ.png" /></figure><p>If the user logs in with a Google account, the user’s name and photo are displayed to personalize the experience. On the other hand, if the user logs in with an email and password, only their email address will be displayed. This distinction is made to safeguard user’s personal information, and also give a better personalized experience. Additionally, this is a good practice to follow because it ensures that the user only sees the necessary information, without compromising on the security.</p><p><strong>when user is logged in with google</strong></p><p>When a user logs in using their Google account, the application retrieves their name and photo from the Google authentication service. By displaying the user’s name and photo, it provides a more personalized experience for the user and makes it easy for the user to identify themselves on the application. Additionally, this feature can help with the user’s recognition and can foster feelings of trust and loyalty towards the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z8ycJesHd7wxxyOscqC3Hg.png" /></figure><p><strong>when user is logged in with email and password</strong></p><p>When a user logs in using their email and password, the application retrieves the user’s email address from the authentication service. This information is used to identify the user. Displaying only the email address is a security best practice to protect user’s personal information. Additionally, this way, the application is not storing the password and it is not capable to show it to someone else, this maintain the users’ sensitive information more secure. By only displaying the email address, the application ensures that the user’s personal information is kept private and secure while still providing a means of identification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mgmEp_tLVH53BCQL2U5Xhw.png" /></figure><p>When the user logs out, the user is redirected back to the login page.</p><p>In summary, the counter app is a simple application that allows users to perform basic counting operations such as increment, decrement, reset and setValue. It is built using Reactjs, a JavaScript library for building user interfaces. The application also makes use of additional libraries such as React Router for client-side routing, React Error Boundary for handling errors, React Helmet Async for managing the document head, Firebase Authentication for user authentication and the Context API for easy management of state and props throughout the application. It uses Firebase for user authentication, it enables user to register with email and password and log in with their google account. When the user logs in with their google account, the user’s name and photo are displayed to personalize the experience, and when the user logs in with an email and password, only their email address is displayed to maintain security and protect their personal information. When a user is authenticated and logged in, the user will be able to access the counter application’s functionality, if not, the user will be redirected to the login page.</p><h3>Possible features to add</h3><p>The following are some examples of potential features that could be added to the application:</p><ul><li>An additional functionality that can be added is the ability for the application to confirm the user’s email address by sending a confirmation link to the user’s mailbox. Once the user clicks on the link, the application can confirm that the email is valid and that the user is the legitimate owner of the email address and can authenticate the user accordingly.</li><li>A feature that allows the user to reset their password</li><li>A feature that allows the user to update their email address</li></ul><h3><strong>Links</strong></h3><p>Live site URL: <a href="https://counter-app-eight-silk.vercel.app/">counter-app-eight-silk.vercel.app</a></p><p>Link to GitHub codebase: <a href="https://github.com/okhuarobo-osayuki/counter-app">github.com/okhuarobo-osayuki/counter-app</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26a55f1d4903" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>