@bluealba/platform-cli 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/index.js +278 -15
  2. package/docs/404.mdx +5 -0
  3. package/docs/architecture/api-explorer.mdx +478 -0
  4. package/docs/architecture/architecture-diagrams.mdx +12 -0
  5. package/docs/architecture/authentication-system.mdx +903 -0
  6. package/docs/architecture/authorization-system.mdx +886 -0
  7. package/docs/architecture/bootstrap.mdx +1442 -0
  8. package/docs/architecture/gateway-architecture.mdx +845 -0
  9. package/docs/architecture/multi-tenancy.mdx +1150 -0
  10. package/docs/architecture/overview.mdx +776 -0
  11. package/docs/architecture/scheduler.mdx +818 -0
  12. package/docs/architecture/shell.mdx +885 -0
  13. package/docs/architecture/ui-extension-points.mdx +781 -0
  14. package/docs/architecture/user-states.mdx +794 -0
  15. package/docs/development/overview.mdx +21 -0
  16. package/docs/development/workflow.mdx +914 -0
  17. package/docs/getting-started/core-concepts.mdx +892 -0
  18. package/docs/getting-started/installation.mdx +780 -0
  19. package/docs/getting-started/overview.mdx +83 -0
  20. package/docs/getting-started/quick-start.mdx +940 -0
  21. package/docs/guides/adding-documentation-sites.mdx +1367 -0
  22. package/docs/guides/creating-services.mdx +1736 -0
  23. package/docs/guides/creating-ui-modules.mdx +1860 -0
  24. package/docs/guides/identity-providers.mdx +1007 -0
  25. package/docs/guides/mermaid-diagrams.mdx +212 -0
  26. package/docs/guides/using-feature-flags.mdx +1059 -0
  27. package/docs/guides/working-with-rooms.mdx +566 -0
  28. package/docs/index.mdx +57 -0
  29. package/docs/platform-cli/commands.mdx +604 -0
  30. package/docs/platform-cli/overview.mdx +195 -0
  31. package/package.json +5 -2
  32. package/skills/ba-platform/platform-cli.skill.md +26 -0
  33. package/skills/ba-platform/platform.skill.md +35 -0
  34. package/templates/application-monorepo-template/gitignore +95 -0
  35. package/templates/bootstrap-service-template/Dockerfile.development +1 -1
  36. package/templates/bootstrap-service-template/gitignore +57 -0
  37. package/templates/bootstrap-service-template/package.json +1 -1
  38. package/templates/bootstrap-service-template/src/main.ts +6 -16
  39. package/templates/customization-ui-module-template/Dockerfile.development +1 -1
  40. package/templates/customization-ui-module-template/gitignore +73 -0
  41. package/templates/nestjs-service-module-template/Dockerfile.development +1 -1
  42. package/templates/nestjs-service-module-template/gitignore +56 -0
  43. package/templates/platform-init-template/{{platformName}}-core/gitignore +97 -0
  44. package/templates/platform-init-template/{{platformName}}-core/local/.env.example +1 -1
  45. package/templates/platform-init-template/{{platformName}}-core/local/platform-docker-compose.yml +1 -1
  46. package/templates/platform-init-template/{{platformName}}-core/local/{{platformName}}-core-docker-compose.yml +0 -1
  47. package/templates/react-ui-module-template/Dockerfile +1 -1
  48. package/templates/react-ui-module-template/Dockerfile.development +1 -3
  49. package/templates/react-ui-module-template/caddy/Caddyfile +1 -1
  50. package/templates/react-ui-module-template/gitignore +72 -0
  51. package/templates/react-ui-module-template/Dockerfile_nginx +0 -11
  52. package/templates/react-ui-module-template/nginx/default.conf +0 -23
@@ -0,0 +1,940 @@
1
+ ---
2
+ title: Quick Start Guide
3
+ description: Get the Blue Alba Platform up and running with your own white-label product
4
+ ---
5
+
6
+ import { Steps, Aside, Card, CardGrid, Code } from '@astrojs/starlight/components';
7
+ import PAEDockerComposeFile from '~/assets/quick-start/files/docker-compose-platform.yml?raw';
8
+ import EnvExampleFile from '~/assets/quick-start/files/.env.example?raw';
9
+ import GatewayServiceEnvFile from '~/assets/quick-start/files/environment/gateway-service.env?raw';
10
+ import SchedulerServiceEnvFile from '~/assets/quick-start/files/environment/scheduler-service.env?raw';
11
+
12
+ This guide will help you get the Blue Alba Platform running locally. You'll create your own minimal white-label product from scratch, giving you a solid foundation to build upon.
13
+
14
+ <Aside type="tip" title="Use the Platform CLI">
15
+ The **Platform CLI** (`@bluealba/platform-cli`) automates the entire setup process described in this guide. If you prefer a guided experience over manual file creation, install the CLI and run `platform init` — it will scaffold the correct directory structure, generate configuration files, and walk you through each step interactively.
16
+
17
+ See the [Platform CLI Overview](/_/docs/platform-cli/overview/) and [Command Reference](/_/docs/platform-cli/commands/) to get started.
18
+ </Aside>
19
+
20
+ ## Choose Your Setup Path
21
+
22
+ There are two ways to get started with the Blue Alba Platform:
23
+
24
+ <CardGrid>
25
+ <Card title="Path 1: Pre-built Images (RECOMMENDED)" icon="rocket">
26
+ **Best for most users** - Use pre-built Docker images from the registry.
27
+
28
+ - **Setup time**: ~10 minutes
29
+ - **Use case**: Building your product on the platform
30
+ - **What you need**: Docker, basic configuration files
31
+ - **What you don't need**: Platform source code, build tools
32
+
33
+ This is the fastest way to get started and is recommended for most users who want to focus on building their product features.
34
+ </Card>
35
+
36
+ <Card title="Path 2: Source Code (ADVANCED)" icon="rocket">
37
+ **For platform contributors** - Clone and build from source.
38
+
39
+ - **Setup time**: ~15 minutes
40
+ - **Use case**: Contributing to the platform or customizing core functionality
41
+ - **What you need**: Node.js, Docker, platform source code
42
+ - **When to use**: You need to modify platform internals
43
+
44
+ Choose this path only if you need to modify platform code or contribute to platform development.
45
+ </Card>
46
+ </CardGrid>
47
+
48
+ ### Quick Comparison
49
+
50
+ | Aspect | Path 1: Pre-built Images | Path 2: Source Code |
51
+ |--------|-------------------------|---------------------|
52
+ | **Platform Updates** | Change image tags | Pull + rebuild source |
53
+ | **Platform Build Required** | No | Yes |
54
+ | **Best For** | Product developers | Platform contributors |
55
+
56
+ <Aside type="tip" title="Not Sure Which to Choose?">
57
+ If you're asking "which one should I use?", the answer is **Path 1**. You can always switch to Path 2 later if you need to modify platform internals.
58
+ </Aside>
59
+
60
+ ## Prerequisites
61
+
62
+ <CardGrid>
63
+ <Card title="Node.js 20+" icon="node">
64
+ Required for building the platform from source.
65
+
66
+ ```bash
67
+ node --version
68
+ # Should be >= v20.0.0
69
+ ```
70
+ </Card>
71
+
72
+ <Card title="Docker" icon="seti:docker">
73
+ Required for running platform services and infrastructure components.
74
+
75
+ ```bash
76
+ docker --version
77
+ docker-compose --version
78
+ ```
79
+ </Card>
80
+
81
+ <Card title="Git" icon="github">
82
+ Version control for cloning the platform repository.
83
+
84
+ ```bash
85
+ git --version
86
+ ```
87
+ </Card>
88
+ </CardGrid>
89
+
90
+ <Aside type="tip">
91
+ **macOS Users**: Install Node.js via [nvm](https://github.com/nvm-sh/nvm) for easy version management.
92
+
93
+ **Windows Users**: Use [Docker Desktop for Windows](https://docs.docker.com/desktop/install/windows-install/) and ensure WSL 2 is enabled.
94
+ </Aside>
95
+
96
+ ## Path 1: Quick Setup with Pre-built Images (RECOMMENDED)
97
+
98
+ This is the recommended path for most users. You'll create a minimal product called "my-product" that includes:
99
+ - The Gateway Service (API and authentication)
100
+ - The Shell UI (web interface)
101
+ - An admin user for platform management
102
+ - All necessary infrastructure
103
+
104
+ <Steps>
105
+
106
+ 1. **Create your product directory structure**
107
+
108
+ Create a directory for your product:
109
+
110
+ ```bash
111
+ mkdir -p my-product/{my-product-local,environment}
112
+ cd my-product
113
+ ```
114
+
115
+ 2. **Create Base Docker files**
116
+
117
+ Inside `my-product-local/`, create the following files:
118
+
119
+ <Code lang="yaml" title="docker-compose-platform.yml" code={PAEDockerComposeFile}/>
120
+
121
+ 3. **Create environment configuration**
122
+
123
+ Inside `my-product-local/`, Create a `.env` file with all required environment variables:
124
+
125
+
126
+ <Code lang="dotenv" title=".env" code={EnvExampleFile}/>
127
+
128
+ Inside `my-product-local/environment`, create the following files:
129
+
130
+ <Code lang="dotenv" title="gateway-service.env" code={GatewayServiceEnvFile}/>
131
+
132
+ <Code lang="dotenv" title="scheduler-service.env" code={SchedulerServiceEnvFile}/>
133
+
134
+ <Aside type="tip">
135
+ Remember to change the secret keys before deploying to production. Generate strong random strings for **PAE_AUTH_JWT_SECRET** and **PAE_GATEWAY_SERVICE_ACCESS_SECRET**.
136
+ </Aside>
137
+
138
+ 4. **Create platform bootstrap service**
139
+ Inside `my-product-local/`, clone the platform bootstrap template repository:
140
+
141
+ <Code lang="bash" title="Clone Bootstrap Template" code={`git clone https://github.com/bluealba/pae-bootstrap-template.git bootstrap`}/>
142
+
143
+
144
+ 8. **Create bootstrap configuration files**
145
+
146
+ Create the basic bootstrap configurations for operations, roles, and the Shell application.
147
+
148
+ Each application folder inside `bootstrap/` must match the application name. In this example we use `my-app` — replace it with your own application name.
149
+
150
+ **Operations** (`bootstrap/my-app/operations.json`):
151
+
152
+ ```json title="bootstrap/my-app/operations.json"
153
+ {
154
+ "operations": [
155
+ {
156
+ "code": "CREATE",
157
+ "name": "Create",
158
+ "description": "Create new resources"
159
+ },
160
+ {
161
+ "code": "READ",
162
+ "name": "Read",
163
+ "description": "View and read resources"
164
+ },
165
+ {
166
+ "code": "UPDATE",
167
+ "name": "Update",
168
+ "description": "Modify existing resources"
169
+ },
170
+ {
171
+ "code": "DELETE",
172
+ "name": "Delete",
173
+ "description": "Remove resources"
174
+ },
175
+ {
176
+ "code": "ADMIN",
177
+ "name": "Administration",
178
+ "description": "Administrative operations"
179
+ }
180
+ ]
181
+ }
182
+ ```
183
+
184
+ **Roles** (`bootstrap/my-app/roles.json`):
185
+
186
+ ```json title="bootstrap/my-app/roles.json"
187
+ {
188
+ "roles": [
189
+ {
190
+ "code": "PLATFORM_ADMIN",
191
+ "name": "Platform Administrator",
192
+ "description": "Full platform administration access",
193
+ "permissions": [
194
+ {
195
+ "resource": "*",
196
+ "operations": ["*"]
197
+ }
198
+ ]
199
+ },
200
+ {
201
+ "code": "USER",
202
+ "name": "User",
203
+ "description": "Basic user access",
204
+ "permissions": [
205
+ {
206
+ "resource": "shell",
207
+ "operations": ["READ"]
208
+ }
209
+ ]
210
+ }
211
+ ]
212
+ }
213
+ ```
214
+
215
+ **Shell Application** (`bootstrap/shell/application.json`):
216
+
217
+ ```json title="bootstrap/shell/application.json"
218
+ {
219
+ "application": {
220
+ "code": "shell",
221
+ "name": "Shell",
222
+ "description": "Main application container",
223
+ "url": "http://localhost:8080",
224
+ "type": "shell",
225
+ "active": true,
226
+ "metadata": {
227
+ "icon": "home",
228
+ "order": 0
229
+ }
230
+ }
231
+ }
232
+ ```
233
+
234
+ **Shell Modules** (`bootstrap/shell/modules.json`):
235
+
236
+ ```json title="bootstrap/shell/modules.json"
237
+ {
238
+ "modules": [
239
+ {
240
+ "code": "home",
241
+ "name": "Home",
242
+ "description": "Home page module",
243
+ "route": "/home",
244
+ "component": "HomeModule",
245
+ "active": true,
246
+ "metadata": {
247
+ "icon": "home",
248
+ "showInMenu": true,
249
+ "order": 0
250
+ }
251
+ }
252
+ ]
253
+ }
254
+ ```
255
+
256
+ 9. **Start the infrastructure services**
257
+
258
+ Start PostgreSQL, Kafka, and Zookeeper:
259
+
260
+ ```bash
261
+ docker-compose -f docker-compose-infra.yml up -d
262
+ ```
263
+
264
+ Wait about 30 seconds for services to initialize properly.
265
+
266
+ 10. **Bootstrap the platform**
267
+
268
+ Initialize the database schema and create the admin user:
269
+
270
+ ```bash
271
+ docker-compose -f docker-compose-bootstrap.yml up
272
+ ```
273
+
274
+ <Aside>
275
+ This command creates the database schema, operations, roles, the Shell application, and your admin user. It should complete in about 1-2 minutes. The container will exit when finished.
276
+ </Aside>
277
+
278
+ 11. **Start the platform services**
279
+
280
+ Start the Gateway Service and Shell UI:
281
+
282
+ ```bash
283
+ docker-compose -f docker-compose-pae.yml up -d
284
+ ```
285
+
286
+ 12. **Verify everything is running**
287
+
288
+ Check that all services are healthy:
289
+
290
+ ```bash
291
+ docker-compose -f docker-compose-pae.yml ps
292
+ ```
293
+
294
+ You should see both services in the "Up" state.
295
+
296
+ 13. **Access the platform**
297
+
298
+ Open your browser and navigate to:
299
+
300
+ ```
301
+ https://localhost:9443
302
+ ```
303
+
304
+ <Aside type="caution" title="SSL Certificate Warning">
305
+ You'll see a security warning because the platform uses a self-signed certificate for local development. This is expected - click "Advanced" and "Proceed to localhost" to continue.
306
+ </Aside>
307
+
308
+ Default login credentials:
309
+
310
+ ```
311
+ Username: admin@platform.com
312
+ Password: admin123
313
+ ```
314
+
315
+ </Steps>
316
+
317
+ Congratulations! You've successfully set up the Blue Alba Platform using pre-built images. Skip to the [What You Just Created](#what-you-just-created) section to learn about your new environment.
318
+
319
+ ---
320
+
321
+ ## Path 2: Development Setup with Source Code (ADVANCED)
322
+
323
+ <Aside type="caution" title="Advanced Users Only">
324
+ This path is only needed if you're contributing to the platform or need to modify platform internals. Most users should use Path 1 instead.
325
+ </Aside>
326
+
327
+ If you need to work with the platform source code, follow these steps:
328
+
329
+ <Steps>
330
+
331
+ 1. **Create a workspace directory**
332
+
333
+ Create a directory to hold both the platform code and your product:
334
+
335
+ ```bash
336
+ mkdir bluealba-workspace
337
+ cd bluealba-workspace
338
+ ```
339
+
340
+ 2. **Clone the Blue Alba Platform**
341
+
342
+ Clone the main platform repository:
343
+
344
+ ```bash
345
+ git clone https://github.com/bluealba/bluealba-platform.git
346
+ cd bluealba-platform
347
+ ```
348
+
349
+ 3. **Install dependencies and build**
350
+
351
+ Install all dependencies:
352
+
353
+ ```bash
354
+ npm install
355
+ ```
356
+
357
+ Build all packages and applications:
358
+
359
+ ```bash
360
+ npx turbo build
361
+ ```
362
+
363
+ <Aside type="note">
364
+ The first build may take 5-10 minutes as Turborepo builds all packages and apps. Subsequent builds will be much faster thanks to caching.
365
+ </Aside>
366
+
367
+ 4. **Create your product directory structure**
368
+
369
+ Return to the workspace directory and create your product structure:
370
+
371
+ ```bash
372
+ cd ..
373
+ mkdir -p my-product/{bootstrap/my-app,bootstrap/shell,ssl}
374
+ cd my-product
375
+ ```
376
+
377
+ 5. **Generate SSL certificates**
378
+
379
+ Create self-signed certificates for local HTTPS:
380
+
381
+ ```bash
382
+ openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
383
+ -keyout ssl/private.key \
384
+ -out ssl/certificate.crt \
385
+ -subj "/C=US/ST=State/L=City/O=Organization/CN=localhost"
386
+ ```
387
+
388
+ 6. **Create environment configuration**
389
+
390
+ Create a `.env` file (same as Path 1 - see above for the complete file).
391
+
392
+ 7. **Create infrastructure configuration**
393
+
394
+ Create `docker-compose-infra.yml` (same as Path 1).
395
+
396
+ 8. **Create bootstrap service configuration**
397
+
398
+ Create `docker-compose-bootstrap.yml` for source-based bootstrap:
399
+
400
+ ```yaml title="docker-compose-bootstrap.yml"
401
+ version: '3.8'
402
+
403
+ services:
404
+ bootstrap:
405
+ image: node:20-alpine
406
+ container_name: pae-bootstrap
407
+ working_dir: /app
408
+ volumes:
409
+ - ../bluealba-platform:/app:ro
410
+ - ./bootstrap:/bootstrap:ro
411
+ environment:
412
+ PAE_DB_HOST: ${PAE_DB_HOST}
413
+ PAE_DB_PORT: ${PAE_DB_PORT}
414
+ PAE_DB_USER: ${PAE_DB_USER}
415
+ PAE_DB_PASSWORD: ${PAE_DB_PASSWORD}
416
+ PAE_DB: ${PAE_DB}
417
+ PAE_DB_SCHEMA: ${PAE_DB_SCHEMA}
418
+ BOOTSTRAP_ADMIN_EMAIL: ${BOOTSTRAP_ADMIN_EMAIL}
419
+ BOOTSTRAP_ADMIN_PASSWORD: ${BOOTSTRAP_ADMIN_PASSWORD}
420
+ BOOTSTRAP_ADMIN_FIRST_NAME: ${BOOTSTRAP_ADMIN_FIRST_NAME}
421
+ BOOTSTRAP_ADMIN_LAST_NAME: ${BOOTSTRAP_ADMIN_LAST_NAME}
422
+ BOOTSTRAP_CONFIG_PATH: /bootstrap
423
+ command: >
424
+ sh -c "
425
+ cd /app/packages/pae-bootstrap-lib &&
426
+ node dist/cli.js bootstrap
427
+ "
428
+ depends_on:
429
+ - postgres
430
+ networks:
431
+ - pae-network
432
+
433
+ networks:
434
+ pae-network:
435
+ external: true
436
+ ```
437
+
438
+ 9. **Create platform services configuration**
439
+
440
+ Create `docker-compose-pae.yml` for source-based services:
441
+
442
+ ```yaml title="docker-compose-pae.yml"
443
+ version: '3.8'
444
+
445
+ services:
446
+ pae-nestjs-gateway-service:
447
+ image: node:20-alpine
448
+ container_name: pae-nestjs-gateway-service
449
+ working_dir: /app
450
+ volumes:
451
+ - ../bluealba-platform:/app:ro
452
+ - ./ssl:/ssl:ro
453
+ ports:
454
+ - "9080:80"
455
+ - "9443:443"
456
+ environment:
457
+ NODE_ENV: development
458
+ PAE_DB_HOST: ${PAE_DB_HOST}
459
+ PAE_DB_PORT: ${PAE_DB_PORT}
460
+ PAE_DB_USER: ${PAE_DB_USER}
461
+ PAE_DB_PASSWORD: ${PAE_DB_PASSWORD}
462
+ PAE_DB: ${PAE_DB}
463
+ PAE_DB_SCHEMA: ${PAE_DB_SCHEMA}
464
+ PAE_AUTH_JWT_SECRET: ${PAE_AUTH_JWT_SECRET}
465
+ PAE_GATEWAY_SERVICE_ACCESS_SECRET: ${PAE_GATEWAY_SERVICE_ACCESS_SECRET}
466
+ PAE_GATEWAY_PORT: ${PAE_GATEWAY_PORT}
467
+ PAE_GATEWAY_HTTPS_PORT: ${PAE_GATEWAY_HTTPS_PORT}
468
+ KAFKA_BROKERS: ${KAFKA_BROKERS}
469
+ KAFKA_CLIENT_ID: ${KAFKA_CLIENT_ID}
470
+ SSL_KEY_PATH: /ssl/private.key
471
+ SSL_CERT_PATH: /ssl/certificate.crt
472
+ command: >
473
+ sh -c "
474
+ cd /app/apps/pae-nestjs-gateway-service &&
475
+ node dist/main.js
476
+ "
477
+ depends_on:
478
+ - postgres
479
+ - kafka
480
+ healthcheck:
481
+ test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:80/health"]
482
+ interval: 30s
483
+ timeout: 10s
484
+ retries: 3
485
+ networks:
486
+ - pae-network
487
+
488
+ pae-shell-ui:
489
+ image: nginx:alpine
490
+ container_name: pae-shell-ui
491
+ volumes:
492
+ - ../bluealba-platform/apps/pae-shell-ui/dist:/usr/share/nginx/html:ro
493
+ - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
494
+ ports:
495
+ - "8080:80"
496
+ depends_on:
497
+ - pae-nestjs-gateway-service
498
+ networks:
499
+ - pae-network
500
+
501
+ networks:
502
+ pae-network:
503
+ external: true
504
+ ```
505
+
506
+ 10. **Create Nginx configuration**
507
+
508
+ Create `nginx.conf` (same as Path 1).
509
+
510
+ 11. **Create bootstrap configuration files**
511
+
512
+ Create the bootstrap JSON files (same as Path 1).
513
+
514
+ 12. **Start infrastructure and bootstrap**
515
+
516
+ ```bash
517
+ docker-compose -f docker-compose-infra.yml up -d
518
+ # Wait 30 seconds
519
+ docker-compose -f docker-compose-bootstrap.yml up
520
+ ```
521
+
522
+ 13. **Start platform services**
523
+
524
+ ```bash
525
+ docker-compose -f docker-compose-pae.yml up -d
526
+ ```
527
+
528
+ 14. **Verify and access**
529
+
530
+ Verify services are running:
531
+
532
+ ```bash
533
+ docker-compose -f docker-compose-pae.yml ps
534
+ ```
535
+
536
+ Access at: https://localhost:9443
537
+
538
+ </Steps>
539
+
540
+ <Aside type="tip" title="Development Mode">
541
+ When working with source code, you can run services in development mode with hot reload:
542
+
543
+ ```bash
544
+ # Stop the Docker container first
545
+ docker-compose -f docker-compose-pae.yml stop pae-nestjs-gateway-service
546
+
547
+ # Run locally with hot reload
548
+ cd ../bluealba-platform/apps/pae-nestjs-gateway-service
549
+ npm run dev
550
+ ```
551
+ </Aside>
552
+
553
+ ---
554
+
555
+ ## What You Just Created
556
+
557
+ Your local environment now includes:
558
+
559
+ ### Backend Services
560
+
561
+ - **Gateway Service** (ports 9080/9443): Main API gateway with authentication, authorization, and application catalog
562
+
563
+ ### Frontend Applications
564
+
565
+ - **Shell UI** (port 8080): Main application container that hosts micro-frontend modules
566
+
567
+ ### Infrastructure
568
+
569
+ - **PostgreSQL** (port 5432): Database server for platform data
570
+ - **Kafka** (port 9092): Event streaming platform
571
+ - **Zookeeper** (port 2181): Kafka coordination service
572
+
573
+ ### Your Product Structure
574
+
575
+ **Path 1 (Pre-built Images)**:
576
+
577
+ ```
578
+ my-product/
579
+ ├── docker-compose-infra.yml # Infrastructure services
580
+ ├── docker-compose-bootstrap.yml # One-time bootstrap
581
+ ├── docker-compose-pae.yml # Platform services (using images)
582
+ ├── nginx.conf # Shell UI web server config
583
+ ├── .env # Environment variables
584
+ ├── ssl/ # SSL certificates
585
+ │ ├── private.key
586
+ │ └── certificate.crt
587
+ └── bootstrap/ # Bootstrap configurations
588
+ ├── my-app/ # Application folder (name must match your app)
589
+ │ ├── operations.json
590
+ │ └── roles.json
591
+ └── shell/
592
+ ├── application.json
593
+ └── modules.json
594
+ ```
595
+
596
+ **Path 2 (Source Code)**:
597
+
598
+ ```
599
+ bluealba-workspace/
600
+ ├── bluealba-platform/ # Platform source code
601
+ │ ├── apps/
602
+ │ ├── packages/
603
+ │ └── ... (all platform code)
604
+ └── my-product/
605
+ ├── docker-compose-infra.yml # Infrastructure services
606
+ ├── docker-compose-bootstrap.yml # One-time bootstrap
607
+ ├── docker-compose-pae.yml # Platform services (mounting source)
608
+ ├── nginx.conf # Shell UI web server config
609
+ ├── .env # Environment variables
610
+ ├── ssl/ # SSL certificates
611
+ │ ├── private.key
612
+ │ └── certificate.crt
613
+ └── bootstrap/ # Bootstrap configurations
614
+ ├── my-app/ # Application folder (name must match your app)
615
+ │ ├── operations.json
616
+ │ └── roles.json
617
+ └── shell/
618
+ ├── application.json
619
+ └── modules.json
620
+ ```
621
+
622
+ ## First Steps in the Platform
623
+
624
+ Now that you're logged in, let's explore:
625
+
626
+ ### 1. Explore the Shell UI
627
+
628
+ The **Shell UI** is the main container that hosts all micro-frontend applications. You'll see a minimal interface - this is your blank canvas ready for customization.
629
+
630
+ ### 2. Check the API Documentation
631
+
632
+ Visit the Swagger API documentation:
633
+
634
+ ```
635
+ https://localhost:9443/docs
636
+ ```
637
+
638
+ This shows all available API endpoints from the gateway. You can test endpoints directly from the Swagger UI.
639
+
640
+ ### 3. Verify Your Admin User
641
+
642
+ Your admin user has the `PLATFORM_ADMIN` role with full permissions. You can use this account to:
643
+ - Manage users and roles
644
+ - Register new applications
645
+ - Configure the platform
646
+
647
+ ## Development Workflow Quick Overview
648
+
649
+ ### For Path 1 Users (Pre-built Images)
650
+
651
+ If you used pre-built images, your workflow focuses on building your product:
652
+
653
+ #### Adding Your First Custom Service
654
+
655
+ 1. Create your service (can be in any language/framework)
656
+ 2. Build a Docker image for your service
657
+ 3. Register it in the application catalog via bootstrap configuration
658
+ 4. Add it to `docker-compose-pae.yml` in your product
659
+ 5. Restart to load the new service
660
+
661
+ #### Updating Platform Versions
662
+
663
+ To update to a newer version of the platform:
664
+
665
+ ```bash
666
+ # In your product's docker-compose-pae.yml, update the image tags
667
+ # From: ghcr.io/bluealba/pae-nestjs-gateway-service:v2.1.0
668
+ # To: ghcr.io/bluealba/pae-nestjs-gateway-service:v2.2.0
669
+
670
+ # Then restart services
671
+ docker-compose -f docker-compose-pae.yml pull
672
+ docker-compose -f docker-compose-pae.yml up -d
673
+ ```
674
+
675
+ ### For Path 2 Users (Source Code)
676
+
677
+ If you're working with platform source code:
678
+
679
+ #### Running Services in Dev Mode
680
+
681
+ To work on the Gateway Service with hot reload:
682
+
683
+ ```bash
684
+ # Stop the Docker container first
685
+ docker-compose -f docker-compose-pae.yml stop pae-nestjs-gateway-service
686
+
687
+ # Run locally with hot reload
688
+ cd ../bluealba-platform/apps/pae-nestjs-gateway-service
689
+ npm run dev
690
+ ```
691
+
692
+ #### Running UIs in Dev Mode
693
+
694
+ To work on the Shell UI with hot reload:
695
+
696
+ ```bash
697
+ cd ../bluealba-platform/apps/pae-shell-ui
698
+ npm run dev
699
+ ```
700
+
701
+ The UI will be available at `http://localhost:8080` with hot module replacement enabled.
702
+
703
+ #### Making Changes to Platform Code
704
+
705
+ 1. Make your code changes in the `bluealba-platform` directory
706
+ 2. Rebuild if needed: `npx turbo build`
707
+ 3. Restart the affected service in Docker
708
+ 4. Create a changeset before committing:
709
+
710
+ ```bash
711
+ npm run changeset
712
+ ```
713
+
714
+ ## Troubleshooting
715
+
716
+ ### Services won't start
717
+
718
+ **Issue**: Docker containers fail to start or show errors.
719
+
720
+ **Solution**: Check the logs for specific errors:
721
+
722
+ ```bash
723
+ docker-compose -f docker-compose-pae.yml logs pae-nestjs-gateway-service
724
+ ```
725
+
726
+ Common issues:
727
+ - Ports already in use (stop other services on ports 9443, 5432, 9092)
728
+ - Insufficient Docker memory (allocate at least 4GB in Docker Desktop settings)
729
+ - SSL certificate paths incorrect (verify ssl/ directory exists)
730
+
731
+ ### Cannot connect to database
732
+
733
+ **Issue**: Services can't connect to PostgreSQL.
734
+
735
+ **Solution**: Ensure the infrastructure is running:
736
+
737
+ ```bash
738
+ docker-compose -f docker-compose-infra.yml ps
739
+ ```
740
+
741
+ Check PostgreSQL logs:
742
+
743
+ ```bash
744
+ docker-compose -f docker-compose-infra.yml logs postgres
745
+ ```
746
+
747
+ Restart if needed:
748
+
749
+ ```bash
750
+ docker-compose -f docker-compose-infra.yml restart postgres
751
+ ```
752
+
753
+ ### Bootstrap fails
754
+
755
+ **Issue**: Bootstrap container exits with errors.
756
+
757
+ **Solution**: Check bootstrap logs:
758
+
759
+ ```bash
760
+ docker-compose -f docker-compose-bootstrap.yml logs
761
+ ```
762
+
763
+ Common issues:
764
+ - Database not ready (wait 30 seconds after starting infra)
765
+ - Invalid JSON in bootstrap files (validate JSON syntax)
766
+ - Missing environment variables (check .env file)
767
+
768
+ To re-run bootstrap after fixing issues:
769
+
770
+ ```bash
771
+ docker-compose -f docker-compose-bootstrap.yml up
772
+ ```
773
+
774
+ ### SSL certificate errors
775
+
776
+ **Issue**: Browser shows SSL warnings or refuses to connect.
777
+
778
+ **Solution**: This is expected for local development. The platform uses self-signed certificates. You can:
779
+ - Accept the warning and proceed (recommended for dev)
780
+ - Use HTTP on port 9080 instead: `http://localhost:9080`
781
+ - Regenerate certificates if they're corrupted (run the openssl command again)
782
+
783
+ ### Gateway Service won't start
784
+
785
+ **Issue**: Gateway container exits or shows health check failures.
786
+
787
+ **Solution**:
788
+
789
+ 1. Check that SSL certificate paths are correct
790
+ 2. Verify database is accessible
791
+ 3. Check logs for specific errors:
792
+
793
+ ```bash
794
+ docker-compose -f docker-compose-pae.yml logs pae-nestjs-gateway-service
795
+ ```
796
+
797
+ **Path 2 only**: Verify the build completed successfully in bluealba-platform.
798
+
799
+ ### Shell UI shows blank page
800
+
801
+ **Issue**: Shell UI loads but shows a blank page.
802
+
803
+ **Solution**:
804
+
805
+ 1. Check browser console for errors (F12)
806
+ 2. Verify nginx configuration is correct
807
+ 3. Check Shell UI container logs:
808
+
809
+ ```bash
810
+ docker-compose -f docker-compose-pae.yml logs pae-shell-ui
811
+ ```
812
+
813
+ **Path 2 only**: Verify the Shell UI was built by checking that `bluealba-platform/apps/pae-shell-ui/dist/` exists.
814
+
815
+ ### Image pull failures (Path 1)
816
+
817
+ **Issue**: Docker cannot pull platform images.
818
+
819
+ **Solution**:
820
+
821
+ 1. Verify you have internet connectivity
822
+ 2. Check if the image version exists:
823
+
824
+ ```bash
825
+ docker pull ghcr.io/bluealba/pae-nestjs-gateway-service:v2.1.0
826
+ ```
827
+
828
+ 3. If using a private registry, ensure you're authenticated:
829
+
830
+ ```bash
831
+ docker login ghcr.io
832
+ ```
833
+
834
+ ### Port conflicts
835
+
836
+ **Issue**: "Port already in use" errors.
837
+
838
+ **Solution**: Find and kill processes using the ports:
839
+
840
+ ```bash
841
+ # Find process on port 9443
842
+ lsof -i :9443
843
+
844
+ # Kill the process
845
+ kill -9 <PID>
846
+ ```
847
+
848
+ Or change the port mappings in the docker-compose files:
849
+
850
+ ```yaml
851
+ ports:
852
+ - "9090:80" # Change external port from 9080 to 9090
853
+ - "9444:443" # Change external port from 9443 to 9444
854
+ ```
855
+
856
+ ### Build failures in bluealba-platform (Path 2)
857
+
858
+ **Issue**: `turbo build` fails with errors.
859
+
860
+ **Solution** (Path 2 users only):
861
+
862
+ 1. Ensure you're using Node.js 20+ and npm 10.8.2:
863
+
864
+ ```bash
865
+ node --version
866
+ npm --version
867
+ ```
868
+
869
+ 2. Clean and reinstall:
870
+
871
+ ```bash
872
+ npx turbo clean
873
+ rm -rf node_modules package-lock.json
874
+ npm install
875
+ npx turbo build
876
+ ```
877
+
878
+ 3. Check for disk space (build requires several GB)
879
+
880
+ ### Docker network issues
881
+
882
+ **Issue**: Services can't communicate with each other.
883
+
884
+ **Solution**: Ensure the Docker network exists:
885
+
886
+ ```bash
887
+ docker network ls | grep pae-network
888
+ ```
889
+
890
+ If missing, create it:
891
+
892
+ ```bash
893
+ docker network create pae-network
894
+ ```
895
+
896
+ Then restart all services.
897
+
898
+ ## Next Steps
899
+
900
+ Congratulations! You now have a fully functional Blue Alba Platform running locally with your own white-label product.
901
+
902
+ Here's what to explore next:
903
+
904
+ 1. **Add More Services** - Create microservices for your business logic
905
+ 2. **Customize the Shell UI** - Modify the look and feel to match your brand
906
+ 3. **Create Custom Modules** - Build micro-frontend modules for your features
907
+ 4. **Configure Multi-Tenancy** - Set up tenant isolation for your product
908
+ 5. **Integrate Authentication** - Add SSO, OAuth, or other auth providers
909
+
910
+ ### Recommended Learning Path
911
+
912
+ 1. **[Core Concepts](/_/docs/getting-started/core-concepts/)** - Understand applications, modules, operations, and roles
913
+ 2. **[Development Workflow](/_/docs/development/workflow/)** - Master the day-to-day development process
914
+ 3. **[Architecture Overview](/_/docs/architecture/overview/)** - Deep dive into the platform architecture
915
+ 4. **[Creating Services Guide](/_/docs/guides/creating-services/)** - Learn to build microservices
916
+ 5. **[Creating UI Modules Guide](/_/docs/guides/creating-ui-modules/)** - Build micro-frontend modules
917
+
918
+ ## Getting Help
919
+
920
+ If you encounter issues not covered here:
921
+
922
+ 1. Check the detailed [Installation Guide](/_/docs/getting-started/installation/) for more context
923
+ 2. Examine Docker logs for error messages: `docker-compose logs <service-name>`
924
+ 3. Review the bootstrap logs if platform setup fails
925
+ 4. Consult the repository's GitHub Issues for known problems
926
+ 5. **Path 2 users**: Review service-specific README files in the `bluealba-platform/apps/` directories
927
+
928
+ ## What Makes This White-Label?
929
+
930
+ The minimal product you just created is a foundation for building any type of application:
931
+
932
+ - **No pre-built features** - Start with a clean slate
933
+ - **Your branding** - Customize the UI, logos, and theme
934
+ - **Your services** - Add only the microservices you need
935
+ - **Your data model** - Define your own database schemas
936
+ - **Your business logic** - Implement your unique requirements
937
+
938
+ The platform provides the infrastructure (auth, routing, module loading, multi-tenancy) while you build the features that make your product unique.
939
+
940
+ Happy building!