Gabriele Ferro Home

Learn... from your mistakes!

Day 84: 17 November 2020

The sixth OpenClassRooms project concerns the back end programming, that means to write the code for a fictitious server.

This project is built using the MEAN web development stack: The back end uses the Node.js / Express / MongoDB while the front end is written in Angular.

MEAN is a free and open-source JavaScript software stack for building dynamic web sites and web applications. Because all components of the MEAN stack support programs that are written in JavaScript, MEAN applications can be written in one language for both server-side and client-side execution environments. 


23 days ago, I started to study for the first time the entire back end.

That's right, I've never used this tools before. The only stack I knew was the LAMP and my knowledge is antiquated.

But thanks to my previous knowledge was easy to make mental associations and I grasped the basic concepts very quickly.

When I have to learn something, any topic, I feel more confortable if I follow a progressive approach, that is, I start with an empty folder and I slowly add feature and abstraction layers.

In this case, I already had the front end coded by someone else with a framework that I have never seen before.

My confusion also augmented due to the numerous keywords and methods that I encountered all at once for the first time.

So I had to mentally categorize each keyword with the respecting framework or node package.

For this reason I needed to study and review the course multiple times to really understand what I was doing and also what I was doing wrong.

Whenever I find myself repeating a task, I often use different resources about the same topic to increase the memorization of concepts.

I stopped copy and pasting blocks of code into the editor but instead I also write them on paper. By pressing buttons and using pen and paper I use more my brain in particular the muscle memory.

It's true that we should not memorize the entire documentation and that cheatsheets are useful tools, but we also need to be realistic and we should consider the waste of time looking for the correct sintax. Time is important and it must become second nature to be able to think directly in code.

Writing the code by hand, letter after letter, the worst enemies are now typing errors! I have to pay attention to every letter I write and I have to ask myself why every single symbol is present.

module.export or module.exports ?

_id or id?

Once I write a working piece of code that I consider 'a solution' I commit and push on GitHub. Afterwards, using GitLens (VSCode extension) I study the differences, line by line.

**Today’s Progress:**

I have followed this MongoDB video tutorial on youTube (schema attributes trim and default!).

I have read an article about jsonwebtoken authentication with Angular framework and an Introduction to Mongoose for MongoDB.

I used the mongoose documentation and I reviewed again my sixth OpenClassRooms project from the beginning using Postman a lot more.

When two days ago I changed the sauce schema, I broke everything.

So today I reverted these modifications and I found a typo in the deleteSauce method. I also fixed the modifySauce method to handle an image file as user's input.

Finally the front end and the back end are properly connected. We can now create multiple sauces with a title, an image and other informations.

The user that created the sauce can now modify and delete it.


I still have to write the method to manage the likes and review the whole project following the OWASP directives.

**Link to tweet:**

[twitter-follow screen_name='20Gabriele20']

June 2024


Gabriele Ferro Home
Copyright © Ferro Gabriele. All rights reserved.