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.
First of all, let’s take a look at how our API will be structured. …
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…
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.
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…
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 ├──…
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
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.
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…
Software Engineer. Mathematics and Computer Science Student.