|
1 | | -# Quick start: registry + evault-core + dev-sandbox |
| 1 | +# Quick start |
2 | 2 |
|
3 | | -Run Postgres and Neo4j in Docker, then start the core services and dev-sandbox with one script. |
| 3 | +The local dev quick start (registry + evault-core + dev-sandbox, environment, `REGISTRY_ENTROPY_KEY_JWK`, one-command start, ports, troubleshooting) has been moved to the docs: |
4 | 4 |
|
5 | | -## Prerequisites |
| 5 | +**[Local Dev Quick Start Markdown on GitHub](docs/docs/Post%20Platform%20Guide/local-dev-quick-start.md)** |
6 | 6 |
|
7 | | -- **Docker** (for Postgres and Neo4j) |
8 | | -- **Node.js 18+** and **pnpm** |
9 | | -- **.env** in the repo root (copy from `.env.example` if present, or set the variables below) |
10 | | - |
11 | | -## Environment |
12 | | - |
13 | | -Create or edit `.env` in the repo root. Minimum for this stack: |
14 | | - |
15 | | -```bash |
16 | | -# Postgres (used by registry) |
17 | | -POSTGRES_USER=postgres |
18 | | -POSTGRES_PASSWORD=postgres |
19 | | -REGISTRY_DATABASE_URL=postgresql://postgres:postgres@localhost:5432/registry |
20 | | - |
21 | | -# Registry: ES256 key for signing entropy tokens (required; generate once — pnpm generate-entropy-jwk) |
22 | | -REGISTRY_ENTROPY_KEY_JWK='<paste generated JWK here>' |
23 | | - |
24 | | -# Neo4j (used by evault-core) |
25 | | -NEO4J_USER=neo4j |
26 | | -NEO4J_PASSWORD=your-password |
27 | | - |
28 | | -# So the sandbox and evault-core can talk to registry/provisioner |
29 | | -PUBLIC_REGISTRY_URL=http://localhost:4321 |
30 | | -PUBLIC_PROVISIONER_URL=http://localhost:3001 |
31 | | -REGISTRY_SHARED_SECRET=dev-secret-change-me |
32 | | -PUBLIC_EVAULT_SERVER_URI=http://localhost:4000 |
33 | | -``` |
34 | | - |
35 | | -### Generating `REGISTRY_ENTROPY_KEY_JWK` |
36 | | - |
37 | | -The Registry signs entropy tokens (used by the eID Wallet and provisioning) with an ES256 key. You must set `REGISTRY_ENTROPY_KEY_JWK` to a JSON Web Key (private key). From the repo root, generate a JWK (output to stdout) and add it to `.env`: |
38 | | - |
39 | | -```bash |
40 | | -pnpm generate-entropy-jwk |
41 | | -``` |
42 | | - |
43 | | -Put the output in `.env` as `REGISTRY_ENTROPY_KEY_JWK='<paste>'`. Keep the key private; use the same value across local dev if you need tokens to verify elsewhere. |
44 | | - |
45 | | -## One-command start |
46 | | - |
47 | | -From the repo root: |
48 | | - |
49 | | -```bash |
50 | | -pnpm install |
51 | | -pnpm dev:core |
52 | | -``` |
53 | | - |
54 | | -Or run steps individually: |
55 | | - |
56 | | -```bash |
57 | | -pnpm dev:core:docker |
58 | | -pnpm dev:core:wait |
59 | | -pnpm dev:core:migrate |
60 | | -pnpm dev:core:apps |
61 | | -``` |
62 | | - |
63 | | -This will: |
64 | | - |
65 | | -1. Start **Postgres** (port 5432) and **Neo4j** (7474, 7687) via `docker-compose.databases.yml` |
66 | | -2. Wait for Postgres to be ready |
67 | | -3. Start **registry** (4321), **evault-core** (3001 provisioning, 4000 GraphQL), and **dev-sandbox** (8080) in parallel |
68 | | - |
69 | | -Stop with `Ctrl+C`. To stop only the databases: `pnpm docker:core:down`. |
70 | | - |
71 | | -## Ports |
72 | | - |
73 | | -| Service | Port(s) | Notes | |
74 | | -|----------------|---------|--------------------------| |
75 | | -| Postgres | 5432 | | |
76 | | -| Neo4j HTTP | 7474 | | |
77 | | -| Neo4j Bolt | 7687 | | |
78 | | -| Registry | 4321 | | |
79 | | -| evault-core | 3001, 4000 | Provisioning + GraphQL | |
80 | | -| **Dev sandbox**| **8080**| W3DS dev sandbox UI | |
81 | | - |
82 | | -Open **http://localhost:8080** for the dev sandbox (provision, w3ds flows, sign). |
83 | | - |
84 | | -## Optional: databases only |
85 | | - |
86 | | -To run only Postgres and Neo4j (e.g. you run the app services yourself): |
87 | | - |
88 | | -```bash |
89 | | -pnpm docker:core |
90 | | -``` |
91 | | - |
92 | | -Or: `docker compose -f docker-compose.databases.yml up -d`. Stop with `pnpm docker:core:down`. |
93 | | - |
94 | | -## Troubleshooting |
95 | | - |
96 | | -**Neo4j "encryption setting" or connection refused:** The stack uses **Neo4j 4.4** (unencrypted Bolt by default). If you previously used Neo4j 5.x, remove the old data and recreate: |
97 | | - |
98 | | -```bash |
99 | | -docker compose -f docker-compose.databases.yml down |
100 | | -docker volume rm metastate_neo4j_data 2>/dev/null || true |
101 | | -docker compose -f docker-compose.databases.yml up -d |
102 | | -pnpm dev:core |
103 | | -``` |
104 | | - |
105 | | -Otherwise ensure `.env` has `NEO4J_URI=bolt://127.0.0.1:7687` and matching `NEO4J_USER` / `NEO4J_PASSWORD`. |
106 | | - |
107 | | ---- |
108 | | - |
109 | | -For full Docker setups and all platform services, see the main [README](README.md). |
| 7 | +On the docs site: [docs.w3ds.metastate.foundation](https://docs.w3ds.metastate.foundation/docs/Post%20Platform%20Guide/local-dev-quick-start) |
0 commit comments