{"id":13552793,"url":"https://github.com/unigraph-dev/unigraph-dev","last_synced_at":"2025-04-03T04:30:46.583Z","repository":{"id":40334444,"uuid":"303035299","full_name":"unigraph-dev/unigraph-dev","owner":"unigraph-dev","description":"A local-first and universal knowledge graph, personal search engine, and workspace for your life.","archived":false,"fork":false,"pushed_at":"2023-06-19T16:01:04.000Z","size":34772,"stargazers_count":702,"open_issues_count":22,"forks_count":48,"subscribers_count":16,"default_branch":"main","last_synced_at":"2024-04-14T04:22:22.662Z","etag":null,"topics":["dgraph","knowledge-base","knowledge-management","react"],"latest_commit_sha":null,"homepage":"https://unigraph.dev/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unigraph-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"open_collective":"unigraph-dev"}},"created_at":"2020-10-11T03:34:16.000Z","updated_at":"2024-04-12T12:10:07.000Z","dependencies_parsed_at":"2023-01-22T11:46:07.609Z","dependency_job_id":null,"html_url":"https://github.com/unigraph-dev/unigraph-dev","commit_stats":{"total_commits":1432,"total_committers":13,"mean_commits":"110.15384615384616","dds":0.4532122905027933,"last_synced_commit":"a209dfde958f01b14a2bafb9327b9abb56364b10"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unigraph-dev%2Funigraph-dev","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unigraph-dev%2Funigraph-dev/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unigraph-dev%2Funigraph-dev/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unigraph-dev%2Funigraph-dev/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unigraph-dev","download_url":"https://codeload.github.com/unigraph-dev/unigraph-dev/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222508289,"owners_count":16995217,"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":["dgraph","knowledge-base","knowledge-management","react"],"created_at":"2024-08-01T12:02:10.353Z","updated_at":"2024-11-04T00:30:32.300Z","avatar_url":"https://github.com/unigraph-dev.png","language":"TypeScript","readme":"# Unigraph\n\nA local-first and universal knowledge graph, personal search engine, and workspace for your life.\n\nPlease join the Discord community below to talk about contributing, or open a GitHub issue if you want to help!\n\n[![Discord](https://img.shields.io/discord/835194192044621885.svg?label=\u0026logo=discord\u0026logoColor=ffffff\u0026color=7389D8\u0026labelColor=6A7EC2)](https://discord.gg/vDTkKar5Vz)\n\n## Docs\n\n- [🧭 Docs home: Unigraph Developer Documentation](https://docs.unigraph.dev/)\n- [Data model](\u003c./docs/Data model.md\u003e)\n- [Glossary](./docs/Glossary.md)\n\nLicense:\n[MIT](https://github.com/unigraph-dev/unigraph-dev/blob/main/LICENSE)\n\n## Getting started\n\n### Running with Docker image\n\nWe provide an experimental Dockerfile for easy setup:\n\n- Building Unigraph: `docker build -t unigraph-devserver .` (this should take roughly 10 minutes max),\n- Running Unigraph: `docker run -d -p 4002:4002 -v \u003cdata directory\u003e:/opt/unigraph -p 4001:4001 -p 3000:3000 -P unigraph-devserver`, \n- Open `http://localhost:3000` in a Browser that supports JavaScript to access Unigraph. If container is running on a different machine, replace `localhost` accordingly.\n\nTo update the Docker image, run `docker build` again after `git pull`.\n\n### Building from source\n\n**1)** Build the [`Dgraph`](https://github.com/unigraph-dev/dgraph) backend binary from source [[reference](https://github.com/unigraph-dev/dgraph#install-from-source)]\n\n\u003e requires `gcc`, `make`, `go\u003e=1.13`\n\n```bash\ngit clone https://github.com/unigraph-dev/dgraph.git\ncd ./dgraph\nmake install  # installs built binary in $GOPATH/bin\n```\n\n```bash\n# you can view your $GOPATH by running:  go env GOPATH\n# and similarly, confirm binary exists:\n\u003e ls $(go env GOPATH)/bin | grep dgraph\ndgraph\n```\n\n**Alternative** for step **1)**: find Unigraph's Dgraph binary for your platform on [GitHub Releases](https://github.com/unigraph-dev/dgraph/releases) and rename it to `dgraph`. On Linux or macOS, you'll need to make it executable: `chmod +x ./Downloads/dgraph`. Then, continue to step **2)**.\n\n**2)** In the `unigraph` project root, fetch and build project dependencies:\n\n\u003e if you have `node.js` versioning issues, consider using [`nvm`](https://github.com/nvm-sh/nvm). Windows users, see the note further down.\n\n```bash\nyarn \u0026\u0026 yarn build-deps\n```\n\n**3)** Move the `Dgraph` binary you built in step **1)** to a new `/opt/unigraph` directory. This is a project default, but you can use a path of your choosing (as well as keep a separate data directory \u0026 bin path).\n\n\u003e check that your user can read/write to the path(s) — you may need to e.g. `chown -R $(whoami) /opt/unigraph`\n\n**4)** Run the backend and frontend from the `unigraph` project root!\n\n\u003e the `Dgraph` backend currently requires its [default ports](https://dgraph.io/docs/deploy/ports-usage/#default-ports-used-by-different-nodes) to be free, especially `8080`.\n\n\n```bash\n# run backend with default data and bin path:  /opt/unigraph\n./scripts/start_server.sh\n# or, run backend with custom paths:\n./scripts/start_server.sh -d \"\u003cdata directory\u003e\" -b \"\u003cdgraph binary location\u003e\"\n```\n\n\n```bash\n# run frontend application in a browser:\nyarn explorer-start\n# or, to run as an electron application:\nyarn electron-start\n```\n\n\u003e **NOTE:** if the backend failed **during server initialization**, you'll need a clean application state before reattempting:\n\u003e\n\u003e- `killall dgraph` to kill all running `dgraph` processes, then\n\u003e- remove `p/`, `w/`, `zw/` in your data directory (by default `/opt/unigraph`)\n\n\u003e Server initialization is successful upon `unigraph\u003e Unigraph server listening on port 4002` and announcing upserts.\n\n\n**5)** If you want to use third-party API integrations, consult the **\"**API Keys**\"** section below.\n\n----\n**Alternative Setup for Windows Dev/Technically Savvy Users**\n\u003e If you have managed to get a Dgraph instance running in WSL or via Docker, but would like to hack on Unigraph under Windows, the following commands can get the frontend and local backend built and connecting to `Dgraph`. These commands depend on PowerShell. Note that Windows comes with an older version of PowerShell, but you should install the most recent version from [here](https://github.com/PowerShell/PowerShell/releases). The binary, `pwsh.exe`, should be on your path after installation. \n\nIn one PowerShell terminal instance execute the following commands:\n```\nyarn\nyarn build-deps\nyarn backend-start\n```\n\nIn another PowerShell terminal instance run this command, when the last command of the previous set has finished upserting to `Dgraph`:\n```\nyarn explorer-start\n```\nIf you want to change Unigraph's default `Ctrl + e` shortcut for the Omnibar (which in Windows can pop up the browser's search bar), you can do it by editing the following section of `packages\\unigraph-dev-explorer\\src\\pages\\SearchOverlay.tsx` (currently hardcoded):\n\n```typescript\ndocument.onkeydown = function(evt) {\n    evt = evt || window.event;\n    if ((evt.ctrlKey || evt.metaKey) \u0026\u0026 evt.key === 'e' \u0026\u0026 !isElectron()) {\n        if (open === undefined) setSearchEnabled(!searchEnabled);\n    }\n    if ((searchEnabled) \u0026\u0026 evt.key === 'Escape') {\n        setSearchEnabled(false);\n    }\n};\n```\n\n## Updating Unigraph\n\nUnigraph is being worked on constantly. If you're interested in getting the latest version, do the following:\n\n- `git pull` to retrieve the latest changes;\n- make sure backend and dgraph is not running;\n- `yarn build-deps` to re-build common libraries and default packages;\n- `./script/start_server.sh` to re-start backend, and update any new packages if available.\n\n----\n\n\n## Structure\n\nThis repository contains all relevant source code for Unigraph:\n\n- packages/\n    * unigraph-dev-backend/ : Unigraph local backend in Node.js.\n    * unigraph-dev-common/ : shared data and utilities between backend and frontend.\n    * unigraph-dev-explorer/ : Unigraph frontend in React.\n    * default-packages/ : schema, data and code declarations for packages providing default functionalities. If you are looking to build packages, you can study example projects here.\n\n## API Keys\n\nTo use third-party API integrations, obtain desired API keys and put them in this format in a file named `secrets.env.json` before starting the server:\n\n```\n{\n    \"twitter\": {\n        \"api_key\": \"abc\",\n        \"api_secret_key\": \"abc\",\n        \"bearer_token\": \"abc\"\n    },\n    \"reddit\": {\n        \"client_id\": \"abc\"\n    },\n    \"openai\": {\n        \"api_key\": \"abc\"\n    },\n    \"google\": {\n        \"client_id\": \"abc\",\n        \"client_secret\": \"abc\"\n    }\n}\n```\n\nFor how to obtain them, see [the docs page](https://docs.unigraph.dev/Unigraph+Developer+Documentation#%F0%9F%A7%AD+Getting+started).\n","funding_links":["https://opencollective.com/unigraph-dev"],"categories":["TypeScript","react"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funigraph-dev%2Funigraph-dev","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funigraph-dev%2Funigraph-dev","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funigraph-dev%2Funigraph-dev/lists"}