Skip to content

Commit

Permalink
TinaCMS content update by Kelly Davis
Browse files Browse the repository at this point in the history
  • Loading branch information
tina-cloud-app[bot] committed Jul 6, 2023
1 parent 066a311 commit 63b0c29
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions content/blog/Self-hosted-TinaCMS-powered-by-Vercel-KV.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,21 @@ author: Kelly Davis
prev: content/blog/self-hosted-datalayer.md
---

Earlier this year, we [released](/blog/self-hosted-datalayer/ "released") the first iteration of self-hosted TinaCMS. The initial [demo](https://github.com/tinacms/tina-self-hosted-demo/tree/274c0d9ee004629ff0cef2539b56c88324abd8f8) relied on Tina Cloud for auth and used MongoDB for the data layer. That was the first step in freeing TinaCMS users from vendor lock-in, but there were limitations, such as requiring a custom auth implementation when not using Tina Cloud and requiring MongoDB for the data layer.
Earlier this year, we [released](/blog/self-hosted-datalayer/ "released") the first iteration of self-hosted TinaCMS. The initial [demo](https://github.com/tinacms/tina-self-hosted-demo/tree/274c0d9ee004629ff0cef2539b56c88324abd8f8) relied on Tina Cloud for auth and used MongoDB for the data layer. That was the first step in helping our users avoid vendor lock-in, but there were limitations, such as requiring a custom auth implementation when not using Tina Cloud and requiring MongoDB for the data layer.

Since then, we've been hard at work on improving our self-hosted offering to make it easier to get started and less dependent on other vendor services (including our own). Today we are excited to announce the next iteration of our self-hosted Tina demo, leveraging [Vercel KV](https://vercel.com/docs/storage/vercel-kv) for the data layer and [NextAuth.js](NextAuth.js) for auth. It is now possible for a developer to setup a fully functioning [Next.js](https://nextjs.org/) site running TinaCMS relying on only GitHub for source control and Vercel for hosting, auth, and data management.

<Youtube embedSrc="https://www.youtube.com/embed/K3LG2kqcYVs" />

## What is Vercel KV?

Vercel KV is a durable Redis database that enables you to store and retrieve JSON data and is available on both hobby (free) and paid plans. The service is provided in partnership with [Upstash](https://upstash.com/about) and does not require a separate account. Because of it's flexibility and performance, Vercel KV is a great fit for powering the self-hosted TinaCMS data layer.
Vercel KV is a durable Redis database that enables you to store and retrieve JSON data and is available on both hobby (free) and paid plans. The service is provided in partnership with [Upstash](https://upstash.com/about) and does not require a separate Upstash account. Because of it's flexibility and performance, Vercel KV is a great fit for powering the self-hosted TinaCMS data layer.

## Using Vercel KV in the TinaCMS data layer

When you build your site with TinaCMS, the ultimate source of truth is your Markdown files. Features like search and filtering of content while editing, though, require a data layer on top of those Markdown files. TinaCMS has incorporated an open source library called [LevelDB](https://github.com/Level/abstract-level) to provide a further layer of abstraction between TinaCMS's data layer and the underlying database implementation. By leveraging LevelDB in the data layer, virtually any database can be adapted for use with TinaCMS. To enable Vercel KV to work with TinaCMS, we have implemented a new Upstash Redis LevelDB [implementation](https://www.npmjs.com/package/upstash-redis-level). This provides all the data functionality needed by TinaCMS entirely within the Vercel ecosystem.
When you build your site with TinaCMS, the ultimate source of truth is your Markdown files. Features like search and filtering of content while editing, though, require a data layer on top of those Markdown files. TinaCMS has incorporated an open source library called [LevelDB](https://github.com/Level/abstract-level) to provide an additional layer of abstraction between TinaCMS's data layer and the underlying database implementation. By leveraging LevelDB in the data layer, virtually any database can be adapted for use with TinaCMS. To enable Vercel KV to work with TinaCMS, we have implemented a new Upstash Redis LevelDB [implementation](https://www.npmjs.com/package/upstash-redis-level). This provides all the data functionality needed by TinaCMS entirely within the Vercel ecosystem.

## Using NextAuth.js in TinaCMS

Tina Cloud provides organization and project-level user & role management, but we recognize that every project has its own specific authentication and authorization requirements. TinaCMS already provides built-in support for custom auth solutions that can be adapted for a wide variety of situations. The latest iteration of self-hosted TinaCMS takes this a step further by integrating with [NextAuth.js](https://next-auth.js.org/). By leveraging NextAuth.js, any of the available auth providers [offered by the framework](https://next-auth.js.org/providers/) (e.g Github, Twitter, Google, etc...) can easily be integrated with TinaCMS. It also allows fully customizable login screens, allowing your site to be fully branded. Lastly, the latest iteration of the self-hosted demo provides a basic Credentials provider that leverages the Vercel KV store to immediately enable auth without additional configuration.
Tina Cloud provides organization and project-level user & role management, but we recognize that every project has its own specific authentication and authorization requirements. TinaCMS already provides built-in support for custom auth solutions that can be adapted for a wide variety of situations. The latest iteration of self-hosted TinaCMS takes this a step further by integrating with [NextAuth.js](https://next-auth.js.org/). By leveraging NextAuth.js, any of the available auth providers [offered by the framework](https://next-auth.js.org/providers/) (e.g Github, Twitter, Google, etc...) can easily be integrated with TinaCMS. It also features customizable login screens, allowing your site to be fully branded. Lastly, the latest iteration of the self-hosted demo provides a basic Credentials provider that leverages the same Vercel KV store to immediately enable auth without any additional configuration.

## Future Plans

Expand All @@ -31,3 +29,5 @@ Repo-based media is not currently available for self-hosted TinaCMS. We currentl
## Getting Started

Visit the self-hosted [demo](https://github.com/tinacms/tina-self-hosted-demo#deploy-this-repository-to-vercel) repo and click the Deploy button to launch the demo on Vercel.

<Youtube embedSrc="https://www.youtube.com/embed/K3LG2kqcYVs" />

0 comments on commit 63b0c29

Please sign in to comment.