Skip to content

Backend with superpowers. Supercharge your web applications with Authentication, Database, GraphQL and serverless functions right from day zero.

License

Notifications You must be signed in to change notification settings

RocketsGraphQL/rgraph

Repository files navigation

Logo

RocketGraphQL 🚀

Twitter follow Release

signup_api


Rocketgraph gives superpowers to your web applications. Get Authentication, Postgres Database pre-configured, GraphQL console, AI Chatbots and Server-less function right from day 0. When you create a project on rocketgraph you are provided with Postgres Instance, Hasura console to get a GraphQL API and manage granular authorisation rules, automated server-less deployments with Git, and a full blown authentication system built in. It uses the open-source Hasura Batteries to power it's authentication service. In addition you also get an AI chatbot that is trained on the documentation provided by you.

🎉What's new?

Checkout how to train your own AI Chatbot. Just provide the documentation URL and it'll scrape the URL, tokenize the text and train an AI chatbot that can answer your user's questions.

Table of contents

Introduction


We offer the following functionality

  • 🔒 Authentication using email/password
  • 👬 Authentication using social logins
  • 🪄 Authentication using OTP and magic link
  • ⛈️ Server-less functions: Bring your own code and run it as thin AWS lambdas.
  • 👨‍💻 Your code will be automatically picked up from your Github commits by our Github bot and deployed as Lambdas
  • 🦾 AWS RDS support: 8GB PostgreSQL
  • 👩‍🚀 Postgres Logs using pgAudit
  • 🍪 Secure session management with cookies refreshed automatically


Getting Started

Trying out Rocketgraph

This guide helps you get started with rocketgraph and setting up your backend in just 15 minutes. In 15 minutes you will be able to create a todos app with db, auth and realtime subscriptions.

Create account

Your first instance is free for 14 days. No credit card. So go to the signup page and create account. Then on the dashboard click new project. Wait for a few seconds for the instance to boot up and load the software.

Project setup

You can see your hasura console url. There you can manage your database.

And links to your Backend URLs

Code setup TLDR version

For your front-end, you can start with the already provided examples. Just download and npm run dev. todos is without authentication, auth is with authentication.


Code setup (just the basics)

npx create-react-app todos
cd todos
yarn add react-router-dom react-router
yarn add @apollo/client @rocketgraphql/react-apollo @rocketgraphql/rocketgraph-js-sdk graphql

Next create src/utils/config.js and add the following:

import { createClient } from "@rocketgraphql/rocketgraph-js-sdk";
 
const config = {
  baseURL: "https://backend-XXXXXXX.rocketgraph.app/auth",
};
 
const { auth } = createClient(config);
 
export { auth };

Replace the backend-XXX URL with the url on your Rocketgraph dashboard. Congratulations, you have setup the basics required to use Rocketgraph.

RApolloProvider

Use GraphQL in your application, index.js by wrapping your App in RApolloProvider as follows:

// src/index.js
import React from "react";
import ReactDOM from "react-dom";
import { ChakraProvider } from '@chakra-ui/react'
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import App from "./App";
import Message from "./components/Message"
import Login from "./components/Login"
import Signup from "./components/Signup"

// Rocketgraph providers
import { RApolloProvider } from "@rocketgraphql/react-apollo";
import { auth } from "./utils/config";

ReactDOM.render(
  <React.StrictMode>
    <ChakraProvider>
      <RApolloProvider auth={auth} gqlEndpoint="https://hasura-AEF0WTE.rocketgraph.app/v1/graphql">
        <Router>
          <Routes>
            <Route path="/login" element={<Login />}/>
            <Route path="/signup" element={<Signup />}/>
            <Route path="/messages" element={<Message />} />
            <Route path="/" element={<App />} />
          </Routes>
        </Router>
      </RApolloProvider>
    </ChakraProvider>
  </React.StrictMode>,
  document.getElementById("root")
);

Then in your App.js file

import { gql, useSubscription } from "@apollo/client";

const GET_TODOS = gql`
    subscription {
      users {
        id
        email
      }
    }
`;

export default function Application() {
  const [ data, loading] = useSubscription(GET_TODOS);
}

AI Chatbots powered by pgVector and OpenAI:

First enter your documentation URL to train your chatbot:

You can test out your chatbot:

get your embed code that you can embed in your own website:

Postgres Logs using pgAudit

In your logs dasboard you can write complex queries to query your logs. Use cloudwatch logs syntax

Rocketgraph Edge functions

Install Rgraph CLI v0.1.10

Deploy your edge functions with rgraph deploy <project_name>

Run on your machine (self-hosted)

See : https://github.com/RocketsGraphQL/hasura-batteries

To run this as a standalone docker container.

Testing



Buy Me A Coffee