Servage Magazine

Information about YOUR hosting company – where we give you a clear picture of what we think and do!

FTP Integration for Web Applications

Monday, December 11th, 2017 by Servage
FTPOn some websites, you need the ability to modify files stored on a web server. You might want to upload new files, rename them and download some to your computer. In general, there are two choices for implementing this: FTP or a file manager GUI embedded to a web page. This time we will focus on a hybrid solution between these two, which allows you to integrate an FTP client as part of a website. Method 1: net2ftp Let’s start with a rather old but de-facto web-based FTP client. net2ftp is indeed quite old and has not been updated since 2013. However, it has been the only viable solution for integrating FTP with ...

Documenting PHP APIs

Friday, December 8th, 2017 by Servage
APIA good documentation is a requirement for a good API. If you make a good public API but the documentation is lacking, your API will not see as big of an adoption as it would with a well-written developer-friendly API. Let’s have a look at how to write documentation for a PHP-based API and also what a documentation should have, no matter what language it is written in. Writing a Good API Documentation Before looking at how to write API documentation, let’s consider the things a documentation should have. We will be focusing on a REST API, although the points mentioned usually apply to other types of APIs as well. First of all, every ...

Looking at Bootstrap 4

Sunday, December 3rd, 2017 by Servage
Bootstrap4The development of the latest version of Bootstrap entered a beta stage this summer. Going from alpha to beta introduced some major changes, and now that Bootstrap 4 is in beta, there should no longer be many breaking changes. This gives us a good chance to look into the future and see what new is included in the latest version of most popular front-end CSS framework. The New Grid While the grid in Bootstrap is still divided into 12 columns, it now uses Flexbox by default. A new grid tier “xl” has also been added. This means you should use tiers one level higher than previously. For instance, col-md-4 in Bootstrap 3 is ...

API authentication using JSON web tokens

Wednesday, November 29th, 2017 by Servage
json-jwt-tokenThere are many ways to authenticate users in APIs: username and password combinations, OAuth 2 and API keys to name a few. Today we will be having a look at a rather new implementation called JSON Web Token, JWT for short. There are some noteworthy advantages in JWTs that we will be covering as well. What is a JWT? A JWT is a way to send and receive data between two parties in a secure way. The data a JWT contains is mostly up to you, although some metadata must be present. JWTs can be used as session tokens to authenticate against an API. As the name implies, a JWT is JSON and therefore ...

What to know to become a senior developer

Friday, November 24th, 2017 by Servage
developer-codeA senior developer is a higher position granted to experienced developers. Developers start as juniors when they join their first company and are eventually promoted to senior developers. What makes a developer a senior, what skills are required to become one and what are some common characteristics that differentiate a senior from juniors? Skills to Master Let’s start with something concrete that you as a developer can learn. Before qualifying as a senior developer, one of the things you should master is the art of debugging. Debugging gives you the ability to inspect your code at runtime. When you receive a bug report and have some kind of idea where the bug appears, ...

Building multilingual web applications

Saturday, November 18th, 2017 by Servage
multilingualMultilingualism is something you should plan before starting to work on a project. If you start with a single language, it may be difficult to add multiple languages at later stages of development if everything is hardcoded in the source code. If you have the slightest feeling that your application will support multiple languages at some point, it’s best to make it multilingual from the beginning. Here’s how you can do that on both the front and back end. Localization on the Back End Let’s start with the back end. Regardless of which framework you use, the process of setting up and using language files doesn’t differ significantly. A good practice is to ...

Getting started with Docker

Sunday, November 12th, 2017 by Servage
dockerDocker has been around for a few years now, and if you haven’t got your hands on it yet, now is your chance! Containers and virtualization have been used for a long time but Docker does it in a unique way, allowing developers to set up identical and lightweight environments for development, staging and even for production. Let’s dive into the idea behind Docker and how it can be used in a project. What is Docker? Docker is a software that lets you run lightweight containers with any type of software running inside. It can be a MariaDB database, Apache, Nginx, PHP or all of these at the same time. Containers are like virtual ...

HTTP requests with the new Angular 4 HTTP Client

Tuesday, November 7th, 2017 by Servage
angular-4Angular 4.3 comes with a new way of sending HTTP requests: the HttpClient class. The older Http class can still be used and it is not deprecated, at least for now. However, HttpClient brings some new features and will likely replace the old class in the future. Let’s go through some of the features the new HttpClient has to offer. Modifying Requests with Interceptors One of the handy new features is the ability to intercept HTTP requests with interceptors. Intercepting a request means modifying it on the fly. One common use case for interceptors is to attach a session token to every request automatically to easily authenticate with an API. Interceptors are classes that ...

What are progressive web apps

Thursday, November 2nd, 2017 by Servage
web-appThe term progressive web app (PWA) is a hot trend right now. It all started back in 2015 and quickly became popular due to the advantages it offers over traditional mobile applications. But what is a progressive web application? How does it differ from a typical mobile or web application? Let’s find out what the term PWA actually means and what makes an application a progressive web application. The Definition of Progressive In one sentence, a progressive web application is a website that looks and works like a mobile application. Modern HTML5 and CSS3 features allow developers to replicate many of the features native applications can do: storing data locally, using animations to ...

Understanding Observables

Sunday, October 29th, 2017 by Servage
Advanced Javascript development - Part 4Observables are heavily used in frameworks like Angular. Observables are especially useful in cases where you have to respond to an event but don’t know in advance when that event is going to take place. Therefore, you can set up an observable and one or more observers that listen to the event. What Are Observables? Observables are one of the two main objects in the observer design pattern. In the observer pattern, observables are objects that one or multiple objects listen to for events they are interested in. The listening objects are called observers. How Observers Work For example, you can connect a button to an observable, and whenever the ...

Recent articles

Resolving Merge Conflicts in Git

Sooner or later every developer working with Git encounters a merge conflict. Especially if you are working with other developers, it’s possible that the code you are working on is changed by someone else at the same time. When that happens, you have to choose whose work you want to keep and what to discard, or perhaps you want to combine them by taking a piece from both versions. Let’s see ...

Permission Management in PHP with Bouncer

Permission management doesn’t sound like an easy task. Fortunately, a PHP package called Bouncer makes it rather simple. Bouncer not only handles permissions but also user groups, and you can assign permissions to those groups. For example. You can allow editors to create blog posts with only a few lines of code. Installing Bouncer Since Bouncer is a PHP package, to no surprise it can be installed using Composer by running “composer require ...

How JavaScript Promises Work

A promise is an object that represents an asynchronous action that is yet to be completed. Consider an HTTP request that loads the details of a user account. If the request is sent inside a promise, your application can continue to work on other tasks while the HTTP request is sent. When it completes, a function is called where you can handle the data that was returned. Let’s have a closer ...

Building a Front End with Ember.js

Ember.js is yet another JavaScript framework for building the UI for web applications. While there seems to be many JavaScript frameworks out there at the moment, each of them is targeted for a specific use case, or at least is more suitable for something than the others. Usually a single framework is not always the best choice for all kinds of websites and web applications. Let’s explore Ember together and figure ...

Angular 4 Best Practices

Angular is one of the most popular front-end frameworks. Developers sometimes prefer to use their own approach when it comes to naming conventions, whitespace usage, file structure and so on. However, if every developer chooses their own path to follow, managing a single code base in a team becomes quite challenging. To solve this, Angular has a set of rules that all developers should follow when working on an Angular project. ...