Skip to content

Commit

Permalink
docs updates
Browse files Browse the repository at this point in the history
  • Loading branch information
wernst committed Nov 1, 2023
1 parent ca0ddc6 commit c285e97
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/docs/src/pages/guides/_meta.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"local-development": "Local development",
"migrations": "Migrations",
"hosted": "Triplit Hosted",
"triplit-cloud": "Triplit Cloud",
"auth": "Auth"
}
2 changes: 2 additions & 0 deletions packages/docs/src/pages/guides/local-development.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
28 changes: 24 additions & 4 deletions packages/docs/src/pages/guides/migrations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -75,18 +77,36 @@ 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 <version>
triplit migrate up <version>
```

This command applies all up migrations to your server. You may optionally provide a version to migrate to.

Migrate down to a specific migration:

```bash
yarn triplit migrate down <version>
triplit migrate down <version>
```

This command applies all down migrations to your server until you reach the specified verison. You may optionally provide a version to migrate to.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { Callout } from 'nextra-theme-docs';

# Managed Triplit
# Triplit Cloud

<Callout type="info" emoji="ℹ️">
Triplit's managed offering is currently in private beta. If you are interested
in trying it out, please join the{' '}
<a href="https://triplit.dev/waitlist">waitlist</a>.
Triplit Cloud is currently in private beta. If you are interested in using it,
please join the <a href="https://triplit.dev/waitlist">waitlist</a>.
</Callout>

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

Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion packages/docs/src/pages/whats-next.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected].
[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 [email protected].

To stay updated, follow us on [Twitter](https://twitter.com/triplit_dev) and checkout our [roadmap](https://triplit.dev/roadmap).

0 comments on commit c285e97

Please sign in to comment.