--- name: sheds-store-frontend description: How to build UI in sheds.store-new - Astro pages, Vue single-file components mounted as islands, client directives, nanostores, path aliases, Tailwind classes, and how to port a React component to Vue. Use when adding or changing a page, component, form, calculator, configurator, chart, modal, or any interactive widget on sheds.store, or when handed React/JSX code that needs to go into sheds.store. --- # sheds.store frontend Pages are `.astro` files rendered on the server. Anything interactive is a Vue single-file component (`.vue`) that the page mounts as an island. There's no React anywhere in the repo, and none gets added. ## Where things go | Thing | Path | | --- | --- | | Route | `src/pages/.astro` (file-based routing) | | API route | `src/pages/api//.ts`, exporting `GET`/`POST` as `APIRoute`, with `export const prerender = false` | | Static or server-rendered component | `src/components/astro//.astro` | | Interactive component | `src/components/vue//.vue` | | Helpers only one component tree uses (drawing code, its API calls, UI classes) | Next to the components, in `src/components/vue//`, the way `shed-builder/` keeps `api.ts` and `diagram/` | | Page shell | `src/layouts/base.astro` (marketplace), `auth.astro`, partials in `src/layouts/partials/`. `base.astro` takes `noindex` and `robots` props, so don't add your own robots meta. | | Shared client state | `src/store/store.ts` (nanostores) | | Pure helpers | `src/lib/utils/.ts`. A large ported engine can keep its own folder (`src/lib/utils//`) and stay in JS with JSDoc, so the port reads as a move. Write new code in TypeScript. | | Server-only code | `src/lib/server/` (never import it from a `.vue` file) | | Constants and copy | `src/lib/constants/` | | Site config | `src/config/*.json` (`theme.json` holds colours and the type scale) | File names are `snake_case.vue` / `snake_case.astro`. The component's `name` option is PascalCase. Path aliases (from `tsconfig.json`): `@components/*`, `@layouts/*`, `@partials/*`, `@lib/*`, `@store/*`, `@config/*`, `@styles/*`, `@images/*`, `@icons/*`, `@middleware/*`, `@js/*`, and `@supabase/*`. Note that `@supabase/*` points at `src/supabase/`, not the npm scope. The npm client is imported as `@supabase/supabase-js`. ## Vue house style The codebase uses the **Options API** in a plain ` ``` `