You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- `isConnected` is a boolean that indicates that syncing private spaces is not yet possible. You need to wait until it's `false` to query data from private spaces.
37
+
- `logout` is a function that logs out the user.
38
+
39
+
There are serveral more that will be explained in the following sections.
40
+
41
+
## useHypergraphAuth
42
+
43
+
The `useHypergraphAuth` is available inside the `HypergraphAppProvider` and manages the authentication state and provides serveral useful functions.
- `authenticated` is a boolean that indicates if the user is authenticated.
55
+
- `identity` is the identity of the logged in user.
56
+
23
57
## HypergraphSpaceProvider
24
58
25
59
Whenever interact with a space you need to provide the space ID. In order providing the space ID to every hook e.g. useSpace, useQuery, useCreateEntity, etc. you can use the `HypergraphSpaceProvider` to wrap a section of your app with the space ID.
@@ -45,3 +79,4 @@ const SpaceDetails = () => {
45
79
```
46
80
47
81
The `space` prop is the ID of the space. It can be a private or public space.
Copy file name to clipboardExpand all lines: docs/docs/publishing-public-data.md
+42-12Lines changed: 42 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,39 +2,69 @@
2
2
3
3
Once you want to share your data with the world you need to publish it. This is done by creating the necessary `Opertations` (Ops) and then publishing them.
4
4
5
-
## Prepare Publish (not yet supported)
5
+
## Prepare Publish
6
6
7
7
Based on entity Ids, the source space and the target space this function calculates the necessary `Operations` to publish the data.
Copy file name to clipboardExpand all lines: docs/docs/query-private-data.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,8 @@ useQuery for private data returns:
51
51
52
52
- data - a list of entities defined in your schema
53
53
- invalidEntities - a list of entities that are in your space storage with correct type, but can't be parsed to your schema
54
+
- deleted - a list of entities that are marked as deleted, we keep them around to be able to later be able to publish the deleted information to the public knowledge graph
Copy file name to clipboardExpand all lines: docs/docs/quickstart.md
+24-26Lines changed: 24 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,11 @@ version: 0.0.1
5
5
tags: [quickstart, typesync]
6
6
---
7
7
8
-
# 🚀 Quickstart: An existing example app
8
+
# 🚀 Quickstart
9
+
10
+
If you just want to get started and get a feel for how Hypergraph works, we have created an example app that you can clone and use as a starting point.
11
+
12
+
## Explore the Example app
9
13
10
14
In order to get started as fast as possible we have created an example app that you can clone and use as a starting point.
11
15
@@ -18,65 +22,59 @@ pnpm dev
18
22
19
23
Open the browser, navigate to `http://localhost:5173` and you should see the app running.
20
24
21
-
#🚀 Quickstart: Your First Hypergraph App
25
+
## Create a new app using TypeSync
22
26
23
-
In case you want to define your own schema and mapping you can follow the guide below.
27
+
In case you want build an app with your own data types you can follow the guide below.
24
28
25
29
It will walk you through creating a new, fully-functional React application powered by Hypergraph using our scaffolding tool, **TypeSync**. In just a few minutes, you'll have a local development environment up and running.
26
30
27
-
This approach is perfect for developers who want to quickly build an application on top of Hypergraph without needing to set up the entire monorepo infrastructure.
28
-
29
-
## Prerequisites
31
+
### Prerequisites
30
32
31
33
- Node.js >= 22
32
34
- pnpm >= 10 (install with `npm install -g pnpm`)
33
35
34
-
## 1. Get the Hypergraph Toolkit
36
+
###1. Install the Hypergraph CLI
35
37
36
38
First, clone the Hypergraph repository, which contains TypeSync.
# select @tailwindcss/oxide, better-sqlite3, and esbuild
48
50
```
49
51
50
-
## 2. Launch TypeSync
51
-
52
-
TypeSync is a visual tool that helps you define your data schema and then generates a complete starter application based on your design.
52
+
### 2. Launch TypeSync
53
53
54
-
Navigate to the `typesync` app and start its development server:
54
+
TypeSync is a visual tool that helps you define your data schema and then generates a complete starter application based on your design. Launch it with
55
55
56
56
```bash
57
-
cd apps/typesync
58
-
pnpm dev
57
+
hg typesync --open
59
58
```
60
59
61
-
This will start the TypeSync server. You can now access the **TypeSync Studio** in your browser at `http://localhost:4000`.
60
+
This will start the TypeSync server. You can now access the **TypeSync**app in your browser at `http://localhost:3000`.
62
61
63
-
## 3. Scaffold Your Application
62
+
###3. Scaffold Your Application
64
63
65
64
In the TypeSync Studio:
66
65
67
66
1. Give your new application a name and a short description.
68
-
2. Use the visual editor to define your data models (we call them "types"). For example, you could create a `Post` type with a `title` (Text) and `content` (Text) properties.
67
+
2. Use the visual editor to define your data models (we call them "types"). For example, you could create a `Post` type with a `name` (Text) and `content` (Text) properties.
69
68
3. When you're ready, click "Generate App".
70
69
71
-
TypeSync will create a new directory for your application (e.g., `./my-awesome-app`) within the `hypergraph` monorepo, containing all the files and dependencies you need.
70
+
TypeSync will create a new directory for your application (e.g., `./my-awesome-app`) containing all the files and dependencies you need.
72
71
73
-
## 4. Run Your New App
72
+
###4. Run Your New App
74
73
75
74
Once your app is generated, open a **new terminal tab**. Navigate into the newly created app directory, install its dependencies, and start the local development server.
76
75
77
76
```bash
78
-
# In a new terminal, from the `hypergraph/apps/typesync` directory
79
-
cd ../../my-awesome-app # Adjust the path to match your app's name
77
+
cd ./my-awesome-app # Adjust the path to match your app's name
80
78
pnpm install
81
79
pnpm dev
82
80
```
@@ -87,7 +85,7 @@ You're all set! You can now start building your application by editing the files
87
85
88
86
---
89
87
90
-
###Edit on GitHub :bust_in_silhouette:
88
+
## Edit on GitHub :bust_in_silhouette:
91
89
92
90
[✏️ Improve this page](https://github.com/graphprotocol/hypergraph/edit/main/docs/docs/quickstart.md)
0 commit comments