You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-26Lines changed: 28 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ The project is pinned to `pnpm@9.15.3` (see `"packageManager"` in `package.json`
27
27
28
28
### • Install NestJS CLI
29
29
```bash
30
-
pnpm add -g @nestjs/cli
30
+
npm i @nestjs/cli@latest
31
31
```
32
32
33
33
---
@@ -53,26 +53,37 @@ Start PostgreSQL via Docker. The credentials and DB name **must match** what you
53
53
```bash
54
54
docker run --name credebl-postgres \
55
55
-p 5432:5432 \
56
-
-e POSTGRES_USER=credebl \
57
-
-e POSTGRES_PASSWORD=changeme \
56
+
-e POSTGRES_USER=postgres \
57
+
-e POSTGRES_PASSWORD=postgres \
58
58
-e POSTGRES_DB=credebl \
59
59
-v credebl_pgdata:/var/lib/postgresql/data \
60
60
--network platform_default \
61
61
-d postgres:16
62
62
```
63
63
64
+
> ⚠️ **If you later run `docker compose up`, Docker Compose also defines a service named `credebl-postgres`.** To avoid a container name collision, stop and remove the manually started container first (`docker rm -f credebl-postgres`) before running `docker compose up`.
65
+
64
66
Then update your `.env` to match those credentials:
> ⚠️ **Do not use `localhost` in `DATABASE_URL` when services run inside Docker containers.** Inside a container, `localhost` resolves to the container itself — not the host. Use your machine's LAN IP (e.g. `192.168.x.x`) or a Docker service name instead. This applies to `KEYCLOAK_DOMAIN` and `KEYCLOAK_ADMIN_URL` as well (see Step 5).
72
74
73
75
---
74
76
75
-
### Step 3 — Run Prisma Migrations (Schema Generation)
77
+
### Step 3 — Install Dependencies
78
+
79
+
```bash
80
+
# From repo root — use pnpm, not npm
81
+
pnpm install
82
+
```
83
+
84
+
---
85
+
86
+
### Step 4 — Run Prisma Migrations (Schema Generation)
76
87
77
88
> ⚠️ **Migrations must run before seeding.** If you seed first, it will fail because the tables don't exist yet.
Keycloak is required for authentication. It is **not started automatically** — you must run it separately and configure it fully before seeding.
98
109
99
-
#### 4a — Run the Keycloak container
110
+
#### 5a — Run the Keycloak container
100
111
101
112
> ⚠️ **Keycloak must be on the same Docker network as the platform services** (`platform_default`), otherwise the containers cannot reach it. Include `--network platform_default` when creating the container.
102
113
@@ -109,13 +120,13 @@ docker run --name credebl-keycloak \
109
120
-d quay.io/keycloak/keycloak:latest start-dev
110
121
```
111
122
112
-
#### 4b — Create a Realm
123
+
#### 5b — Create a Realm
113
124
114
125
1. Open the Keycloak Admin Console: `http://localhost:8080`
115
126
2. Log in with `admin` / `admin`
116
127
3. Create a new **Realm** named exactly: `credebl-platform`
117
128
118
-
#### 4c — Create Client 1: `adminClient`
129
+
#### 5c — Create Client 1: `adminClient`
119
130
120
131
This client is used by the platform seed script and user-service to authenticate platform admin users.
0 commit comments