{"id":15655026,"url":"https://github.com/adam-cowley/graphapp-starter-react","last_synced_at":"2025-05-05T04:14:39.255Z","repository":{"id":47024183,"uuid":"301190453","full_name":"adam-cowley/graphapp-starter-react","owner":"adam-cowley","description":"A Graph App Starter Kit for React - Clone, connect and code...","archived":false,"fork":false,"pushed_at":"2021-09-03T07:56:02.000Z","size":233,"stargazers_count":27,"open_issues_count":2,"forks_count":14,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-05T04:14:33.280Z","etag":null,"topics":["cypher","cypher-query-language","hacktoberfest","javascript","neo4j","neo4j-database","react","reactjs","typescript"],"latest_commit_sha":null,"homepage":"","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/adam-cowley.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":"2020-10-04T17:48:38.000Z","updated_at":"2024-11-04T10:43:36.000Z","dependencies_parsed_at":"2022-08-26T10:00:19.705Z","dependency_job_id":null,"html_url":"https://github.com/adam-cowley/graphapp-starter-react","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adam-cowley%2Fgraphapp-starter-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adam-cowley%2Fgraphapp-starter-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adam-cowley%2Fgraphapp-starter-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adam-cowley%2Fgraphapp-starter-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adam-cowley","download_url":"https://codeload.github.com/adam-cowley/graphapp-starter-react/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252436586,"owners_count":21747472,"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":["cypher","cypher-query-language","hacktoberfest","javascript","neo4j","neo4j-database","react","reactjs","typescript"],"created_at":"2024-10-03T12:55:34.376Z","updated_at":"2025-05-05T04:14:39.236Z","avatar_url":"https://github.com/adam-cowley.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Graph App Starter - React\n\n\u003cdiv style=\"text-align:center\"\u003e\n\u003cimg src=\"https://github.com/adam-cowley/use-neo4j/raw/main/img/react.png\" height=\"100\"\u003e\n\u003cimg src=\"https://github.com/adam-cowley/use-neo4j/raw/main/img/arrow.svg\" height=\"100\"\u003e\n\u003cimg src=\"https://github.com/adam-cowley/use-neo4j/raw/main/img/neo4j.png\" height=\"100\"\u003e\n\u003c/div\u003e\n\n\nThis repository is your starter kit for [building a Graph App](https://neo4j.com/developer/graph-apps/building-a-graph-app/) for [Neo4j Desktop](https://neo4j.com/download/).  Feel free to fork this project.\n\n## Getting Started\n\nThe repository uses the [`use-neo4j` hooks](https://github.com/adam-cowley/use-neo4j) to communicate with Neo4j using [Cypher Statements](https://neo4j.com/developer/cypher/).  This is a package intended to speed up the development by reducing the amount of boilerplate code required.  **It is not intended for public-facing/production applications used by external users.**\n\n### Provider\n\nThe `Neo4jProvider` is included in in `src/index.ts` and is used to wrap the app.  When you first run the app, you will be presented with a login form which is used to create a driver within the `Neo4jContext`.  This context (exported from `use-neo4j`) can then be used to obtain the driver instance.\n\nYou can default the scheme, host, port, username, password or database\n\nAlternatively you can pass a driver instance to the `Neo4jProvider` if you know the Neo4j credentials up front.\n\n```tsx\nimport { Neo4jProvider, createDriver } from 'use-neo4j'\n\nconst driver = createDriver('neo4j', 'localhost', 7687, 'neo4j', 'letmein')\n\nReactDOM.render(\n  \u003cReact.StrictMode\u003e\n    \u003cNeo4jProvider driver={driver}\u003e\n      \u003cApp /\u003e\n    \u003c/Neo4jProvider\u003e\n  \u003c/React.StrictMode\u003e,\n  document.getElementById('root')\n);\n```\n\n\n### Querying Neo4j\n\n`use-neo4j` provides `useReadCypher` and `useWriteCypher` hooks for querying Neo4j.  Both hooks return a `Neo4jResultState` which provides helpers for accessing the query state and results.\n\n```ts\nuseReadCypher(cypher: string, params?: Record\u003cstring, any\u003e, database?: string): Neo4jResultState\n```\n\nExample code:\n\n```tsx\nfunction MyComponent() {\n    const query = `MATCH (m:Movie {title: $title}) RETURN m`\n    const params = { title: 'The Matrix' }\n\n    const { loading, first } = useReadCypher(query, params)\n\n    if ( loading ) return (\u003cdiv\u003eLoading...\u003c/div\u003e)\n\n    // Get `m` from the first row\n    const movie = first.get('m')\n\n    return (\n        \u003cdiv\u003e{movie.properties.title} was released in {movie.properties.year}\u003c/div\u003e\n    )\n}\n```\n\nFor more information, [check the `use-neo4j` README](https://github.com/adam-cowley/use-neo4j).\n\n\n## Testing Your Graph App\n\nTo test your Graph App, open up Neo4j Desktop and navigate to the **Application Settings** tab.  Under *Developer Tools*, check *Enable development mode*, enter `http://localhost:3000` (or the URL to this app from `yarn start`) into the Entry Point and `/` into the Root Path.\n\nNext, open the *Action Bar* using Ctrl+K on Windows/Linux or CMD+K on a Mac and start to type `Development App` - hit enter when **Open Development App** is highlighted.\n\n\n## Building your Graph App\n\nTo build your Graph App, use the `yarn build` command.  This will generate a `dist/` folder with the built assets.  Running `npm pack` will generate a `.tgz` file which can be dragged into the Install form at the bottom of the **Graph Apps** pane.\n\n\n## Releasing your Graph App\n\nYou can publish your Graph App to `npm` or share the `.tgz` file with your colleagues.\n\n[Let us know about your app on the Neo4j Community Site](https://community.neo4j.com/c/neo4j-graph-platform/graph-apps/95) or if you would like a link added to [The Graph App Gallery](https://install.graphapp.io/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadam-cowley%2Fgraphapp-starter-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadam-cowley%2Fgraphapp-starter-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadam-cowley%2Fgraphapp-starter-react/lists"}