From 5d867dd519b48807480e1535fe232c7ae50f21b2 Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Mon, 19 Jan 2026 17:20:01 +0100 Subject: [PATCH] refactor: update application name and related identifiers from Analytics to Pulse for consistent branding across the codebase --- app/actions/auth.ts | 4 ++-- components/dashboard/Chart.tsx | 2 +- lib/api/client.ts | 4 ++-- lib/api/oauth.ts | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- public/script.js | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/actions/auth.ts b/app/actions/auth.ts index 4d4f8b0..9dbff34 100644 --- a/app/actions/auth.ts +++ b/app/actions/auth.ts @@ -5,7 +5,7 @@ import { cookies } from 'next/headers' const AUTH_API_URL = process.env.NEXT_PUBLIC_AUTH_API_URL || process.env.NEXT_PUBLIC_AUTH_URL || 'http://localhost:8081' // * Determine cookie domain dynamically -// * In production (on ciphera.net), we want to share cookies with subdomains (e.g. analytics-api.ciphera.net) +// * In production (on ciphera.net), we want to share cookies with subdomains (e.g. pulse-api.ciphera.net) // * In local dev (localhost), we don't set a domain const getCookieDomain = () => { if (process.env.NODE_ENV === 'production') { @@ -37,7 +37,7 @@ export async function exchangeAuthCode(code: string, codeVerifier: string, redir body: JSON.stringify({ grant_type: 'authorization_code', code, - client_id: 'analytics-app', + client_id: 'pulse-app', redirect_uri: redirectUri, code_verifier: codeVerifier, }), diff --git a/components/dashboard/Chart.tsx b/components/dashboard/Chart.tsx index 63ce087..38f0b40 100644 --- a/components/dashboard/Chart.tsx +++ b/components/dashboard/Chart.tsx @@ -82,7 +82,7 @@ export default function Chart({ data, prevData, stats, prevStats, interval }: Ch const encodedUri = encodeURI(csvContent) const link = document.createElement("a") link.setAttribute("href", encodedUri) - link.setAttribute("download", `analytics_export_${new Date().toISOString().split('T')[0]}.csv`) + link.setAttribute("download", `pulse_export_${new Date().toISOString().split('T')[0]}.csv`) document.body.appendChild(link) link.click() document.body.removeChild(link) diff --git a/lib/api/client.ts b/lib/api/client.ts index 7d9ee0f..6593fa8 100644 --- a/lib/api/client.ts +++ b/lib/api/client.ts @@ -9,12 +9,12 @@ export const AUTH_API_URL = process.env.NEXT_PUBLIC_AUTH_API_URL || 'https://aut export function getLoginUrl(redirectPath = '/auth/callback') { const redirectUri = encodeURIComponent(`${APP_URL}${redirectPath}`) - return `${AUTH_URL}/login?client_id=analytics-app&redirect_uri=${redirectUri}&response_type=code` + return `${AUTH_URL}/login?client_id=pulse-app&redirect_uri=${redirectUri}&response_type=code` } export function getSignupUrl(redirectPath = '/auth/callback') { const redirectUri = encodeURIComponent(`${APP_URL}${redirectPath}`) - return `${AUTH_URL}/signup?client_id=analytics-app&redirect_uri=${redirectUri}&response_type=code` + return `${AUTH_URL}/signup?client_id=pulse-app&redirect_uri=${redirectUri}&response_type=code` } export class ApiError extends Error { diff --git a/lib/api/oauth.ts b/lib/api/oauth.ts index b9d306c..851856b 100644 --- a/lib/api/oauth.ts +++ b/lib/api/oauth.ts @@ -52,7 +52,7 @@ export async function initiateOAuthFlow(redirectPath = '/auth/callback') { const redirectUri = encodeURIComponent(`${APP_URL}${redirectPath}`) - const loginUrl = `${AUTH_URL}/login?client_id=analytics-app&redirect_uri=${redirectUri}&response_type=code&state=${state}&code_challenge=${codeChallenge}&code_challenge_method=S256` + const loginUrl = `${AUTH_URL}/login?client_id=pulse-app&redirect_uri=${redirectUri}&response_type=code&state=${state}&code_challenge=${codeChallenge}&code_challenge_method=S256` window.location.href = loginUrl } @@ -68,7 +68,7 @@ export async function initiateSignupFlow(redirectPath = '/auth/callback') { const redirectUri = encodeURIComponent(`${APP_URL}${redirectPath}`) - const signupUrl = `${AUTH_URL}/signup?client_id=analytics-app&redirect_uri=${redirectUri}&response_type=code&state=${state}&code_challenge=${codeChallenge}&code_challenge_method=S256` + const signupUrl = `${AUTH_URL}/signup?client_id=pulse-app&redirect_uri=${redirectUri}&response_type=code&state=${state}&code_challenge=${codeChallenge}&code_challenge_method=S256` window.location.href = signupUrl } diff --git a/package-lock.json b/package-lock.json index 84bcdc3..cfca4ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "analytics-frontend", + "name": "pulse-frontend", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "analytics-frontend", + "name": "pulse-frontend", "version": "0.1.0", "dependencies": { "@ciphera-net/ui": "^0.0.6", diff --git a/package.json b/package.json index 3dd5cdb..a007c9e 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "analytics-frontend", + "name": "pulse-frontend", "version": "0.1.0", "private": true, "scripts": { diff --git a/public/script.js b/public/script.js index 4a7af1c..8734dbf 100644 --- a/public/script.js +++ b/public/script.js @@ -19,7 +19,7 @@ } const domain = script.getAttribute('data-domain'); - const apiUrl = script.getAttribute('data-api') || 'https://analytics-api.ciphera.net'; + const apiUrl = script.getAttribute('data-api') || 'https://pulse-api.ciphera.net'; // * Performance Monitoring (Core Web Vitals) State let currentEventId = null;