{"id":13564156,"url":"https://github.com/dgraph-io/flock","last_synced_at":"2025-04-03T21:30:27.957Z","repository":{"id":51407700,"uuid":"174635301","full_name":"dgraph-io/flock","owner":"dgraph-io","description":"Twitter on Dgraph","archived":true,"fork":false,"pushed_at":"2022-12-10T09:28:25.000Z","size":4699,"stargazers_count":31,"open_issues_count":10,"forks_count":6,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-11-04T17:47:00.833Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dgraph-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-09T01:45:00.000Z","updated_at":"2024-07-16T14:06:53.000Z","dependencies_parsed_at":"2023-01-26T05:16:00.927Z","dependency_job_id":null,"html_url":"https://github.com/dgraph-io/flock","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgraph-io%2Fflock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgraph-io%2Fflock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgraph-io%2Fflock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgraph-io%2Fflock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dgraph-io","download_url":"https://codeload.github.com/dgraph-io/flock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247082803,"owners_count":20880722,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:01:27.302Z","updated_at":"2025-04-03T21:30:27.396Z","avatar_url":"https://github.com/dgraph-io.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Flock \n\nFlock loads real Twitter streams into Dgraph to make use of graph travesals.\n\n**Use [Discuss Issues](https://discuss.dgraph.io/tags/c/issues/35/flock) for reporting issues about this repository.**\n\nFlock has two parts, \n- *Tweet loader* - Connects to [realtime Tweets][tweetsapi] via the Twitter Developer API and\nloads a graph model of Twitter into Dgraph via mutations.\n- *Query client* - Runs interesting graph queries on the Tweets data stored in Dgraph.\n\nHere is the graph schema of Flock:\n\n![Schema](./schema.JPG)\n\n[tweetsapi]: https://developer.twitter.com/en/docs/tweets/sample-realtime/overview/GET_statuses_sample\n\n# Running Flock\n\n## Obtaining Twitter credentials\n\nWe need to create a Twitter developer account and an app to be able to fetch stream of Tweets using \ntheir APIs. Let's start with how to create a Twitter developer account.\n\n- Apply for a Twitter developer account [here](https://developer.twitter.com/en/apply/user) and \n  follow the instructions. The series of steps would end with your email verification.\n- Create a Twitter app from [this link](https://developer.twitter.com/en/apps/create). \n  All fields are `not` required.\n- You'll be redirected to the App details tab after creating the app. Go to the `Keys and tokens` tab\n   and create new access and secret tokens.\n![Twitter Developer account](./twitter-keys.png)\n- Create a copy of the credentials template.\n  ```sh\n  cp credentials-template.json credentials.json\n  ```\n- Open the `crendentials.json` file and replace the placeholders with the keys from the \n  Twitter app's `Keys and token` tab.\n\n---\n## Setup\n\n- Clone the repository.\n```sh\n$ git clone https://github.com/dgraph-io/flock.git\n$ cd flock\n```\n\n- Export the persistent data directory. Since Dgraph is run using Docker containers, it is nice\n  to mount a directory on the host machine to persist the data across multiple runs.\n```sh\n$ mkdir ./data\n$ export DATA_DIR=$(pwd)/data\n```\n\n- If you're running Linux, you can add the current user to the `docker` group to use Docker as a non-root user.\n  `newgrp` creates a new terminal session. It is necessary after the user modification to see the effects.\n\n```sh\n$ sudo usermod -aG docker $USER\n$ newgrp docker\n```\n\n- Start the Dgraph servers and Ratel with Docker Compose. Visit http://localhost:8000 on your \n  browser to view the UI.\n  \n```sh\n$ docker-compose up\n```\n\n## Running Flock\n\nCurrently, we have Flock implemention for Go and JavaScript.\n\nGo to the specific Flock documentation for instructions:\n\n- [Go](./go)\n- [JavaScript](./js)\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgraph-io%2Fflock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdgraph-io%2Fflock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgraph-io%2Fflock/lists"}