Skip to content

Commit 00e53a5

Browse files
authored
Feat/dev sandbox and eid sdk (#797)
* feat(wallet-sdk): add package and CryptoAdapter interface (BYOC) * feat(wallet-sdk): implement provisioning flow with CryptoAdapter * feat(wallet-sdk): implement auth flow (parse w3ds auth, sign session, POST to platform) * feat(wallet-sdk): add syncPublicKeyToEvault and signPayload * test(wallet-sdk): add test double and tests for provision, auth, sync, sign * feat(dev-sandbox): add app scaffold and Web Crypto adapter * feat(dev-sandbox): wire provision and auth UI to SDK * feat(dev-sandbox): add sync key and sign payload UI, README * feat: base working dev sandbox * feat: restyle sandbox * feat: docker setup * chore: delete junk files
1 parent fcfd5ed commit 00e53a5

45 files changed

Lines changed: 2487 additions & 1113 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Tests [wallet-sdk]
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'packages/wallet-sdk/**'
8+
pull_request:
9+
branches: [main]
10+
paths:
11+
- 'packages/wallet-sdk/**'
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v3
20+
21+
- name: Set up Node.js 22
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 22
25+
26+
- name: Install pnpm
27+
run: npm install -g pnpm
28+
29+
- name: Install dependencies
30+
run: pnpm install
31+
32+
- name: Run tests
33+
run: pnpm -F=wallet-sdk test

Dockerfile.dev

Lines changed: 0 additions & 21 deletions
This file was deleted.

QUICKSTART.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Quick start: registry + evault-core + dev-sandbox
2+
3+
Run Postgres and Neo4j in Docker, then start the core services and dev-sandbox with one script.
4+
5+
## Prerequisites
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+
# Neo4j (used by evault-core)
22+
NEO4J_USER=neo4j
23+
NEO4J_PASSWORD=your-password
24+
25+
# So the sandbox and evault-core can talk to registry/provisioner
26+
PUBLIC_REGISTRY_URL=http://localhost:4321
27+
PUBLIC_PROVISIONER_URL=http://localhost:3001
28+
REGISTRY_SHARED_SECRET=dev-secret-change-me
29+
PUBLIC_EVAULT_SERVER_URI=http://localhost:4000
30+
```
31+
32+
## One-command start
33+
34+
From the repo root:
35+
36+
```bash
37+
pnpm install
38+
pnpm dev:core
39+
```
40+
41+
Or run the script directly: `chmod +x scripts/start-dev.sh && ./scripts/start-dev.sh`
42+
43+
This will:
44+
45+
1. Start **Postgres** (port 5432) and **Neo4j** (7474, 7687) via `docker-compose.databases.yml`
46+
2. Wait for Postgres to be ready
47+
3. Start **registry** (4321), **evault-core** (3001 provisioning, 4000 GraphQL), and **dev-sandbox** (8080) in parallel
48+
49+
Stop with `Ctrl+C`. To stop only the databases: `pnpm docker:core:down`.
50+
51+
## Ports
52+
53+
| Service | Port(s) | Notes |
54+
|----------------|---------|--------------------------|
55+
| Postgres | 5432 | |
56+
| Neo4j HTTP | 7474 | |
57+
| Neo4j Bolt | 7687 | |
58+
| Registry | 4321 | |
59+
| evault-core | 3001, 4000 | Provisioning + GraphQL |
60+
| **Dev sandbox**| **8080**| W3DS dev sandbox UI |
61+
62+
Open **http://localhost:8080** for the dev sandbox (provision, w3ds flows, sign).
63+
64+
## Optional: databases only
65+
66+
To run only Postgres and Neo4j (e.g. you run the app services yourself):
67+
68+
```bash
69+
pnpm docker:core
70+
```
71+
72+
Or: `docker compose -f docker-compose.databases.yml up -d`. Stop with `pnpm docker:core:down`.
73+
74+
## Troubleshooting
75+
76+
**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:
77+
78+
```bash
79+
docker compose -f docker-compose.databases.yml down
80+
docker volume rm metastate_neo4j_data 2>/dev/null || true
81+
docker compose -f docker-compose.databases.yml up -d
82+
pnpm dev:core
83+
```
84+
85+
Otherwise ensure `.env` has `NEO4J_URI=bolt://127.0.0.1:7687` and matching `NEO4J_USER` / `NEO4J_PASSWORD`.
86+
87+
---
88+
89+
For full Docker setups and all platform services, see the main [README](README.md).

README.md

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
**[Documentation](https://docs.w3ds.metastate.foundation)** — Getting started with W3DS and the MetaState prototype.
44

5+
**Quick start (registry + evault-core + dev-sandbox):** see **[QUICKSTART.md](QUICKSTART.md)** — one script to run Postgres + Neo4j in Docker and the core services locally. Dev sandbox runs at **http://localhost:8080**.
6+
57
## Docker Development Environment
68

79
### Port Assignments
@@ -26,7 +28,7 @@
2628
- **1111** - Pictique API
2729

2830
#### Frontend Services
29-
- **8080** - Blabsy Frontend
31+
- **8080** - Dev sandbox (W3DS) / Blabsy Frontend
3032
- **5173** - Pictique Frontend
3133
- **3004** - Group Charter Manager Frontend
3234
- **3005** - eVoting Frontend
@@ -52,22 +54,9 @@ Runs all services (core + all APIs + all frontends)
5254

5355
### Usage
5456

55-
Start all services:
56-
```bash
57-
pnpm dev:docker:all
58-
```
57+
**Local dev (recommended):** `pnpm dev:core` — see [QUICKSTART.md](QUICKSTART.md). Runs Postgres + Neo4j in Docker, then registry, evault-core, and dev-sandbox locally.
5958

60-
Start specific profile:
61-
```bash
62-
pnpm dev:docker:socials
63-
pnpm dev:docker:charter-blabsy
64-
```
65-
66-
Or use docker compose directly:
67-
```bash
68-
docker compose -f dev-docker-compose.yaml --profile socials up --watch
69-
docker compose -f dev-docker-compose.yaml --profile charter-blabsy up --watch
70-
```
59+
**Databases only:** `pnpm docker:core` (Postgres + Neo4j). Stop with `pnpm docker:core:down`.
7160

7261
## Project Structure
7362

@@ -93,5 +82,5 @@ prototype/
9382
│ └─ marketplace/
9483
├─ docker/
9584
│ └─ Dockerfile.* (Dedicated Dockerfiles for each service)
96-
└─ dev-docker-compose.yaml (Docker Compose configuration)
85+
└─ docker-compose.databases.yml (Postgres + Neo4j)
9786
```

control-panel.compose.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)