From b2d5f6f49f78baffcd592308fb0a0eab4340f1b4 Mon Sep 17 00:00:00 2001 From: Michael Parkadze <52443367+michaelparkadze@users.noreply.github.com> Date: Sun, 5 Jan 2025 17:04:59 +0200 Subject: [PATCH 1/2] chore: added missing step from multi tentant example quick start --- examples/multi-tenant/README.md | 44 +++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/examples/multi-tenant/README.md b/examples/multi-tenant/README.md index 94539b6a5cf..60fe07a1a2f 100644 --- a/examples/multi-tenant/README.md +++ b/examples/multi-tenant/README.md @@ -6,15 +6,45 @@ This example demonstrates how to achieve a multi-tenancy in [Payload](https://gi To spin up this example locally, follow these steps: -1. Run the following command to create a project from the example: +### 1. Create the Project +Run the following command to set up the project: -- `npx create-payload-app --example multi-tenant` +```bash +npx create-payload-app --example multi-tenant +``` -2. `pnpm dev`, `yarn dev` or `npm run dev` to start the server - - Press `y` when prompted to seed the database -3. `open http://localhost:3000` to access the home page -4. `open http://localhost:3000/admin` to access the admin panel - - Login with email `demo@payloadcms.com` and password `demo` +### 2. Configure Environment Variables +Duplicate the .env.example file and rename it to .env. + + +```bash +DATABASE_URI=mongodb://127.0.0.1/payload-example-multi-tenant +PAYLOAD_SECRET=PAYLOAD_MULTI_TENANT_EXAMPLE_SECRET_KEY +PAYLOAD_PUBLIC_SERVER_URL=http://localhost:3000 +``` + +### 3. Start the Development Server + +Use your preferred package manager to start the server: + +```bash +pnpm dev +``` +```bash +yarn dev +``` +```bash +npm dev +``` + +> When prompted, press y to seed the database. + +### 4. Access the Application + +- Home Page: Open http://localhost:3000 in your browser. +- Admin Panel: Open http://localhost:3000/admin and log in with the following credentials: + - Email: demo@payloadcms.com + - Password: demo ## How it works From 8036fe2ccbbdf2119617cd2382c159fec688175c Mon Sep 17 00:00:00 2001 From: Michael Parkadze <52443367+michaelparkadze@users.noreply.github.com> Date: Mon, 6 Jan 2025 14:36:59 +0200 Subject: [PATCH 2/2] Update README.md replaced the contents of the .env file with the cp command example. --- examples/multi-tenant/README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/examples/multi-tenant/README.md b/examples/multi-tenant/README.md index 60fe07a1a2f..e09812e769e 100644 --- a/examples/multi-tenant/README.md +++ b/examples/multi-tenant/README.md @@ -14,17 +14,13 @@ npx create-payload-app --example multi-tenant ``` ### 2. Configure Environment Variables -Duplicate the .env.example file and rename it to .env. - +Duplicate the .env.example file and rename it to .env ```bash -DATABASE_URI=mongodb://127.0.0.1/payload-example-multi-tenant -PAYLOAD_SECRET=PAYLOAD_MULTI_TENANT_EXAMPLE_SECRET_KEY -PAYLOAD_PUBLIC_SERVER_URL=http://localhost:3000 +cp .env.example .env ``` ### 3. Start the Development Server - Use your preferred package manager to start the server: ```bash