Introduction

My friend Ryan Hansen recently told me about Moralis, a new serverless platform for building Web3 Applications. This seemed like a good opportunity to try something new out!

Today I want to show you all how to add authentication with Moralis into your web application.

Before we begin, it’s important to understand what Web3 is.

Web3

It’s funny, Web 2.0 is just the “Web” these days. It’s hard to imagine a world without mobile internet, social media giants, and cloud computing. Just as Web 2.0 was emerging in the mid 2000s, a new paradigm shift is upon us.

Web 3 can…


Photo credit: https://www.prisma.io/blog/prisma-client-preview-ahph4o1umail/

ORMs (Object Relational Mappings) get a ton of hate amongst engineers today. We often look at ORMs with disdain writing them off as “leaky abstractions” over our database. But time and time again, engineering teams still use ORMs! Often they start with an ORM and use them with full force until they start hitting performance issues. Once the bottlenecks hit, many teams fork their current library and add more abstractions on top of it to fit their business need! …


Today I want to write about a nice little utility for communicating between GraphQL microservices.

At Workpop, our architecture looks like this:

Johannes Schickling did a great job on this diagram because it really illustrates our service setup perfectly.

Our frontend clients communicate with a GraphQL Gateway: a service that merges all the schemas of our GraphQL microservices and forwards incoming requests to the correct underlying service that owns that API.

This makes requests coming in through the front door of the application stack easy because you only have to worry about one endpoint and can query the whole system!


I’ve recently been taking advantage of building custom scalars to simplify presentational logic across all my API clients. Before I share with you my favorite scalars, let’s talk about what scalars are and what custom scalars can allow you to do.

What are Scalars?

Scalars are another type and represent leaf values of the GraphQL type system. A good way to look at this is through this graph:

The leaves of this graph are the scalars.

Even if you didn’t know what scalars were, there’s a good chance you have used them in GraphQL development.

String, Int, Boolean, Float are all built-in scalars…


Today I want to share a cool pattern I’ve been using in my React Apollo applications.

I was working on a feature recently where I needed to fetch some user data to determine if the current user had a specific “role”. Based on that role, we would render you a UI component that only that role could view.

Pretty easy right? Because this component was deep in the application hierarchy we can take advantage of one of my favorite features in Apollo Client: caching.

Let me make a smaller example to show off:

In this simple example, we use…


Happy Memorial Day to those in the U.S!

In the last chapter we created some backdoor, moderator apis for managing the inventory of our credits system! If you want to get caught up on this series, checkout Part 1 here, Part 2 here, Part 3 here and Part 4 here.

Today we are going to leverage our backdoor apis to bootstrap our inventory. Then we’re going to write mutations to buy credits and then in the next chapter we’ll write a mutation to buy something with our credits.

Just like the last post, I’m going to write code and write…


After a good nights sleep, we’re back at it again.

In the last chapter we installed prisma-binding to use our data access layer within our service. We sketched out some APIs users will use to interact with it as well. If you want to get caught up on this series, checkout Part 1 here, Part 2 here, and Part 3 here.

Just like the last post, I’m going to write code and write this post at the same time!

Back at it

So when I woke up this morning, I realized that we have all these APIs to access data in our system…


Alrighty, we’re gonna keep keeping on.

In the last chapter we got our boilerplate for creating our application server done. If you want to get caught up on this series, checkout Part 1 here and Part 2 here.

Just like the last post, I’m going to write code and write this post at the same time!

Now I want to integrate our data access tier (the apis we generated with Prisma) into our service tier (the application server we built in the last chapter). The way we can do that is by using GraphQL Bindings

Bindings

GraphQL bindings are an amazing…


Alright! Back to it! In the last chapter we scaffolded the beginnings of our credit service with the hope we can facilitate in app purchases!

If you want to get caught up on this series, checkout Part 1 here.

Now, with our data access layer generated for us from the datamodel created in the last part, I want to create what I like to call the Service layer that holds the business logic of our service.

Why create this layer? A couple reasons

  • Clients of this service should be consuming APIs within the domain it serves. You don’t want these…

Thank you https://www.windowscentral.com/gamble-night-away-slots-club-windows-phone-8 for the pic

In the spirits of gamification, I am going to build a microservice that can power in-app currency.

This is going to be a unique blog post. I am going to build the service as I am writing the blog post. Here goes:

First things first, let’s install prisma

$ npm install prisma -g

Alright next I’m going to make a new project:

$ prisma init credits

This returns some options to jump start your project. Let me get a screenshot for everyone:

Abhi Aiyer

Software Engineer at Workpop, Inc.

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