diff --git a/packages/docs/src/pages/guides/_meta.json b/packages/docs/src/pages/guides/_meta.json index 892f0c9fb..25ae88a43 100644 --- a/packages/docs/src/pages/guides/_meta.json +++ b/packages/docs/src/pages/guides/_meta.json @@ -1,6 +1,6 @@ { "local-development": "Local development", "migrations": "Migrations", - "hosted": "Triplit Hosted", + "triplit-cloud": "Triplit Cloud", "auth": "Auth" } diff --git a/packages/docs/src/pages/guides/local-development.mdx b/packages/docs/src/pages/guides/local-development.mdx index 93cbc8bd5..1d8f53a2b 100644 --- a/packages/docs/src/pages/guides/local-development.mdx +++ b/packages/docs/src/pages/guides/local-development.mdx @@ -31,3 +31,5 @@ If your project has a `.env` file, you may set the following environment variabl - `TRIPLIT_JWT_SECRET` - Overrides the JWT secret used when generating local api tokens. ## Database Migrations + +Database migrations are also managed locally with the CLI. See [Database Migrations](/guides/migrations) for more information on how to manage database migrations. diff --git a/packages/docs/src/pages/guides/migrations.mdx b/packages/docs/src/pages/guides/migrations.mdx index 13c2e898c..3e97eade5 100644 --- a/packages/docs/src/pages/guides/migrations.mdx +++ b/packages/docs/src/pages/guides/migrations.mdx @@ -9,7 +9,7 @@ import { Callout } from 'nextra-theme-docs'; The `@triplit/cli` package provides a CLI tool for generating migrations. -Additional details about the CLI tool can be found by running `yarn triplit --help`. +Additional details about the CLI tool can be found by running `triplit --help`. ## Checking the current server status @@ -21,6 +21,8 @@ This command checks the current state of your project's schema and migrations an ## Creating migrations +### Local creation + To create a migration, you must first create or edit your schema file, located at `triplit/schema.ts`. Once you have made your changes, run the following command: ```bash @@ -75,10 +77,28 @@ A migration creating a collection called `todos` would look like this: } ``` -## Running migrations +### Syncing with the Console + +The Triplit Console also allows you to make changes to your schema via a GUI. Your project will not be aware of these changes until you run pull those changes into your project. This command will generate a migration file for you based on the changes made in the console: + +```bash +triplit migrate pull +``` + +### Code generation + +Triplit also provides a code generation tool to aid with editing your schema. To generate a schema file based on the current set of migrations, run: + +```bash +triplit migrate codegen +``` + +This will overwrite any changes to your schema file that have not been tracked by migrations. + +## Applying migrations ```bash -yarn triplit migrate up +triplit migrate up ``` This command applies all up migrations to your server. You may optionally provide a version to migrate to. @@ -86,7 +106,7 @@ This command applies all up migrations to your server. You may optionally provid Migrate down to a specific migration: ```bash -yarn triplit migrate down +triplit migrate down ``` This command applies all down migrations to your server until you reach the specified verison. You may optionally provide a version to migrate to. diff --git a/packages/docs/src/pages/guides/hosted.mdx b/packages/docs/src/pages/guides/triplit-cloud.mdx similarity index 69% rename from packages/docs/src/pages/guides/hosted.mdx rename to packages/docs/src/pages/guides/triplit-cloud.mdx index 5aa14aa2c..a113e7f78 100644 --- a/packages/docs/src/pages/guides/hosted.mdx +++ b/packages/docs/src/pages/guides/triplit-cloud.mdx @@ -1,14 +1,13 @@ import { Callout } from 'nextra-theme-docs'; -# Managed Triplit +# Triplit Cloud - Triplit's managed offering is currently in private beta. If you are interested - in trying it out, please join the{' '} - waitlist. + Triplit Cloud is currently in private beta. If you are interested in using it, + please join the waitlist. -Triplit's managed offering is a fully managed service that allows you to manage your Triplit projects without having to worry about the infrastructure. It is a great way to start scaling with Triplit and is suitable for most use cases. +Triplit Cloud is a fully managed service that allows you to manage your Triplit projects without having to worry about the infrastructure. It is a great way to start scaling with Triplit and is suitable for most use cases. ## Getting Started diff --git a/packages/docs/src/pages/index.mdx b/packages/docs/src/pages/index.mdx index 5286e4780..e675ffa62 100644 --- a/packages/docs/src/pages/index.mdx +++ b/packages/docs/src/pages/index.mdx @@ -27,6 +27,6 @@ These features are required for any application that aims to be fast, responsive **Triplit is developer friendly.** Triplit takes care to be easy to use. It gets rid of the headaches of building a realtime system at all levels of the stack, and is potentially the only backend service you need for an app. Additionally, it is designed to work well with Typescript applications, ensuring your type definitions remain up to date as your schema evolves. -**Triplit is open source.** Triplit may be self-hosted, so you can run it on your own infrastructure. Triplit also provides a hosted service that managages upgrades, auto-scaling, and offers technical support. +**Triplit is open source.** Triplit may be self-hosted, so you can run it on your own infrastructure. Triplit also provides [Triplit Cloud](/guides/triplit-cloud) - a hosted service that managages upgrades, auto-scaling, and offers technical support. The rest of the docs will explain how to use Triplit in your application. diff --git a/packages/docs/src/pages/whats-next.mdx b/packages/docs/src/pages/whats-next.mdx index f838f9212..21d85c634 100644 --- a/packages/docs/src/pages/whats-next.mdx +++ b/packages/docs/src/pages/whats-next.mdx @@ -2,6 +2,6 @@ Triplit is available for use in your projects today, see [Getting Started](/getting-started). -Triplit's cloud offering is opening its Beta on November 1st to members on the waitlist. If you're interested in following Triplit or using Triplit's cloud offering, [join our Discord](/waitlist). You can also contact us at contact us directly at hello@triplit.dev. +[Triplit Cloud](/guides/triplit-cloud) is opening its beta on November 1st to users on the waitlist. If you're interested in using Triplit Cloud, trying out Triplit locally, or just following the project, [join our Discord](/waitlist). You can also contact us at contact us directly at hello@triplit.dev. To stay updated, follow us on [Twitter](https://twitter.com/triplit_dev) and checkout our [roadmap](https://triplit.dev/roadmap).