diff --git a/README.md b/README.md index 6f3b4eb..bd0db45 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ -# Super Graph +# Super Graph - Instant GraphQL API for Rails -## Instant GraphQL API for Rails. Zero code. +![MIT license](https://img.shields.io/github/license/dosco/super-graph.svg) +![Docker build](https://img.shields.io/docker/cloud/build/dosco/super-graph.svg) +![Cloud native](https://img.shields.io/badge/cloud--native-enabled-blue.svg) -Get an high-performance GraphQL API for your Rails app in seconds. Super Graph will auto-learn your database structure and relationships. Built in support for Rails authentication and JWT tokens. +Get an high-performance GraphQL API for your Rails app in seconds without writing a line of code. Super Graph will auto-learn your database structure and relationships. Built in support for Rails authentication and JWT tokens. ![Super Graph Web UI](docs/.vuepress/public/super-graph-web-ui.png?raw=true "Super Graph Web UI for web developers") diff --git a/demo b/demo index d16ce79..1a14e4b 100755 --- a/demo +++ b/demo @@ -1,7 +1,7 @@ #!/bin/bash if [ "$1" == "setup" ]; then - docker-compose -f rails-app/demo.yml run web rake db:drop db:create db:migrate db:seed + docker-compose -f rails-app/demo.yml run web rake db:create db:migrate db:seed elif [ "$1" == "run" ]; then docker-compose -f rails-app/demo.yml up else diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index f63f12a..212c29e 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -3,12 +3,15 @@ module.exports = { description: 'Get an instant GraphQL API for your Rails apps.', themeConfig: { - logo: '/hero.png', + logo: '/logo.png', nav: [ { text: 'Guide', link: '/guide' }, { text: 'Install', link: '/install' }, { text: 'Github', link: 'https://github.com/dosco/super-graph' }, { text: 'Docker', link: 'https://hub.docker.com/r/dosco/super-graph/builds' }, - ] + ], + serviceWorker: { + updatePopup: true + } } } diff --git a/docs/.vuepress/public/logo.png b/docs/.vuepress/public/logo.png new file mode 100644 index 0000000..6d5a812 Binary files /dev/null and b/docs/.vuepress/public/logo.png differ diff --git a/docs/README.md b/docs/README.md index 47730e7..6c168f5 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,6 @@ --- home: true -heroImage: /hero.png +heroImage: /logo.png heroText: "SUPER GRAPH" tagline: Get an instant GraphQL API for your Rails apps. actionText: Get Started → diff --git a/docs/prez/test.slide b/docs/prez/test.slide deleted file mode 100644 index d334e7e..0000000 --- a/docs/prez/test.slide +++ /dev/null @@ -1,36 +0,0 @@ -Super Graph -Get an instant GraphQL API for your Rails apps -18 Apr 2019 -Tags: GraphQL, API, GoLang, Postgres - -Vikram Rangnekar -https://supergraph.dev -@dosco - - -* Motivation - -Honestly, cause it was more fun than my real work. After working on several product though my career I found myself hating building CRUD APIs (Create, Update, Delete, List, Show). It was always the same thing figure out what the UI needs then build an endpoint for it, if related data is needed than join with another table. I didn't want to write that code anymore I wanted the computer to just do it. - -** Subsection - -- bullets -- more bullets -- a bullet with - -*** Sub-subsection - -Some More text - - Preformatted text - is indented (however you like) - -Further Text, including invocations like: - -.image image.jpg -.background image.jpg -.iframe http://foo -.link http://foo label -.caption _Gopher_ by [[https://www.instagram.com/reneefrench/][Renée French]] - -Again, more text \ No newline at end of file diff --git a/rails-app/demo.yml b/rails-app/demo.yml index da66b0b..d8baa01 100644 --- a/rails-app/demo.yml +++ b/rails-app/demo.yml @@ -2,6 +2,7 @@ version: '3.4' services: db: image: postgres + tmpfs: /var/lib/postgresql/data super_graph: image: dosco/super-graph:latest @@ -16,6 +17,7 @@ services: image: dosco/super-graph-demo:latest environment: RAILS_ENV: "development" + tmpfs: /app/tmp/pids ports: - "3000:3000" depends_on: diff --git a/slides/overview.slide b/slides/overview.slide new file mode 100644 index 0000000..91ca45a --- /dev/null +++ b/slides/overview.slide @@ -0,0 +1,101 @@ +Super Graph +Instant GraphQL API for Rails. Zero Code. +Tags: GraphQL, API, GoLang, Postgres + +Vikram Rangnekar +https://twitter.com/@dosco + + +* Motivation + +- Honestly, cause it was more fun than my real work. +- Bored of building yet anther CRUD API +- Save hours of my life +- Easier to use advanced Postgres features +- Always get secure, optimized queries +- Quickly add GraphQL to existing apps + +* Got Web UI? + +.image https://supergraph.dev/super-graph-web-ui.png _ 1000 + +* What does it do? + +- Add a GraphQL API to any Rails app with zero code +- Automatically learns schemas and relationships +- Supports Belongs-To, One-To-Many and Many-To-Many relationships +- Full text search and Aggregations +- Rails Auth supported (Redis, Memcache, Cookie) +- JWT tokens supported (Auth0, etc) +- Highly optimized and fast Postgres SQL queries + +* How does it work? + +GraphQL Input + + query { + users{ + email + id + } + } + +SQL Output + + SELECT + "users_0"."email" AS "email", + "users_0"."id" AS "id" + FROM ( + SELECT + "users"."email", + "users"."id" + FROM "users" + WHERE ((("users"."id") = ('4'))) limit ('20') :: integer) + LIMIT ('20') :: integer)) + +* Advanced Queries made simple + + query { + products( + # Search for all products that contain 'ale' or some version of it + search: "ale" + + # Return only matches where the price is less than 10 + where: { price: { lt: 10 } } + + # Use the search_rank to order from the best match to the worst + order_by: { search_rank: desc }) { + + id + name + search_rank + search_headline_description + } + } + +* Easy to configure + + database: + variables: + account_id: "select account_id from users where id = $user_id" + + defaults: + filter: ["{ user_id: { eq: $user_id } }"] + + blacklist: + - password + - secret_token + + fields: + - name: users + filter: ["{ id: { eq: $user_id } }"] + + - name: products + filter: [ + "{ price: { gt: 0 } }", + "{ price: { lt: 8 } }" + ] + + - name: me + table: users + filter: ["{ id: { eq: $user_id } }"]