A robust, serverless virtual goods shop built with Next.js 16, Shadcn UI, and Linux DO Connect.
🚀 Recommended: Cloudflare Workers Deployment
Comparison Cloudflare Workers Vercel Free Requests 100K/day Limited Database D1 Free 5GB Postgres quota Cold Start Near zero Has delay Global Edge ✅ Worldwide Partial
- Modern Stack: Next.js 16 (App Router), Tailwind CSS, TypeScript.
- Vercel Native: One-click deploy with Vercel Postgres database.
- Linux DO Integration: Built-in OIDC login and EasyPay payments.
- Storefront Experience:
- 🔍 Search & Categories: Client-side search and category filters.
- 📢 Announcement Banner: Configurable homepage announcements (supports scheduled start/end).
- 📝 Markdown Descriptions: Rich product descriptions.
- 🔥 Hot & Discounts: Hot tag and original/discount price display.
- ⭐ Ratings & Reviews: Verified buyers can rate and review.
- 📦 Stock & Sold Counters: Real-time inventory and sales display.
- 🚫 Purchase Limits: Limit purchases by paid order count.
- Orders & Delivery:
- ✅ Payment Callback Verification: Signature and amount checks.
- 🎁 Auto Delivery: Card key delivery on payment; paid status retained if out of stock.
- 🔒 Stock Reservation: 5-minute hold after entering checkout to prevent oversell.
- ⏱️ Auto-Cancel: Unpaid orders are cancelled after 5 minutes and stock is released.
- 🧾 Order Center: Order list and details pages.
- 🔔 Pending Order Alert: Homepage banner reminds users of unpaid orders.
- 🔄 Refund Requests: Users can submit refund requests for admin review (supports client-side & server-side refund).
- 💳 Payment QR: Admins can generate payment links/QR codes for direct payments without requiring a product.
- Admin Console:
- 📊 Sales Stats: Today/week/month/total overview.
⚠️ Low Stock Alerts: Configurable threshold and warnings.- 🧩 Product Management: Create/edit, enable/disable, reorder, purchase limits, hot tag, discount price.
- 🏷️ Category Management: CRUD categories with icons and ordering.
- 🗂️ Card Inventory: Bulk import (newline/comma) with de-duplication and delete unused card keys.
- 🧯 Stock Self-Heal: Handles legacy
is_used = NULLthat can cause false out-of-stock, and backfills it tofalse. - 📦 Total Stock Display: Homepage shows "Available + Locked" stock to prevent perceived sell-outs.
- 💳 Orders & Refunds: Pagination/search/filters, order detail, mark paid/delivered/cancel, client-mode refund + optional server proxy.
- 🧹 Order Cleanup: Bulk select and bulk delete.
- ⭐ Review Management: Search and delete reviews.
- 📦 Data Export: Export orders/products/reviews/settings; full dump JSON + D1 SQL.
- 📣 Announcements: Homepage announcement management.
- 🏷️ Store Name: Editable in admin and reflected in header/title.
- I18n & Theme:
- 🌐 English/Chinese switcher.
- 🌓 Light/Dark/System themes.
- ⏱️ Auto Update (Upstream Sync): GitHub Actions workflow included for Fork users to auto-sync upstream changes and trigger Vercel deploy.
The following features are available ONLY in the Cloudflare Workers version:
| Feature | Description |
|---|---|
| 📱 Telegram Notifications | Real-time purchase/refund alerts to Telegram, supports English/Chinese, built-in setup wizard |
| 🗑️ Bulk Card Delete | Batch delete unused card keys with multi-select/select-all |
| 🔄 Shared Card Products | Unlimited stock products that don't deduct inventory (for shared accounts, tutorials, etc.) |
| 📝 Store Description (SEO) | Custom site description |
| 🖼️ Store Logo | Custom site Logo and Favicon |
| 📜 Custom Footer | Custom site footer content |
| 🎨 Theme Colors | 7 theme colors available (Purple/Blue/Cyan/Green/Orange/Pink/Red) |
| 🤖 Noindex Support | Option to set 'noindex' to prevent search engine indexing |
| 👤 User Profile | Points overview, order stats, order history |
| 📧 Email Notifications | Automatic order completion emails (via Resend) |
| 📱 Mobile Navigation | Optimized bottom navigation bar for mobile |
Higher free tier, faster global access, no cold start delay.
👉 View Full Deployment Guide → _workers_next/README.md
Click the button above for one-click deploy to Vercel with auto-provisioned Postgres database.
While the system supports active order status querying, for the best user experience (instant payment status updates), we still recommend binding a custom domain (e.g., store.yourdomain.com).
The shared vercel.app domain is sometimes flagged by firewalls or payment gateways, which might delay or block payment callbacks. Using a custom domain avoids these issues.
⚠️ Experimental: Docker deployment has not been fully tested and may have unknown issues. We recommend using Vercel deployment for better stability.
If you have your own server (VPS/NAS), you can deploy simply with Docker:
- Clone the repository:
git clone https://github.com/chatgptuk/ldc-shop.git cd ldc-shop - Edit
docker-compose.ymlenvironment variables:- This file starts a local PostgreSQL database by default.
- Crucial: Replace
OAUTH_CLIENT_ID,OAUTH_CLIENT_SECRET,MERCHANT_ID,MERCHANT_KEYwith your actual credentials.
- Start the service:
docker-compose up -d
- Visit
http://localhost:3000.- Database data is persisted in the local
./postgres-datafolder.
- Database data is persisted in the local
If you forked this project, you can enable GitHub Actions to automatically sync the latest code from upstream (triggering a Vercel redeploy):
- Go to your GitHub repository page.
- Click the Actions tab.
- Select Upstream Sync from the left sidebar.
- Click the Enable workflow button.
- (Optional) Click Run workflow to test it manually.
Once enabled, the script will check for updates from chatgptuk/ldc-shop:main daily and merge them into your repository.
The following environment variables are required.
⚠️ NOTE: The following configuration usesstore.chatgpt.org.ukas an example. Please replace it with your ACTUAL domain when deploying!
Go to connect.linux.do to create/configure:
- App Name:
LDC Store Next(or any name) - App Homepage:
https://store.chatgpt.org.uk - App Description:
LDC Store Next - Callback URL:
https://store.chatgpt.org.uk/api/auth/callback/linuxdo
Get Client ID and Client Secret, and fill them into Vercel Environment Variables as OAUTH_CLIENT_ID and OAUTH_CLIENT_SECRET.
Go to credit.linux.do to create/configure:
- App Name:
LDC Store Next(or any name) - App Address:
https://store.chatgpt.org.uk - Callback URI:
https://store.chatgpt.org.uk/callback - Notify URL:
https://store.chatgpt.org.uk/api/notify
Get Client ID and Client Secret, and fill them into Vercel Environment Variables as MERCHANT_ID and MERCHANT_KEY.
- ADMIN_USERS: Admin usernames, comma separated (e.g.,
chatgpt,admin). - NEXT_PUBLIC_APP_URL: Your full app URL (e.g.,
https://store.chatgpt.org.uk).
- Clone the repository.
- Install dependencies:
npm install
- Link Vercel Project (for Env Vars & DB):
vercel link vercel env pull .env.development.local
- Run migrations:
npx drizzle-kit push
- Start dev server:
npm run dev
MIT