<?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 Bright Ikhide on Medium]]></title>
        <description><![CDATA[Stories by Bright Ikhide on Medium]]></description>
        <link>https://medium.com/@brightikhide?source=rss-617dda864e86------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*yFndeupo6g61mw2C3gO4jw.jpeg</url>
            <title>Stories by Bright Ikhide on Medium</title>
            <link>https://medium.com/@brightikhide?source=rss-617dda864e86------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 08:42:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@brightikhide/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[My Tiidelab Boot camp Journey]]></title>
            <link>https://medium.com/@brightikhide/my-tiidelab-boot-camp-journey-1f6944336d45?source=rss-617dda864e86------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f6944336d45</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[tiidelab]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[vuejs]]></category>
            <dc:creator><![CDATA[Bright Ikhide]]></dc:creator>
            <pubDate>Thu, 14 May 2020 20:27:56 GMT</pubDate>
            <atom:updated>2020-05-14T20:48:14.062Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/868/0*xtcyaAjZJhqbEAjm.jpeg" /><figcaption>Tiidelab Cohorts with Facilitators</figcaption></figure><p>You only grow by coming to the end of something and by beginning something else. Endings are often characterized by sad and/or mixed feelings. This is different. Last month saw the celebration of the completion of the Tiidelab fellowship for me and others in the first cohort. Whilst, I am winding up this month, I have had time to reflect on what this means. It signifies the end, yet the beginning — the beginning of a new chapter, for me and other cohorts, the start of the exploration in the quest to becoming a true technology and business leader.</p><p><strong>Learning Process</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*87qR429b8Lq9i-zM.jpeg" /><figcaption>Learning Session at Tiidelab</figcaption></figure><p>The Tiidelab fellowship had great learning curriculum, superb learning environment and great Tutors guiding fellows. The first 2 weeks of the program was focused on HTML and CSS where we learnt how webpages are created and styled. During this month, we redesigned popular websites like Twitter, Facebook, and others then we continued with JavaScript for the rest of January till February. In the third month March, we focused on Vuejs which is a framework of JavaScript for building Single Page Applications (SPAs). We were introduced to MySQL, Nodejs/Express in the third and fourth months respectively where Mr Celestine Omin made us certified in Database Management and Mr Fikayo gave us in depth guide to Nodejs and Express from beginners to advanced levels. The capstone project for the fellowship was an E-commerce website where we used Vuejs for the front-end and Nodejs for the back-end. Mr Shamsudeen and Mr Lanre give us extra Soft skills and business skills during the 4 months of programming at Tiidlab. Generally, my Learning experience at the program was the best ever!</p><p><strong>Appreciations</strong></p><p>The amazing four months at Tiidlab wouldn’t have been so without the awesome people I have met along the way. First, I acknowledge Mr Salami Kadir for bringing the Tiidelab Fellowship to reality, Mr Shamsudeen Aderoju for all his patience and efforts in driving the program through to the end. To Grace Ituing, Nasir, Ridwan, for being wonderful teammates. To everyone especially Miss Grace and Mr Fikayo who mentored me at Tiidelab, I am thankful for the contributions in making me a world-class software engineer. To my awesome fellows Umoh Esther, Abonyi Francis, Elijah, Abdulazeez — I’m glad I had you all around to go on this journey with. I am super glad of how far we’ve come in our respective strides. Cheers!</p><p><strong>Conclusion</strong></p><p>So what’s next for me? Well, I have been a fan of following my dreams. I do know that the future of software development is super bright. I would be more focused in this field going forward, putting all my knowledge and skills in the last months at Tiidelab to use in creating interesting solutions targeted at the health, finance and power sector.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f6944336d45" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to guard routes in vue.js]]></title>
            <link>https://medium.com/@brightikhide/how-to-guard-routes-in-vue-js-c5e85129aa4c?source=rss-617dda864e86------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5e85129aa4c</guid>
            <category><![CDATA[vue]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[vue-router]]></category>
            <category><![CDATA[vuejs-2]]></category>
            <category><![CDATA[vuex]]></category>
            <dc:creator><![CDATA[Bright Ikhide]]></dc:creator>
            <pubDate>Sun, 01 Mar 2020 20:34:31 GMT</pubDate>
            <atom:updated>2020-03-01T20:34:31.252Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*42H-ByJJT9Olqms3y6PQwg.png" /></figure><p>Vue.js is an open-source Model–view–viewmodel JavaScript framework for building user interfaces and single-page applications. It was created by Evan You, and is maintained by him and the rest of the active core team members.</p><p>Vue.js provides a great Routing method which allow users to switch between pages without refreshing the page. This is what makes navigation easy on single page applications (SPAs).</p><p>Guarding routes becomes very important when you are developing an application that has registration and user login features.</p><p>Here’s a quick break down of all available methods within each type of navigation guard in Vue Router.</p><h4>Global Guards</h4><ul><li>beforeEach: action before entering any route (no access to this scope)</li><li>beforeResolve: action before the navigation is confirmed, but after in-component guards (same as beforeEach with this scope access)</li><li>afterEach: action after the route resolves (cannot affect navigation)</li></ul><h4>Per Route Guards</h4><ul><li>beforeEnter: action before entering a specific route (unlike global guards, this has access to this)</li></ul><h4>Component Guards</h4><ul><li>beforeRouteEnter: action before navigation is confirmed, and before component creation (no access to this)</li><li>beforeRouteUpdate: action after a new route has been called that uses the same component</li><li>beforeRouteLeave: action before leaving a route</li></ul><p>Let’s begin! 😎</p><p><strong>Setting my state from vuex when a user logs in</strong></p><p>In my application, i have a Login and Dashboard route. The dashboard route is protected and only allows logged in user.</p><p>I will be setting my state in the store when a user logs in using vuex.</p><p>Vuex is a state management library for vue.js applications. Its the centralized store for vue components. It is advisable to use vuex if you need to keep track of a state used throughout your application</p><p>In the index.js file in your store folder import vue and vuex then tell vue to use vuex. Set a global state with token, user, and isUserLoggedIn. On login, we will set the state of isUserLoggedIn to true and false on signout.</p><p><strong>Mutations</strong></p><p>To change the state in a Vuex store, we have to commit a mutation. Vuex mutations are essentially events: each mutation has a name and a handler.</p><p><strong>Actions</strong></p><p>Actions are just functions that dispatch mutations.</p><p>So your store should look like this</p><pre>import Vue from ‘vue’<br>import Vuex from ‘vuex’</pre><pre>Vue.use(Vuex)</pre><pre>export default new Vuex.Store({<br>state: {<br>token: null,<br>user: null,<br>isUserLoggedIn: false<br>},</pre><pre>mutations: {<br>setToken (state, token) {<br>state.token = token<br>if (token &amp;&amp; state.token != null) {<br>state.isUserLoggedIn = true<br>} else {<br>state.isUserLoggedIn = false<br>}<br>}<br>},</pre><pre>actions: {<br>setToken ({ commit }, token) {<br>commit(‘setToken’, token)<br>}<br>}<br>})</pre><p>Actions are triggered with the store.dispatch method. You can dispatch actions in components with this.$store.dispatch(&#39;/////&#39;)</p><p>When a user logs in we call the mutation setToken and pass a token to it like:</p><pre>// some api request to login a user<br>}).then((res) <strong>=&gt;</strong> {<br>this.$store.dispatch(‘setToken’, res.data.token)<br>})</pre><p>Now in index.js file in the router folder, import store from store. We will use per component navigation guard beforeEnter. It accepts three parameters: to the route the app is about navigating to</p><p>from the current route the app is navigating away from</p><p>next the function that must be called for the route to resolve successfully</p><p>Use a conditional statement to check if a user is logged in from store. If it returns true, call the next()without any arguments. This assumes a perpetual success state but if user is not logged in call next() with arguments. We will use the path of the route to navigate users to if they are unauthorized like:</p><pre>next({<br>path: “login” // back to safety<br>})</pre><p>We then pass a query parameter to the next function. This allows us to append the protected resource path to the redirect URL. So, if you want to prompt a user to log into an application or obtain the proper permissions without having to remember where they left off, you can do so. We can get access to the path of the protected resource via the to route object that is passed into the beforeEnter function like so: to.fullPath</p><pre>import Vue from ‘vue’<br>import VueRouter from ‘vue-router’</pre><pre>import Dashboard from ‘../views/Dashboard.vue’<br>import Login from ‘../views/Login.vue’<br>import store from ‘../store/index’</pre><pre>Vue.use(VueRouter)<br><strong>const</strong> routes = [<br>{<br>path: ‘/dashboard’,<br>name: ‘Dashboard’,<br>component: Dashboard,<br>meta: {<br>title: ‘Dashboard page’<br>},<br>beforeEnter: (to, from, next) <strong>=&gt;</strong> {<br>if (store.state.isUserLoggedIn === false) {<br>next({<br>path: ‘/login’, // back to safety<br>query: {<br>redirectFrom: to.fullPath<br>}<br>})<br>} else {<br>next()<br> }<br> }<br>},<br>{<br>path: ‘/login’,<br>name: ‘Login’,<br>component: Login,<br>meta: {<br>title: ‘Login page’<br>}<br>}<br>]</pre><pre><strong>const</strong> router = new VueRouter({<br>mode: ‘history’,<br>base: process.env.BASE_URL,<br>routes<br>})<br>export default router</pre><p>After that, you need to display a message in the Login page to tell the user why they were redirected when they tried visiting a protected route. We can make use of in component guard,beforeRouteEnter, to check whether or not a redirect has happened. Because we passed in the redirect path as a query parameter in our routes file, we can check the route object to see if a redirect happened</p><pre>&lt;script&gt;<br>export default {<br>name: ‘login’,<br>data () {<br>return {<br>email: ‘’,<br>password: ‘’,<br>alert: null<br>}<br>},<br>beforeRouteEnter (to, from, next) {<br>if (to.query.redirectFrom) {<br>next(vm <strong>=&gt;</strong> {<br>vm.alert =<br>‘Sorry, you have to login first!’<br>})<br>} else {<br>next()<br>}<br>}<br>}</pre><h3>Conclusion</h3><p>Vue.js routing makes your app navigation awesome. it creates a better user experience and gives your app the power of a single page application SPA</p><p>Keep coding…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5e85129aa4c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>