feat: add sidecar service for Sessionize sync
- Introduced a new Node HTTP service (sidecar) to sync event agendas from Sessionize into Convivo. - Implemented two import paths: API sync and Excel import for session and speaker data. - Added necessary database migrations for sessionize integration, including new columns and audit tables. - Created functions for handling speaker and session imports, ensuring proper error handling and logging. - Established row-level security and grants for new functions to restrict access to service-role only.
This commit is contained in:
1 parent
8054d0ace2
commit
f7aea663d8
31 files changed
+2729
-390
No files matched your search
+22
-7
@@ -4,10 +4,13 @@ Docker is the backbone. Two pieces:
|
||||
|
||||
1. **The Supabase core** — a set of containers managed by the **Supabase CLI**
|
||||
(not by a compose file in this repo). See [supabase-core.md](./supabase-core.md).
|
||||
2. **The app sidecars** — two containers, the attendee app
|
||||
([`apps/convivo/Dockerfile`](../../apps/convivo/Dockerfile), `:3000`) and the
|
||||
2. **The app sidecars** — the attendee app
|
||||
([`apps/convivo/Dockerfile`](../../apps/convivo/Dockerfile), `:3000`), the
|
||||
admin console ([`apps/admin/Dockerfile`](../../apps/admin/Dockerfile), `:3001`),
|
||||
and the **Sessionize sync sidecar**
|
||||
([`apps/sidecar/Dockerfile`](../../apps/sidecar/Dockerfile), `:3002`),
|
||||
orchestrated by the root [`docker-compose.yml`](../../docker-compose.yml).
|
||||
The sidecar is documented in [sidecar.md](./sidecar.md).
|
||||
|
||||
Each app container **joins the network the CLI created** for the core and proxies
|
||||
the Supabase same-origin paths to the Kong container. Both use the identical
|
||||
@@ -24,10 +27,13 @@ flowchart LR
|
||||
K["supabase_kong_Convivo<br/>:8000 (internal)"]
|
||||
APP["convivo-app<br/>nginx :3000"]
|
||||
ADM["convivo-admin<br/>nginx :3001"]
|
||||
SC["convivo-sidecar<br/>node :3002"]
|
||||
end
|
||||
CLI -.creates.-> Net
|
||||
APP -->|"proxy /auth /rest /realtime /storage"| K
|
||||
ADM -->|"proxy /auth /rest /realtime /storage"| K
|
||||
ADM -->|"proxy /sidecar/*"| SC
|
||||
SC -->|"service-role key"| K
|
||||
APP -->|"host port 3000"| U["Browser"]
|
||||
ADM -->|"host port 3001"| U
|
||||
```
|
||||
@@ -67,9 +73,10 @@ same-origin paths to the core:
|
||||
|
||||
## Root `docker-compose.yml`
|
||||
|
||||
Runs **only the apps** (the core is CLI-managed). There are two services —
|
||||
`convivo-app` (`:3000`) and `convivo-admin` (`:3001`) — with identical settings
|
||||
except the build context and port:
|
||||
Runs **only the apps** (the core is CLI-managed). There are three services —
|
||||
`convivo-app` (`:3000`), `convivo-admin` (`:3001`), and `convivo-sidecar`
|
||||
(`:3002`). The two nginx apps have identical settings except the build context
|
||||
and port:
|
||||
|
||||
| Setting | `convivo-app` | `convivo-admin` | Why |
|
||||
|---|---|---|---|
|
||||
@@ -79,6 +86,12 @@ except the build context and port:
|
||||
| `networks.supabase` | **external**, name `supabase_network_Convivo` | same | Joins the CLI-created network |
|
||||
| `healthcheck` | `wget http://127.0.0.1:3000/` | `wget http://127.0.0.1:3001/` | Container reports healthy |
|
||||
|
||||
The **`convivo-sidecar`** service is different: it builds
|
||||
[`apps/sidecar`](../../apps/sidecar) (a plain Node service, no nginx), exposes
|
||||
`:3002`, and carries the sidecar env vars (`SUPABASE_URL`,
|
||||
`SUPABASE_SERVICE_ROLE_KEY`, `SESSIONIZE_API_KEY`). It is the first server-side
|
||||
holder of the service-role key. See [sidecar.md](./sidecar.md).
|
||||
|
||||
> If you change `project_id` in `supabase/config.toml`, update the external
|
||||
> network name (`supabase_network_<project_id>`) and the default proxy target
|
||||
> (`supabase_kong_<project_id>:8000`) to match.
|
||||
@@ -92,7 +105,7 @@ npm run db:start
|
||||
# 2. (Optional) reset to clean seed data
|
||||
npm run db:reset
|
||||
|
||||
# 3. Build + run both app sidecars (:3000 + :3001)
|
||||
# 3. Build + run the app sidecars (:3000 + :3001) and the sync sidecar (:3002)
|
||||
docker compose up --build
|
||||
```
|
||||
|
||||
@@ -101,12 +114,14 @@ Open **http://localhost:3000** (attendee) and **http://localhost:3001** (admin).
|
||||
### Alternative: dev server (no app container)
|
||||
|
||||
For faster iteration you can skip the app containers and use the Vite dev
|
||||
servers, which proxy the same paths to `127.0.0.1:54321` (host port):
|
||||
servers, which proxy the same paths to `127.0.0.1:54321` (host port). The admin
|
||||
dev server also proxies `/sidecar` to `127.0.0.1:3002`, so start the sidecar too:
|
||||
|
||||
```bash
|
||||
npm run db:start
|
||||
npm run app:dev # attendee Vite on :3000
|
||||
npm run admin:dev # admin Vite on :3001
|
||||
npm run sidecar:dev # sync sidecar on :3002
|
||||
```
|
||||
|
||||
## Verified behavior
|
||||
|
||||
Reference in new issue
Block a user