Chidiebere Nnadi

Diaries of an afrocentric polymath

Read this first

Bootstrapping your first Vue.js project using Vue CLI

 Required prerequisite knowledge

For this guide, you will need to have a good understanding of Javascript. You will also need to have had some experience using a Javascript framework as we’ll be making use of automated build tools. The Vue.js documentation also recommends against beginners starting out with Vue CLI. I will be releasing a more beginner friendly tutorial shortly but this is expected to be a practical guide for more experienced developers.

 Introduction

If you don’t already know, Vue.js is a progressive Javascript framework quite similar to the likes of Angular and React. It is used on the front-end to handle user events, present dynamic DOM content and it provides an easy way to architect apps that are modular and performant as required by the apps of today. In this guide, I will be taking you through the process of bootstrapping your very first Vue.js project quite

Continue reading →


…one journey ends. Another begins…

It’s been a while since I wrote my last blog post, for several reasons. For one, I hadn’t renewed my subscription on Svbtle (this awesome blogging platform). This was one of the main reasons I went for a paid blogging platform over using Medium - to encourage me to write more knowing that I was paying for it. Secondly, and more importantly, the last three months have been, perhaps, the most interesting times in my entire life. There has been learning, changes, growth and oh so many challenges.

The highlight of this period has been that I left my job as Sr. Technical Trainer at Andela three months ago, in July ???. I was extremely stressed out and became less effective than usual. Startups do have a way of draining all the energy you have.
Things were changing and moving extremely fast. I wasn’t actually fazed by all of that because I was determined to make a meaningful effort into

Continue reading →


Creating Somewhat Middleware using Decorators in Flask

For a while now I’ve been doing some study on constructing and consuming microservices using Flask and a combination of tools. This has led to a lot of discoveries along the way and improvements overall in the way I write Python code.

In my most recent experiment, while trying to create a user service, I found a nifty way to use decorators to intercept requests to routes especially for performing generic actions like authentication, error handling, blanket resource loading (loading objects in request object for a group of routes/URL patterns) etc. before the main controller logic runs.

In this write-up, I will be assuming you have adequate knowledge of Flask and how it works. I will also be making use of my goto Flask wrapper of choice, [Flask-RESTful](flask-restful-cn.readthedocs.org/en/0.3.4/).

 Why do I need this?

I don’t seek to impose this on you and so you may actually not need

Continue reading →


Demystifying Token-Based Authentication using Django REST Framework

Authentication is one of those things which have now been considered a rote and repetitive task when doing web development. Most applications you will ever develop almost always need to have some form of user authentication to allow users access the app’s functionality.

Generally speaking, all authentication you will do goes through these steps:

  1. Get the details sent in by the user (Parse JSON or use form data)
  2. Search for the user from the user’s table on the column identified with the unique field value passed in by the user (This is usually either username or e-mail address).
  3. Get the first record from the above query. (This is usually done because we assume there should be no duplicates on the unique field we’re searching on)
  4. Hash the password using the same algorithms to hash passwords at register phase (Done before saving the user object).
  5. Check if the password value matches the

Continue reading →


Restful API Design using Flask-RESTful (Part 1)

Python is by far one of the best languages I’ve used to write programs so far. The ease of writing code as well as how intuitive it is to understand the language nuances make it a good choice for beginners or experts alike.
Like most Python programs, Flask is built on Python philosophies which in summary make using the package API as easy as eating ice-cream.
Don’t take my word for it, head over to their docs to see what I mean.
Starting up a server is just a few lines

from flask import Flask

app = Flask(__name__)

if __name__ == '__main__':
    app.run(debug=True)

Doing this and then running it, we see that the Python server starts off and shows that it is listening on port 7000 (The default port number).

If you haven’t already installed flask, run pip install Flask within your virtual environment to do so.

For this exercise, we shall be making use of Flask-RESTful, a tool that

Continue reading →


REST-Pi: Python IOT library for Software Developer

RESTPi is going to be a Raspberry Pi platform for developers to quickly bootstrap IOT applications that would benefit from remote information transfer via REST-based APIs. I have tried my hands on a couple of IOT technology and I discover that the required architecture for most of my ideas frequently had to do with Building remote clients and connected device servers. The remote clients can easily communicate 2-ways with the device via API calls.

There are a number of things to be baked in the library including easy access to the device board components including Ethernet, USB and Storage. The GPIO channel access is the major interface as the library would appeal to teams with both Software Engineers and Hardware engineers.

Looking at all of this, you might have already realized that extreme security would have to be applied to the initial design of the system to prevent simple attacks

Continue reading →


An aweful much of self improvement

I really do not know what happened to me last year but I happened to be extremely determined to change (and I mean mostly improve) in the new year. I had spent a number of weeks at home during the holidays and I had time to think such as I’ve been hoping for in ages. During the time I spent thinking, I discovered that so much opportunity had gone by due to blatant neglect and too low determination. I tried looking back and saw nothing to hold on to as an achievement for the complete year. The main let-down was that there was so much potential. I made up my mind that whatever it took, I would do to get to a good place in 2016. I was determined to improve my technical skills, personal and inter-personal strength, management and leadership skills, business skills and a host of other mundane things I was deciding to be better at. Well, I have made a lot of progress in the first 2 weeks. I

Continue reading →