Ecommerce Template
Next.js·React 등으로 만든 최신 전자상거래 템플릿
README 전체를 불러오는 중입니다. 아래는 저장된 발췌입니다.
An offline-first point of sale for Xpel Beauty NG. The cashier types the first few
letters of a product, the app suggests matches, items go into a cart, and the sale is
closed with cash, transfer or card. Everything is written to the device first and
synced to Supabase in the background, so the till keeps working when the network drops.README 전문 보기 ↗An offline-first point of sale for Xpel Beauty NG. The cashier types the first few letters of a product, the app suggests matches, items go into a cart, and the sale is closed with cash, transfer or card. Everything is written to the device first and synced to Supabase in the background, so the till keeps working when the network drops.
Enter to add. Matches
name, SKU, category, brand and barcode. F2 jumps to the search box, F9 closes the
sale.₦8,500 are parsed,
and every row is previewed with its outcome before anything is written. Existing products
are matched on SKU (else name) and can be updated or skipped; a template is downloadable.pending flag and uploaded by a sync engine that runs on app launch, the moment the
device comes back online, when the window regains focus, right after signing in, and on
a timer — backing off exponentially while the backend is unreachable. Concurrent runs
collapse onto one, so a row is never uploaded twice. Nothing is lost while offline:
the queue simply drains when a connection appears.npm install
cp .env.example .env.local # add your Supabase URL + publishable key
npm run dev # http://localhost:3000
Open Settings → Load sample products to try it with a demo catalogue.
Open the deployed URL and use the Install app button in the header (or on the Settings page). It replays the browser's own install prompt; where the browser has no such prompt it shows the manual steps for that platform.
| Platform | How |
|---|---|
| Windows PC | Edge or Chrome → Install app button, or the install icon in the address bar (menu → Apps → Install this site as an app). |
| Android | Chrome → Install app button, or ⋮ menu → Add to Home screen. |
| iPhone / iPad | Safari → Share → Add to Home Screen (iOS has no install prompt API). |
Once installed the app launches full screen, keeps its local database, and works with no internet connection. Sales made offline upload the next time the device is online.
Sync needs a Supabase account to be signed in once per device (Settings → Cloud sync). Local data is never blocked by this — an unsigned device still records sales, and they upload when someone signs in.
Tables used (created by the migrations in supabase/migrations):
| Table | Holds |
|---|---|
pos_products | catalogue and stock levels |
pos_sales | one row per completed sale |
pos_sale_items | the lines of each sale |
pos_stock_movements | every stock change with its reason |
Row-level security is on; only authenticated users can read or write.
Conflict handling is last-write-wins on updated_at, and a device never overwrites its own
unsynced edits with a remote copy.
Next.js 15 (App Router) · React 19 · TypeScript · Tailwind CSS · Dexie (IndexedDB) · Supabase · Recharts · SheetJS · jsPDF · docx.
| Name | Purpose |
|---|---|
NEXT_PUBLIC_SUPABASE_URL | Supabase project URL |
NEXT_PUBLIC_SUPABASE_ANON_KEY | Supabase publishable (anon) key |