What we'll be building?
We'll be building a production grade messaging application in minutes using React.js and Postgres. There will be a simple users list. Users can message other users on the platform.
Rocketgraph is a complete backend. Think of it like Firebase, but with Postgres and Graphql. Let's look at some of the use cases of Rocketgraph in this scenario.
First to build the app, we'll need users, messages, a database to store all this and real-time functionality:
- Authentication: We'll need to authenticate the users somehow and store them in the database
- A database: to store all the users, products and invoices
- Real-time: All the products and actions should be synced in real-time to the database
💡To read this article you need to have a basic understanding of React.js
Rocketgraph : A complete backend
A little background. Rocketgraph provides a complete backend. It comes with a Postgres DB, Hasura console to manage your Postgres and add GraphQL layer to your data, Authentication and Serverless functions.
So to sum it up we provide auth for your web apps, GraphQL for realtime functionality like messages/notifications/comments etc and Serverless functions for anything you want to offload. It's Serverless Github app auto-compiles your Github code to thin AWS Lambda functions.
So what the hack is GraphQL?
GraphQL is a language specification by Meta to achieve realtime queries on your data by asking for exactly what you need. This is different from traditional API approach where the query is coded into the backend and front-end has very little control over what/how to ask for data.
Think of it like a JSON query. You ask for what data you want in a json-like query and it will return exactly those fields.
In this article we'll leverage the power of GraphQL, React Apollo and Hasura to build a real-time system for building a messaging application.
TLDR Version
If you just want to see the code. Here is the code base for this article. Here you can see more examples. This is the open-source software behind Rocketgraph
Also, we just released v0.2.0 stable: https://github.com/RocketsGraphQL/rgraph/releases/tag/v0.2-stable
Keep reading
Top comments (0)