Fix demo to run as memory only

This commit is contained in:
Vikram Rangnekar 2019-04-17 23:35:08 -04:00
parent 6b164aed08
commit de52ce4738
8 changed files with 115 additions and 43 deletions

View File

@ -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") ![Super Graph Web UI](docs/.vuepress/public/super-graph-web-ui.png?raw=true "Super Graph Web UI for web developers")

2
demo
View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
if [ "$1" == "setup" ]; then 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 elif [ "$1" == "run" ]; then
docker-compose -f rails-app/demo.yml up docker-compose -f rails-app/demo.yml up
else else

View File

@ -3,12 +3,15 @@ module.exports = {
description: 'Get an instant GraphQL API for your Rails apps.', description: 'Get an instant GraphQL API for your Rails apps.',
themeConfig: { themeConfig: {
logo: '/hero.png', logo: '/logo.png',
nav: [ nav: [
{ text: 'Guide', link: '/guide' }, { text: 'Guide', link: '/guide' },
{ text: 'Install', link: '/install' }, { text: 'Install', link: '/install' },
{ text: 'Github', link: 'https://github.com/dosco/super-graph' }, { text: 'Github', link: 'https://github.com/dosco/super-graph' },
{ text: 'Docker', link: 'https://hub.docker.com/r/dosco/super-graph/builds' }, { text: 'Docker', link: 'https://hub.docker.com/r/dosco/super-graph/builds' },
] ],
serviceWorker: {
updatePopup: true
}
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -1,6 +1,6 @@
--- ---
home: true home: true
heroImage: /hero.png heroImage: /logo.png
heroText: "SUPER GRAPH" heroText: "SUPER GRAPH"
tagline: Get an instant GraphQL API for your Rails apps. tagline: Get an instant GraphQL API for your Rails apps.
actionText: Get Started → actionText: Get Started →

View File

@ -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

View File

@ -2,6 +2,7 @@ version: '3.4'
services: services:
db: db:
image: postgres image: postgres
tmpfs: /var/lib/postgresql/data
super_graph: super_graph:
image: dosco/super-graph:latest image: dosco/super-graph:latest
@ -16,6 +17,7 @@ services:
image: dosco/super-graph-demo:latest image: dosco/super-graph-demo:latest
environment: environment:
RAILS_ENV: "development" RAILS_ENV: "development"
tmpfs: /app/tmp/pids
ports: ports:
- "3000:3000" - "3000:3000"
depends_on: depends_on:

101
slides/overview.slide Normal file
View File

@ -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 } }"]