<?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 Paul Ogolla on Medium]]></title>
        <description><![CDATA[Stories by Paul Ogolla on Medium]]></description>
        <link>https://medium.com/@paulzay?source=rss-6672e35065f2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*HbD9VVhoI5feWpSl5kfzZA.jpeg</url>
            <title>Stories by Paul Ogolla on Medium</title>
            <link>https://medium.com/@paulzay?source=rss-6672e35065f2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 20:35:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@paulzay/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 I built my ALx Portfolio Project]]></title>
            <link>https://paulzay.medium.com/how-i-built-my-alx-portfolio-project-3a3de1b31630?source=rss-6672e35065f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a3de1b31630</guid>
            <category><![CDATA[alx-software-engineering]]></category>
            <dc:creator><![CDATA[Paul Ogolla]]></dc:creator>
            <pubDate>Mon, 22 Jul 2024 16:10:31 GMT</pubDate>
            <atom:updated>2024-07-22T16:10:48.785Z</atom:updated>
            <content:encoded><![CDATA[<p>After 7 grueling months of studying, the time finally came to build something with my acquired skills. Here’s how it went.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OZ93sKyaxyRpFqWpZZzg6Q.png" /></figure><p>The first step was setting up a team and generating practical project ideas. I haven’t enjoyed working in teams throughout the program so I opted to do it independently. This way I could be more adventurous in my decisions and iterate quickly. I was the full-stack developer and DevOps guy wrapped into one. I didn’t think it would be that difficult to come up with ideas but at the last minute, I had a lightbulb moment for two.</p><p>The first idea was for my car but it wasn’t something I would be using frequently enough for me to dedicate time to it. The second one was something I could immediately put to use and continue to utilize for a while and I’m sure others would find it useful. That was the birth of “Babysteps”, a digital booklet for babies to have their data recorded like milestones, vaccinations, height, and weight changes. The target was parents/guardians of infants. The idea started with milestones tracking as the focus but grew to also include the other data. The final product would end up being a mobile app for easier accessibility.</p><p>The idea for the project came to me while I was looking at my daughter’s photos from birth vs now and how much she had changed. From a tiny, skinny little bean to a plump full face with wide eyes and heavy cheeks. I thought to myself that I should have taken pictures every day or every week and just track her growth in pictorial form so that I don&#39;t miss a single change. It wasn’t enough to just organise the photos into albums on Google drive. With that as the base, I researched what milestones babies achieve in different ages and compiled them into a list to tick them as the baby grew. The other features came as I continued to do my research. This was a personal project that I was doing for my child and I hope to build it to completion.</p><p><strong>Tech stack</strong></p><p>Next up was in deciding what tech to use to build the project. I settled on Nestjs for backend simply because I had never used it before and was interested in it. Having worked with expressjs for the longest time, this was an opportunity for something different. For the front-end, I opted to use Vuejs as I had been trying to add it to my skill set and this would be a great opportunity to do so. I could have gone with Reactjs but I have used it for nearly all my projects before and this should have been a learning moment. As for the database, I went with MySQL because I’d spent some time in the program interacting with it. For hosting I chose <a href="https://www.heroku.com/">Heroku</a> for the backend and Vercel for the frontend. The architecture would end up being a monolith because of hosting limitations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6psmrgRm14vuoXDu" /></figure><p><strong>Features</strong></p><p>The features I managed to implement included user signup and login using just email and password as well as authenticating with Jason Web Tokens(JWT). Another feature was in enabling users to add a baby to the platform. Unlike a similar app, this one could have multiple babies added. The core features of the application included a growth chart displaying the weight and height progression and the ability to provide data updates for that. An additional feature was creating milestone categories and milestones by the admin. The user could mark milestones as achieved and have them appear on the baby’s profile.</p><p><strong>Challenges</strong></p><p>In retrospect, what was once very challenging looks to be so minor. However the biggest challenge I had was in using a state management tool called pinia. Since I was new to Vuejs, I spent a lot of time getting to meet a lot of things for the first time and pinia was one of them. Accessing the state and updating it without needing to reload the page almost overwhelmed me. This problem included accessing JWT upon logging in. I had to reload the page to access it from localstorage. I did finally manage to access the state inside components like the navigation bar, enabling me to show different links based on whether a user is logged in on not. For files that were not components, the problem is yet to be resolved and I had to abandon that for another time. This prevented me from implementing an automatic logout when a request uses an expired token.</p><p><strong>Lessons</strong></p><p>The project was an exercise in pushing my learning skills to a new level. Using tools that I was not already good at elevated how quickly I can pick up new things and focus on using documentation rather than tutorials. The key take-away is that learning never stops and there are plenty of ways to stay sharp in your skills. In a similar project next time I would focus on a maximum of 3 features to build and utilize a template to skip past setting up everything I will need. This will allow me to extensively write tests and add validations for edge cases. I did not do any of that in the project. I did learn something about myself: I know more than I give myself credit for. My skills have grown significantly enough to run an entire project on my own and it confirms I work best on my own or with equally motivated people. Team projects only work with people who you align with and at times that is difficult to come by.</p><p>This project reiterates my love for small teams. Things iterate faster and decisions get made and implemented very quickly. In future I would enjoy small teams and working on full-stack applications. I’ve also learned that I may need to occasionally rely on others to do what I cannot, like design stuff.</p><p><strong>About me</strong></p><p>I’m a software engineer and also a student at ALX about to finish the SWE Foundations Course at the time of this writing. I love backend development but mostly get to write frontend code, both with Javascript.</p><p>You can find the frontend repo <a href="https://github.com/paulzay/babysteps-client">here</a> and the backend repo <a href="https://github.com/paulzay/babysteps-api">here</a>. The landing page is <a href="https://paulzay.github.io/babysteps-landingpage/">here</a> and the live version of the application <a href="https://babysteps-three.vercel.app/">here</a>. I’m also on <a href="https://www.linkedin.com/in/paulogolla/">LinkedIn</a>. Until next time, adios!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a3de1b31630" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What happens when you type google.com in your browser and press Enter]]></title>
            <link>https://paulzay.medium.com/what-happens-when-you-type-google-com-in-your-browser-and-press-enter-9cc9693bd73d?source=rss-6672e35065f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/9cc9693bd73d</guid>
            <category><![CDATA[google]]></category>
            <category><![CDATA[web-server]]></category>
            <category><![CDATA[full-stack]]></category>
            <dc:creator><![CDATA[Paul Ogolla]]></dc:creator>
            <pubDate>Fri, 24 May 2024 08:25:10 GMT</pubDate>
            <atom:updated>2024-05-24T08:25:10.282Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FqfFIdzEn2s6aPgf" /><figcaption>Photo by <a href="https://unsplash.com/@mitchel3uo?utm_source=medium&amp;utm_medium=referral">Mitchell Luo</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>This is a rather popular question asked in interviews and even non-technical people get curious as to what the answer is.</p><p>To start, google.com is a domain name. A domain name is a human-readable format of an address of a web server. The actual address comes in two formats; IPv4 which is a 32-bit numeric address of numbers separated by decimals and ends at <strong>255.255.255.255 </strong>and IPv6 which a 128-bit address written in hexadecimal and separated by colons for example <strong>3ffe:1900:4545:3:200:f8ff:fe21:67cf</strong>. IPv4 and IPv6 are Internet Protocol(IP) versions.</p><blockquote>A web server is a software application that runs on a server machine and handles HTTP requests and serves web pages.</blockquote><p>The next thing to know is the Domain Name System(DNS). It is what translates the domain name to an IP address that machines can read. Once you press ‘Enter’ key, a DNS Lookup is executed. The browser and the operating system first check if the IP already exists in the cache. If it does not exist, a DNS server called Resolving Name Server aka resolver server which is configured by your Internet Service Provider(ISP) or network admin checks its cache for the IP address. If it does not find it, it asks its root server.</p><p>The root server knows where to find the location of the dotcom top-level domain(TLD) name server to send a query to google.com. The authoritative name server will give you the exact IP address of google.com. Now we have the exact web server where Google lives on in either IPv4 or IPv6 format.</p><p>The browser will now send an HTTP request to that web server to ask for a copy of the website using Transmission Control Protocol/Internet Protocol(TCP/IP). Computers use TCP/IP to communicate with each other over a network like the Internet.</p><blockquote>TCP/IP is a set of rules to enable communication between computers</blockquote><p>If the web server approves the request from the client/browser, it sends back a ‘<em>200 OK’</em> message and sends the website files to the browser in chunks called data packets. The browser assembles the packets into a complete web page and displays the page.</p><p>Assuming that your firewall will not block the data packets from entering your network, the browser will assemble them and display the Google homepage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6prVBqljryifpk2m" /><figcaption>Photo by <a href="https://unsplash.com/@nathanareboucas?utm_source=medium&amp;utm_medium=referral">Nathana Rebouças</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>A firewall is a division between a private network and an outer network, often the internet, that manages traffic passing between the two networks.</blockquote><p>The page may contain HTTPS which signals that all communications between your browser and the website are encrypted using Secure Sockets Layer(SSL). An SSL certificate is usually added to the web server from providers like Certbot.</p><p>Because many people may be trying to access the same website at the same time as you, a load balancer may be utilized to split the traffic between many servers and reduce downtime. An example of a load-balancer is HAProxy, which stands for High Availability Proxy. A popular load-balancing algorithm called ‘roundrobin’ can be used.</p><p>If you are logged in, the page will show things like your account which is information received from Google’s database so an interaction with the db also occurred behind the scenes.</p><p>That summarises what happens when you type google.com and press Enter. Cheers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9cc9693bd73d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Build User and Admin in Ruby on Rails]]></title>
            <link>https://paulzay.medium.com/how-to-build-user-and-admin-in-ruby-on-rails-33a054fbdaf3?source=rss-6672e35065f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/33a054fbdaf3</guid>
            <category><![CDATA[admin]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[mvc]]></category>
            <category><![CDATA[ruby]]></category>
            <dc:creator><![CDATA[Paul Ogolla]]></dc:creator>
            <pubDate>Thu, 19 Nov 2020 08:37:25 GMT</pubDate>
            <atom:updated>2020-11-19T08:37:25.144Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wj96Qq59Fxy5WMnt_Pps2A.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@xps?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">XPS</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Almost every application out there has a user feature for signup and login and there are various ways and means to go around building this feature. Ruby on Rails has gems like Devise, which builds all the features you might need out of the box. Additionally, in order to build an admin feature you have options like pundit, activeadmin and cancan.</p><p>While I love gems and all that they offer just as much as the next developer, sometimes I love to go old school. So I will show you how to build a simple authentication and authorization system for a small app.</p><p>To start off, create a new app, call it Demo. Fire up your terminal and run this command;</p><pre>rails new Demo</pre><p>This creates a new project with sqlite3 as the default database.</p><p>To create our database, run</p><pre>rails db:create</pre><p>To save on time and space, we can use scaffold to generate the MVC files for our user and fill in the rest of the details as we go. So let’s go.</p><pre>rails generate scaffold user</pre><p>If you look through the files in the app folder you’ll find the model, views and controller file have been created for the user.</p><p>Head over to the migration file and add these attributes in the change method. The admin is set to false by default so every user created will not be an admin.</p><pre>t.string :name<br>t.string :email<br>t.string :password<br>t.boolean :admin, default: false</pre><p>Run the migration:</p><pre>rails db:migrate</pre><p>Sweet. Now we have a schema generated and you can have a look at it to see what the database is made up of.<br>We can now seed data in order to have an admin user in the database so go to seeds.rb file and add</p><pre>User.create!(name: &quot;Superman&quot; ,admin: true)</pre><p>Back to on the terminal, run</p><pre>rails db:seed</pre><p>If you peek at the database, we have one user, and admin is set to true. Every other user created from the UI will be a normal user.</p><p>In your controller files, you can now restrict certain actions to only be accessible to the admin by adding this line</p><pre>before_action :admin_user</pre><p>And with that, we wrap up how to create a user model and an admin without using any gems.</p><p>If you liked this article, make sure to:</p><ul><li>Check out my <a href="https://github.com/paulzay">GitHub profile</a></li><li>Check out my <a href="https://paulzay.tech/">portfolio</a></li></ul><p>Sweet. Now we have a schema generated and you can have a look at it to see what the database is made up of.<br>We can now seed data in order to have an admin user in the database so go to seeds.rb file and add <br>```<br>User.create!(name: “Superman” ,admin: true)<br>```<br>Back to on the terminal, run<br>```<br>rails db:seed<br>```<br>If you peek at the database, we have one user and admin is set to true. Every other to user created from the UI will be a normal user. <br>In your controller files you can now restrict certain actions to only be accessible to the admin by adding this line<br>```<br>before_action :admin_user<br>``` <br>And with that, we wrap up how to create a user model and an admin without using any gems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33a054fbdaf3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Git and Github]]></title>
            <link>https://paulzay.medium.com/getting-started-with-git-and-github-c5d6a344dbe9?source=rss-6672e35065f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5d6a344dbe9</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Paul Ogolla]]></dc:creator>
            <pubDate>Mon, 01 Jun 2020 10:32:12 GMT</pubDate>
            <atom:updated>2020-06-01T11:38:22.949Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RpdCB8ssHVk6dpHL31rKbA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@yancymin?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Yancy Min</a> on <a href="https://unsplash.com/s/photos/git?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><blockquote>Git is a distributed version-control system for tracking changes in source code during software development. It is designed for coordinating work among programmers, but it can be used to track changes in any set of files. Its goals include speed, data integrity, and support for distributed, non-linear workflows. — Wikipedia</blockquote><p>Github is also a version-control system, serving the same purpose as Git. The only difference between the two is that Git is local, and Github is remote. By local I mean your computer environment and remote is basically the internet or cloud.</p><p>Now let’s unpack something else. What is version-control? Say you have an app, and you release it to the market. You later discover it has bugs, or you want to add new features to it. So you go back to the lab and make the improvements then release it again to the market as a better version of the first release. You’ve just done version control.</p><p>Enough talk, let’s get coding.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FHIYW8sTRTHt1m%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FHIYW8sTRTHt1m%2Fsource.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FHIYW8sTRTHt1m%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="243" frameborder="0" scrolling="no"><a href="https://medium.com/media/af5487c0d11c0edfffba203f9d448798/href">https://medium.com/media/af5487c0d11c0edfffba203f9d448798/href</a></iframe><p>First, create a project folder. On Windows, you can do this by right-clicking and selecting “create new folder”.</p><p>For my terminal enthusiasts on Linux and Mac, you can use the mkdir command.</p><pre>mkdir HNG</pre><p>Next, enter the folder using the cd command.</p><pre>cd HNG</pre><p>Alright, now we are in the folder. The first thing we do is to initialize the git repository. I feel I should point out that we only need to do this once because when learning Git, I used to initialize every time I open my project. Run: git init</p><pre>git init</pre><p>Git allows you to create and work on different versions of your project by using branches. When you create a new project on your computer or on Github, the default branch is called master.</p><p>To check which branch you’re currently on, run: git branch</p><pre>git branch</pre><p>If you have multiple branches, the current branch will be highlighted in green.</p><p>Everything originates from the master and from here is where you will deploy ready code. To avoid messing up the master with bad code and ruin the deployed code, we create branches and once we’re done working on the code, we merge it to the master branch and can now delete the branch if we want.</p><p>Branches have a naming convention based on tasks we’re currently working on. The task can either be a feature, chore, bug or fix. So when you want to name your branch, you can prefix it with any of the tasks. If I’m making a website and I’m working on the navigation bar, that’s a feature of the project. I can name the branch <strong>feature/navbar.</strong> If the navbar has a bug and you want to fix it, you don’t work on that feature/navbar branch, you create a <strong>bug/navbar</strong> branch and work on the bug.</p><p>We are now going to open our project folder on a text editor. I use Vscode but you can use other editors like Atom, Sublime Text or Pycharm.</p><p>To open the folder using the terminal, run;</p><pre>code .</pre><p>This works for Vscode, you can look up the command for other editors.</p><p>Assuming you’ve now opened the project on your code editor, we will now create a file, specifically, the README file. Run the touch command on your terminal.</p><pre>touch README.MD</pre><p>Edit the file with whatever necessary content you want to about the project you’re working on.</p><p>When we want git to track a particular file, we need to “stage” it. We use the “git add “ command.</p><pre>git add README.MD</pre><p>There’s a saying among developers, <em>“Commit fast, commit often”.</em></p><blockquote>A <strong>commit</strong>, or “revision”, is an individual change to a file (or set of files). It’s like when you save a file, except with <strong>Git</strong>, every time you save it creates a unique ID (a.k.a. the “SHA” or “hash”) that allows you to keep a record of what changes were made when and by who.-Stackoverflow.</blockquote><p>Each commit acts like a different version of your project and you can even go back to a specific commit in case you mess up. This is why you should commit your often. It will save you a lot of trouble. Additionally, commits can be changed but that’s a story for another day. Commit messages are a summary or commentary on what you have just committed. There are conventions followed when writing commit messages but I will not go into it.</p><p>Additionally you should always check the status of your project by running the git status command.</p><pre>git status</pre><p>It’s worth mentioning that since we have created our project locally we don’t need to add a README file while on Github so don’t check that box. Finally, click the create button.</p><p>Before you commit your changes, ensure you have staged the file using the previous command. To commit, run “git commit -m “commit-message”</p><pre>git commit -m &quot;initial commit message&quot;</pre><p>With that, you’ve learned the most common git commands you’ll be using as a developer.</p><p>There’s one more important one. To upload your project to Github you will use the “git push” command.</p><p>Head to your Github account and create a new repository. Add a description and choose whether you want your repo to be private or public.</p><p>It’s worth mentioning that since we have created our project locally we don’t need to add a README file while on Github so don’t check that box. Finally, click the create button.</p><p>The next screen will provide you with options and we’ll take the second-last option. Copy that and paste it on your terminal.</p><pre>git remote add origin <a href="https://github.com/myname/hng.git">https://github.com/myname/hng.git</a><br>git push -u origin master</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FcLqTqyigA8b5gl23Dw%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FcLqTqyigA8b5gl23Dw%2Fsource.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FcLqTqyigA8b5gl23Dw%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/132ac2c387c221ea17b5bf1dd0ddc5b2/href">https://medium.com/media/132ac2c387c221ea17b5bf1dd0ddc5b2/href</a></iframe><p>Enter your credentials and VOILA! We have pushed our code to Github.</p><p>As an extra step, you can also pull your code from your online repo using:</p><pre>git pull origin master</pre><p>So there you have it, the basics of git and github. I hope you learned something new so take your new power and use it for good. Til next time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5d6a344dbe9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>