# Web User UI — TanStack Start App ## Overview Create `apps/web-ui` — a server-rendered web app using TanStack Start, Tailwind CSS, shadcn/ui, and tRPC. It mirrors `apps/user-ui` functionality (auth, products, stores, 1hr delivery, cart, checkout, orders, addresses, coupons, complaints, profile) excluding mobile-only features (notifications, location, haptics, hardware back, status bar) and payment (COD only). Create `packages/web-components` — a shared web component library with shadcn primitives and domain components used by the web-ui app. --- ## Phase 1: Initialize `packages/web-components` ### 1.1 Create the package ``` packages/web-components/ ├── package.json # name: "web-components", private: true ├── tsconfig.json ├── tailwind.config.ts ├── postcss.config.js ├── globals.css # Tailwind base + CSS variables from shadcn ├── components.json # shadcn config ├── src/ │ ├── index.ts # barrel export │ ├── lib/ │ │ ├── utils.ts # cn() helper (clsx + tailwind-merge) │ │ └── constants.ts # shared constants │ ├── components/ │ │ └── ui/ # shadcn primitives (added via CLI) │ ├── hooks/ │ └── services/ ``` ### 1.2 Steps 1. Create `packages/web-components/package.json`: - name: `web-components` - main: `./src/index.ts` - types: `./src/index.ts` - private: true - peerDependencies: `react`, `react-dom`, `tailwindcss`, `class-variance-authority`, `clsx`, `tailwind-merge`, `lucide-react` - devDependencies: `typescript`, `@types/react`, `tailwindcss`, `postcss`, `autoprefixer` 2. Create `tsconfig.json`: - jsx: `react-jsx` - strict: true - paths: `@/*` -> `./src/*` 3. Initialize Tailwind: - `npx tailwindcss init` in the package - Configure `content` paths to scan `./src/**/*.{ts,tsx}` 4. Initialize shadcn: - Run `npx shadcn@latest init` inside `packages/web-components` - Config values: - style: default - base color: neutral / slate - CSS variables: yes - globals.css path: `./globals.css` - components path: `./src/components/ui` - utils path: `./src/lib/utils.ts` - tailwind config: `./tailwind.config.ts` 5. Install shadcn UI primitives via CLI: - `npx shadcn@latest add button -p .` - `npx shadcn@latest add input -p .` - `npx shadcn@latest add dialog -p .` - `npx shadcn@latest add card -p .` - `npx shadcn@latest add badge -p .` - `npx shadcn@latest add checkbox -p .` - `npx shadcn@latest add sheet -p .` - `npx shadcn@latest add separator -p .` - `npx shadcn@latest add scroll-area -p .` - `npx shadcn@latest add select -p .` - `npx shadcn@latest add tabs -p .` - `npx shadcn@latest add alert-dialog -p .` - `npx shadcn@latest add avatar -p .` 6. Build domain components in `packages/web-components/src/components/`: | Component | Web Implementation | Mirrors from `common-ui` | |-----------|-------------------|--------------------------| | `my-text.tsx` | `

`/`` with Tailwind + variant props | text.tsx | | `my-button.tsx` | Wraps shadcn `Button` with color variants | button.tsx | | `my-text-input.tsx` | Wraps shadcn `Input` with label + error | textinput.tsx | | `my-touchable-opacity.tsx` | `