/sync-engine

Sync engine for building fast and scalable applications

Primary LanguageTypeScript

sync-engine

Sync engine for building fast and scalable fullstack applications.

Based on Linear architecture (see: Scaling the Linear Sync Engine).

Design doc: https://docs.google.com/document/d/1bRGZz7YL1sd_YNg3AiyfbPUT2cLwgcOtFyp1dcpaqGI/edit?usp=sharing

dev

Install deps

$ npm install

Run dev build.

$ npm run dev

Then navigate to localhost:8080. localhost:8080/api/graphql can be used to load the graphql explorer.

migrations and generated code

This project uses prisma as an ORM to manage db connections, create schemas and models, and run queries. It's pretty nifty and works quite well with TypeScript! See https://www.prisma.io/.

  1. To run a migration:
$ npx prisma migrate dev --name <migration name>
  1. To re-generate types for prisma/client:
$ npx prisma generate
  1. To generate graphql types from queries. (note: server needs to be runnning)
$ npm run codegen

TODO: should automate some of these steps in the build pipeline