尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證e-commerce frontend
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗The customer-facing storefront for Coovi, an online saree shop serving customers across Bangladesh. Shoppers browse products, keep a guest cart in the browser, check out with Cash on Delivery, and track orders by order number and phone.
Built with Next.js 16 (App Router), React 19, Tailwind CSS 4 and Zustand.
Requires Node.js 20.9+ and pnpm 10.28.2 (pinned via packageManager).
pnpm install
pnpm dev
Open http://localhost:3000. The storefront needs the Coovi API running; by default it calls http://localhost:5000/api.
Set these in .env.local:
| Variable | Default | Purpose |
|---|---|---|
NEXT_PUBLIC_API_URL | http://localhost:5000/api | Base URL of the Coovi API |
NEXT_PUBLIC_SITE_URL | http://localhost:3000 | Public site URL, used for metadata, the sitemap and WhatsApp share links |
NEXT_PUBLIC_WHATSAPP_NUMBER | 8801700000000 (placeholder) | Fallback WhatsApp number, digits in international format, used until shop settings load from the API. The real number is set on the admin Settings page |
STOREFRONT_API_KEY | none | Server-only secret, equal to STOREFRONT_API_KEY on the API; gives this storefront's server its own rate limit |
| Command | What it does |
|---|---|
pnpm dev | Start the development server |
pnpm build | Production build |
pnpm start | Serve the production build |
pnpm lint | Run ESLint |
pnpm typecheck | Generate Next.js route types (next typegen), then run tsc --noEmit |
pnpm test | Run the test suite once |
pnpm test:watch | Run tests in watch mode |
pnpm coverage | Run tests with a coverage report (written to coverage/, open coverage/index.html) |
Tests use Vitest and live next to the code they cover as *.test.ts(x). The default environment is Node; files that need browser APIs opt in with a // @vitest-environment jsdom comment at the top (see lib/cartStore.test.ts).
Covered today, at 100% line and branch coverage:
lib/api.ts: request URLs and query params, error and timeout handling, and that orders send only product IDs and quantitieslib/cartStore.ts: cart actions, localStorage persistence, totals and countslib/utils.ts: price formattinglib/site.ts: site URL, Open Graph and WhatsApp link helperslib/useDialog.ts: Escape, focus trap, scroll lock and focus return for dialogsComponent tests use React Testing Library; components/CartDrawer.test.tsx covers the cart drawer's dialog behaviour. Other components and pages are not tested yet.
GitHub Actions (.github/workflows/ci.yml) runs on every pull request and on pushes to master, as three parallel jobs:
pnpm lintpnpm typecheckpnpm coverage, with the coverage report uploaded as a build artifact for 14 daysapp/ Routes: home (in the (home) route group), saree, sale,
products/[slug], cart, checkout,
order-confirmation/[orderNumber], track-order,
track-order/[orderNumber], about, contact, policy pages.
Each route has its own loading.tsx, built from components/Skeleton.tsx
components/ UI components (cart drawer, filters, product card, gallery, ...)
lib/
api.ts API client (fetch with a 60s timeout on the server, 30s in the browser)
cartStore.ts Zustand guest cart, persisted to localStorage as "coovi-cart"
types.ts Shared types for products, cart items and orders
utils.ts Formatting helpers
The cart lives only in the browser. At checkout the storefront sends the customer's details plus product IDs and quantities, and nothing else. The API is authoritative for prices, stock, delivery fees and totals, and recomputes them from its own database. The API contract shared with the other Coovi apps is ../API_ENDPOINTS.md.
Any Next.js host works. Run pnpm build and pnpm start, or deploy to Vercel. Set the environment variables above in production. Product images are allowed from res.cloudinary.com (photos uploaded in the admin), images.pexels.com, images.unsplash.com and picsum.photos (see next.config.ts).