Giter Site home page Giter Site logo

cempisirgen / rgraph Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rocketsgraphql/rgraph

0.0 0.0 0.0 53.78 MB

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

Home Page: https://rocketgraph.io

License: GNU Affero General Public License v3.0

Shell 4.27% JavaScript 81.22% CSS 4.85% HTML 9.66%

rgraph's Introduction

Logo

RocketGraphQL ๐Ÿš€

Docs โ€ข Youtube โ€ข Discord โ€ข Templates

Twitter follow Release


Rocketgraph gives superpowers to your web applications. Get Authentication, realtime GraphQL, Serverless functions and a Postgres DB 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 backend deployments with Git, and a full blown authentication system built in. It uses the open-source Hasura Batteries to power it's authentication service.

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);
}

Postgres Logs using pgAudit

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

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

rgraph's People

Contributors

kaushik94 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.