Unfortunatly shoes are sold out!

For the Pinelab webshops I use Gridsome as static site generator for SEO and speed purposes. The backend used, is the headless GraphQL e-commerce platform Vendure.

TL;DR: Statically generated product overview, client side stock-level hydration: https://github.com/martijnvdbrug/gridsome-vendure-example

What we will do in this blog post:

  • Generate a static page with an overview of products
  • Hydrate the overview on the client with ‘sold-out’ tags for products that are sold out. We do this, so we only have to rebuild the static product overview when products are added, updated or deleted, but not when stock level changes.

Gridsome setup

Create a fresh Gridsome project and…

For my company Pinelab.studio I decided to build a SaaS eCommerce platform, to hold multiple webshops. After doing some research I stumbled upon Vendure.io, a headless eCommerce framework written in NodeJS with a GraphQL API. What more could you want?

For scalability and cost reduction I am running Vendure on Google Cloud Run, here is how to do it!

Minimal effort

This blog describes the minimal steps to deploy Vendure to Cloud Run. More improvements are possible. I have described them at the end of this blog.

What needs to be done

  • Vendure uses local file system to store assets. …

Need a hand? Artwork by Feleon.nl

At MisterGreen we are moving our repositories to GitHub. Coming from Bitbucket, we had to move our Bitbucket pipelines to GitHub Actions. In this post I will describe how to deploy to Google Cloud Run from GitHub:

  • This blog assumes that there is an image available on gcr.io. More information on how to set this up can be found here.
  • Deploy to Staging by creating a Tag with git tag staging-v1 && git push origin --tags
  • Deploy to Production by creating a Tag with git tag production-v1 && git push origin --tags

The datamodel we want

At MisterGreen, an EV leasing company, we enable customers to configure a Tesla and a lease contract.

Contracts need to be signed. We want users to be able to sign through an electronic signature or by payment signature. The electronic signature is just a written signature, but done digitally. The payment signature is a €0.01 payment to verify you/your bank account.

Either way, a contract needs a signature, no matter the implementation. We want to use inheritance, but also store our data in a relational database.

Inheritance in a relation database

Congratulations, you decided to Program to an interface, not an implementation, but now you…

In this blog we will setup an Apollo GraphQL microservice in the Google Cloud Function environment, using NestJS for structuring our codebase.

This service will expose data about the Tesla cars in our system using a GraphQL interface.

Martijn van de Brug

Fullstack developing for the web, check out Pinelab.studio for more!

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