2626- [ Startup Payload multi-tenant in dev mode] ( #startup-payload-multi-tenant-in-dev-mode )
2727 - [ Terminal 1: Start Postgres and admin UI] ( #terminal-1-start-postgres-and-admin-ui )
2828 - [ Terminal 2: Start web client] ( #terminal-2-start-web-client )
29- - [ Terminal 3: Start reverse proxy] ( #terminal-3-start-reverse-proxy )
29+ - [ Terminal 3: Start reverse proxy to simulate multi-tenancy ] ( #terminal-3-start-reverse-proxy-to-simulate-multi-tenancy )
3030- [ Development Tools \& Services] ( #development-tools--services )
3131 - [ Infisical Secrets Management] ( #infisical-secrets-management )
3232 - [ Fly.io Deployment] ( #flyio-deployment )
33- - [ Connect to the database on local machine] ( #connect-to-the-database-on-local-machine )
3433 - [ Release Management] ( #release-management )
3534
3635## Packages
@@ -95,25 +94,40 @@ The Payload suite consists of
9594
9695### Terminal 1: Start Postgres and admin UI
9796
98- Start a Docker container
97+ #### Start Postgres in Docker <!-- omit in toc -->
9998
10099``` sh
101100nx dx:postgres cms
102101```
103102
104- Make sure database is in a fresh state (when needed)
103+ #### Serve admin UI <!-- omit in toc -->
105104
106105``` sh
107- nx payload cms migrate:fresh
106+ nx serve cms
108107```
109108
110- Start the admin UI with live-reload
109+ > [ !NOTE]
110+ > Database is auto-seeded with static data when the admin UI is started.
111+
112+ #### Optional <!-- omit in toc -->
113+
114+ ##### Clear database and run migrations <!-- omit in toc -->
111115
112116``` sh
113- nx serve cms
117+ nx payload cms migrate:fresh
114118```
115119
116- :bulb : Database auto-seed will run
120+ ##### Generate seed data <!-- omit in toc -->
121+
122+ Seed data is stored in environment-specific TypeScript files in
123+
124+ - ` libs/shared/data-access/seed/src/lib/seed-data ` .
125+
126+ You can remove the existing seed data and save the empty object to the file to generate new seed data.
127+
128+ ``` sh
129+ nx seed cms
130+ ```
117131
118132### Terminal 2: Start web client
119133
@@ -124,37 +138,32 @@ nx serve cms
124138nx start web
125139```
126140
127- ### Terminal 3: Start reverse proxy
141+ ### Terminal 3: Start reverse proxy to simulate multi-tenancy
128142
129143``` sh
130144nx payload-proxy
131-
132- # stop the proxy
133- nx payload-proxy:down
134-
135- # or extended command to restart
136- nx proxy-cmd shared-util-payload restart
137145```
138146
139147> [ !NOTE]
140148> You can now access the different web sites as different tenants:
141149>
142- > ** Admin UI** - Aimed for different maintainers
143150> 🌐 ` cms.localhost `
144151>
145152> :pouting_face : ` system@local.dev ` @ ` dev `
146- >
147- > :pouting_face : ` web-one.admin@local.dev ` @ ` dev `
148- > :pouting_face : ` web-one.user@local.dev ` @ ` dev `
149- >
150- > :pouting_face : ` web-two.admin@local.dev ` @ ` dev `
151- > :pouting_face : ` web-two.user@local.dev ` @ ` dev `
152- >
153- > ** Tenant 1**
154- > 🌐 ` web-one.localhost `
155- >
156- > ** Tenant 2**
157- > 🌐 ` web-two.localhost `
153+
154+ #### Optional <!-- omit in toc -->
155+
156+ ##### Stop the proxy <!-- omit in toc -->
157+
158+ ``` sh
159+ nx payload-proxy:down
160+ ```
161+
162+ ##### Restart the proxy <!-- omit in toc -->
163+
164+ ``` sh
165+ nx proxy-cmd shared-util-payload restart
166+ ```
158167
159168## Development Tools & Services
160169
@@ -245,7 +254,7 @@ For deployments to preview the applications will be attached to the Postgres clu
245254> fly postgres create --name pg-preview --org codeware --region arn --vm-size shared-cpu-1x --volume-size 1 --initial-cluster-size 1
246255> ```
247256
248- ##### Connect to the database on local machine
257+ ##### Connect to the database on local machine <!-- omit in toc -->
249258
250259Forward server port `5432` to local port `5433` to avoid conflicts with local Postgres running in Docker.
251260
0 commit comments