• Stars
    star
    116
  • Rank 303,894 (Top 6 %)
  • Language
    JavaScript
  • Created over 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Run the entire StackOverflow on Dgraph. Work in progress.

Graphoverflow

A blazingly fast Stack Overflow clone running the real Stack Exchange dataset.

NOTE: The repository is no longer being actively maintained by the Dgraph team. If something is broken, we'd happily accept a pull request from you, but won't fix anything ourselves.

UPDATE: This project is properly updated to work with version 20.xx.x of Dgraph. It's working as expected on macOS and Linux. There are some problems running the project on Windows, that can be solved by starting JS server and JS client separately. See "syntax_changed.md" for detailed instructions

Running locally

First Thing first

Before starting, make sure that Dgraph is running on default ports (8080, 9080 ...) Then go to Ratel UI or by cURL and set the Schema in the schema.txt file. Without this it won't work.

Avoid to use ACL with this project.

Node

  1. You have to open Ratel UI, go to the panel schema. Then click in "Bulk Edit". And paste the file "schema.txt" in this repository.
  2. You may also have to read the syntax_changes.md. Cuz you may need to create a fake user if you don't wanna import the dataset we provide. You gonna run a "clean" GraphOverflow. And also workaround some bugs in Windows.
  3. Run npm install in the root directory.
  4. Run npm install in the /client directory.
  5. In the root directory, run npm run dev.

You can also instead of steps 2, 3, and 4, you can just run sh ./run.sh

Docker Compose

We have a dockerized env so you can run this project.

  1. Run Docker-composer

The first build will take time.

docker-compose up            # In the first time
or
docker-compose up --build    # If you wanna rebuild it

The compose has a script that will prepare everything for you. You might wait for the deployment to be done and updated the page if so.

  1. Now go to localhost:3000 or the IP if you are running docker in a VM.

If anything goes wrong

If the page loads but keeps showing the animated loader. It means that something goes wrong. You should see a loaded site with empty questions.

You don't need to do much when running this docker-compose. In general, if you are running docker in a VM the IP is 192.168.99.100 (between 99 and 199, you can check it via docker-machine). In that case, you gonna need to change all addresses in the code from localhost or 127.0.0.1 to the VM IP.

Paths you might change:
app/client/src/lib/helpers.js
app/helpers.js

Pay attention that this docker-composer will create a volume in your docker env.

If your docker is binded to localhost. Don't change anything.

Clean up docker.

docker-compose down
or
docker-compose rm

and

docker stop $(docker ps -a -q)

docker rm $(docker ps -a -q)

docker volume ls

docker volume rm graphoverflow_dgraph

Dgraph

This app is currently compatible with Dgraph v20.xx.x

  1. Run Docker

    docker run -it -p 8080:8080 -p 9080:9080 \
    -v ~/dgraph:/dgraph --name dgraph dgraph/dgraph:v20.03.1 \
    dgraph alpha --bindall=true
    

    PS. You can also run this project with Dgraph binaries instead of Docker.

  2. Choose, download and unarchive a data dump from https://archive.org/details/stackexchange, for example lifehacks.stackexchange.com.7z

  3. Convert stackexchange data from relation to graph. From the current directory:

    for category in comments posts tags users votes; do go run $category/main.go -dir="$HOME/Downloads/lifehacks.stackexchange.com" -output="/$HOME/dgraph/$category.rdf.gz"; done
    
  4. Run the schema mutation

  5. Load graph data files into Dgraph. From the current directory:

    for category in comments posts tags users votes; do docker exec -it dgraph dgraphloader -r $category.rdf.gz; done
    

Stack

  • React
  • node.js
  • Dgraph

Attribution

Using Stack Exchange data dump under Attribution-Share Alike 3.0

License

MIT

More Repositories

1

dgraph

The high-performance database for modern applications
Go
19,791
star
2

badger

Fast key-value DB in Go.
Go
12,961
star
3

ristretto

A high performance memory-bound Go cache
Go
5,088
star
4

dgo

Official Dgraph Go client
Go
347
star
5

dgraph-js

Official Dgraph JavaScript client
JavaScript
322
star
6

sroar

Serialized Roaring Bitmaps
Go
267
star
7

pydgraph

Official Dgraph Python client
Python
261
star
8

dgraph4j

Official Dgraph Java client
Java
157
star
9

travel

Starter Kit For Building Graph Database Go and Browser Apps Using Dgraph
Go
126
star
10

ratel

Dgraph Data Visualizer and Cluster Manager
JavaScript
114
star
11

wisemonk

Bot to move conversations from Slack to Discourse.
Go
106
star
12

benchmarks

Run benchmarks with RDF data
Go
97
star
13

badger-bench

Benchmarks of Badger
Go
92
star
14

graphql-sample-apps

This repository contains sample GraphQL applications powered by Dgraph.
JavaScript
73
star
15

dgraph-js-http

A JavaScript HTTP client for Dgraph
TypeScript
67
star
16

gru

Help identify the right minions
JavaScript
46
star
17

dgraph-lambda

TypeScript
39
star
18

tutorial

A Tour of Dgraph
HTML
38
star
19

dgraph-docs

A native GraphQL Database with a graph backend
Shell
35
star
20

charts

Helm charts for Dgraph
Shell
32
star
21

ingressutil

Utils for building an ingress controller
Go
31
star
22

flock

Twitter on Dgraph
Go
31
star
23

dgraph.net

Official Dgraph .NET Client
C#
28
star
24

dgraph-operator

Dgraph Operator creates/configures/manages Dgraph clusters atop Kubernetes
Go
23
star
25

hugo-dgraph-theme

Hugo theme used for our blog
CSS
22
star
26

typhoon-ui

🌀 typhoon-ui: Token-based React component library built using emotion.
TypeScript
14
star
27

hugo-docs

Theme for Dgraph documentation built via Hugo
HTML
13
star
28

experiments

Go
13
star
29

graphql-kanban

Project management app written with Dgraph and Apollo Client
TypeScript
13
star
30

mediawiki-dgraph-skin

Mediawiki skin used by Dgraph wiki.
CSS
13
star
31

svelte-urql-example

Svelte
12
star
32

slash-graphql-cli

Command Line Tools for Slash GraphQL
TypeScript
11
star
33

auth-webinar

Resources for Serverless Authentication + Authorization Webinar
JavaScript
9
star
34

discuss-tutorial

Discuss clone app built for a tutorial
CSS
8
star
35

tove

Crash vulnerability tests for Badger using the ALICE framework
Go
7
star
36

graphql-dgraph-web

GraphQL Web
SCSS
7
star
37

graphql-asia-workshop-2020

JavaScript
7
star
38

rails-graphoverflow

Showcase of using Dgraph in Ruby on Rails
Ruby
7
star
39

dgraph-react-todomvc

TodoMVC in React with GraphQL, Dgraph, NoSQL graph database
JavaScript
7
star
40

grpc-proxy

Go
6
star
41

webinar-1-twitter-graphql

JavaScript
5
star
42

react-slash-graphql-starter

JavaScript
4
star
43

gatsby-dgraph-graphql

A simple blog app with Gatsby and Dgraph's GraphQL API
JavaScript
4
star
44

auth0-integration

Slash GraphQL + Auth0 integration quick start
JavaScript
4
star
45

tweetsletter-workshop

JavaScript
4
star
46

dgraph-day

Learn graph database best practices from experts using Dgraph at scale in production and building the next generation of apps. Sign up for the FREE virtual event, April 15-16th.
4
star
47

hello

Dgraph's take on Go present
JavaScript
3
star
48

live-demo

JavaScript
3
star
49

dev-jokes

Slash powered DevJokes Application
JavaScript
3
star
50

Install-Dgraph

Dgraph installation scripts
Shell
2
star
51

workshop

Dgraph workshop: Build a Twitter graph with Dgraph!
2
star
52

video-tutorial-todo

JavaScript
2
star
53

vlg

Dgraph's Very Large Graph (WIP) Project
Go
2
star
54

website-old

Website code for dgraph.io
CSS
2
star
55

tudo-tutorial

Tutorial for building a GraphQL React app with Slash GraphQL
JavaScript
2
star
56

dgraph-io.github.io

Dgraph blog
HTML
2
star
57

cloud-docs

Documentation for Dgraph Cloud
Shell
1
star
58

discuss-tutorial-vue

CSS
1
star
59

developer-connect-sessions

1
star