Development and Managed Hosting
ANEXIA
AUG
21
2018

5 things I learned in my summer internship

Written on August 21, 2018 by Patrick Krumpl

After a long school year, I started my summer internship as a software developer at Anexia. Since I was also allowed to work here last year, I didn’t need much acclimatization time. Now the month is almost over, and my internship is coming to an end.

JOR_Patrick_2018

Many people are probably wondering what an intern actually does at a global company like Anexia. With five things I learned in my holiday internship, I will answer this question.

 

Phalcon

Phalcon

At the beginning I come directly to my main field of activity during my internship – programming. With about 43% of the code, PHP is the most used programming language of my project. Especially for the API, which I mostly worked on, only PHP was used. Creating a PHP project from scratch is very complicated and costly. As a basis there are therefore programming constructs, so-called frameworks. Certain classes are already predefined and form the frame of the application. In the project I worked on, the framework Phalcon was used. Phalcon is a high-performance PHP framework without overhead. It is used exclusively for developing the Web API. Speed plays an important role here. That is also the reason why Phalcon is so well suited. Other examples of PHP frameworks include Laravel and CodeIgniter. Unlike these frameworks, Phalcon is installed as a PHP extension on the server.

 

Vue-js

Vue.js

However, an application usually does not only consist of a backend. In our project we also implemented a frontend that manages the user input. This retrieves the existing data from the API and sends user input to the backend via the API. Similar to the backend, there are also frameworks for the frontend. However, these are not based on PHP, but on JavaScript. The advantage is that the contents of a website are loaded dynamically without having to reload the entire page. The number of JavaScript frameworks has increased considerably in recent years. In the meantime, there are countless different frameworks of this kind and you not only slowly lose the overview, but also the selection becomes more and more difficult. The best-known frameworks are React, Vue and Angular. JavaScript frameworks have some advantages. At Vue, it is possible to divide a website into individual reusable components. This makes a project much clearer. Vue also takes care of the automatic updating of components. If the value of a variable changes, all components in which the variable is used are also automatically updated. This makes loading data via an API even easier. The loaded data only needs to be stored in a variable and the associated components are updated.

 

Vuex_2

Vuex

The question now arises: how to best store the queried data on the client side? As for almost every problem, there is a suitable JavaScript library. Vuex was especially developed as a library for Vue.js. It is a central data store. All components of an application can easily access this data memory. The data memory consists of a single object that contains all data. To save a variable, there are so-called actions. The variable can be prepared here and asynchronous operations can also be performed. For example, querying new data via an API. At the end of the action, the variable – as one would say with Vuex terms – must commit a mutation. Mutations are the only way to change the value of the data memory. New keys can also be assigned to the data storage object here.

 

Nuxt

Nuxt

Nuxt is, like the two frameworks above, a JavaScript framework. It is required to create universal Vue applications. Why do you need this, since Vue already facilitates the development of JavaScript applications? However, there is a small but subtle difference between the two frameworks: while Vue uses JavaScript to render the content of a web page on the client side, a Nuxt application is already rendered on the server side. With only one command – “nuxt generate” – the static website can be created. Nuxt takes care of the complete UI rendering. Nevertheless, the question remains why Nuxt should be used. Nowadays, so-called SPAs (Single Page Applications) are often used. These are web pages consisting of only one index.html file. The content is loaded dynamically from page to page using JavaScript. If such a website is rendered on the client side, there can be problems with search engine optimization, as initially no content can be found on the site. However, if the Vue application is already rendered using Nuxt on the server side, you can work around the problem and improve search engine optimization.

 

Docker

Docker

In order to be able to run my applications, various services are required. In my case, not only a web server running the application, but also other services like PHP and MySQL are required. Here, too, there are various ways to set up a development environment locally. XAMPP or a virtual machine with VirtualBox would be one possibility. The disadvantage is that each developer has to set up and configure his development environment himself. Also, configuration changes usually have to be made manually. Docker offers a solution. It is based on the principle of container virtualization. Each service, such as PHP, MySQL, or an nginx web server, comes in its own container. These containers contain all packages and configurations. The images of the containers and the docker files (with commands that describe an image) can be transported easily. If you are now working on a new project, a command must be executed and the development environment is set up automatically. In practice, applications can easily be scaled by using Docker.


Summary

With all the tools and extensions mentioned above, very large applications can already be built. Such frameworks make programming enormously easier. Applications can be developed professionally with little effort. However, due to the multitude of different frameworks, it is very important not to lose track and to always stay up to date.
To summarize my internship, it was not only very intense and interesting, but also brought me a lot for my future. Working at Anexia is fun and that’s the most important thing in my opinion. If you are also looking for an internship, an apprenticeship or a job, check out our current vacancies and apply.