A low-code backend story at Cityscoot

Michaël Ringelstein
Cityscoot XP blog
6 min readFeb 27, 2023

--

Hey guys, I have been a product manager at Cityscoot for 2 years now. This is my first article on this domain. Just sharing some experiences I faced here, give me feedbacks !

I recently faced a situation that probably a lot of product managers have experienced in their companies, which is the lack of ressources available for a project. In my case, I was lacking the back-end development part for a webapp project.

The project in question is balancetonscoot.com, a platform to anonymously signal a moped (particularly free floating mopeds) badly parked in the city so that the company can come pick it up before is becomes dangerous or impounded. The information is not made public or shared with the townhall or impounds like other platforms (for example Dansmarue), which makes it a tool to optimise internal operations of free floating operators rather than a delation and punitive tool.

Back to our lack of resources, I know theoretically this should not happen, because resources have been securized before a sprint and everything should be ready for the development. Well, that is the theory, but sometimes life happens and we need to move forwards in other ways.

As a product manager, when you have your sprint defined, your front-end developer ready but no back-end to create a few endpoints and some basic data and business logic… you have to find a workaround, quickly and frugally.

Fortunatelly, we are in 2023, and no code and low code tools happen to be extremely good in this kind of situation. Today I want to share my experience of launching a product in record time with very limited resources using a low code back-end tool called Node-red combined with the open source database Supabase.

Before deep diving in the use case, let me introduce quickly the basic principles of Node-Red.

Node-red x Supabase

Node-Red is a low code open source flow programming tool edited by IBM in 2013 that proposes a self-hosted browser based interface to manage a back-end logic. The interface isn’t the fanciest, but it is practical and very effective.

Node-red was originally intended for Internet of Things backend applications but its openness and hability to code custom node.js mini-functions makes it easy to build fully featured backend applications. There are not that many ressources or articles related to Node-Red on the web compared to other tools like Zapier, Make, or even N8N, but it is not that hard to get started it if you have a minimum technical background and you can go deeper into custom business logics than the other alternatives.

So basically the back-end app you will develop on Node-red will follow the logic of flow-base programming. Everything is based on nodes, messages containing information go from one node to the next in order.

A node is a function block that gets an input, transforms it and outputs a message. As it is open source and the comunity is quite active, there is usually a node available for almost any service, with pre-defined functions to make the development faster. For example there are nodes for database connection (Postgre, Firebase), for message platforms connection (Slack, WhatsApp). If you need further customization, you can always implement your own node.js function.

I chose to use Node-Red over other automation solutions firstly because it is self-hosted and open source (so it is free to use). Secondly because it is easy to create APIs and simple back-end services for quick projects. But you can really push it far to compose more complex flows and logics.

Great, we can connect efficiently to a database (important to complete your backend webservices). But what Database should we choose?

I recently found out that Supabase was a great alternative to Firebase for PostgreSQL. Firebase is great to prototype but it only proposes NoSQL Databases out of the box.

Supabase has pre-built APIs, which is super cool for applications that just need to read and write raw data, and the free tier is quite generous to start a project.

Basic webservices example

Here is what I needed for my App.

  • a POST endpoint to store images into an S3 Bucket, store data in a PostgreSQL database, and send a slack message (depending on the content of the input)
  • a GET enpoint to return content to my app (from PostreSQL DB)

Disclaimer, for the example I will stick to the functionnal aspect, not to the security one. There are different ways of securing your webservice with node-red but it would be the topic of a full article.

POST enpoint

Uploading an image to an AWS S3 bucket.
There are pre-built nodes available for AWS services in node-red, but we did not like some of the implementation so we decided to build our own node.js function using the AWS Node.js SDK, well documented and mantained.

  • Source node (Step 1): a POST endpoint getting and parsing the json informaiton required.
  • Step 2: verify keys and security and create a unique and meaningful filename and metadata (send an error response if the verification isn’t passed)
  • Step 3: upload the file to S3.
  • Step 4: handle success or failures with http response or continuing the flow.

In 4 easy steps, you have a fully functional backend uploading a picture to a S3 bucket (okay, we are not detailing the ins and outs, but you get the idea). Note that the green node are just debug nodes to “see what’s going on”.

Then the moment to log the image and data in our Supabase Database.

  • Step 1: refactor the message in the flow so it matches the format needed in input of the PostgreSQL node
  • Step 2: Compose your SQL request (by looping in the object to store) and apply transformations (I do apply a regex here for example)
  • Step 3: Insert the data into the PostgreSQL Database created with Supabase. As the message is well formatted with the previous steps, you have nothing to do here but to configure the database access.
  • Sink node (Step 4): Return the http response to the client.
  • Bonus step: I added a logic to have Slack alerts in real time and function node to filter the answers that are relevant for us to manage this way. As for the PostgreSQL, the Slack prebuilt node requests you to format the message before.

GET enpoint

Even easier, the GET endpoint to retrieve information directly from Supabase. The app uses it to retrieve some data to display.

  • Source node (Step 1): GET endpoint
  • Step 2: Postgre node injecting the SQL query and returning the result
  • Sink node (Step 3): send back the response.

There you go!

A fully featured web app: balancetonscoot.com

We could launch balancetonscoot.com in record time, with extremely limited resources, combining traditional front development with a low-code backend using Node-red and Supabase.

A clear success story and an App live since last year, used by parisians everyday and helping Cityscoot operate better and improve the usage of the public space and lives of our co-citizens.

--

--