From 07e53d6aa1c8802eb17d200b72dd486c0148e54e Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Tue, 3 Mar 2026 13:53:50 -0800 Subject: [PATCH] feat: add Twenty CRM /crm route + deploy stack for commons-hub lead funnel Adds dedicated /crm sub-route to rNetwork module embedding Twenty CRM via ExternalAppShell iframe. Updates TWENTY_API_URL to use internal Docker networking (http://twenty-server:3000). Includes full Twenty CRM Docker stack (server, worker, postgres, redis) with Traefik routing for crm.rspace.online and deployment instructions. Co-Authored-By: Claude Opus 4.6 --- deploy/twenty-crm/.env.example | 10 ++ deploy/twenty-crm/DEPLOY.md | 123 ++++++++++++++++++++++++ deploy/twenty-crm/docker-compose.yml | 137 +++++++++++++++++++++++++++ docker-compose.yml | 2 +- modules/rnetwork/mod.ts | 14 +++ 5 files changed, 285 insertions(+), 1 deletion(-) create mode 100644 deploy/twenty-crm/.env.example create mode 100644 deploy/twenty-crm/DEPLOY.md create mode 100644 deploy/twenty-crm/docker-compose.yml diff --git a/deploy/twenty-crm/.env.example b/deploy/twenty-crm/.env.example new file mode 100644 index 0000000..d467fae --- /dev/null +++ b/deploy/twenty-crm/.env.example @@ -0,0 +1,10 @@ +# Twenty CRM secrets +# Generate these before first deploy: +# APP_SECRET: openssl rand -hex 32 +# POSTGRES_PASSWORD: openssl rand -hex 16 + +POSTGRES_PASSWORD=changeme +APP_SECRET=changeme + +# Store these in Infisical (twenty-crm project) for production. +# The .env file is only used for initial bootstrap / local dev. diff --git a/deploy/twenty-crm/DEPLOY.md b/deploy/twenty-crm/DEPLOY.md new file mode 100644 index 0000000..ca2491d --- /dev/null +++ b/deploy/twenty-crm/DEPLOY.md @@ -0,0 +1,123 @@ +# Twenty CRM Deployment — commons-hub Lead Funnel + +## 1. Deploy Twenty CRM Stack on Netcup + +```bash +# SSH to server +ssh netcup-full + +# Create directory and copy files +mkdir -p /opt/twenty-crm +# (copy docker-compose.yml and .env from this directory) + +# Generate secrets +cd /opt/twenty-crm +cat > .env < { ]); }); +// ── CRM sub-route — dedicated iframe to Twenty CRM ── +routes.get("/crm", (c) => { + const space = c.req.param("space") || "demo"; + return c.html(renderExternalAppShell({ + title: `${space} — CRM | rSpace`, + moduleId: "rnetwork", + spaceSlug: space, + modules: getModuleInfoList(), + appUrl: "https://crm.rspace.online", + appName: "Twenty CRM", + theme: "dark", + })); +}); + // ── Page route ── routes.get("/", (c) => { const space = c.req.param("space") || "demo";