Skip to content

Commit dcb1bc3

Browse files
committed
Merge branch 'main' into pcv/connect-owner-key
2 parents bdd6d31 + 2403970 commit dcb1bc3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2154
-560
lines changed

.github/workflows/fly-deploy.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/
2+
3+
name: Fly Deploy (Paused)
4+
on:
5+
push:
6+
branches:
7+
- main
8+
jobs:
9+
deploy:
10+
name: Deploy app
11+
runs-on: ubuntu-latest
12+
concurrency: deploy-group # optional: ensure only one action runs at a time
13+
steps:
14+
- uses: actions/checkout@v4
15+
# - uses: superfly/flyctl-actions/setup-flyctl@master
16+
# - run: flyctl deploy --remote-only
17+
# env:
18+
# FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

Dockerfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ RUN --mount=type=cache,id=workspace,target=/root/.local/share/pnpm/store pnpm in
2424
# Build stage for the server.
2525
FROM base AS build
2626
# TODO: Remove this when we switch to an actual database.
27-
ENV DATABASE_URL="file:./dev.db"
27+
# ENV DATABASE_URL="file:./dev.db"
2828
RUN \
2929
# TODO: This initalizes the database. But we should probably remove this later.
30-
pnpm --filter server prisma migrate reset --force && \
30+
# pnpm --filter server prisma migrate reset --force && \
3131
# Build the monorepo packages
3232
pnpm build && \
3333
# Generate the prisma client
@@ -40,13 +40,15 @@ RUN \
4040
mkdir -p deployment/out && mv deployment/dist deployment/node_modules deployment/package.json deployment/out && \
4141
# Add prisma client in dist
4242
mv deployment/prisma/generated/client/libquery_engine-linux-musl-arm64-openssl-3.0.x.so.node deployment/out/dist/libquery_engine-linux-musl-arm64-openssl-3.0.x.so.node && \
43-
mv deployment/prisma/generated/client/libquery_engine-linux-musl-openssl-3.0.x.so.node deployment/out/dist/libquery_engine-linux-musl-openssl-3.0.x.so.node
43+
mv deployment/prisma/generated/client/libquery_engine-linux-musl-openssl-3.0.x.so.node deployment/out/dist/libquery_engine-linux-musl-openssl-3.0.x.so.node && \
44+
mv deployment/prisma deployment/out
4445

4546
# Slim runtime image.
4647
FROM node:22-alpine AS server
4748
WORKDIR /app
4849
COPY --from=build /workspace/deployment/out .
4950
# TODO: Remove this when we switch to an actual database.
50-
ENV DATABASE_URL="file:./dev.db"
51+
ENV DATABASE_URL="file:/mnt/hypergraph_data/production.sqlite"
52+
RUN npm run prisma migrate deploy --skip-generate
5153
EXPOSE 3030
52-
CMD ["node", "dist/index.js"]
54+
CMD ["sh", "-c", "npm run prisma migrate deploy && node dist/index.js"]

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Graph Framework
1+
# Hypergraph Framework
22

33
## Development
44

@@ -22,16 +22,22 @@ pnpm dev
2222
# in another tab
2323
cd apps/server
2424
pnpm dev
25+
# in another tab
26+
cd apps/typesync
27+
pnpm build
28+
# then, from anywhere in the repo, start Typesync
29+
hypergraph typesync
2530
```
2631

32+
2733
Any time you make changes to the schema, you will need to run the following commands:
2834

2935
```sh
3036
cd apps/server
3137
pnpm prisma migrate dev # this will also generate the Prisma client
3238
```
3339

34-
You can run the next example app with:
40+
You can run the Typesync Next example app with:
3541

3642
```sh
3743
# Notes:
@@ -40,6 +46,7 @@ cd apps/next-example
4046
pnpm dev
4147
```
4248

49+
4350
## Upgrading Dependencies
4451

4552
```sh

apps/connect/.env.development

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ VITE_HYPERGRAPH_SYNC_SERVER_ORIGIN="http://localhost:3030"
22
VITE_HYPERGRAPH_CHAIN="geo-testnet"
33
VITE_HYPERGRAPH_API_URL="https://hypergraph-v2-testnet.up.railway.app/graphql"
44
VITE_HYPERGRAPH_RPC_URL="https://rpc-geo-test-zc16z3tcvf.t.conduit.xyz"
5+
VITE_PRIVY_APP_ID="cmbhnmo1x000bla0mxudtd8z9"
6+
VITE_PRIVY_PROVIDERS="development"
57
# VITE_HYPERGRAPH_CHAIN="geogenesis"
68
# VITE_HYPERGRAPH_API_URL="https://hypergraph-v2.up.railway.app/graphql"
79
# VITE_HYPERGRAPH_RPC_URL="https://rpc-geo-genesis-h0q2s21xx8.t.conduit.xyz"

apps/connect/.env.production

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
VITE_HYPERGRAPH_SYNC_SERVER_ORIGIN="https://syncserver.hypergraph.thegraph.com"
2-
VITE_HYPERGRAPH_CHAIN="geogenesis"
3-
VITE_HYPERGRAPH_API_URL="https://hypergraph-v2.up.railway.app/graphql"
4-
VITE_HYPERGRAPH_RPC_URL="https://rpc-geo-genesis-h0q2s21xx8.t.conduit.xyz"
1+
# VITE_HYPERGRAPH_SYNC_SERVER_ORIGIN="https://syncserver.hypergraph.thegraph.com"
2+
VITE_HYPERGRAPH_SYNC_SERVER_ORIGIN="https://hypergraph.fly.dev"
3+
VITE_HYPERGRAPH_CHAIN="geo-testnet"
4+
VITE_HYPERGRAPH_API_URL="https://hypergraph-v2-testnet.up.railway.app/graphql"
5+
VITE_HYPERGRAPH_RPC_URL="https://rpc-geo-test-zc16z3tcvf.t.conduit.xyz"
6+
VITE_PRIVY_APP_ID="cmcccikza007bjy0niawgutl0"
7+
VITE_PRIVY_PROVIDERS="production"

apps/connect/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@tanstack/react-router": "^1.120.2",
2424
"@xstate/store": "^3.5.1",
2525
"clsx": "^2.1.1",
26-
"effect": "^3.16.3",
26+
"effect": "^3.16.10",
2727
"graphql-request": "^7.2.0",
2828
"lucide-react": "^0.508.0",
2929
"react": "^19.1.0",
@@ -44,6 +44,7 @@
4444
"prettier-plugin-tailwindcss": "^0.6.13",
4545
"tailwindcss": "^4.1.10",
4646
"unplugin-fonts": "^1.3.1",
47+
"vite-plugin-node-polyfills": "^0.23.0",
4748
"vite-plugin-svgr": "^4.3.0"
4849
}
4950
}

apps/connect/src/Boot.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,17 @@ export function Boot() {
4545
}
4646
}, []);
4747

48+
// @ts-expect-error - window is not typed
49+
window.APP_VERSION = 'v1';
50+
// @ts-expect-error - window is not typed
51+
window.VITE_PRIVY_APP_ID = import.meta.env.VITE_PRIVY_APP_ID;
52+
4853
return (
4954
<QueryClientProvider client={queryClient}>
5055
<PrivyProvider
51-
appId="cmbhnmo1x000bla0mxudtd8z9"
56+
appId={import.meta.env.VITE_PRIVY_APP_ID}
5257
config={{
53-
loginMethods: ['email', 'google'],
58+
loginMethods: import.meta.env.VITE_PRIVY_PROVIDERS === 'development' ? ['email', 'google'] : ['email'],
5459
appearance: {
5560
theme: 'light',
5661
accentColor: '#6833ff',

apps/connect/src/routes/authenticate.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { Loading } from '@/components/ui/Loading';
44
import { usePrivateSpaces } from '@/hooks/use-private-spaces';
55
import { usePublicSpaces } from '@/hooks/use-public-spaces';
66
import { Connect, Identity, Key, type Messages, StoreConnect, Utils } from '@graphprotocol/hypergraph';
7-
87
import { useIdentityToken, usePrivy, useWallets } from '@privy-io/react-auth';
98
import { createFileRoute } from '@tanstack/react-router';
109
import { createStore } from '@xstate/store';
@@ -247,7 +246,7 @@ function AuthenticateComponent() {
247246

248247
const privateSpacesInput = privateSpacesData
249248
? privateSpacesData
250-
.filter((space) => selectedPrivateSpaces.has(space.id))
249+
// .filter((space) => selectedPrivateSpaces.has(space.id))
251250
.map((space) => {
252251
// TODO: currently without checking we assume all keyboxes exists and we don't create any - we should check if the keyboxes exist and create them if they don't
253252
if (space.appIdentities.some((spaceAppIdentity) => spaceAppIdentity.address === appIdentity.address))
@@ -373,8 +372,8 @@ function AuthenticateComponent() {
373372
console.log('public spaces data', publicSpacesData);
374373
const spaces =
375374
publicSpacesData
376-
?.filter((space) => selectedPublicSpaces.has(space.id))
377-
.map((space) => ({
375+
// .filter((space) => selectedPublicSpaces.has(space.id))
376+
?.map((space) => ({
378377
address:
379378
space.type === 'personal'
380379
? (space.personalAddress as `0x${string}`)

apps/connect/src/routes/login.lazy.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import GeoLogo from '@/assets/images/geo-logo-branded.svg?react';
22
import { AppTitle } from '@/components/ui/AppTitle';
33
import { Connect, type Identity } from '@graphprotocol/hypergraph';
4-
import { GEOGENESIS, GEO_TESTNET } from '@graphprotocol/hypergraph/connect/smart-account';
54
import { type ConnectedWallet, useIdentityToken, usePrivy, useWallets } from '@privy-io/react-auth';
65
import { createLazyFileRoute, useRouter } from '@tanstack/react-router';
76
import { useCallback, useEffect, useState } from 'react';
87
import { type WalletClient, createWalletClient, custom } from 'viem';
98

10-
const CHAIN = import.meta.env.VITE_HYPERGRAPH_CHAIN === 'geogenesis' ? GEOGENESIS : GEO_TESTNET;
9+
const CHAIN = import.meta.env.VITE_HYPERGRAPH_CHAIN === 'geogenesis' ? Connect.GEOGENESIS : Connect.GEO_TESTNET;
1110
const syncServerUri = import.meta.env.VITE_HYPERGRAPH_SYNC_SERVER_ORIGIN;
1211
const addressStorage = localStorage;
1312
const keysStorage = sessionStorage;

apps/connect/vercel.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"rewrites": [{ "source": "/(.*)", "destination": "/" }]
3+
}

0 commit comments

Comments
 (0)