@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.
- package/dist/index.js +278 -15
- package/docs/404.mdx +5 -0
- package/docs/architecture/api-explorer.mdx +478 -0
- package/docs/architecture/architecture-diagrams.mdx +12 -0
- package/docs/architecture/authentication-system.mdx +903 -0
- package/docs/architecture/authorization-system.mdx +886 -0
- package/docs/architecture/bootstrap.mdx +1442 -0
- package/docs/architecture/gateway-architecture.mdx +845 -0
- package/docs/architecture/multi-tenancy.mdx +1150 -0
- package/docs/architecture/overview.mdx +776 -0
- package/docs/architecture/scheduler.mdx +818 -0
- package/docs/architecture/shell.mdx +885 -0
- package/docs/architecture/ui-extension-points.mdx +781 -0
- package/docs/architecture/user-states.mdx +794 -0
- package/docs/development/overview.mdx +21 -0
- package/docs/development/workflow.mdx +914 -0
- package/docs/getting-started/core-concepts.mdx +892 -0
- package/docs/getting-started/installation.mdx +780 -0
- package/docs/getting-started/overview.mdx +83 -0
- package/docs/getting-started/quick-start.mdx +940 -0
- package/docs/guides/adding-documentation-sites.mdx +1367 -0
- package/docs/guides/creating-services.mdx +1736 -0
- package/docs/guides/creating-ui-modules.mdx +1860 -0
- package/docs/guides/identity-providers.mdx +1007 -0
- package/docs/guides/mermaid-diagrams.mdx +212 -0
- package/docs/guides/using-feature-flags.mdx +1059 -0
- package/docs/guides/working-with-rooms.mdx +566 -0
- package/docs/index.mdx +57 -0
- package/docs/platform-cli/commands.mdx +604 -0
- package/docs/platform-cli/overview.mdx +195 -0
- package/package.json +5 -2
- package/skills/ba-platform/platform-cli.skill.md +26 -0
- package/skills/ba-platform/platform.skill.md +35 -0
- package/templates/application-monorepo-template/gitignore +95 -0
- package/templates/bootstrap-service-template/Dockerfile.development +1 -1
- package/templates/bootstrap-service-template/gitignore +57 -0
- package/templates/bootstrap-service-template/package.json +1 -1
- package/templates/bootstrap-service-template/src/main.ts +6 -16
- package/templates/customization-ui-module-template/Dockerfile.development +1 -1
- package/templates/customization-ui-module-template/gitignore +73 -0
- package/templates/nestjs-service-module-template/Dockerfile.development +1 -1
- package/templates/nestjs-service-module-template/gitignore +56 -0
- package/templates/platform-init-template/{{platformName}}-core/gitignore +97 -0
- package/templates/platform-init-template/{{platformName}}-core/local/.env.example +1 -1
- package/templates/platform-init-template/{{platformName}}-core/local/platform-docker-compose.yml +1 -1
- package/templates/platform-init-template/{{platformName}}-core/local/{{platformName}}-core-docker-compose.yml +0 -1
- package/templates/react-ui-module-template/Dockerfile +1 -1
- package/templates/react-ui-module-template/Dockerfile.development +1 -3
- package/templates/react-ui-module-template/caddy/Caddyfile +1 -1
- package/templates/react-ui-module-template/gitignore +72 -0
- package/templates/react-ui-module-template/Dockerfile_nginx +0 -11
- package/templates/react-ui-module-template/nginx/default.conf +0 -23
|
@@ -0,0 +1,780 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Installation Guide
|
|
3
|
+
description: Detailed installation instructions for the Blue Alba Platform including system requirements, repository structure, and troubleshooting
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { Steps, Aside, Card, CardGrid, Tabs, TabItem } from '@astrojs/starlight/components';
|
|
7
|
+
|
|
8
|
+
This comprehensive guide covers everything you need to install and configure the Blue Alba Platform for local development.
|
|
9
|
+
|
|
10
|
+
## System Requirements
|
|
11
|
+
|
|
12
|
+
Before installing the platform, ensure your system meets these requirements:
|
|
13
|
+
|
|
14
|
+
### Required Software
|
|
15
|
+
|
|
16
|
+
<CardGrid>
|
|
17
|
+
<Card title="Node.js" icon="seti:nodejs">
|
|
18
|
+
**Version**: 20.0.0 or higher (LTS recommended)
|
|
19
|
+
|
|
20
|
+
**Why**: Platform services and UIs are built with Node.js
|
|
21
|
+
|
|
22
|
+
**Verification**:
|
|
23
|
+
```bash
|
|
24
|
+
node --version
|
|
25
|
+
# Expected: v20.x.x or higher
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Installation**:
|
|
29
|
+
- macOS: `brew install node@20` or use [nvm](https://github.com/nvm-sh/nvm)
|
|
30
|
+
- Linux: Use nvm or your package manager
|
|
31
|
+
- Windows: Download from [nodejs.org](https://nodejs.org/)
|
|
32
|
+
</Card>
|
|
33
|
+
|
|
34
|
+
<Card title="npm" icon="seti:npm">
|
|
35
|
+
**Version**: 10.8.2 (enforced by package.json)
|
|
36
|
+
|
|
37
|
+
**Why**: Platform requires specific npm version for consistency
|
|
38
|
+
|
|
39
|
+
**Verification**:
|
|
40
|
+
```bash
|
|
41
|
+
npm --version
|
|
42
|
+
# Expected: 10.8.2
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Installation**:
|
|
46
|
+
```bash
|
|
47
|
+
npm install -g npm@10.8.2
|
|
48
|
+
```
|
|
49
|
+
</Card>
|
|
50
|
+
|
|
51
|
+
<Card title="Docker Desktop" icon="docker">
|
|
52
|
+
**Version**: Latest stable release
|
|
53
|
+
|
|
54
|
+
**Why**: Required for databases, Kafka, and containerized services
|
|
55
|
+
|
|
56
|
+
**Verification**:
|
|
57
|
+
```bash
|
|
58
|
+
docker --version
|
|
59
|
+
docker-compose --version
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Installation**:
|
|
63
|
+
- macOS: [Docker Desktop for Mac](https://docs.docker.com/desktop/install/mac-install/)
|
|
64
|
+
- Linux: [Docker Engine](https://docs.docker.com/engine/install/)
|
|
65
|
+
- Windows: [Docker Desktop for Windows](https://docs.docker.com/desktop/install/windows-install/)
|
|
66
|
+
|
|
67
|
+
**Requirements**:
|
|
68
|
+
- At least 4GB RAM allocated to Docker
|
|
69
|
+
- 20GB+ free disk space
|
|
70
|
+
</Card>
|
|
71
|
+
|
|
72
|
+
<Card title="Git" icon="github">
|
|
73
|
+
**Version**: 2.x or higher
|
|
74
|
+
|
|
75
|
+
**Why**: Version control for source code
|
|
76
|
+
|
|
77
|
+
**Verification**:
|
|
78
|
+
```bash
|
|
79
|
+
git --version
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Installation**:
|
|
83
|
+
- macOS: Pre-installed or `brew install git`
|
|
84
|
+
- Linux: `sudo apt install git` or `sudo yum install git`
|
|
85
|
+
- Windows: [Git for Windows](https://git-scm.com/download/win)
|
|
86
|
+
</Card>
|
|
87
|
+
</CardGrid>
|
|
88
|
+
|
|
89
|
+
### Recommended Software
|
|
90
|
+
|
|
91
|
+
- **IDE**: VS Code with TypeScript, ESLint, and Prettier extensions
|
|
92
|
+
- **Terminal**: iTerm2 (macOS), Windows Terminal, or any modern terminal
|
|
93
|
+
- **Database Client**: DBeaver, pgAdmin, or TablePlus for PostgreSQL inspection
|
|
94
|
+
- **API Client**: Postman, Insomnia, or Thunder Client for API testing
|
|
95
|
+
|
|
96
|
+
### Hardware Requirements
|
|
97
|
+
|
|
98
|
+
- **CPU**: 4+ cores recommended (2 minimum)
|
|
99
|
+
- **RAM**: 8GB minimum, 16GB recommended
|
|
100
|
+
- **Disk**: 20GB free space for code, dependencies, and Docker images
|
|
101
|
+
- **Network**: Broadband internet for downloading dependencies
|
|
102
|
+
|
|
103
|
+
<Aside type="tip">
|
|
104
|
+
**Performance Tip**: The platform builds faster with SSDs and more RAM. If you have limited resources, consider closing other applications during the initial build.
|
|
105
|
+
</Aside>
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Understanding the Repository Structure
|
|
110
|
+
|
|
111
|
+
The Blue Alba Platform uses a **Turborepo monorepo** structure. Understanding this layout is crucial for effective development.
|
|
112
|
+
|
|
113
|
+
### High-Level Structure
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
bluealba-platform/
|
|
117
|
+
├── apps/ # Applications (services and UIs)
|
|
118
|
+
├── packages/ # Shared libraries
|
|
119
|
+
├── scripts/ # Utility scripts
|
|
120
|
+
├── .changeset/ # Changesets for versioning
|
|
121
|
+
├── turbo.json # Turborepo configuration
|
|
122
|
+
├── package.json # Workspace root package.json
|
|
123
|
+
├── package-lock.json # Dependency lock file
|
|
124
|
+
├── tsconfig.json # TypeScript configuration
|
|
125
|
+
└── README.md # Repository readme
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Apps Directory
|
|
129
|
+
|
|
130
|
+
The `apps/` directory contains deployable applications:
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
apps/
|
|
134
|
+
├── pae-nestjs-gateway-service/ # Main API Gateway
|
|
135
|
+
│ ├── src/ # Source code
|
|
136
|
+
│ ├── test/ # E2E tests
|
|
137
|
+
│ ├── Dockerfile # Production image
|
|
138
|
+
│ ├── Dockerfile.development # Development image
|
|
139
|
+
│ └── package.json
|
|
140
|
+
│
|
|
141
|
+
├── pae-habits-service/ # Habits tracking service
|
|
142
|
+
│ ├── src/
|
|
143
|
+
│ ├── bootstrap/ # Service bootstrap
|
|
144
|
+
│ └── package.json
|
|
145
|
+
│
|
|
146
|
+
├── pae-scheduler-service/ # Scheduling service
|
|
147
|
+
│
|
|
148
|
+
├── pae-shell-ui/ # Main Shell UI (React)
|
|
149
|
+
│ ├── src/
|
|
150
|
+
│ ├── public/
|
|
151
|
+
│ └── package.json
|
|
152
|
+
│
|
|
153
|
+
├── pae-admin-ui/ # Administration UI (React)
|
|
154
|
+
│
|
|
155
|
+
└── pae-documentation/ # Documentation site (Astro)
|
|
156
|
+
├── src/
|
|
157
|
+
└── astro.config.mjs
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Packages Directory
|
|
161
|
+
|
|
162
|
+
The `packages/` directory contains shared libraries:
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
packages/
|
|
166
|
+
├── pae-core-lib/ # Core domain logic
|
|
167
|
+
│ ├── src/
|
|
168
|
+
│ │ ├── entities/ # Domain entities
|
|
169
|
+
│ │ ├── authorization/ # Authorization logic
|
|
170
|
+
│ │ └── catalog/ # Catalog types
|
|
171
|
+
│ └── package.json
|
|
172
|
+
│
|
|
173
|
+
├── pae-ui-react-sdk/ # React build tools
|
|
174
|
+
│ ├── config/ # Webpack configs
|
|
175
|
+
│ ├── bin/ # CLI tools
|
|
176
|
+
│ └── package.json
|
|
177
|
+
│
|
|
178
|
+
├── pae-ui-react-core/ # Shared React components
|
|
179
|
+
│ ├── src/
|
|
180
|
+
│ │ ├── components/ # UI components
|
|
181
|
+
│ │ ├── hooks/ # Custom hooks
|
|
182
|
+
│ │ └── context/ # React contexts
|
|
183
|
+
│ └── package.json
|
|
184
|
+
│
|
|
185
|
+
├── pae-service-nestjs-sdk/ # NestJS utilities
|
|
186
|
+
│ ├── src/
|
|
187
|
+
│ │ ├── decorators/ # Custom decorators
|
|
188
|
+
│ │ ├── guards/ # Auth guards
|
|
189
|
+
│ │ └── filters/ # Exception filters
|
|
190
|
+
│ └── package.json
|
|
191
|
+
│
|
|
192
|
+
├── pae-bootstrap-lib/ # Bootstrap utilities
|
|
193
|
+
│
|
|
194
|
+
└── pae-microservices-runtime-sdk/ # Runtime SDK
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Key Configuration Files
|
|
198
|
+
|
|
199
|
+
<Tabs>
|
|
200
|
+
<TabItem label="turbo.json">
|
|
201
|
+
**Purpose**: Configures Turborepo's build pipeline
|
|
202
|
+
|
|
203
|
+
```json
|
|
204
|
+
{
|
|
205
|
+
"pipeline": {
|
|
206
|
+
"build": {
|
|
207
|
+
"dependsOn": ["^build"],
|
|
208
|
+
"outputs": ["dist/**", "build/**"]
|
|
209
|
+
},
|
|
210
|
+
"test": {
|
|
211
|
+
"dependsOn": ["build"],
|
|
212
|
+
"outputs": ["coverage/**"]
|
|
213
|
+
},
|
|
214
|
+
"dev": {
|
|
215
|
+
"cache": false,
|
|
216
|
+
"persistent": true
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
**Key Features**:
|
|
223
|
+
- Defines task dependencies
|
|
224
|
+
- Specifies caching strategies
|
|
225
|
+
- Configures parallel execution
|
|
226
|
+
</TabItem>
|
|
227
|
+
|
|
228
|
+
<TabItem label="package.json">
|
|
229
|
+
**Purpose**: Workspace root configuration
|
|
230
|
+
|
|
231
|
+
```json
|
|
232
|
+
{
|
|
233
|
+
"name": "bluealba-platform",
|
|
234
|
+
"private": true,
|
|
235
|
+
"workspaces": [
|
|
236
|
+
"apps/*",
|
|
237
|
+
"packages/*"
|
|
238
|
+
],
|
|
239
|
+
"packageManager": "npm@10.8.2",
|
|
240
|
+
"scripts": {
|
|
241
|
+
"build": "turbo build",
|
|
242
|
+
"dev": "turbo dev",
|
|
243
|
+
"test": "turbo test",
|
|
244
|
+
"changeset": "changeset"
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
**Key Features**:
|
|
250
|
+
- Defines workspace structure
|
|
251
|
+
- Enforces npm version
|
|
252
|
+
- Provides common scripts
|
|
253
|
+
</TabItem>
|
|
254
|
+
|
|
255
|
+
<TabItem label="tsconfig.json">
|
|
256
|
+
**Purpose**: TypeScript configuration
|
|
257
|
+
|
|
258
|
+
```json
|
|
259
|
+
{
|
|
260
|
+
"compilerOptions": {
|
|
261
|
+
"target": "ES2022",
|
|
262
|
+
"module": "commonjs",
|
|
263
|
+
"strict": true,
|
|
264
|
+
"esModuleInterop": true,
|
|
265
|
+
"skipLibCheck": true
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
**Note**: Individual packages extend this base config
|
|
271
|
+
</TabItem>
|
|
272
|
+
</Tabs>
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## Installation Steps
|
|
277
|
+
|
|
278
|
+
Follow these steps to install the Blue Alba Platform on your local machine.
|
|
279
|
+
|
|
280
|
+
<Steps>
|
|
281
|
+
|
|
282
|
+
1. **Create a workspace directory**
|
|
283
|
+
|
|
284
|
+
Create a parent directory to hold both the platform code and the sandbox product:
|
|
285
|
+
|
|
286
|
+
```bash
|
|
287
|
+
mkdir bluealba-workspace
|
|
288
|
+
cd bluealba-workspace
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
<Aside>
|
|
292
|
+
This file system convention is important - the Sandbox Product expects the platform code to be in a sibling directory.
|
|
293
|
+
</Aside>
|
|
294
|
+
|
|
295
|
+
2. **Clone the repository**
|
|
296
|
+
|
|
297
|
+
Clone the Blue Alba Platform repository:
|
|
298
|
+
|
|
299
|
+
```bash
|
|
300
|
+
git clone https://github.com/bluealba/bluealba-platform.git
|
|
301
|
+
cd bluealba-platform
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
Verify the clone was successful:
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
ls -la
|
|
308
|
+
# Should see: apps/, packages/, turbo.json, package.json, etc.
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
3. **Install dependencies**
|
|
312
|
+
|
|
313
|
+
Install all dependencies for the monorepo:
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
npm install
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
This command:
|
|
320
|
+
- Installs root dependencies
|
|
321
|
+
- Installs dependencies for all packages
|
|
322
|
+
- Links workspace packages together
|
|
323
|
+
- May take 5-10 minutes depending on your internet speed
|
|
324
|
+
|
|
325
|
+
<Aside type="note">
|
|
326
|
+
npm will enforce the required version (10.8.2) due to the `packageManager` field in package.json. If you have a different version, npm will prompt you to upgrade/downgrade.
|
|
327
|
+
</Aside>
|
|
328
|
+
|
|
329
|
+
4. **Build all packages**
|
|
330
|
+
|
|
331
|
+
Build all packages and applications:
|
|
332
|
+
|
|
333
|
+
```bash
|
|
334
|
+
npx turbo build
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
What happens during build:
|
|
338
|
+
- Packages are built in dependency order
|
|
339
|
+
- TypeScript is compiled to JavaScript
|
|
340
|
+
- Build artifacts are output to `dist/` directories
|
|
341
|
+
- Turborepo caches successful builds
|
|
342
|
+
- First build takes 10-15 minutes
|
|
343
|
+
|
|
344
|
+
<Aside type="tip">
|
|
345
|
+
**Turborepo Caching**: After the first build, subsequent builds are much faster. Turborepo only rebuilds changed packages and their dependents.
|
|
346
|
+
</Aside>
|
|
347
|
+
|
|
348
|
+
5. **Verify the build**
|
|
349
|
+
|
|
350
|
+
Check that all packages built successfully:
|
|
351
|
+
|
|
352
|
+
```bash
|
|
353
|
+
# Check for dist directories
|
|
354
|
+
ls apps/pae-nestjs-gateway-service/dist
|
|
355
|
+
ls packages/pae-core-lib/dist
|
|
356
|
+
|
|
357
|
+
# Run turbo's build again (should be instant due to cache)
|
|
358
|
+
npx turbo build
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
If you see "cache hit" messages, the build completed successfully.
|
|
362
|
+
|
|
363
|
+
6. **Run tests (optional)**
|
|
364
|
+
|
|
365
|
+
Verify everything works by running tests:
|
|
366
|
+
|
|
367
|
+
```bash
|
|
368
|
+
npx turbo test
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
This runs all unit tests across packages and services.
|
|
372
|
+
|
|
373
|
+
</Steps>
|
|
374
|
+
|
|
375
|
+
---
|
|
376
|
+
|
|
377
|
+
## File System Conventions
|
|
378
|
+
|
|
379
|
+
For local development, the platform expects a specific file system layout:
|
|
380
|
+
|
|
381
|
+
### Required Directory Structure
|
|
382
|
+
|
|
383
|
+
```
|
|
384
|
+
bluealba-workspace/
|
|
385
|
+
├── bluealba-platform/ # This repository (platform code)
|
|
386
|
+
│ ├── apps/
|
|
387
|
+
│ ├── packages/
|
|
388
|
+
│ └── ...
|
|
389
|
+
│
|
|
390
|
+
└── sandbox-product/ # Recommended for development
|
|
391
|
+
└── pae-sandbox-local/
|
|
392
|
+
├── docker-compose-pae.yaml # Platform services
|
|
393
|
+
├── docker-compose-infra.yaml # Infrastructure
|
|
394
|
+
├── docker-compose-bootstrap.yaml # Bootstrap
|
|
395
|
+
└── .env # Environment variables
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
### Why This Structure?
|
|
399
|
+
|
|
400
|
+
The Docker Compose files in the Sandbox Product use **relative paths** to mount source code:
|
|
401
|
+
|
|
402
|
+
```yaml
|
|
403
|
+
# docker-compose-pae.yaml
|
|
404
|
+
volumes:
|
|
405
|
+
- ${PWD}/../../bluealba-platform:/app/out
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
This assumes:
|
|
409
|
+
- Sandbox Product is at `./sandbox-product/pae-sandbox-local/`
|
|
410
|
+
- Platform code is at `./bluealba-platform/`
|
|
411
|
+
- Both are siblings in the same parent directory
|
|
412
|
+
|
|
413
|
+
<Aside type="caution">
|
|
414
|
+
If you use a different directory structure, you'll need to update the volume paths in `docker-compose-pae.yaml`.
|
|
415
|
+
</Aside>
|
|
416
|
+
|
|
417
|
+
---
|
|
418
|
+
|
|
419
|
+
## Setting Up the Sandbox Product
|
|
420
|
+
|
|
421
|
+
The Sandbox Product provides a complete development environment with Docker Compose.
|
|
422
|
+
|
|
423
|
+
<Steps>
|
|
424
|
+
|
|
425
|
+
1. **Clone the Sandbox Product**
|
|
426
|
+
|
|
427
|
+
From your workspace directory:
|
|
428
|
+
|
|
429
|
+
```bash
|
|
430
|
+
cd bluealba-workspace
|
|
431
|
+
git clone https://github.com/bluealba/sandbox-product.git
|
|
432
|
+
cd sandbox-product/pae-sandbox-local
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
2. **Configure environment variables**
|
|
436
|
+
|
|
437
|
+
Copy the example environment file:
|
|
438
|
+
|
|
439
|
+
```bash
|
|
440
|
+
cp .env.example .env
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
Edit `.env` to customize settings:
|
|
444
|
+
|
|
445
|
+
```bash
|
|
446
|
+
# Database Configuration
|
|
447
|
+
PAE_DB_HOST=postgres
|
|
448
|
+
PAE_DB_PORT=5432
|
|
449
|
+
PAE_DB_USER=postgres
|
|
450
|
+
PAE_DB_PASSWORD=postgres
|
|
451
|
+
PAE_DB=pae_dev
|
|
452
|
+
|
|
453
|
+
# JWT Configuration
|
|
454
|
+
PAE_AUTH_JWT_SECRET=your-super-secret-jwt-key-here
|
|
455
|
+
|
|
456
|
+
# Service Secrets
|
|
457
|
+
PAE_GATEWAY_SERVICE_ACCESS_SECRET=another-secret-key
|
|
458
|
+
|
|
459
|
+
# Service URLs
|
|
460
|
+
PAE_AUTHN_SERVICE_URL=http://pae-nestjs-gateway-service:80
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
<Aside type="caution" title="Security Warning">
|
|
464
|
+
**Never commit the `.env` file to version control.** It should be in `.gitignore`. Use strong secrets in production environments.
|
|
465
|
+
</Aside>
|
|
466
|
+
|
|
467
|
+
3. **Start infrastructure services**
|
|
468
|
+
|
|
469
|
+
Start PostgreSQL, Kafka, Zookeeper:
|
|
470
|
+
|
|
471
|
+
```bash
|
|
472
|
+
docker-compose -f docker-compose-infra.yml up -d
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
Wait 30-60 seconds for services to initialize:
|
|
476
|
+
|
|
477
|
+
```bash
|
|
478
|
+
docker-compose -f docker-compose-infra.yml ps
|
|
479
|
+
# All services should show "Up"
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
4. **Bootstrap the platform**
|
|
483
|
+
|
|
484
|
+
Initialize the database schema and seed data:
|
|
485
|
+
|
|
486
|
+
```bash
|
|
487
|
+
docker-compose -f docker-compose-bootstrap.yml up
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
This command:
|
|
491
|
+
- Creates database tables
|
|
492
|
+
- Inserts initial users (admin@platform.com)
|
|
493
|
+
- Creates roles and operations
|
|
494
|
+
- Registers applications in the catalog
|
|
495
|
+
- Seeds example data
|
|
496
|
+
|
|
497
|
+
The bootstrap should complete in 1-2 minutes. When finished, you'll see "Bootstrap complete" in the logs.
|
|
498
|
+
|
|
499
|
+
5. **Start platform services**
|
|
500
|
+
|
|
501
|
+
Start all platform services and UIs:
|
|
502
|
+
|
|
503
|
+
```bash
|
|
504
|
+
docker-compose -f docker-compose-pae.yml up -d
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
Verify all services are running:
|
|
508
|
+
|
|
509
|
+
```bash
|
|
510
|
+
docker-compose -f docker-compose-pae.yml ps
|
|
511
|
+
```
|
|
512
|
+
|
|
513
|
+
6. **Verify the installation**
|
|
514
|
+
|
|
515
|
+
Test the gateway health endpoint:
|
|
516
|
+
|
|
517
|
+
```bash
|
|
518
|
+
curl -k https://localhost:9443/_/health
|
|
519
|
+
# Expected: {"status": "ok"}
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
Open the platform in your browser:
|
|
523
|
+
|
|
524
|
+
```
|
|
525
|
+
https://localhost:9443
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
Login with default credentials:
|
|
529
|
+
- Username: `admin@platform.com`
|
|
530
|
+
- Password: `admin123`
|
|
531
|
+
|
|
532
|
+
</Steps>
|
|
533
|
+
|
|
534
|
+
---
|
|
535
|
+
|
|
536
|
+
## Troubleshooting
|
|
537
|
+
|
|
538
|
+
### Installation Issues
|
|
539
|
+
|
|
540
|
+
#### npm install fails with version error
|
|
541
|
+
|
|
542
|
+
**Problem**: npm complains about version mismatch
|
|
543
|
+
|
|
544
|
+
```bash
|
|
545
|
+
npm ERR! This version of npm is not compatible
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
**Solution**: Install the exact required version:
|
|
549
|
+
|
|
550
|
+
```bash
|
|
551
|
+
npm install -g npm@10.8.2
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
#### Build fails with "out of memory" error
|
|
555
|
+
|
|
556
|
+
**Problem**: Node.js runs out of heap memory during build
|
|
557
|
+
|
|
558
|
+
```bash
|
|
559
|
+
FATAL ERROR: Ineffective mark-compacts near heap limit
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
**Solution**: Increase Node.js heap size:
|
|
563
|
+
|
|
564
|
+
```bash
|
|
565
|
+
export NODE_OPTIONS="--max-old-space-size=4096"
|
|
566
|
+
npx turbo build
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
#### Cannot find module errors after install
|
|
570
|
+
|
|
571
|
+
**Problem**: TypeScript can't find workspace packages
|
|
572
|
+
|
|
573
|
+
```bash
|
|
574
|
+
Cannot find module '@bluealba/pae-core-lib'
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
**Solution**: Rebuild packages:
|
|
578
|
+
|
|
579
|
+
```bash
|
|
580
|
+
npx turbo clean
|
|
581
|
+
npm install
|
|
582
|
+
npx turbo build
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
### Docker Issues
|
|
586
|
+
|
|
587
|
+
#### Ports already in use
|
|
588
|
+
|
|
589
|
+
**Problem**: Docker can't bind to required ports
|
|
590
|
+
|
|
591
|
+
```bash
|
|
592
|
+
Error: bind: address already in use
|
|
593
|
+
```
|
|
594
|
+
|
|
595
|
+
**Solution**: Find and kill processes using the ports:
|
|
596
|
+
|
|
597
|
+
```bash
|
|
598
|
+
# Check what's using port 9443
|
|
599
|
+
lsof -i :9443
|
|
600
|
+
|
|
601
|
+
# Kill the process
|
|
602
|
+
kill -9 <PID>
|
|
603
|
+
|
|
604
|
+
# Or change the port in docker-compose-pae.yml
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
#### Docker containers won't start
|
|
608
|
+
|
|
609
|
+
**Problem**: Services fail to start with various errors
|
|
610
|
+
|
|
611
|
+
**Solution**: Check Docker resource allocation:
|
|
612
|
+
|
|
613
|
+
1. Open Docker Desktop
|
|
614
|
+
2. Go to Settings → Resources
|
|
615
|
+
3. Ensure at least:
|
|
616
|
+
- CPUs: 2 or more
|
|
617
|
+
- Memory: 4GB or more
|
|
618
|
+
- Swap: 1GB or more
|
|
619
|
+
- Disk: 20GB or more
|
|
620
|
+
|
|
621
|
+
Restart Docker Desktop after changes.
|
|
622
|
+
|
|
623
|
+
#### Cannot connect to PostgreSQL
|
|
624
|
+
|
|
625
|
+
**Problem**: Services can't reach the database
|
|
626
|
+
|
|
627
|
+
```bash
|
|
628
|
+
Error: connect ECONNREFUSED 127.0.0.1:5432
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
**Solution**: Ensure infrastructure services are running:
|
|
632
|
+
|
|
633
|
+
```bash
|
|
634
|
+
docker-compose -f docker-compose-infra.yml ps
|
|
635
|
+
docker-compose -f docker-compose-infra.yml logs postgres
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
If PostgreSQL is down, restart it:
|
|
639
|
+
|
|
640
|
+
```bash
|
|
641
|
+
docker-compose -f docker-compose-infra.yml restart postgres
|
|
642
|
+
```
|
|
643
|
+
|
|
644
|
+
Wait 30 seconds for PostgreSQL to fully start.
|
|
645
|
+
|
|
646
|
+
### Build Issues
|
|
647
|
+
|
|
648
|
+
#### Turborepo cache issues
|
|
649
|
+
|
|
650
|
+
**Problem**: Builds succeed but runtime fails with old code
|
|
651
|
+
|
|
652
|
+
**Solution**: Clear Turborepo cache:
|
|
653
|
+
|
|
654
|
+
```bash
|
|
655
|
+
npx turbo clean
|
|
656
|
+
rm -rf node_modules/.cache
|
|
657
|
+
npx turbo build --force
|
|
658
|
+
```
|
|
659
|
+
|
|
660
|
+
The `--force` flag bypasses the cache.
|
|
661
|
+
|
|
662
|
+
#### TypeScript compilation errors
|
|
663
|
+
|
|
664
|
+
**Problem**: Build fails with TypeScript errors
|
|
665
|
+
|
|
666
|
+
**Solution**:
|
|
667
|
+
|
|
668
|
+
1. Ensure you're using TypeScript 5.8:
|
|
669
|
+
|
|
670
|
+
```bash
|
|
671
|
+
npm list typescript
|
|
672
|
+
```
|
|
673
|
+
|
|
674
|
+
2. Clean and rebuild:
|
|
675
|
+
|
|
676
|
+
```bash
|
|
677
|
+
npx turbo clean
|
|
678
|
+
npm install
|
|
679
|
+
npx turbo build
|
|
680
|
+
```
|
|
681
|
+
|
|
682
|
+
3. Check for missing peer dependencies:
|
|
683
|
+
|
|
684
|
+
```bash
|
|
685
|
+
npm run check-deps
|
|
686
|
+
npm run fix-deps
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
#### Circular dependency warnings
|
|
690
|
+
|
|
691
|
+
**Problem**: Warnings about circular imports
|
|
692
|
+
|
|
693
|
+
```bash
|
|
694
|
+
Warning: Circular dependency detected
|
|
695
|
+
```
|
|
696
|
+
|
|
697
|
+
**Solution**: These are usually harmless warnings. If they cause issues:
|
|
698
|
+
|
|
699
|
+
1. Review the import chain
|
|
700
|
+
2. Refactor to break the cycle
|
|
701
|
+
3. Use dynamic imports if necessary
|
|
702
|
+
|
|
703
|
+
### File System Issues
|
|
704
|
+
|
|
705
|
+
#### Permission denied errors
|
|
706
|
+
|
|
707
|
+
**Problem**: Can't write to directories
|
|
708
|
+
|
|
709
|
+
```bash
|
|
710
|
+
EACCES: permission denied
|
|
711
|
+
```
|
|
712
|
+
|
|
713
|
+
**Solution**: Fix directory permissions:
|
|
714
|
+
|
|
715
|
+
```bash
|
|
716
|
+
# Fix ownership
|
|
717
|
+
sudo chown -R $USER:$USER bluealba-platform
|
|
718
|
+
|
|
719
|
+
# Or run with appropriate permissions
|
|
720
|
+
sudo npm install
|
|
721
|
+
```
|
|
722
|
+
|
|
723
|
+
#### Disk space issues
|
|
724
|
+
|
|
725
|
+
**Problem**: Not enough space for dependencies and builds
|
|
726
|
+
|
|
727
|
+
```bash
|
|
728
|
+
ENOSPC: no space left on device
|
|
729
|
+
```
|
|
730
|
+
|
|
731
|
+
**Solution**:
|
|
732
|
+
|
|
733
|
+
1. Clean Docker:
|
|
734
|
+
|
|
735
|
+
```bash
|
|
736
|
+
docker system prune -a
|
|
737
|
+
```
|
|
738
|
+
|
|
739
|
+
2. Clean npm cache:
|
|
740
|
+
|
|
741
|
+
```bash
|
|
742
|
+
npm cache clean --force
|
|
743
|
+
```
|
|
744
|
+
|
|
745
|
+
3. Clean builds:
|
|
746
|
+
|
|
747
|
+
```bash
|
|
748
|
+
npx turbo clean
|
|
749
|
+
rm -rf node_modules
|
|
750
|
+
```
|
|
751
|
+
|
|
752
|
+
---
|
|
753
|
+
|
|
754
|
+
## Next Steps
|
|
755
|
+
|
|
756
|
+
Congratulations! You've successfully installed the Blue Alba Platform.
|
|
757
|
+
|
|
758
|
+
Here's what to do next:
|
|
759
|
+
|
|
760
|
+
1. **[Development Workflow](/_/docs/development/workflow/)** - Learn how to develop with the platform
|
|
761
|
+
2. **[Core Concepts](/_/docs/getting-started/core-concepts/)** - Understand applications, modules, roles, and more
|
|
762
|
+
3. **[Architecture Deep Dive](/_/docs/architecture/overview/)** - Explore the technical architecture
|
|
763
|
+
4. **[Building Your First Service](/_/docs/guides/creating-services/)** - Create a custom service
|
|
764
|
+
|
|
765
|
+
## Getting Help
|
|
766
|
+
|
|
767
|
+
If you encounter issues not covered in this guide:
|
|
768
|
+
|
|
769
|
+
1. **Check the logs**:
|
|
770
|
+
```bash
|
|
771
|
+
docker-compose -f docker-compose-pae.yml logs <service-name>
|
|
772
|
+
```
|
|
773
|
+
|
|
774
|
+
2. **Review service READMEs**: Each app has a README in its directory
|
|
775
|
+
|
|
776
|
+
3. **GitHub Issues**: Search or create issues in the repository
|
|
777
|
+
|
|
778
|
+
4. **Documentation**: Browse other sections of this documentation site
|
|
779
|
+
|
|
780
|
+
Happy coding!
|