Skip to content

Commit

Permalink
Accept invite form (#49)
Browse files Browse the repository at this point in the history
Accept invite form and a massive refactor of the styling
  • Loading branch information
mattdean-digicatapult authored Jun 11, 2024
1 parent 2fc968d commit 6d36bd1
Show file tree
Hide file tree
Showing 49 changed files with 1,967 additions and 841 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ jobs:
run: npm ci
- name: Build tsoa
run: npm run tsoa:build
- name: touch env
run: touch .env
- name: Setup dependencies
run: docker compose up -d
- name: Sleep
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ jobs:
run: npm ci
- name: Build tsoa
run: npm run tsoa:build
- name: touch env
run: touch .env
- name: Setup dependencies
run: docker compose up -d
- name: Sleep
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ npm-debug.log*
*.seed
*.pid.lock
.tsimp

.DS_Store
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ COPY package*.json ./
RUN npm ci --omit-dev

COPY public ./public
COPY knexfile.js ./
COPY --from=builder /veritable-ui/build ./build

EXPOSE 80
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ And then to building the `tsoa` routes:
npm run tsoa:build
```

Setup service dependencies
To setup service dependencies make sure there's at a minimum an empty `.env` file in the root directory of this repository and then run:

```bash
docker compose up -d
Expand Down
131 changes: 108 additions & 23 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
services:
postgres-veritable-ui:
image: postgres:16.3-alpine
container_name: postgres-veritable-ui
ports:
- 5432:5432
volumes:
- postgres-veritable-ui:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=postgres
- POSTGRES_DB=veritable-ui
# -------------------- shared -------------------------------#
keycloak:
image: quay.io/keycloak/keycloak:24.0.5
container_name: keycloak
Expand All @@ -26,39 +16,134 @@ services:
image: ipfs/kubo:release
volumes:
- ipfs:/data/ipfs
postgres:
container_name: postgres-veritable-cloudagent

# -------------------- alice -------------------------------#
postgres-veritable-ui-alice:
image: postgres:16.3-alpine
container_name: postgres-veritable-ui-alice
ports:
- 5432:5432
volumes:
- postgres-veritable-ui-alice:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=postgres
- POSTGRES_DB=veritable-ui
postgres-veritable-cloudagent-alice:
container_name: postgres-veritable-cloudagent-alice
image: postgres:16.3-alpine
restart: on-failure
volumes:
- postgres-veritable-cloudagent:/var/lib/postgresql/data
- postgres-veritable-cloudagent-alice:/var/lib/postgresql/data
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres-veritable-cloudagent
veritable-cloudagent:
veritable-cloudagent-alice:
image: digicatapult/veritable-cloudagent
container_name: veritable-cloudagent
container_name: veritable-cloudagent-alice
restart: always
depends_on:
ipfs:
condition: service_healthy
ports:
- 3100:3000
command: --inbound-transport http 5002 ws 5003 --outbound-transport http ws
environment:
# - AFJ_REST_INBOUND_TRANSPORT="http 5002 ws 5003"
# - AFJ_REST_OUTBOUND_TRANSPORT="http ws"
- AFJ_REST_ENDPOINT=ws://veritable-cloudagent-alice:5003
- AFJ_REST_ADMIN_PORT=3000
- AFJ_REST_IPFS_ORIGIN=http://ipfs:5001
- AFJ_REST_POSTGRES_HOST=postgres-veritable-cloudagent-alice
- AFJ_REST_POSTGRES_PORT=5432
- AFJ_REST_POSTGRES_USERNAME=postgres
- AFJ_REST_POSTGRES_PASSWORD=postgres
- AFJ_REST_LABEL=vertiable-cloudagent
- AFJ_REST_WALLET_ID=alice
- AFJ_REST_WALLET_KEY=alice-key

# -------------------- bob -------------------------------#
veritable-ui-bob:
container_name: veritable-ui-bob
build:
context: .
dockerfile: Dockerfile
restart: no
depends_on:
- postgres-veritable-ui-bob
- veritable-cloudagent-bob
ports:
- 3001:3000
command: >
sh -c "
npm i -g pino-colada
node ./node_modules/.bin/knex migrate:latest
npm start | pino-colada"
env_file:
- docker/test.env
- .env
environment:
- NODE_ENV=production
- LOG_LEVEL=trace
- DB_HOST=postgres-veritable-ui-bob
- DB_NAME=veritable-ui
- PUBLIC_URL=http://localhost:3001
- CLOUDAGENT_ADMIN_ORIGIN=http://veritable-cloudagent-bob:3000
- COOKIE_SESSION_KEYS=secret
- DB_PASSWORD=postgres
- DB_USERNAME=postgres
- IDP_CLIENT_ID=veritable-ui
- IDP_PUBLIC_URL_PREFIX=http://localhost:3080/realms/veritable/protocol/openid-connect
- IDP_INTERNAL_URL_PREFIX=http://keycloak:8080/realms/veritable/protocol/openid-connect
- INVITATION_FROM_COMPANY_NUMBER=07964699
- INVITATION_PIN_SECRET=secret
postgres-veritable-ui-bob:
image: postgres:16.3-alpine
container_name: postgres-veritable-ui-bob
volumes:
- postgres-veritable-ui-bob:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=postgres
- POSTGRES_DB=veritable-ui
postgres-veritable-cloudagent-bob:
container_name: postgres-veritable-cloudagent-bob
image: postgres:16.3-alpine
restart: on-failure
volumes:
- postgres-veritable-cloudagent-bob:/var/lib/postgresql/data
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres-veritable-cloudagent
veritable-cloudagent-bob:
image: digicatapult/veritable-cloudagent
container_name: veritable-cloudagent-bob
restart: always
depends_on:
ipfs:
condition: service_healthy
ports:
- 3101:3000
command: --inbound-transport http 5002 ws 5003 --outbound-transport http ws
environment:
- AFJ_REST_ENDPOINT=ws://veritable-cloudagent:5003
# - AFJ_REST_INBOUND_TRANSPORT="http 5002 ws 5003"
# - AFJ_REST_OUTBOUND_TRANSPORT="http ws"
- AFJ_REST_ENDPOINT=ws://veritable-cloudagent-bob:5003
- AFJ_REST_ADMIN_PORT=3000
- AFJ_REST_INBOUND_TRANSPORTS="ws 5003"
- AFJ_REST_IPFS_ORIGIN=http://ipfs:5001
- AFJ_REST_POSTGRES_HOST=postgres
- AFJ_REST_POSTGRES_HOST=postgres-veritable-cloudagent-bob
- AFJ_REST_POSTGRES_PORT=5432
- AFJ_REST_POSTGRES_USERNAME=postgres
- AFJ_REST_POSTGRES_PASSWORD=postgres
- AFJ_REST_LABEL=vertiable-cloudagent
- AFJ_REST_WALLET_ID=walletId
- AFJ_REST_WALLET_KEY=walletKey
- AFJ_REST_WALLET_ID=bob
- AFJ_REST_WALLET_KEY=bob-key

volumes:
ipfs:
postgres-veritable-ui:
postgres-veritable-cloudagent:
postgres-veritable-ui-alice:
postgres-veritable-ui-bob:
postgres-veritable-cloudagent-alice:
postgres-veritable-cloudagent-bob:
9 changes: 7 additions & 2 deletions docker/keycloak/veritable.json
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,13 @@
"enabled": true,
"alwaysDisplayInConsole": false,
"clientAuthenticatorType": "client-secret",
"redirectUris": ["http://localhost:3000/auth/redirect", "http://localhost:3000/swagger/oauth2-redirect.html"],
"webOrigins": ["http://localhost:3000"],
"redirectUris": [
"http://localhost:3000/auth/redirect",
"http://localhost:3000/swagger/oauth2-redirect.html",
"http://localhost:3001/auth/redirect",
"http://localhost:3001/swagger/oauth2-redirect.html"
],
"webOrigins": ["http://localhost:3000", "http://localhost:3001"],
"notBefore": 0,
"bearerOnly": false,
"consentRequired": false,
Expand Down
1 change: 1 addition & 0 deletions docker/test.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
COMPANY_PROFILE_API_KEY=API_KEY
8 changes: 5 additions & 3 deletions src/models/db/knexfile.ts → knexfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import type { Knex } from 'knex'

export const pgConfig = {
client: 'pg',
timezone: 'UTC',
Expand All @@ -15,14 +13,15 @@ export const pgConfig = {
max: 10,
},
migrations: {
directory: './src/models/db/migrations',
tableName: 'migrations',
},
seeds: {
directory: '../../../seeds',
},
}

const config: { [key: string]: Knex.Config } = {
const config = {
test: pgConfig,
development: pgConfig,
production: {
Expand All @@ -34,6 +33,9 @@ const config: { [key: string]: Knex.Config } = {
password: process.env.DB_PASSWORD,
database: process.env.DB_NAME,
},
migrations: {
directory: './build/models/db/migrations',
},
},
}

Expand Down
Loading

0 comments on commit 6d36bd1

Please sign in to comment.