Upgrade your PostgreSQL version and migrate your data using Docker

Image for post
Image for post
Photo by Campaign Creators on Unsplash.

Recently, I had to upgrade my local PostgreSQL version from 10.10 to 11.8 to mirror the same version that exists in the production environment. I originally thought the upgrade would be simple: Turn off the container, update the docker-compose service to reference the new version, and then spin the container.

However, as soon as the container went up, an error started showing up in the logs:‌

Image for post
Image for post

The error is very explicit: Because it was created by an earlier version, my data was incompatible with the new version. When I searched for possible solutions to this problem, all I could find was related to macOS and relied on using Brew to execute some shell commands that would take care of upgrading the data and making it compatible with the new version. …


Image for post
Image for post
Photo by 𝓴𝓘𝓡𝓚 𝕝𝔸𝕀 on Unsplash

Recently I needed to tap on Laravel’s Passport programming to control how the JSON Web Tokens (JWT) were being issued. Specifically, I needed to add more claims to it (to hold more user information) and to control how the scopes were being generated. The idea was to add information like the authenticated user’s email, VAT number, account type, and, also, to forcibly add the scopes that were associated with the user’s role.

However, changing Laravel Passport’s behavior to make it happen isn’t quite obvious, and in a world were service-oriented architectures are becoming ever more common, JWT being the de facto way of carrying user’s information through multiple services, and since I couldn’t find quite a good resource to understand how to do it, I thought I could share with you how I approached and solved my own problem. …


How we leveraged Laravel’s custom Guards and Providers on Place Checkup to authenticate users against our existent API service.

Image for post
Image for post

We’ve recently launched Place Checkup, a web application that allows users to check if a given place follows the WHO recommended safety and prevention measures against COVID-19. Business owners, which are not yet Infraspeak’s customers, can register through this website, claim their places and register how and what measures they’re actually following. In the end, they get an A, B, or C badge qualifying their places.

Since Infraspeak’s core software business is directly related to infrastructure maintenance management, and since we develop with an API-first approach, we already had the core functionalities available to easily use on Place Checkup. …


How to leverage Dnsmasq to route all local development traffic to localhost.

Image for post
Image for post
Photo by Denys Nevozhai on Unsplash

The hosts file is used by the system’s DNS resolver to map a fully qualified domain name (FQDN) to its related IP, without the need to query any of the Internet’s DNS servers. However, since updating this file, manually, by the common computer user would be impractical, its common use is to map the local IP 127.0.0.1 to localhost domain so that it resolves to the host machine.

So, since this file overrides the default behavior of querying the Internet’s DNS servers, and directly maps any string of characters to an IP, it’s frequently used by programmers to associate a development domain with the localhost IP address. This enables the use of a non-existent domain like, for example, my-secret-project.test as an FQDN on a browser, as you’d normally access a registered .com


How we automated integration testing in a simple and effective way.

Image for post
Image for post
Photo by Yancy Min on Unsplash

Infraspeak is a startup founded in 2015, focused on developing the best maintenance management software in the market. Built around simplicity and a user-friendly UI/UX, we have more than 25000 buildings being managed every day, with the help of our product.

You might think that due to this number, there’s a big team of software engineers developing and maintaining the software. You’d be wrong. The Product Team is composed of 12 people, distributed between Backend, Frontend, Mobile, AI, and Integrations, and I’m also counting with the CTO.

Although we’re actively recruiting new developers to the team, we’re perfectly comfortable in maintaining such a user base and still making sure we keep improving the codebase with optimizations, as well as deploying new features because we automate as much as possible. …


A tutorial on assigning containers to communicate with each other and run your everyday scripts

Image for post
Image for post
Photo by chuttersnap on Unsplash

There’s no doubt that Docker is the best way to build, share, and run applications in the cloud. Once you configure your infrastructure, you can run on every cloud provider. It’s amazingly fast, too. No wonder that everyone is crazy about this technology and are using it to support their critical business services.

Surely you’ve also heard, and read, about teams using Docker in their development process. You can get any project up and running without having to worry about installing different (or specific) versions of a software language or any other dependency you might need. You simply docker-compose up and all services/dependencies spawn and are ready to use. …


Image for post
Image for post
“A man wearing jeans and a backpack walking down a trail through the Muir Woods” by Caleb Jones on Unsplash

If you had an offer, from another company, that paid <insert_value_here>% more then you currently are, would you accept it?

This is a question which I’ve discussed, many times, with colleagues and friends, and I think it’s such an interesting topic that I wanted to share my opinion with you and, in return, I’d appreciate if you shared yours. So, please, feel free to comment.

Although the answer seems petty easy to predict, I would never decide only based on money. Yes, it takes a great part on my decision process, but there’s three more parameters I’ll also evaluate:

  1. What’s the main vision, the mission and culture? …


Image for post
Image for post
Photo by Sorin Sîrbu on Unsplash

A little of context

At the time of writing this post, I’m a Full-Stack Web Developer @ TBFiles, a Portuguese company with operations also in Angola and Mozambique. Our core business is dematerialization, workflow design and optimization of documents and digital processes. We help our customers transferring offline information (documents, forms, processes in general). By using digital processes, instead of physical documents, our customers save time, space (because they don’t have to deal with physical archives) and keeps all information accessible through a single application, in a friendly, searchable and scalable way.

This kind of service, however, requires that we support data collection and extraction using different technologies (like FTP, e-mail and third-party web-services) with very distinctive nuances that comes with each customer having its own ways of organizing information. …

About

José Postiga

Senior Backend Developer @ Infraspeak, co-host on Laravel Portugal Podcast and contributor on various Open Source Software projects.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store