Compare commits

...

9 Commits
main ... main

Author SHA1 Message Date
16e1c8ee40 chore: sync package-lock.json with upstream deps 2026-10-30 11:59:51 +05:30
71c0671a25 chore: sync package-lock.json with upstream deps 2026-10-30 11:58:48 +05:30
26ec688fec Merge remote-tracking branch 'upstream/main'
# Conflicts:
#	app/lib/pocketbase.ts
#	app/routes/admin/login.tsx
#	yarn.lock
2026-10-30 11:47:42 +05:30
Dikshantpatil2077
d085cbca26 feat: add AR illustration and armchair components with animations 2026-10-09 15:41:36 +05:30
Dikshantpatil2077
a7836f0c4b feat: enhance login page with improved error handling and UI updates 2026-10-09 15:37:37 +05:30
Dikshantpatil2077
21371410d4 Merge remote-tracking branch 'upstream/main'
# Conflicts:
#	app/routes/admin/login.tsx
2026-10-09 15:19:45 +05:30
Dikshantpatil2077
e29ad75c55 fix: bake VITE_POCKETBASE_URL into image, guard against empty value 2026-09-07 16:41:21 +05:30
24b0c5889f test: added test code for debugging purpose 2026-08-21 19:26:13 +05:30
4e69cfe270 Refactor code structure for improved readability and maintainability 2026-08-17 15:41:57 +05:30
7 changed files with 4161 additions and 5330 deletions

3
.gitignore vendored
View File

@ -13,3 +13,6 @@
# Keep the root pb_migrations folder tracked (empty placeholder for production) # Keep the root pb_migrations folder tracked (empty placeholder for production)
!/pb_migrations/.gitkeep !/pb_migrations/.gitkeep
.yarn

Binary file not shown.

View File

@ -1,8 +1,15 @@
import PocketBase from 'pocketbase'; import PocketBase from 'pocketbase';
import { reachableUrl } from '~/lib/local-url'; import { reachableUrl } from '~/lib/local-url';
const envUrl = (import.meta.env.VITE_POCKETBASE_URL ?? '').trim();
// VITE_ vars are inlined at build time, so a production image built without --build-arg VITE_POCKETBASE_URL must fail loudly
if (!envUrl && import.meta.env.PROD) {
throw new Error('VITE_POCKETBASE_URL is not set. Pass it as a --build-arg when building the Docker image; setting it at runtime has no effect.');
}
// Defaults to the local PocketBase dev server when VITE_POCKETBASE_URL is unset // Defaults to the local PocketBase dev server when VITE_POCKETBASE_URL is unset
const rawUrl = (import.meta.env.VITE_POCKETBASE_URL ?? '').trim() || 'http://127.0.0.1:8099'; const rawUrl = envUrl || 'http://127.0.0.1:8099';
// Ensure URL always has a protocol so PocketBase SDK treats it as absolute // Ensure URL always has a protocol so PocketBase SDK treats it as absolute
const pbUrl = rawUrl.startsWith('http') ? rawUrl : `https://${rawUrl}`; const pbUrl = rawUrl.startsWith('http') ? rawUrl : `https://${rawUrl}`;

View File

@ -1,11 +1,28 @@
#!/bin/bash #!/bin/bash
set -e set -euo pipefail
REGISTRY="registry.digitalocean.com/thob-blr1" REGISTRY="registry.digitalocean.com/thob-blr1"
SHA=$(git rev-parse --short=10 HEAD) SHA=$(git rev-parse --short=10 HEAD)
# Load .env if present, so VITE_* don't have to be exported by hand.
if [ -f .env ]; then
echo "Loading build vars from .env"
set -a
# shellcheck disable=SC1091
. ./.env
set +a
fi
# VITE_ vars are inlined into the client bundle at BUILD time. If they are empty
# here, the app ships with a broken PocketBase URL (https://api/...) that fails
# in the browser as a DNS error resembling CORS. Refuse to build.
: "${VITE_POCKETBASE_URL:?VITE_POCKETBASE_URL is not set — export it or add it to .env}"
: "${VITE_FRONTEND_URL:?VITE_FRONTEND_URL is not set — export it or add it to .env}"
echo "Building commit: $SHA" echo "Building commit: $SHA"
echo " VITE_POCKETBASE_URL=$VITE_POCKETBASE_URL"
echo " VITE_FRONTEND_URL=$VITE_FRONTEND_URL"
# Login # Login
doctl registry login doctl registry login
@ -14,13 +31,25 @@ doctl registry login
echo "Building AR App..." echo "Building AR App..."
docker buildx build \ docker buildx build \
--platform linux/amd64 \ --platform linux/amd64 \
--build-arg VITE_POCKETBASE_URL=$VITE_POCKETBASE_URL \ --build-arg "VITE_POCKETBASE_URL=$VITE_POCKETBASE_URL" \
--build-arg VITE_FRONTEND_URL=$VITE_FRONTEND_URL \ --build-arg "VITE_FRONTEND_URL=$VITE_FRONTEND_URL" \
-f Dockerfile \ -f Dockerfile \
--load \ --load \
-t $REGISTRY/ar:$SHA \ -t "$REGISTRY/ar:$SHA" \
-t $REGISTRY/ar:latest . -t "$REGISTRY/ar:latest" .
docker push $REGISTRY/ar:$SHA
docker push $REGISTRY/ar:latest
echo "✅ All images built and pushed successfully" # Verify the URL actually made it into the client bundle before pushing.
echo "Verifying baked-in PocketBase URL..."
PB_HOST=$(echo "$VITE_POCKETBASE_URL" | sed -e 's#^https\?://##' -e 's#/.*$##')
if ! docker run --rm --entrypoint sh "$REGISTRY/ar:$SHA" \
-c "grep -rq '$PB_HOST' /app/build/client"; then
echo "❌ Build verification failed: '$PB_HOST' not found in the client bundle."
echo " The image was NOT pushed."
exit 1
fi
echo "✅ Verified: $PB_HOST is baked into the client bundle"
docker push "$REGISTRY/ar:$SHA"
docker push "$REGISTRY/ar:latest"
echo "✅ All images built and pushed successfully (tag: $SHA)"

View File

@ -79,9 +79,10 @@ services:
- VITE_POCKETBASE_URL=${VITE_POCKETBASE_URL:-https://pb.ar.thob.studio} - VITE_POCKETBASE_URL=${VITE_POCKETBASE_URL:-https://pb.ar.thob.studio}
expose: expose:
- "3000" - "3000"
# NOTE: VITE_* vars are inlined into the client bundle at BUILD time by Vite.
# Setting them here has NO effect on the pulled image — they must be passed
# as --build-arg in build-and-push.sh. Only server-side vars belong below.
environment: environment:
- VITE_POCKETBASE_URL=${VITE_POCKETBASE_URL:-https://pb.ar.thob.studio}
- VITE_FRONTEND_URL=${VITE_FRONTEND_URL:-https://ar.thob.studio}
- INTERNAL_POCKETBASE_URL=http://ar-pb:8090 - INTERNAL_POCKETBASE_URL=http://ar-pb:8090
depends_on: depends_on:
- pocketbase - pocketbase
@ -89,6 +90,9 @@ services:
- traefik - traefik
labels: labels:
- "wud.watch=true" - "wud.watch=true"
# Required: the :latest tag doesn't change, so wud must compare digests
# to notice a new image was pushed to the same tag.
- "wud.watch.digest=true"
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.docker.network=traefik" - "traefik.docker.network=traefik"
- "traefik.http.routers.ar-app.rule=Host(`ar.thob.studio`)" - "traefik.http.routers.ar-app.rule=Host(`ar.thob.studio`)"
@ -121,4 +125,4 @@ services:
- "traefik.http.routers.ar-pb.tls=true" - "traefik.http.routers.ar-pb.tls=true"
- "traefik.http.routers.ar-pb.tls.certresolver=letsencrypt" - "traefik.http.routers.ar-pb.tls.certresolver=letsencrypt"
- "traefik.http.routers.ar-pb.service=ar-pb" - "traefik.http.routers.ar-pb.service=ar-pb"
- "traefik.http.services.ar-pb.loadbalancer.server.port=8090" - "traefik.http.services.ar-pb.loadbalancer.server.port=8090"

1556
package-lock.json generated

File diff suppressed because it is too large Load Diff

7868
yarn.lock

File diff suppressed because it is too large Load Diff