Skip to content

Commit

Permalink
update sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
jharrell committed Feb 10, 2025
1 parent f839c8b commit e64467f
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion content/800-guides/070-cloudflare-d1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'How to use Prisma ORM with Cloudflare D1'
metaTitle: 'How to use Prisma ORM with Cloudflare D1'
description: 'Learn how to use Prisma ORM with Cloudflare D1'
sidebar_label: 'Cloudflare D1'
sidebar_label: 'Connect to Cloudflare D1 with Prisma ORM'
image: '/img/guides/prisma-d1-setup-cover.png'
---

Expand Down
2 changes: 1 addition & 1 deletion content/800-guides/080-turborepo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'How to use Prisma ORM with Turborepo'
metaTitle: 'How to use Prisma ORM with Turborepo'
description: 'Learn step-by-step how to integrate Prisma ORM with Turborepo to build modular, scalable monorepo architectures efficiently.'
sidebar_label: 'Turborepo'
sidebar_label: 'Set up Turborepo with Prisma ORM'
image: '/img/guides/prisma-turborepo-setup.png'
tags:
- Turborepo
Expand Down
2 changes: 1 addition & 1 deletion content/800-guides/090-nextjs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'How to use Prisma ORM with Next.js'
metaTitle: 'How to use Prisma ORM and Prisma Postgres with Next.js 15 and Vercel'
description: 'Learn how to use Prisma ORM in a Next.js app and deploy it to Vercel'
sidebar_label: 'Next.js'
sidebar_label: 'Set up Next.js with Prisma ORM'
image: '/img/guides/prisma-nextjs-cover.png'
tags:
- Next.js
Expand Down
10 changes: 5 additions & 5 deletions content/800-guides/100-nuxt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'How to use Prisma ORM with Nuxt'
metaTitle: 'Build a Nuxt app with Prisma ORM and Prisma Postgres'
description: 'A step-by-step guide to setting up and using Prisma ORM and Prisma Postgres with the Prisma Nuxt module and deploying to Vercel.'
sidebar_label: 'Nuxt'
sidebar_label: 'Set up Nuxt with Prisma ORM'
image: '/img/guides/prisma-postgres-and-prisma-nuxt-guide.png'
tags:
- Nuxt
Expand Down Expand Up @@ -171,7 +171,7 @@ By completing these steps, your application is now capable of fetching data from

## 5. Create a Prisma Postgres instance

To store your app’s data, you’ll create a Prisma Postgres database instance using the Prisma Data Platform.
To store your app's data, you'll create a Prisma Postgres database instance using the Prisma Data Platform.

Follow these steps to create your Prisma Postgres database:

Expand Down Expand Up @@ -230,7 +230,7 @@ Congratulations, your Nuxt app is now fully integrated with Prisma Postgres!

Deploy your Nuxt application with Prisma Postgres integration to Vercel by following these steps:

1. Ensure your project is version-controlled and pushed to a GitHub repository. If you don’t have a repository yet, [create one on GitHub](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-new-repository). Once the repository is ready, run the following commands:
1. Ensure your project is version-controlled and pushed to a GitHub repository. If you don't have a repository yet, [create one on GitHub](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-new-repository). Once the repository is ready, run the following commands:
```terminal
git add .
git commit -m "Initial commit with Prisma Postgres integration"
Expand All @@ -253,7 +253,7 @@ Deploy your Nuxt application with Prisma Postgres integration to Vercel by follo
:::
5. Click the **Deploy** button. Vercel will build your project and deploy it to a live URL.
6. Open the live URL provided by Vercel and verify that your application is working:
- If you’ve added a user in Prisma Studio, their name should appear on the live site.
- If you've added a user in Prisma Studio, their name should appear on the live site.
- If no users exist, the application will display:
```
No user has been added yet.
Expand All @@ -267,4 +267,4 @@ Congratulations! Your Nuxt application with Prisma Postgres integration is now l

## Considerations

This guide helps you get started with Prisma Postgres using the Nuxt module. Because the Nuxt module is actively evolving, it does not cover all of Prisma’s features or support every edge case. For more advanced functionality or edge deployments, consider using Prisma directly.
This guide helps you get started with Prisma Postgres using the Nuxt module. Because the Nuxt module is actively evolving, it does not cover all of Prisma's features or support every edge case. For more advanced functionality or edge deployments, consider using Prisma directly.
10 changes: 5 additions & 5 deletions content/800-guides/110-realtime-apps.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "How to build a real-time application with Prisma Postgres and Cloudflare Workers"
metaTitle: "How to build a real-time application with Prisma Postgres and Cloudflare Workers"
description: "Learn step-by-step how to build and deploy a Hono.js application that uses Prisma Postgres for real-time data updates on Cloudflare Workers."
sidebar_label: "Real-time apps on Cloudflare Workers"
sidebar_label: 'Build real-time apps'
image: "/img/guides/realtime-app-with-ppg.png"
tags:
- Cloudflare
Expand All @@ -13,7 +13,7 @@ tags:
- Serverless
---

This guide walks you through building a real-time application using [Hono.js](https://hono.dev/), [Prisma Postgres](https://www.prisma.io/postgres), and [Cloudflare Workers](https://workers.cloudflare.com/). By the end of this guide, you’ll have a fullstack app where users can submit points (`x` and `y` coordinates) via a form, visualize the data in a scatter plot, and see updates in real time when new points are added. The final application will look like this:
This guide walks you through building a real-time application using [Hono.js](https://hono.dev/), [Prisma Postgres](https://www.prisma.io/postgres), and [Cloudflare Workers](https://workers.cloudflare.com/). By the end of this guide, you'll have a fullstack app where users can submit points (`x` and `y` coordinates) via a form, visualize the data in a scatter plot, and see updates in real time when new points are added. The final application will look like this:

![An demo of the app we built where a scatter plot updates in real-time](/img/guides/realtime-app-demo-ppg-cf-workers.gif)

Expand Down Expand Up @@ -85,7 +85,7 @@ This will create:

## 3. Create a Prisma Postgres instance and enable real-time capabilites

To store your app’s data, you’ll create a Prisma Postgres database instance using the Prisma Data Platform.
To store your app's data, you'll create a Prisma Postgres database instance using the Prisma Data Platform.

Follow these steps to create your Prisma Postgres database:

Expand Down Expand Up @@ -446,11 +446,11 @@ Now you'll deploy your real-time application to Cloudflare Workers. This involve

The `wrangler` CLI will bundle and upload your application.

2. If you’re not already logged in, the `wrangler` CLI will open a browser window prompting you to log in to the [Cloudflare dashboard](https://dash.cloudflare.com/).
2. If you're not already logged in, the `wrangler` CLI will open a browser window prompting you to log in to the [Cloudflare dashboard](https://dash.cloudflare.com/).
:::note
If you belong to multiple accounts, select the account where you want to deploy the project.
:::
3. Once the deployment completes, you’ll see output similar to this:
3. Once the deployment completes, you'll see output similar to this:
```terminal
> deploy
> wrangler deploy --minify
Expand Down
14 changes: 7 additions & 7 deletions content/800-guides/120-cursor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Best practices for using Prisma in Cursor"
metaTitle: "Best practices for using Prisma in Cursor"
description: "Get the most out of Prisma when using Cursor AI editor"
sidebar_label: "Cursor (IDE)"
sidebar_label: 'Best practices for Cursor and Prisma'
image: "/img/guides/using-prisma-orm-in-cursor.png"
tags:
- Cursor
Expand Down Expand Up @@ -163,11 +163,11 @@ This file ensures consistent and maintainable code generation, reducing manual i

## Using Cursor's context-aware capabilities

Cursor’s [context-aware](https://docs.cursor.com/context/) capabilities let you add specific websites, files, folders or documentation to enhance its understanding of your project. By adding your `schema.prisma` file as context, you enable Cursor to generate more accurate queries, tests, and seed data based on your database schema.
Cursor's [context-aware](https://docs.cursor.com/context/) capabilities let you add specific websites, files, folders or documentation to enhance its understanding of your project. By adding your `schema.prisma` file as context, you enable Cursor to generate more accurate queries, tests, and seed data based on your database schema.

### Add Prisma docs `llm.txt` file as `@Docs` context

To improve Cursor’s understanding of Prisma-related suggestions in your project, include the [`/llms.txt`](https://llmstxt.org/) markdown file as context. This file offers a concise overview, useful guidance, and links to detailed Prisma documentationβ€”all optimized for LLM processing. Simply navigate to the [url](/llms.txt) and add it as a `@Docs` resource in your Cursor configuration.
To improve Cursor's understanding of Prisma-related suggestions in your project, include the [`/llms.txt`](https://llmstxt.org/) markdown file as context. This file offers a concise overview, useful guidance, and links to detailed Prisma documentationβ€”all optimized for LLM processing. Simply navigate to the [url](/llms.txt) and add it as a `@Docs` resource in your Cursor configuration.

### Adding additional Prisma documentation

Expand All @@ -186,7 +186,7 @@ Add your `schema.prisma` file (or the entire codebase) as context using the [`@F

## Generating Prisma Schema

Cursor can generate Prisma schemas from high-level descriptions, enabling you to quickly establish a solid foundation for your database schema. By providing a clear and detailed prompt, Cursor creates Prisma schemas tailored to your requirements. Whether you need a general foundational schema or a highly specific one for detailed use cases, Cursor can deliver with precision. Here’s an example prompt and its corresponding result:
Cursor can generate Prisma schemas from high-level descriptions, enabling you to quickly establish a solid foundation for your database schema. By providing a clear and detailed prompt, Cursor creates Prisma schemas tailored to your requirements. Whether you need a general foundational schema or a highly specific one for detailed use cases, Cursor can deliver with precision. Here's an example prompt and its corresponding result:

:::note
If you run the prompts below, you may receive a different outputs because LLMs produce non-deterministic responses.
Expand All @@ -197,7 +197,7 @@ If you run the prompts below, you may receive a different outputs because LLMs p
<TabItem value="Prompt to generate Prisma schema">

```text copy
β€œCreate a Prisma schema for a SaaS app using PostgreSQL as a provider with `User`, `Organization`, and `Subscription` models, ensuring all models include `createdAt` and `updatedAt` DateTime fields with defaults, a soft-delete `deletedAt` field, and proper relationships between entities."
"Create a Prisma schema for a SaaS app using PostgreSQL as a provider with `User`, `Organization`, and `Subscription` models, ensuring all models include `createdAt` and `updatedAt` DateTime fields with defaults, a soft-delete `deletedAt` field, and proper relationships between entities."
```

</TabItem>
Expand Down Expand Up @@ -276,7 +276,7 @@ enum SubscriptionStatus {

## Generating Prisma queries

Cursor can help you create queries tailored to your Prisma schema, whether for basic data retrieval or complex, optimized operations. To get the best results, focus on writing clear, specific prompts that define your requirements, such as the fields to include, conditions to apply, and relationships to traverse. This ensures Cursor generates accurate, performant, and type-safe queries. Here’s an example prompt and its resulting query:
Cursor can help you create queries tailored to your Prisma schema, whether for basic data retrieval or complex, optimized operations. To get the best results, focus on writing clear, specific prompts that define your requirements, such as the fields to include, conditions to apply, and relationships to traverse. This ensures Cursor generates accurate, performant, and type-safe queries. Here's an example prompt and its resulting query:

<TabbedContent code>
<TabItem value="Prompt to generate a database query">
Expand Down Expand Up @@ -321,7 +321,7 @@ const activeUsers = await prisma.user.findMany({

## Creating seed files with Cursor

Writing seed scripts can be a tedious process, but Cursor simplifies it by quickly generating structured and organized seed code. By providing clear instructions, you can guide Cursor to create scripts that populate your database with realistic data, including handling relationships and complex structures defined in your schema. Here’s an example prompt and its resulting seed script:
Writing seed scripts can be a tedious process, but Cursor simplifies it by quickly generating structured and organized seed code. By providing clear instructions, you can guide Cursor to create scripts that populate your database with realistic data, including handling relationships and complex structures defined in your schema. Here's an example prompt and its resulting seed script:

<TabbedContent code>
<TabItem value="Prompt to seed the database">
Expand Down
30 changes: 15 additions & 15 deletions content/800-guides/130-docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
title: "How to use Prisma in Docker"
metaTitle: "How to use Prisma in Docker"
description: "Learn step-by-step configure a Prisma ORM app in Docker"
sidebar_label: "Docker"
sidebar_label: 'Build Docker apps with Prisma ORM'
image: "/img/guides/prisma-orm-docker.png"
tags:
- Docker
- Alpine
- Containerization
---

This guide walks you through setting up a Prisma ORM application within a Docker environment. You’ll learn how to configure a Node.js project, integrate Prisma for database management, and orchestrate the application using Docker Compose. By the end, you’ll have a fully functional Prisma application running in a Docker container.
This guide walks you through setting up a Prisma ORM application within a Docker environment. You'll learn how to configure a Node.js project, integrate Prisma for database management, and orchestrate the application using Docker Compose. By the end, you'll have a fully functional Prisma application running in a Docker container.

## Prerequisites

Expand All @@ -35,7 +35,7 @@ docker ps -q | xargs docker stop

## 1. Set up your Node.js and Prisma application

Let’s start by creating a simple Node.js application with Prisma ORM and [Express.js](https://expressjs.com/).
Let's start by creating a simple Node.js application with Prisma ORM and [Express.js](https://expressjs.com/).

### 1.1. Initialize your project

Expand Down Expand Up @@ -117,7 +117,7 @@ In the `schema.prisma` file, we specify a [custom `output` path](/orm/prisma-cli

### 1.4. Create an Express.js server

With the Prisma schema in place, let’s create an Express.js server to interact with the database. Start by creating an `index.js` file:
With the Prisma schema in place, let's create an Express.js server to interact with the database. Start by creating an `index.js` file:

```terminal
touch index.js
Expand Down Expand Up @@ -166,11 +166,11 @@ Update the `package.json` scripts to include commands for running the server and
}
```

Now that the application is set up, let’s move on to configuring a PostgreSQL database using Docker Compose.
Now that the application is set up, let's move on to configuring a PostgreSQL database using Docker Compose.

## 2. Set up a PostgreSQL database with Docker Compose

To perform database migrations, we’ll create a standalone PostgreSQL database using Docker Compose.
To perform database migrations, we'll create a standalone PostgreSQL database using Docker Compose.

### 2.1. Create a Docker Compose file for PostgreSQL

Expand Down Expand Up @@ -269,23 +269,23 @@ This command will:
- Remove the default network created by Docker Compose.
- Remove associated volumes (if not named explicitly).

Now that we’ve tested the application locally, let’s containerize it using Docker.
Now that we've tested the application locally, let's containerize it using Docker.

## 3. Run the app and database together with Docker Compose

We’ll now containerize the application using Docker, ensuring it can run in any environment.
We'll now containerize the application using Docker, ensuring it can run in any environment.

To do that create a `Dockerfile` in project root:

```terminal
touch Dockerfile
```

For the next step, you’ll need to choose between two options for the base image: `node:alpine` (lightweight) or `node:slim` (stable). Both options are fully supported by Prisma ORM, but may have to be configured differently.
For the next step, you'll need to choose between two options for the base image: `node:alpine` (lightweight) or `node:slim` (stable). Both options are fully supported by Prisma ORM, but may have to be configured differently.

### 3.1. Option 1: Use Linux Alpine (`node:alpine`) as a base image

The node:alpine image is based on Alpine Linux, a lightweight Linux distribution that uses the `musl` C standard library. It’s perfect if you want to keep your container small and efficient. Prisma supports Alpine on `amd64` out of the box, and supports it on `arm64` since `[email protected]`.
The node:alpine image is based on Alpine Linux, a lightweight Linux distribution that uses the `musl` C standard library. It's perfect if you want to keep your container small and efficient. Prisma supports Alpine on `amd64` out of the box, and supports it on `arm64` since `[email protected]`.

Add the following content to the `Dockerfile`:

Expand Down Expand Up @@ -317,7 +317,7 @@ Related Docker images:

### 3.1. Option 2: Use Linux Debian (`node:slim`) as a base image

The `node:slim` image is based on Linux Debian, a stable and widely supported distribution that uses the `glibc` C standard library. It is mostly supported out of the box on `amd64` and `arm64`, making it a good choice if you’re running into compatibility issues with Alpine or need a more production-ready environment. However, some older versions of this image may come without `libssl` installed, so it’s sometimes necessary to install it manually.
The `node:slim` image is based on Linux Debian, a stable and widely supported distribution that uses the `glibc` C standard library. It is mostly supported out of the box on `amd64` and `arm64`, making it a good choice if you're running into compatibility issues with Alpine or need a more production-ready environment. However, some older versions of this image may come without `libssl` installed, so it's sometimes necessary to install it manually.

Add the following content to the `Dockerfile`:

Expand Down Expand Up @@ -347,7 +347,7 @@ Related Docker images:

### 3.2. Create and configure a Docker Compose file

Now that the `Dockerfile` is ready, we’ll use Docker Compose to manage both the app and the database together. This makes it easy to start, stop, and manage the entire setup.
Now that the `Dockerfile` is ready, we'll use Docker Compose to manage both the app and the database together. This makes it easy to start, stop, and manage the entire setup.

Create a `docker-compose.yml` file in your project folder:

Expand Down Expand Up @@ -419,7 +419,7 @@ DATABASE_URL="postgresql://postgres:prisma@postgres_db:5432/postgres?schema=publ

### 3.4. Build and run the application

With everything set up, it’s time to build and run the app using Docker Compose. Run the following command:
With everything set up, it's time to build and run the app using Docker Compose. Run the following command:

```terminal
docker compose -f docker-compose.yml up --build -d
Expand All @@ -433,7 +433,7 @@ No users have been added yet.

### 3.5. Bonus: Add Prisma Studio for database management

[Prisma Studio](/orm/tools/prisma-studio) offers a graphical user interface (GUI) that allows you to view and manage your database directly in the browser. It’s a great tool for debugging and managing your data during development.
[Prisma Studio](/orm/tools/prisma-studio) offers a graphical user interface (GUI) that allows you to view and manage your database directly in the browser. It's a great tool for debugging and managing your data during development.

To add Prisma Studio to your Docker setup, update the `docker-compose.yml` file:

Expand Down Expand Up @@ -507,4 +507,4 @@ Run the following command to start everything:
docker compose -f docker-compose.yml up --build -d
```

By following this guide, you’ve successfully containerized your Prisma app and database using Docker Compose.
By following this guide, you've successfully containerized your Prisma app and database using Docker Compose.

0 comments on commit e64467f

Please sign in to comment.