DEV Community

Kaushik Varanasi
Kaushik Varanasi

Posted on

2 1

How to build the backend for the messaging app in minutes 🀯

Backend on Rocketgraph

Head over to the Hasura console. You can find it here on the 2nd tab in Rocketgraph:

Rocketgraph Hasura tab

use the password to login to the console. And head over to the data column and create the following columns:

Image description

Permissions

We have to add user permissions so that the users can view only their messages.

Head over to the permissions tab in messages and create a role called user. A user is a person's role who is logged in.

Create insert permissions as follows:

Image description

Notice the column presets. WE are letting Hasura to inject custom variables automatically into our columns, so we can use them later.

Next allow select over the messages as follows:

Image description

We are telling Hasura to only allow messages to the user if he is the sender or receiver of the message.

And save:

Image description

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay