pnpm install
cd apps/server
cp .env.example .env
# add the PRIVY_APP_SECRET & PRIVY_APP_ID to the apps/server/.env file
pnpm prisma migrate devpnpm build --watch
# in another tab
cd apps/events
pnpm dev
# in another tab
cd apps/server
pnpm devAny time you make changes to the schema, you will need to run the following commands:
cd apps/server
pnpm prisma migrate dev # this will also generate the Prisma clientTo develop the create-hypergraph, run:
cd packages/create-hypergraph
pnpm run devYou can run the Next example app with:
# Notes:
# - You need to build the packages first and every time you make changes to the packages
cd apps/next-example
pnpm devTo run the docs locally, you can run:
cd docs
pnpm startChangesets are used to create a changelog and publish a new version of the package. In order to document your changes, you can run the following command:
pnpm changesetIt will open a prompt to ask you which packages are affected and the type of change you are making.
pnpm up --interactive --latest -rUpdate the version in the package.json files (hypergraph, hypergraph-react)
pnpm changeset version
pnpm build
pnpm changeset publishdocker build . -t hypergraph
docker run -it --rm --name=hypergraph hypergraph:latestSetup a service and attach a volume under /data to it.
Since cache-mounts on Railway need to prefixed with the service ID and BuildKit doesn’t expand variables there. You must give it a literal value for the mount ID.
To do so you can fill in the service ID below and run the command before your railway up command.
More info here: https://docs.railway.com/guides/dockerfiles#cache-mounts
Get the service ID by using CMD/CTRL+K and search for Copy Service ID.
sed -i '' \
's|\(--mount=type=cache,id=\)workspace|\1s/<service-id>-pnpm-store|' \
Dockerfile
railway upNote: By default horizontal scaling is disabled because of the attached volume.
In the UI setup the following variables for the service:
- set the
DATABASE_URLtofile:/data/production.sqlite - set the
PRIVY_APP_SECRETto your Privy app secret - set the
PRIVY_APP_IDto your Privy app id - set the
HYPERGRAPH_CHAINto your Hypergraph chain
Then restart the service in the UI.
# change the name of the `app` and `primary_region` in the fly.toml file
# create a volume for the sqlite db file - replace `fra` with your region
fly volumes create data -s 1 -r fra
# set the DATABASE_URL (not sure if it's necessary since already set in the Dockerfile)
fly secrets set DATABASE_URL=file:/data/production.sqlite
# set the Privy app secret, id and chain (fill in your values)
fly secrets set PRIVY_APP_SECRET=<PRIVY_APP_SECRET>
fly secrets set PRIVY_APP_ID=<PRIVY_APP_ID>
fly secrets set HYPERGRAPH_CHAIN=<HYPERGRAPH_CHAIN>
# deploy (ha=false to avoid starting multiple instances)
fly launch --ha=false
# probably not necessary, but better safe than sorry
fly scale count 1Resources:
- https://fly.io/docs/js/prisma/sqlite/
- https://programmingmylife.com/2023-11-06-using-sqlite-for-a-django-application-on-flyio.html
- https://community.fly.io/t/backup-and-restore-sqlite-db-to-server/21232/2
As an alternative you might want to setup a lite-fs volume for multi-region deployments.
Resources: