Internship 2019

The weekly digest

Week 1

During the interview, I was presented with the project That I'll be working on this week, an angularJS component that is tasked with searching through a database and displaying it to an average user.

In the first week of the internship I created a service in typescript that would be able to read a JSON file and execute a search in the database with knex a node package installed via node package manager.

The tools used where the following:

  • FireFox
  • Visual Studio Code
  • Slack
  • Postman
  • Docker Desktop
  • Microsoft Office
  • GitKraken
  • Docker Desktop

This week I set up the workspace on the first day and got to work on making a json file with a structure close to that of an sql request allowing me to test my code with help from Postman, a piece of software allowing to test posts, a post is a request method on the internet made from a users computer towards a server containing an arbitrary amount of data. In my case, a JSON file.

On the left: The json file sent from the users PC to the server
On the right: The response from the server once it has finished the request

Week 2

Visualisation of the relationships between APIs within the application:

On mondays, the company organises Monday Knowledge Transfers (MKT) where they invite a specialist to talk about a certain topic. This week was all about health and safety around the BBQ, how it is unhealthy to put food in direct contact with the flame and other tips and facts that could help us

Back at work, I started thinking how I would tackle the Where condition of an sql statement through a json knowing that a condition can have multiple other conditions nested inside so I had to find a way to handle each of those conditions while maintaining the right track, as in, not forget or lose track of what condition belonged to other conditions.

At first it seemed pretty confusing since all the solutions that came to mind couldn't efficiently solve the problem but after a bit of help by the project manager a recursive function was the way to go about solving this problem.

The program would need to read the request in a linear fashion, and so converting the json into an sql statement was going to be my challenge for that week.

This week I managed to create the main structure for the JSON that would be adaptable to other forms of requests

I learned a lot this week about Typescript data types, recursive functions and a few programming good practices, at the end of the week there was a BBQ where the whole team joined up and everyone brought to a common picnic.

Week 3

These past two weeks I completed the backend of the component allowing me to start on the frontend, the user interface this week.

The first few days I spent learning how all the components fit together within the project and got started on creating the form in AngularJS using PrimeNG components

I learned a lot enabling me to get started on making a basic form that would generate a json file in real time

Week 4

This week I had to find a solution on how to generate a recursive query in the form of a form, It took many tries.

Initial idea:

Final version:

This tutorial really helped me understand Dynamic Nested Reactive Forms In Angular for my Where clause but can also serve for nested comments

Created a service that will independantly handle the form data from the form components, so by changing the form data, the json is generated automatically from the data.

Week 5

This week, I finished linking the front end to the back, so the whole system works as intended after quite a bit of debugging and created a table using primeNG So the user inputs data into the form => it gets sent as an object to the backend via an API controller => The object is read and transformed into a request in the database via knex finally, the response is sent back to the user.

Week 6

Last week of the internship, I finished up debugging, tweaking a few features and making it all look nice like changing the condition operators dependant on if it is a string or a number.

Added JOI form validation to make sure the data coming from the user is correct and hid unused fields from view.

I learned a neat little trick that I never really thought about before: To make sure $('row') isn't null, instead of using "$('row') != null ? true : false" we can use what is known as the "double bang" !!, a double "not operator" that ensures that the condition is a boolean.

Finally after merging on git flow via git kraken and resolving all confilcts due to changes between two different versions of the same file, we could push to production to a container on dockerhub

That is the end of my internship and feel free to read the conclusion