SSR (universal) storefront for estore, built with Nuxt 4 / Vue 3. It targets the
root-owned OpenAPI contract (../estore/contract/openapi.yaml), not any single backend — so the
same app runs unchanged against the Laravel, Spring Boot, or .NET implementations.
- Nuxt 4 (SSR) + Vue 3 + vue-router
- Pinia (
@pinia/nuxt) for state (auth,cart) - openapi-typescript — generates
app/types/api.tsfrom the contract; a thin typed wrapper over Nuxt's native$fetch/useFetch(no extra runtime client) - pnpm
pnpm install # installs deps + runs `nuxt prepare`
cp .env.example .env # then edit NUXT_PUBLIC_API_BASE if needed
pnpm dev # http://localhost:3000The frontend talks to the backend at NUXT_PUBLIC_API_BASE
(default http://localhost:8000/api/v1, i.e. estore-laravel via php artisan serve).
| Script | Purpose |
|---|---|
pnpm dev |
Dev server (HMR) |
pnpm build / pnpm preview |
Production build / preview |
pnpm gen:api |
Regenerate app/types/api.ts from ../estore/contract/openapi.yaml |
pnpm typecheck |
vue-tsc type check across the app |
app/types/api.tsis committed so the app builds out of the box. Re-runpnpm gen:apiwhenever the contract changes (it reads../estore/contract, available in the monorepo checkout).
app/
composables/ useApi (imperative $fetch) · useApiFetch (SSR useFetch) · useTokens (cookies)
stores/ auth · cart (Pinia, auto-imported)
types/ api.ts (generated) · index.ts (aliases)
utils/ formatMoney · getProblem (RFC 9457 helper)
layouts/ default (header/nav/footer)
pages/ index · products/ (storefront skeleton)
assets/css/ main.css
- The Sanctum bearer token and guest cart token live in cookies (
useTokens) so SSR requests are authenticated.useApiattachesAuthorizationandX-Cart-Token. - API errors carry the backend's RFC 9457 Problem Details body; read it with
getProblem(err).
Product detail · cart · checkout · login/register/account · minimal admin (catalog/offers/inventory/orders). UI generation may be assisted by the open-design tool.