Take a hands on approach to learning Rust by building a real world API using Rocket.rs and Diesel.rs

Image for post
Image for post
Photo by Paweł Czerwiński on Unsplash

In this tutorial I’ll describe how to build a simple API using the popular Rust web framework Rocket and Diesel as our ORM for Postgres. I initially built this little project to learn both Rust and the aforementioned technologies, so I thought it would be a nice idea to try to build something that I could use in one way or another. That’s why I decided to build this little API to help me manage the links to my Medium posts in my portfolio.

Structure of Our API

First of all, let’s take a look at how our API will be structured. …


Stop learning a new ORM syntax for every language

Image for post
Image for post
Photo by Robert Anasch on Unsplash.

If you are a software engineer who likes to try out many different languages and frameworks, you may have experienced the pain of having to learn the syntax of a new ORM for each language. This is a huge drawback that will either slow your initial productivity or drain your motivation.

On the other hand, if you already know SQL, you can use that knowledge and transfer it to many different languages by just following a few indications or simple tutorials like this one.

First of all, we will set up our environment. In order to follow the tutorial, you…


Concurrent programming with Java and the JVM

Image for post
Image for post
Photo by drmakete lab on Unsplash.

When writing complex applications, it is common to find ourselves in need of executing multiple actions at the same time. Thankfully, Java and the JVM have been designed to support concurrent programming, as all execution takes place in the context of threads.

JVM Support for Multi-Threading

As Java was created in the ‘90s, a time when computers already had multiple processing units, their creators decided to include native support for multi-threading.

Java runs in the Java Virtual Machine. When a program is started, the JVM creates the main thread that executes the main() method. From this point on, the program can create as many…


Start developing your new full-stack app in a containerized environment with little to no previous Docker experience

Image for post
Image for post
Photo by chuttersnap on Unsplash

This article will cover how to set up all the containers you need to start developing a full-stack web app.

Although, here, I will use specific technologies, the technologies running in each container could be replaced by your preferred ones with some minor changes.

On the other hand, note that this article will only cover the set up of the development. All the Dockerfiles included in this article are not production-ready.

Now, let’s have a look at what our infrastructure will look like. To do so, I will first show the file structure of our project:

app ├── docker-compose.yaml ├──…


Learn how to deploy a Gin-Gonic’s Go backend and a React web app on Kubernetes using minikube and kubectl

Image for post
Image for post
https://unsplash.com/photos/4I41IQtmSs0

First of all, we create the Docker images we need for our deployment and push them to Docker Hub.

We will start with the back end container. In your root directory, create a directory named api, which will contain all the files related to the back end. As we will be using Gin-Gonic as our Go framework, we will create a go.mod file (note that you should change the name of the module):

module github.com/uxioandrade/go-react-kubernetes-tutorialgo 1.13require github.com/gin-gonic/gin v1.5.0

Now that we have our go.mod file set up, let’s create a main.go


Go’s web framework Gin-Gonic provides developers with a wide range of approaches to keep track of users’ sessions. In this article I will discuss the one involving Redis.

While trying to implement gin’s sessions with Redis in Go, I went through some issues that could have been avoided hadn’t there been a lack of examples that helped me understand how to implement it. So, once I figured it out, I thought it would be a good idea to make a post out of it.

Image for post
Image for post
https://unsplash.com/photos/WiONHd_zYI4

This article will cover how to implement a basic API with user authentication and session cache in Go. For that purpose, we will use the Gin-gonic framework and Redis, running both services in separate docker containers.

First of all, let’s set up our environment

Uxío García Andrade

Software Engineer. Mathematics and Computer Science Student.

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