From b5458ccab57ee1be4f29688f00b9a78d7b9c1338 Mon Sep 17 00:00:00 2001 From: Umar Adilov <99314948+adilovcode@users.noreply.github.com> Date: Fri, 16 Jan 2026 17:55:33 +0500 Subject: [PATCH 1/6] Added deploy steps --- taylordb.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/taylordb.yml b/taylordb.yml index ab3a199..4b6d660 100644 --- a/taylordb.yml +++ b/taylordb.yml @@ -24,6 +24,26 @@ services: TAYLORDB_API_TOKEN: secrets.TAYLORDB_API_TOKEN TAYLORDB_SERVER_ID: vars.TAYLORDB_SERVER_ID FRONTEND_URL: routing.client.url + + start: + command: pnpm start --port 3000 + port: 3000 + env: + vars: + TAYLORDB_BASE_URL: vars.TAYLORDB_INTERNAL_BASE_URL + TAYLORDB_API_TOKEN: secrets.TAYLORDB_API_TOKEN + TAYLORDB_SERVER_ID: vars.TAYLORDB_SERVER_ID + FRONTEND_URL: routing.client.url + + build: + commands: + - pnpm build + env: + vars: + TAYLORDB_BASE_URL: vars.TAYLORDB_INTERNAL_BASE_URL + TAYLORDB_API_TOKEN: secrets.TAYLORDB_API_TOKEN + TAYLORDB_SERVER_ID: vars.TAYLORDB_SERVER_ID + FRONTEND_URL: routing.client.url client: workDir: apps/client @@ -36,6 +56,19 @@ services: env: vars: VITE_TRPC_URL: routing.server.url + start: + command: pnpm preview --port 5173 + port: 5173 + env: + vars: + VITE_TRPC_URL: routing.server.url + + build: + commands: + - pnpm build + env: + vars: + VITE_TRPC_URL: routing.server.url taylordb: types: From 507b345fab54da5939a25ea8d87c03c5bebad6f0 Mon Sep 17 00:00:00 2001 From: Umar Adilov <99314948+adilovcode@users.noreply.github.com> Date: Fri, 16 Jan 2026 23:51:40 +0500 Subject: [PATCH 2/6] Added esbuild as dev dependency --- apps/server/package.json | 1 + pnpm-lock.yaml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/apps/server/package.json b/apps/server/package.json index 2291ebf..e0c6faa 100644 --- a/apps/server/package.json +++ b/apps/server/package.json @@ -25,6 +25,7 @@ "@types/express": "^5.0.6", "@types/node": "^24.10.1", "concurrently": "^9.2.1", + "esbuild": "^0.27.2", "tsx": "^4.21.0", "typescript": "~5.9.3" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1456c45..597056a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -166,6 +166,9 @@ importers: concurrently: specifier: ^9.2.1 version: 9.2.1 + esbuild: + specifier: ^0.27.2 + version: 0.27.2 tsx: specifier: ^4.21.0 version: 4.21.0 From 0d74f211a9cf30b278452dabbd8d5c1ce6fe662f Mon Sep 17 00:00:00 2001 From: Umar Adilov <99314948+adilovcode@users.noreply.github.com> Date: Sat, 17 Jan 2026 00:14:56 +0500 Subject: [PATCH 3/6] Fixed build execution --- apps/server/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/server/package.json b/apps/server/package.json index e0c6faa..8676f51 100644 --- a/apps/server/package.json +++ b/apps/server/package.json @@ -10,7 +10,7 @@ }, "scripts": { "dev": "tsx watch index.ts", - "build": "npx esbuild index.ts --bundle --outfile=dist/index.js --format=esm --platform=node --packages=external", + "build": "pnpm exec esbuild index.ts --bundle --outfile=dist/index.js --format=esm --platform=node --packages=external", "start": "node dist/index.js" }, "dependencies": { From f7419462f1afcaf2380702fa3cf37d51596e1fbe Mon Sep 17 00:00:00 2001 From: Umar Adilov <99314948+adilovcode@users.noreply.github.com> Date: Sat, 17 Jan 2026 16:38:23 +0500 Subject: [PATCH 4/6] Fixed BASE_URL for build --- apps/client/src/lib/trpc.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/apps/client/src/lib/trpc.ts b/apps/client/src/lib/trpc.ts index 0b8e077..6761495 100644 --- a/apps/client/src/lib/trpc.ts +++ b/apps/client/src/lib/trpc.ts @@ -11,14 +11,7 @@ export const trpc: CreateTRPCReact = /** * Get the base URL for tRPC requests */ -function getBaseUrl() { - if (typeof window !== "undefined") { - // Browser: use relative URL or environment variable - return import.meta.env.VITE_TRPC_URL || "http://localhost:3001/api"; - } - // SSR: assume localhost - return "http://localhost:3001/api"; -} +const BASE_URL = import.meta.env.VITE_TRPC_URL || "http://localhost:3001/api"; /** * Create tRPC client @@ -26,7 +19,7 @@ function getBaseUrl() { export const trpcClient: TRPCClient = trpc.createClient({ links: [ httpBatchLink({ - url: `${getBaseUrl()}/trpc`, + url: `${BASE_URL}/trpc`, // Optional: add headers, credentials, etc. // headers() { // return { From ef9ce95a793852b345756da3ca00c1b755433bdf Mon Sep 17 00:00:00 2001 From: Umar Adilov <99314948+adilovcode@users.noreply.github.com> Date: Mon, 19 Jan 2026 13:33:48 +0500 Subject: [PATCH 5/6] Added env for client connection --- apps/client/src/lib/trpc.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/client/src/lib/trpc.ts b/apps/client/src/lib/trpc.ts index 6761495..ea7d6a7 100644 --- a/apps/client/src/lib/trpc.ts +++ b/apps/client/src/lib/trpc.ts @@ -11,7 +11,10 @@ export const trpc: CreateTRPCReact = /** * Get the base URL for tRPC requests */ -const BASE_URL = import.meta.env.VITE_TRPC_URL || "http://localhost:3001/api"; +const BASE_URL = + process.env.VITE_TRPC_URL || + import.meta.env.VITE_TRPC_URL || + "http://localhost:3001/api"; /** * Create tRPC client From c494d0b855b16689aed905b21f13c2c3f559fdae Mon Sep 17 00:00:00 2001 From: Umar Adilov <99314948+adilovcode@users.noreply.github.com> Date: Mon, 19 Jan 2026 13:38:53 +0500 Subject: [PATCH 6/6] Added env for client connection --- apps/client/src/lib/trpc.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/client/src/lib/trpc.ts b/apps/client/src/lib/trpc.ts index ea7d6a7..7733109 100644 --- a/apps/client/src/lib/trpc.ts +++ b/apps/client/src/lib/trpc.ts @@ -12,7 +12,8 @@ export const trpc: CreateTRPCReact = * Get the base URL for tRPC requests */ const BASE_URL = - process.env.VITE_TRPC_URL || + (typeof globalThis.process !== "undefined" && + globalThis.process.env?.VITE_TRPC_URL) || import.meta.env.VITE_TRPC_URL || "http://localhost:3001/api";