Different approaches to do Pagination in an API Rest

Introduction In this post, I will talk about Pagination in Rest API, my idea was only to talk about that topic and create a tiny repository where I can show a simple example. But I started adding some features, like Docker, Kubernetes, Makefile, etc. (sometimes that kind of thing happens 😀) That made me think that I can explain many topics with the same repository, the idea will be to add more features or technologies and every post will be related to un tag version. [Read More]

Building an Authorization Service With Fiber Using JWT

What is JWT? JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. This information can be verified and trusted because it is digitally signed. JWTs can be signed using a secret (with the HMAC algorithm) or a public/private key pair using RSA or ECDSA. Although JWTs can be encrypted to provide secrecy between parties, we will focus on signed tokens. [Read More]

Build your own OAuth2 server

What is OAuth2? OAuth 2.0, which stands for “Open Authorization”, is a standard designed to allow a website or application to access resources hosted by other web apps on behalf of a user. It replaced OAuth 1.0 in 2012 and is now the de facto industry standard for online authorization. OAuth 2.0 provides consented access and restricts actions of what the client app can perform on resources on behalf of the user, without ever sharing the user’s credentials. [Read More]

Basics about a gRPC Server

What’s gRPC? gRPC is a Remote Procedure Call (RPC) framework. RPC is an action-based paradigm, similar to remotely calling a function from another microservice. This makes gRPC a type of inter-process communication (IPC) protocol built around Protobufs to handle messaging between the client and the server. gRPC is perfect for intensive and efficient communication, because it supports client and server streaming. Difference with REST? In contrast, REST is a resource-based protocol, which means the client tells the server what resource needs to be created, read, updated, or deleted based on the body of the request. [Read More]

Rest Api Design

Maybe I should have written this article before the previous one. But sometimes one doesn’t know where to start, so now I will explain what you need to take care of when you design a Rest API. Why? Designing a REST API follows specific design principles that allow for flexibility, scalability, and independence between client and server applications. The design should follow the six REST design principles to ensure uniformity, decoupling, statelessness, cacheability, a layered system, and optional code on demand. [Read More]

Documenting Api With Swag

Think on this, you’ve finished developing a new API, and now have to write documentation to guide you when building client-side applications that consume the API. You start thinking of various ways to achieve this, and you lay out multiple alternatives like Swagger, Docusaurus, Postman and many more. You remember all the work involved in the API documentation phase and wonder if there are shortcuts to speed things up. You need to do this because who will use an API without any documentation? [Read More]