Skip to content

Commit 6dd4a52

Browse files
committed
update quickstart guide to focus on TypeSync for creating Hypergraph applications
1 parent 0dd7abe commit 6dd4a52

File tree

1 file changed

+32
-67
lines changed

1 file changed

+32
-67
lines changed

docs/docs/quickstart.md

Lines changed: 32 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,73 @@
11
---
22
title: Quickstart
3-
description: Spin up the Hypergraph monorepo locally, including sync server, event workers, and example app.
3+
description: Create your first Hypergraph-powered application in minutes with TypeSync.
44
version: 0.0.1
5-
tags: [quickstart]
5+
tags: [quickstart, typesync]
66
---
77

8-
# 🚀 Quickstart
8+
# 🚀 Quickstart: Your First Hypergraph App
9+
10+
This guide 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.
11+
12+
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.
913

1014
## Prerequisites
1115

12-
- Node >= 18 (tested on 20+)
13-
- pnpm >= 7 (install via `npm install -g pnpm`)
14-
- Bun (optional, but speeds up the dev server — install via `curl -fsSL https://bun.sh/install | bash`)
16+
- Node.js >= 18 (we recommend v20+)
17+
- pnpm >= 7 (install with `npm install -g pnpm`)
1518

16-
Follow these steps to run the **Hypergraph monorepo** on your machine.
19+
## 1. Get the Hypergraph Toolkit
1720

18-
## 1. Clone the repository
21+
First, clone the Hypergraph repository, which contains TypeSync.
1922

2023
```bash
2124
git clone https://github.com/graphprotocol/hypergraph.git
2225
cd hypergraph
2326
```
2427

25-
## 2. Setup
26-
27-
Install dependencies and initialize the database:
28+
Next, install dependencies and build the required packages. This step ensures that TypeSync and all its components are ready to use.
2829

2930
```bash
3031
pnpm install
31-
cd apps/server
32-
cp .env.example .env
33-
pnpm prisma migrate dev
34-
```
35-
36-
## 3. Build workspace packages
37-
38-
Before you run *any* app you must compile the TypeScript workspaces so their `dist/` folders exist:
39-
40-
```bash
41-
pnpm build # one-off build of every package (hypergraph-react, hypergraph, …)
32+
pnpm build
4233
```
4334

44-
> Pro-tip: while iterating on library code you can use the watch script instead of running a full build each time:
45-
>
46-
> ```bash
47-
> pnpm --filter @graphprotocol/hypergraph-react dev # tsc -w
48-
> ```
49-
50-
After the initial build you can keep a watcher running or rely on the one we start in the next section.
35+
## 2. Launch TypeSync
5136

52-
## 4. Development
37+
TypeSync is a visual tool that helps you define your data schema and then generates a complete starter application based on your design.
5338

54-
Start a watcher to rebuild packages on change:
39+
Navigate to the `typesync` app and start its development server:
5540

5641
```bash
57-
pnpm build --watch
42+
cd apps/typesync
43+
pnpm dev
5844
```
5945

60-
Then, in separate terminal tabs, run the services:
46+
This will start the TypeSync server. You can now access the **TypeSync Studio** in your browser at `http://localhost:4000`.
6147

62-
```bash
63-
# Terminal tab 1: event workers
64-
cd apps/events
65-
pnpm dev
48+
## 3. Scaffold Your Application
6649

67-
# Terminal tab 2: sync server
68-
cd apps/server
69-
pnpm dev
70-
```
71-
72-
**Note:** Whenever you modify the Prisma schema, regenerate the client with:
50+
In the TypeSync Studio:
51+
1. Give your new application a name and a short description.
52+
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.
53+
3. When you're ready, click "Generate App".
7354

74-
```bash
75-
cd apps/server
76-
pnpm prisma migrate dev
77-
```
55+
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.
7856

79-
## 5. Run the Next.js example
57+
## 4. Run Your New App
8058

81-
Ensure packages are built, then:
59+
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.
8260

8361
```bash
84-
cd apps/next-example
62+
# In a new terminal, from the `hypergraph/apps/typesync` directory
63+
cd ../../my-awesome-app # Adjust the path to match your app's name
64+
pnpm install
8565
pnpm dev
8666
```
8767

88-
Visit `http://localhost:3000` to see the example app in action.
68+
Your new Hypergraph-powered React application will now be running, typically at `http://localhost:5173`.
8969

90-
> 💡 **Optional:** If you'd rather skip the `pnpm build --watch` process while hacking on `packages/hypergraph-react`, add the package to `transpilePackages` in `apps/next-example/next.config.ts`:
91-
>
92-
> ```ts title="apps/next-example/next.config.ts"
93-
> const nextConfig = {
94-
> transpilePackages: ['@graphprotocol/hypergraph-react'],
95-
> };
96-
> export default nextConfig;
97-
> ```
98-
99-
## 6. Upgrade dependencies
100-
101-
Keep everything up to date with:
102-
103-
```bash
104-
pnpm up --interactive --latest -r
105-
```
70+
You're all set! You can now start building your application by editing the files in the `src` directory. The generated `src/schema.ts` file contains the Hypergraph schema you defined in TypeSync.
10671

10772
---
10873

0 commit comments

Comments
 (0)