From 2888a663b3bf5d0b8f467154ca600e6a31b9adb3 Mon Sep 17 00:00:00 2001 From: Jurie Smit Date: Sun, 10 May 2026 14:05:50 +0200 Subject: [PATCH] chore(convolens): db logical names + env defaults (PR 4/5) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Decouple the Cosmos logical database name from the Azure resource-naming prefix so the brand rename can land independently of an Azure resource rename. - apps/api/.env.example: header → ConvoLens; DB_NAME, AZURE_COSMOS_DATABASE, AZURE_SQL_DATABASE example values → convolens - apps/web/.env.example: header → ConvoLens - apps/api/src/config/azure/index.ts: AZURE_COSMOS_DATABASE default → 'convolens' - infra/bicep/main.bicep: header → ConvoLens; new param `databaseName` defaulting to 'convolens', wired into Cosmos module instead of `databaseName: projectName` so DB names move while resource names stay Azure resource names INTENTIONALLY UNCHANGED (rg-whatssummarize-*, kvwhatssummarizedev, cosmos-whatssummarize-dev, oai-whatssummarize-dev, etc.). Separate user decision tracked elsewhere. infra/scripts/* are unchanged for the same reason — PROJECT_NAME there drives resource lookups. Production note: any prod env using DB_NAME=whatssummarize for an already-deployed Cosmos database needs to set DB_NAME=whatssummarize explicitly at deploy time until data migrates. New deployments default to convolens. Co-Authored-By: Claude Opus 4.7 (1M context) --- apps/api/.env.example | 8 ++++---- apps/api/src/config/azure/index.ts | 2 +- apps/web/.env.example | 2 +- infra/bicep/main.bicep | 13 +++++++++---- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/apps/api/.env.example b/apps/api/.env.example index 9a2c9e2..cfaadfd 100644 --- a/apps/api/.env.example +++ b/apps/api/.env.example @@ -1,5 +1,5 @@ # =========================================== -# WhatsSummarize API Server - Environment Variables +# ConvoLens API Server - Environment Variables # =========================================== # Copy this file to .env and fill in your values # NEVER commit .env to version control @@ -21,7 +21,7 @@ DB_HOST=localhost DB_PORT=5432 DB_USERNAME=postgres DB_PASSWORD=postgres -DB_NAME=whatssummarize +DB_NAME=convolens DB_SYNCHRONIZE=false DB_LOGGING=false DB_MIGRATIONS_RUN=true @@ -106,12 +106,12 @@ FRONTEND_URL=http://localhost:3000 # Azure Cosmos DB (NoSQL database alternative) # AZURE_COSMOS_ENDPOINT=https://your-account.documents.azure.com # AZURE_COSMOS_KEY=your-cosmos-key -# AZURE_COSMOS_DATABASE=whatssummarize +# AZURE_COSMOS_DATABASE=convolens # AZURE_COSMOS_CONTAINER=chats # Azure SQL Database (relational database alternative) # AZURE_SQL_SERVER=your-server.database.windows.net -# AZURE_SQL_DATABASE=whatssummarize +# AZURE_SQL_DATABASE=convolens # AZURE_SQL_USERNAME=your-username # AZURE_SQL_PASSWORD=your-password # AZURE_SQL_ENCRYPT=true diff --git a/apps/api/src/config/azure/index.ts b/apps/api/src/config/azure/index.ts index 5f58cdd..1754587 100644 --- a/apps/api/src/config/azure/index.ts +++ b/apps/api/src/config/azure/index.ts @@ -130,7 +130,7 @@ export function getAzureCosmosDBConfig(): AzureCosmosDBConfig | null { return { endpoint, key, - databaseName: process.env.AZURE_COSMOS_DATABASE || 'whatssummarize', + databaseName: process.env.AZURE_COSMOS_DATABASE || 'convolens', containerName: process.env.AZURE_COSMOS_CONTAINER || 'chats', }; } diff --git a/apps/web/.env.example b/apps/web/.env.example index 450f465..322ec99 100644 --- a/apps/web/.env.example +++ b/apps/web/.env.example @@ -1,5 +1,5 @@ # =========================================== -# WhatsSummarize Web App - Environment Variables +# ConvoLens Web App - Environment Variables # =========================================== # Copy this file to .env.local and fill in your values # NEVER commit .env.local to version control diff --git a/infra/bicep/main.bicep b/infra/bicep/main.bicep index 2090042..f66f211 100644 --- a/infra/bicep/main.bicep +++ b/infra/bicep/main.bicep @@ -1,7 +1,7 @@ // ============================================================================= -// WhatsSummarize - Azure Infrastructure (Main Template) +// ConvoLens - Azure Infrastructure (Main Template) // ============================================================================= -// This template deploys all Azure resources required for WhatsSummarize. +// This template deploys all Azure resources required for ConvoLens. // Use with appropriate parameter files for each environment. // // Resources deployed: @@ -30,11 +30,16 @@ param environment string = 'dev' @description('Azure region for resources') param location string = resourceGroup().location -@description('Project name used for resource naming') +@description('Project name used for resource naming. Resource names retain the legacy "whatssummarize" prefix until a separate user-driven Azure rename decision lands.') @minLength(3) @maxLength(15) param projectName string = 'whatssummarize' +@description('Logical database name used for Cosmos DB (and future Azure SQL). Decoupled from projectName so the brand rename can land without renaming Azure resources. Override at deploy time only when migrating data.') +@minLength(3) +@maxLength(40) +param databaseName string = 'convolens' + @description('Enable Azure OpenAI deployment') param enableOpenAI bool = true @@ -152,7 +157,7 @@ module cosmosDB 'modules/cosmos-db.bicep' = if (enableCosmosDB) { name: 'cosmos-${resourcePrefix}' location: location tags: tags - databaseName: projectName + databaseName: databaseName containers: [ { name: 'users'