Image for post
Image for post

In my last project, we needed to create an engine to search available products within a huge set of products. Those products are available in a certain geographic region with many conditions that must match to be returned as a search result. Typical search features also need to be satisfied like the use of filters and pagination.

One of the most important requirements was to solve this with a fast query using coordinates for the customer and the product location. Products availability may be represented in two different ways:

  • a pair of coordinates and a fixed maximum distance of deliverability
  • a polygon that represents the area where it can be fulfilled. …

Image for post
Image for post

Introduction

During one of our latest projects, our client told us they would be expecting a specific amount of requests in a short amount of time (think something like 5000 in 10 minutes). Even though the load is not excessive, we decided it would be best to be one hundred percent sure we would not be having trouble once those requests started pouring in. Then Martín and I started automating this task.

What we decided to do

One of the important aspects of every application is its architecture. In our case, it being a web application, we were running a PERN stack (PostgreSQL, Express, ReactJS and Node.js) …


Image for post
Image for post

“🚀 A fully-featured, production ready caching GraphQL client for every UI framework and GraphQL server” — Apollo Client github repository

Why do we need a GraphQL client?

As GraphQL backends expose their API over a single HTTP endpoint, we could just use fetch to interact with it. The problem is this doesn’t scale well because we would need to reimplement backend agnostic features on every project, such as caching data, updating the local cache after a mutation, UI framework integration, and more!

A GraphQL client should have those kinds of functionalities so that you don’t have to reimplement these behaviors yourself. …


Image for post
Image for post

In our previous GraphQL article, we went through the basics and some recommendations on how to use GraphQL. In this new article, we are going to explain how to build a basic GraphQL API using Rails.

We will build a basic blog application. Our application will have multiple Users and they will be associated with multiple Posts.

For the sake of simplicity, we will not include authentication. We managed to authenticate users with devise-token_authenticatable by following this tutorial. You can check our project repository and see how we implemented it.

To follow this guide you’ll need Ruby, RubyGems, and PostgreSQL.

Step 1: Initialize a rails project

$ rails new <app_name> --api -T -d…


Image for post
Image for post

“GraphQL, despite the name, isn’t simply a query language. It’s a comprehensive solution to the problem of connecting modern apps to services in the cloud. As such, it forms the basis for a new and important layer in the modern application development stack: the data graph. This new layer brings all of a company’s app data and services together in one place, with one consistent, secure, and easy-to-use interface, so that anyone can draw upon it with minimal friction.” — Principled GraphQL

REST vs GraphQL

The API-Rest architecture suggests that we should retrieve its data according to the routes we are requesting. Let’s say that you want to get the data for a user in our system with id=1. If we were to ask the API for this data, we would need to make a GET request to /users/1 to retrieve this user’s data. …


Image for post
Image for post
A solid structure makes for a successful project

Motivation

How long does it take you to set up a new project before you can actually start working on it? How many times have you coded the same user model with the same sort of authentication? If you answered, like us, too long and too many times, you might consider creating a boilerplate project.

Using a pre-made template for your new projects has many advantages: less time wasted on set up, consistency across projects, a well-known folder structure to start from. …


Image for post
Image for post
Neox

What’s Neox?

Neox is a really tiny JavaScript library (just 269B when minified and gzipped!) that exposes a function returning a simple data structure from any given plain JavaScript object.

The problem it solves

While using Immutable to create our Redux reducers, we found an issue in the way it interacts with React’s useEffect hook (“the Effect Hook lets you perform side effects in function components”). …


Image for post
Image for post
Photo by Markus Spiske on Unsplash

The problem

During the development of one of the projects I was working on we faced a problem:

We need to let the user know about an incoming event in the fastest (and cleanest) way possible.

The no-brainer solution is polling, but is it the right choice? In this article, I’m going to talk about it, the reasons on why not using it, and present WebSockets as a practical solution to this problem.

Polling

What is it?

Polling is a technique that consists on fetching information on a regular schedule to check for data changes. …


Image for post
Image for post

Authentication is crucial in a lot of web apps, as it’s what makes it possible to limit content to some users. For example, if your bank doesn’t handle it properly, anyone could be able to see your bank account data!

Goal

The main goal of this article is to show the recommended way to handle routes authorization in vue using vue-router. Although vue-router’s documentation covers this, I thought it would be great to have it all in one place with some simple and understandable code examples.

Let’s get into it

Only care about the code? Check the github repo

In order to show how this works, we are going to need at least two routes, one that requires authentication and one that doesn’t. Let’s start by creating a simple router.js file with two routes: Log in and Profile. …


Image for post
Image for post

Purpose

I’ve been in software development for more than 8 years, and have never been taught how to be an effective developer. My only hope was to somehow become a tech guru, but as I started to grow as a developer I also had to deal with clients, projects, epics, complex features, estimations, and that implied more than just understanding the technology I was working on.

The main purpose of this article is to share some of my learnings regarding best practices when it comes to becoming more effective as a developer.

We’ll go through the understanding of:

  • How we usually behave as developers. …

About

NeoCoast

We are always moving

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