Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
4rthem committed Dec 9, 2024
1 parent f3cde47 commit 7c9360c
Show file tree
Hide file tree
Showing 51 changed files with 6,444 additions and 20 deletions.
9 changes: 7 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
**/.git
**/.pnpm-store
**/build
**/dist
**/.build
**/*.log
**/coverage
**/Dockerfile
**/.dockerignore
**/client/build
**/var
**/vendor
**/public/bundles
Expand All @@ -16,7 +22,6 @@
/doc
/report
/tmp
**/dist
/uploader/client/index.html
/expose/client/index.html
/databox/client/index.html
Expand Down
4 changes: 3 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,10 @@ NOVU_VERSION=2.1.0

NOVU_API_HOST=api-novu.${PHRASEA_DOMAIN}${HTTPS_PORT_PREFIX}
NOVU_API_URL="${NOVU_API_URL:-https://${NOVU_API_HOST}}"
NOVU_FRONT_URL=https://novu.${PHRASEA_DOMAIN}${HTTPS_PORT_PREFIX}
NOVU_DASHBOARD_URL=https://novu.${PHRASEA_DOMAIN}${HTTPS_PORT_PREFIX}
NOVU_WS_URL=https://ws-novu.${PHRASEA_DOMAIN}${HTTPS_PORT_PREFIX}
NOVU_STUDIO_URL=https://studio-novu.${PHRASEA_DOMAIN}${HTTPS_PORT_PREFIX}
NOVU_BRIDGE_URL=https://bridge-novu.${PHRASEA_DOMAIN}${HTTPS_PORT_PREFIX}

NOVU_REDIS_HOST=redis
NOVU_REDIS_PORT=6379
Expand Down
4 changes: 3 additions & 1 deletion dashboard/client/config-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
'UPLOADER_CLIENT_URL',
'ZIPPY_URL',
'SOKETI_USAGE_URL',
'NOVU_FRONT_URL',
'NOVU_DASHBOARD_URL',
'NOVU_STUDIO_URL',
'NOVU_BRIDGE_URL',
];

const e = {};
Expand Down
32 changes: 28 additions & 4 deletions dashboard/client/src/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ export default function Dashboard({}: Props) {
RABBITMQ_CONSOLE_URL,
TRAEFIK_CONSOLE_URL,
SOKETI_USAGE_URL,
NOVU_FRONT_URL,
NOVU_DASHBOARD_URL,
NOVU_STUDIO_URL,
NOVU_BRIDGE_URL,
} = config.env;

const roles = user?.roles ?? [];
Expand Down Expand Up @@ -278,14 +280,36 @@ export default function Dashboard({}: Props) {
</Link>
</Grid>
)}
{NOVU_FRONT_URL && (
{NOVU_DASHBOARD_URL && (
<Grid item>
<Link
href={NOVU_FRONT_URL}
href={NOVU_DASHBOARD_URL}
target={'_blank'}
rel={'noreferrer noopener'}
>
Novu
Novu Dashboard
</Link>
</Grid>
)}
{NOVU_BRIDGE_URL && (
<Grid item>
<Link
href={NOVU_BRIDGE_URL}
target={'_blank'}
rel={'noreferrer noopener'}
>
Novu Bridge
</Link>
</Grid>
)}
{NOVU_STUDIO_URL && (
<Grid item>
<Link
href={NOVU_STUDIO_URL}
target={'_blank'}
rel={'noreferrer noopener'}
>
Novu Studio
</Link>
</Grid>
)}
Expand Down
4 changes: 3 additions & 1 deletion dashboard/client/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ declare global {
UPLOADER_CLIENT_URL: string;
ZIPPY_URL: string;
SOKETI_USAGE_URL: string;
NOVU_FRONT_URL: string;
NOVU_DASHBOARD_URL: string;
NOVU_BRIDGE_URL: string;
NOVU_STUDIO_URL: string;
};
} & WindowConfig;
}
Expand Down
3 changes: 3 additions & 0 deletions databox/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@mui/lab": "5.0.0-alpha.173",
"@mui/material": "^5.16.7",
"@mui/x-tree-view": "^6.17.0",
"@novu/framework": "^2.5.2",
"@tanstack/react-query": "^5.59.0",
"@toast-ui/react-image-editor": "^3.15.2",
"ace-builds": "^1.36.2",
Expand Down Expand Up @@ -66,6 +67,8 @@
"tui-image-editor": "^3.15.3",
"uuid": "^9.0.1",
"web-vitals": "^2.1.4",
"zod": "^3.23.8",
"zod-to-json-schema": "^3.23.5",
"zustand": "^4.5.5"
},
"scripts": {
Expand Down
55 changes: 54 additions & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ services:
tty: true
hostname: local
ports:
- 4000:4000
- "0.0.0.0:4000:4000"
environment:
- APP_ENV
- SSH_AUTH_SOCK=/ssh-auth-sock
Expand Down Expand Up @@ -250,6 +250,7 @@ services:
- api-notify.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}
- novu.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}
- api-novu.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}
- bridge-novu.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}
- phraseanet.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}

report-api:
Expand Down Expand Up @@ -282,6 +283,58 @@ services:
- ./cypress/cypress.config.js:/cypress/cypress.config.js
- /tmp/.X11-unix:/tmp/.X11-unix

novu-api:
environment:
- NODE_TLS_REJECT_UNAUTHORIZED=0

novu-worker:
environment:
- NODE_TLS_REJECT_UNAUTHORIZED=0

novu-bridge:
command:
- sh
- -c
- pnpm dev
environment:
- NODE_TLS_REJECT_UNAUTHORIZED=0
volumes:
- ./novu/bridge:/usr/src/app

novu-studio:
image: ${REGISTRY_NAMESPACE}novu-studio:${DOCKER_TAG}
build:
context: ./novu
dockerfile: studio/Dockerfile
profiles:
- novu
command:
# - ash
- sh
- -c
- pnpm exec ./packages/novu/dist/src/index.js dev --headless --dashboard-url ${NOVU_DASHBOARD_URL} --port 443 --origin ${NOVU_BRIDGE_URL} --tunnel ${NOVU_BRIDGE_URL} --studio-host=0.0.0.0
# - pnpm exec ./packages/novu/dist/src/index.js sync --api-url ${NOVU_API_URL} --bridge-url ${NOVU_BRIDGE_URL}/api/novu --secret-key ${NOVU_SECRET_KEY}
environment:
- NOVU_DASHBOARD_URL
- NOVU_BRIDGE_URL
- NOVU_SECRET_KEY
- NOVU_API_URL
- NOVU_API_HOST
- NODE_TLS_REJECT_UNAUTHORIZED=0
- NODE_ENV=development
networks:
- internal
labels:
- "traefik.enable=true"
- "traefik.project_name=${COMPOSE_PROJECT_NAME}"
- "traefik.http.routers.novu-studio.rule=Host(`studio-novu.${PHRASEA_DOMAIN}`)"
- "traefik.http.services.novu-studio.loadbalancer.server.port=2022"
extra_hosts:
- api-novu.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}
- bridge-novu.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}
volumes:
- ./novu/novu:/usr/src/app

volumes:
dev:
driver: local
52 changes: 43 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,9 @@ services:
- SENTRY_RELEASE
- CLIENT_ID=${DASHBOARD_CLIENT_ID}
- SOKETI_USAGE_URL
- NOVU_FRONT_URL
- NOVU_DASHBOARD_URL
- NOVU_STUDIO_URL
- NOVU_BRIDGE_URL
labels:
- "traefik.http.routers.dashboard.rule=Host(`dashboard.${PHRASEA_DOMAIN}`)"

Expand Down Expand Up @@ -1113,7 +1115,7 @@ services:
environment:
API_ROOT_URL: ${NOVU_API_URL}
DISABLE_USER_REGISTRATION: 'false'
FRONT_BASE_URL: ${NOVU_FRONT_URL}
FRONT_BASE_URL: ${NOVU_DASHBOARD_URL}
MONGO_URL: ${NOVU_MONGO_URL}
MONGO_MIN_POOL_SIZE: ${NOVU_MONGO_MIN_POOL_SIZE}
MONGO_MAX_POOL_SIZE: ${NOVU_MONGO_MAX_POOL_SIZE}
Expand All @@ -1134,6 +1136,8 @@ services:
- "traefik.http.services.novu-api.loadbalancer.server.port=3000"
extra_hosts:
- ws-novu.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}
- bridge-novu.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}
- studio-novu.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}

novu-worker:
image: ghcr.io/novuhq/novu/worker:${NOVU_VERSION}
Expand All @@ -1158,6 +1162,8 @@ services:
NOVU_SECRET_KEY: ${NOVU_SECRET_KEY}
extra_hosts:
- ws-novu.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}
- bridge-novu.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}
- studio-novu.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}

novu-ws:
image: ghcr.io/novuhq/novu/ws:${NOVU_VERSION}
Expand All @@ -1177,13 +1183,17 @@ services:
REDIS_PORT: ${NOVU_REDIS_PORT}
REDIS_PASSWORD: ${NOVU_REDIS_PASSWORD}
JWT_SECRET: ${NOVU_JWT_SECRET}
NOVU_SECRET_KEY: ${NOVU_SECRET_KEY}
labels:
- "traefik.enable=true"
- "traefik.project_name=${COMPOSE_PROJECT_NAME}"
- "traefik.http.routers.novu-ws.rule=Host(`ws-novu.${PHRASEA_DOMAIN}`)"
- "traefik.http.services.novu-ws.loadbalancer.server.port=3002"
extra_hosts:
- bridge-novu.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}
- studio-novu.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}

novu-web:
novu-dashboard:
image: ghcr.io/novuhq/novu/web:${NOVU_VERSION}
depends_on:
- novu-api
Expand All @@ -1193,18 +1203,42 @@ services:
- internal
environment:
REACT_APP_API_URL: ${NOVU_API_URL}
REACT_APP_ENVIRONMENT: production
REACT_APP_WIDGET_EMBED_PATH: ${NOVU_DASHBOARD_URL}/embed.umd.min.js
REACT_APP_IS_SELF_HOSTED: 'true'
REACT_APP_WS_URL: ${NOVU_WS_URL}
REACT_APP_WEB_CONTEXT_PATH: ${NOVU_FRONT_URL}/
REACT_APP_API_CONTEXT_PATH: ${NOVU_API_URL}/
REACT_APP_WIDGET_CONTEXT_PATH: ${NOVU_FRONT_URL}/
REACT_APP_WS_CONTEXT_PATH: ${NOVU_WS_URL}/
command: ['/bin/sh', '-c', 'pnpm run envsetup:docker && pnpm run start:static:build']
labels:
- "traefik.enable=true"
- "traefik.project_name=${COMPOSE_PROJECT_NAME}"
- "traefik.http.routers.novu-web.rule=Host(`novu.${PHRASEA_DOMAIN}`)"
- "traefik.http.services.novu-web.loadbalancer.server.port=4200"
- "traefik.http.routers.novu-dashboard.rule=Host(`novu.${PHRASEA_DOMAIN}`)"
- "traefik.http.services.novu-dashboard.loadbalancer.server.port=4200"
extra_hosts:
- bridge-novu.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}
- studio-novu.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}

novu-bridge:
image: ${REGISTRY_NAMESPACE}novu-bridge:${DOCKER_TAG}
build: ./novu/bridge
profiles:
- novu
networks:
- internal
environment:
- NOVU_SECRET_KEY
- NEXT_PUBLIC_NOVU_SECRET_KEY=${NOVU_SECRET_KEY}
- NEXT_PUBLIC_NOVU_APPLICATION_IDENTIFIER=${NOVU_APPLICATION_IDENTIFIER}
- NEXT_PUBLIC_NOVU_SUBSCRIBER_ID=${NOVU_SUBSCRIBER_ID}
labels:
- "traefik.enable=true"
- "traefik.project_name=${COMPOSE_PROJECT_NAME}"
- "traefik.http.routers.novu-bridge.rule=Host(`bridge-novu.${PHRASEA_DOMAIN}`)"
- "traefik.http.services.novu-bridge.loadbalancer.server.port=4000"
extra_hosts:
- api-novu.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}
- bridge-novu.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}
- studio-novu.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}
- novu.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}

volumes:
db:
Expand Down
1 change: 1 addition & 0 deletions infra/dev/hosts.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ ${IP} keycloak2.${PHRASEA_DOMAIN}
${IP} novu.${PHRASEA_DOMAIN}
${IP} ws-novu.${PHRASEA_DOMAIN}
${IP} api-novu.${PHRASEA_DOMAIN}
${IP} bridge-novu.${PHRASEA_DOMAIN}
# </${PHRASEA_DOMAIN}>
3 changes: 3 additions & 0 deletions infra/docker/dev/entrypoint.d/update-cert.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

update-ca-certificates
13 changes: 13 additions & 0 deletions novu/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
**/.git
**/.pnpm-store
**/build
**/dist
**/.build
**/*.log
**/coverage
**/Dockerfile
**/.dockerignore
**/node_modules
**/.idea
**/.gitignore
**/.github
8 changes: 8 additions & 0 deletions novu/bridge/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/Dockerfile
.dockerignore
node_modules
.idea
/bin
/.gitignore
/.github
/dist
3 changes: 3 additions & 0 deletions novu/bridge/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
27 changes: 27 additions & 0 deletions novu/bridge/.github/workflows/novu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Novu Sync

on:
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
# https://github.com/novuhq/actions-novu-sync
- name: Sync State to Novu
uses: novuhq/actions-novu-sync@v2
with:
# The secret key used to authenticate with Novu Cloud
# To get the secret key, go to https://dashboard.novu.co/api-keys.
# Required.
secret-key: ${{ secrets.NOVU_SECRET_KEY }}

# The publicly available endpoint hosting the bridge application
# where notification entities (eg. workflows, topics) are defined.
# Required.
bridge-url: ${{ secrets.NOVU_BRIDGE_URL }}

# The Novu Cloud API URL to sync with.
# Optional.
# Defaults to https://api.novu.co
api-url: https://api.novu.co
Loading

0 comments on commit 7c9360c

Please sign in to comment.