Day 28: Views and Package Notes

Continued with the Inventory App. I finished the constructing the views using pug and started adding the middleware I need for the app. I stopped to take some rough notes on each of the packages I will use in the app. That way I at least know a bit about how to use the package.

Again note-taking is amazing. I love good documentation but documentation is an opinionated topic. I have started to develop my own style of documenting. I have not established some sort of rigid formula or structure but I am noticing my own preferences and patterns. Eventually I might write a docs style guide that represents how I write my notes. That is a long ways away but it would be an interesting activity to undertake.

TLDR;

Okay, so here are the highlights of what I did:

  • Practice -> Continued working on the Inventory Management Application project from The Odin Project. I added to the views for the category and item routes. I am now working on adding all the required middleware functions for my express app. Then I have to update the controllers to bring it all together by loading data from mongoDB.

morgan Logger – Package Notes

morgan is an HTTP request logger middleware for node.js. It is used to log to the console information about the HTTP requests and responses that come to and from our node.js + express server. An example of how it can be used is below:

const express = require('express');
const logger = require('morgan');

const app = express();
app.use(logger('dev'));

The middleware call (logger()) takes two arguments:

  • format argument which can be:
    1. A pre-defined string i.e. logger('dev') that represents an established logging formats.
    2. A format string e.g. logger(':method :url :status :res[content-length] - :response-time ms')
    3. A function that will produce a log entry.
  • An options argument which can be a pre-defined string i.e. 'dev' that represents a

We use dev in our app which is a Concise output colored by response status for development use. The :status token will be colored green for success codes, red for server error codes, yellow for client error codes, cyan for redirection codes, and uncolored for information codes.

:method :url :status :response-time ms - :res[content-length]


Goal For Round 8 of the #100DaysofCode Challenge

This is my eighth round of the “#100daysofcode” challenge. I will be continuing my work from round five, six, and seven into round eight. I was working through the book “Cracking the Coding Interview” by Gayle Laakmann McDowell. My goal was to become more familiar with algorithms and data structures. This goal was derived from my goal to better understand operating systems and key programs that I use in the terminal regularly e.g. Git. This goal was in turn derived from my desire to better understand the fundamental tools used for coding outside of popular GUIs. This in turn was derived from my desire to be a better back-end developer.

I am currently putting a pause on the algorithm work to build some backend/full stack projects. I primarily want to improve my skills with the back-end from an implementation perspective. I have improved tremendously in terminal and CLI skills but I lost focus due to how abstract the algorithm concepts got. I wanted to work on things that were more tangible until I can get to a position where I could directly benefit from improving my algorithm skills and theoretical knowledge. So that’s the focus right now. Build my backend skills and prove my full stack capabilities by building some dope projects.

Again, I still have no idea if my path is correct but I am walking down this road anyways. Worst case scenario I learn a whole bunch of stuff that will help me out on my own personal projects. Best case scenario I actually become one of those unicorn developers that go on to start a billion dollar company… You never know LOL.