A static jewelry catalog website built with Next.js 14 (App Router), hosted on Vercel, using GitHub as the database.
- Framework: Next.js 14 with App Router
- Hosting: Vercel
- Database: GitHub repo (JSON file + image folder)
- API: GitHub REST API via Octokit.js
- Auth: Single admin, password protected
- Styling: Tailwind CSS
- All product data is stored in
/data/products.jsonin the GitHub repo - Admin logs in via
/admin/loginwith a password stored in env vars - Admin actions (add/edit/delete) update the JSON file via GitHub API commits
- Vercel auto-redeploys on every push
- Public pages use ISR (revalidate every 60 seconds)
git clone <your-repo-url>
cd <repo-name>
npm install- Go to GitHub → Settings → Developer Settings → Personal Access Tokens → Fine-grained tokens
- Click "Generate new token"
- Set token name (e.g., "jewelry-store-admin")
- Set expiration (recommended: 90 days)
- Under "Repository access", select "Only select repositories" and choose your repo
- Under "Permissions" → "Repository permissions":
- Contents: Read and write (to update products.json and images)
- Metadata: Read-only (default)
- Generate and copy the token
Create a .env.local file:
ADMIN_PASSWORD=your-secure-password-here
GITHUB_TOKEN=github_pat_xxxxxxxxxxxxx
GITHUB_OWNER=your-github-username
GITHUB_REPO=your-repo-name
GITHUB_BRANCH=main- Push your code to GitHub
- Go to vercel.com and sign in with GitHub
- Click "New Project" and import your repo
- Add the same environment variables in Vercel:
- Go to Project Settings → Environment Variables
- Add
ADMIN_PASSWORD,GITHUB_TOKEN,GITHUB_OWNER,GITHUB_REPO,GITHUB_BRANCH
- Deploy!
- Visit
https://your-domain.vercel.app/admin/login - Login with your admin password
- Add your first products through the dashboard
/app
/page.tsx # Homepage with hero + featured products
/shop/page.tsx # All products with filters
/product/[id]/page.tsx # Product detail page
/sales/page.tsx # Sales tracker table
/admin/page.tsx # Admin dashboard
/admin/login/page.tsx # Admin login
/api/admin/products/route.ts # Products CRUD API
/api/admin/upload/route.ts # Image upload API
/api/auth/route.ts # Authentication API
/lib
/github.ts # GitHub API functions (Octokit)
/types
/product.ts # Product TypeScript types
/data
/products.json # Product data (stored in repo)
/public
/images/ # Product images (stored in repo)
- Homepage: Hero section, featured products, on-sale items
- Shop: All products with category filter and price sort
- Product Detail: Full product info with discount calculations
- Sales Tracker: Price comparison table
- View all products in a table
- Add/edit/delete products
- Image upload (stored in GitHub repo)
- Optimistic UI updates
- Toast notifications
- Mobile responsive
- Gold/amber color scheme for luxury feel
- Product cards with hover effects
- Discount badges
- Loading skeletons
| Technology | Purpose |
|---|---|
| Next.js 14 | React framework with App Router |
| TypeScript | Type safety |
| Tailwind CSS | Styling |
| Octokit.js | GitHub REST API client |
| react-hot-toast | Toast notifications |
| Vercel | Hosting + CI/CD |
MIT