-
Notifications
You must be signed in to change notification settings - Fork 785
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: refine steps for enhance pulse db and app docs
- Loading branch information
1 parent
18de157
commit f82c224
Showing
2 changed files
with
19 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,9 +17,10 @@ toc: true | |
|
||
## Setup with template: "Prisma Pulse DB Only" | ||
|
||
This section provides step-by-step instructions for setting up a Pulse-ready PostgreSQL database using the Railway template called: [Prisma Pulse DB Only](https://railway.app/template/pulse-pg). | ||
This section provides step-by-step instructions for setting up a Pulse-ready PostgreSQL database using the Railway template called: [Prisma Pulse DB Only](https://railway.app/template/pulse-pg). | ||
|
||
The template consists of two [services](https://docs.railway.app/reference/services): | ||
|
||
- **Postgres**: A PostgreSQL database that you'll be able to use with Prisma Pulse after going through the setup instructions. | ||
- **restart-and-delete-me**: This service contains a [script](https://github.com/prisma/pulse-railway-pg-config/blob/main/config-db.ts) that's executed once and configures the PostgreSQL database to make it usable with Prisma Pulse. Once the script has been executed, the instructions will tell you to delete this service since it won't be needed any more. | ||
|
||
|
@@ -31,7 +32,7 @@ The template consists of two [services](https://docs.railway.app/reference/servi | |
```terminal no-copy | ||
All done please restart the database and delete this service. | ||
Here is the DATABASE_URL | ||
postgresql://postgres:[email protected]:28606/railway | ||
postgresql://postgres:[email protected]:28606/railway | ||
``` | ||
> **Note**: | ||
> The `DATABASE_URL` can also be found by clicking on the **Postgres** Service and navigating to the **Variables** tab, then clicking the copy icon next to `DATABASE_URL` environment variable value. | ||
|
@@ -46,28 +47,34 @@ The template consists of two [services](https://docs.railway.app/reference/servi | |
|
||
## Setup with template: "Prisma Pulse DB & App" | ||
|
||
This section provides step-by-step instructions for setting up a Pulse starter project with a Pulse-ready PostgreSQL database using the Railway template called: [Prisma Pulse DB & App](https://railway.app/template/pulse-starter). | ||
|
||
This section provides step-by-step instructions for setting up a Pulse starter project with a Pulse-ready PostgreSQL database using the Railway template called: [Prisma Pulse DB & App](https://railway.app/template/pulse-starter). | ||
The template consists of three [services](https://docs.railway.app/reference/services): | ||
|
||
- **Pulse-Starter**: A Typescript app with a basic setup for using Prisma Pulse. You can find the repo for it [on GitHub](https://github.com/prisma/pulse-starter/tree/main). | ||
- **Postgres**: A PostgreSQL database that you'll be able to use with Prisma Pulse after going through the setup instructions. | ||
- **restart-and-delete-me**: This service contains a [script](https://github.com/prisma/pulse-railway-pg-config/blob/main/config-db.ts) that's executed once and configures the PostgreSQL database to make it usable with Prisma Pulse. Once the script has been executed, the instructions will tell you to delete this service since it won't be needed any more. | ||
|
||
1. Deploy the [template](https://railway.app/template/pulse-starter) on Railway. | ||
2. To set up the database and make it Pulse-ready, complete the steps outlined in the [previous section](#setup-with-template-prisma-pulse-db-only), starting from **2.**, then follow the instructions below. | ||
2. Click on the **pulse-starter** service. | ||
2. You'll be navigated to a page prompting configuration for both the **restart-db-then-delete-me** and **pulse-starter** service. | ||
![Configure Railway template](../images/railway-template-configure.png) | ||
1. For the **restart-db-then-delete-me** service, click on the **Configure** button and then save the configuration by clicking on **Save Config**. | ||
2. On the **pulse-starter** service, locate and click the **Configure** button. Within the **Environment variables** section, you'll find an option to include the `PULSE_API_KEY` environment variable. Keep the `PULSE_API_KEY` field blank for the time being. Once you've set up the database and obtained the database URL from the [Prisma Data Platform](https://console.prisma.io/), you can then add the `PULSE_API_KEY` to the **pulse-starter** service. | ||
3. Click on the **Deploy** button. | ||
3. To set up the database and make it Pulse-ready, complete the steps outlined in the [previous section](#setup-with-template-prisma-pulse-db-only), starting from **2.**, then follow the instructions below. | ||
4. Go to the [Platform Console](https://console.prisma.io/) and activate Pulse in a Platform environment. Next, use the `DATABASE_URL` acquired from earlier steps to generate a `PULSE_API_KEY`. | ||
5. Click on the **pulse-starter** service. | ||
> **Note**: You'll likely find that the build failed for the **pulse-starter** service. This is because the Prisma Pulse API key wasn't provided as the database wasn’t Prisma Pulse ready. | ||
> Do not worry, this is to be expected and not a problem for the next steps. | ||
3. Click on the **Variables** tab. | ||
4. Manage your `PULSE_API_KEY` environment variable: | ||
6. Click on the **Variables** tab. | ||
7. Manage your `PULSE_API_KEY` environment variable: | ||
1. If you do not have the variable, click the **New Variable** button, create the `PULSE_API_KEY` environment variable, and then paste the `API_KEY`. Then save the changes by clicking the **Add** button. | ||
2. If you see a variable called `PULSE_API_KEY`. Click the three vertical dots on the `PULSE_API_KEY` row and select **Edit**. Paste in the `API_KEY` and click the check mark icon (☑️). | ||
5. Rebuild the **pulse-starter** service | ||
2. If you have the variable, click the three vertical dots on the `PULSE_API_KEY` row and select **Edit**. Then paste in the `API_KEY` and click the check mark icon (☑️). | ||
8. Rebuild the **pulse-starter** service | ||
1. Click on the **Deployments** tab. | ||
2. Click on the three verticle dots on the deployment that failed. Then click **Redeploy**. | ||
3. When the deployment starts, click the **View Logs** button. | ||
4. Then click on the **Deploy Logs** tab. | ||
6. See an event in action | ||
9. See an event in action | ||
1. Click on the **Postgres** service on your railway.app project. | ||
2. Click on the **Data** tab. | ||
3. Click the `User` table and click **Add Row**. | ||
|
@@ -82,7 +89,7 @@ The template consists of three [services](https://docs.railway.app/reference/ser | |
modelName: "User" | ||
} | ||
``` | ||
7. Congrats 🎉! You should have a Prisma Pulse-compatible PostgreSQL database and a project running on **[railway.app](https://railway.app/template/railway.app)**. | ||
10. You now have a Pulse-compatible PostgreSQL database and the starter project running on **[railway.app](https://railway.app/template/railway.app)**. | ||
|
||
## Setup without using a template | ||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.