Adds a public funnel landing at `/` and moves the login to `/login`, rebuilt around the panel's own colors instead of an invented palette. Landing (`src/components/landing/`, one section per file, no props): - Seven funnel sections composed by `LandingPage`. The hero's eight swatches are literally `PIE_COLORS` from `DashboardPage`, the same hex values the seed hands to avatars and services, so "your colors become your numbers" is literal. - `BrandMark` becomes the single source for the logo, replicating `public/favicon.svg`. Blue is the action surface, orange only ever marks. - `NotebookVisual` is the one deliberate exception to the palette: it is what the product replaces. - Copy drops all system vocabulary; motion comes from `src/lib/motion.ts` with a single easing, and reduced-motion resolves `initial` to the final state so a never-firing `whileInView` cannot leave a section invisible forever. Routing and bundle: - `homePathFor` is the single definition of each role's destination. - Landing, login, dashboard and calendar load lazily. Eager, the login dragged framer-motion (~40 KB gz) into every panel load and the landing downloaded recharts + FullCalendar (~187 KB gz) without charting anything. `clsx` is pinned to the `react` chunk because Rollup otherwise assigns it to `charts`, making the entry import 111 KB gz for a 200-byte utility. Responsiveness (iPhone/iPad), verified with `npm run audit:responsive`: - No touch form field below 16px, `dvh` height utilities, safe-area insets, and 40px touch targets keyed off `pointer: coarse` rather than `sm:`. - New `.ld-gutter`: `.safe-x` lives outside `@layer` and beats Tailwind's `px-*`, so it left the login's side padding at 0 on anything but an iPhone in landscape. No overflow check could see it — there was no overflow, just zero margin. The audit now guards it with a `gutter` check. - `shell-height` no longer fires on pages that legitimately scroll; the static `raw-viewport-unit` scan covers those instead. Production build: - The Dockerfile now sets `VITE_DEMO_UI=1` as a build arg. `DEMO` is a build-time constant, so without it Vite eliminated the magic login and the "Ver como…" switcher: the deployed landing promised "no registration" and led to an empty form. Verified by building both ways and diffing the bundle. - Service worker cache bumped to v2 so the orphaned pre-landing chunks get purged from returning visitors' caches. Verified: typecheck clean; unit 39/39, e2e 33/33, admin 17/17, booking 12/12, landing 13/13 (WebKit), PWA passed against the real production build. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
47 lines
1.4 KiB
Docker
47 lines
1.4 KiB
Docker
# ---- Build frontend ----
|
|
FROM node:22-slim AS web-build
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm ci
|
|
COPY . .
|
|
|
|
# El login mágico y el "Ver como…" del panel viven detrás de la constante de build
|
|
# `DEMO` (`import.meta.env.DEV || import.meta.env.VITE_DEMO_UI === "1"`, ver
|
|
# src/pages/LoginPage.tsx, src/components/AppShell.tsx y src/components/DemoSwitcher.tsx).
|
|
# En un build de producción `DEV` es false, así que sin esta variable Vite elimina esas
|
|
# ramas por dead-code elimination: el despliegue quedaba con la landing prometiendo
|
|
# "no pide registro" y un /login sin ninguna cuenta de prueba que ofrecer.
|
|
#
|
|
# Este despliegue ES la demostración del producto, de ahí el default en 1. Cuando deje
|
|
# de serlo, basta pasar `--build-arg VITE_DEMO_UI=0` (o declararlo como build variable en
|
|
# Coolify) y las cuentas demo desaparecen del bundle sin tocar código.
|
|
ARG VITE_DEMO_UI=1
|
|
ENV VITE_DEMO_UI=$VITE_DEMO_UI
|
|
|
|
RUN npm run build
|
|
|
|
# ---- Runtime ----
|
|
FROM node:22-slim
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production
|
|
ENV HOST=0.0.0.0
|
|
ENV PORT=3000
|
|
|
|
COPY package*.json ./
|
|
RUN npm ci --omit=dev && npm cache clean --force
|
|
|
|
# Built frontend (vite outputs to dist/)
|
|
COPY --from=web-build /app/dist ./dist
|
|
|
|
# Server source (tsx runs TS directly in production)
|
|
COPY server ./server
|
|
COPY shared ./shared
|
|
COPY tsconfig.json ./
|
|
|
|
# Persistent SQLite data
|
|
RUN mkdir -p /app/data
|
|
VOLUME /app/data
|
|
|
|
EXPOSE 3000
|
|
CMD ["npx", "tsx", "server/index.ts"]
|