Your ready-to-deploy e-commerce storefront with the entire backend already handled. Configure your payment methods and products in the Spensit dashboard — then watch your custom site take flight. 🚀
This is a fully production-ready e-commerce storefront — the entire backend is taken care of for you by Spensit. No building checkout logic, no wiring up payment APIs, no managing orders from scratch.
Here's all you need to do:
- ✅ Configure your payment methods in the Spensit dashboard
- ✅ Add your products in the Spensit dashboard
- ✅ Customise your storefront to look exactly how you want
- ✅ Deploy — and your store is live
That's it. Everything else — payments, orders, product management, currency handling — is handled by Spensit.
| Feature | Description |
|---|---|
| ⚡ Next.js App Router | Server components, layouts, and streaming out of the box |
| 🛒 Slide-in Cart Drawer | Persistent cart with quantity controls |
| 💳 Secure Checkout | Server-side price calculation via SpensPay |
| 🌏 Currency Context | Consistent symbol display across 80+ currencies |
| 🔍 Product Filtering | Search, category, gender, price range, colour, and size |
| 📱 Fully Responsive | Mobile-first design that looks great on every device |
| 🧩 One-file Rebrand | All UI copy lives in src/config/site.ts |
| 🔒 API Key Server-side | Your SPENSIT_API_KEY is never exposed to the browser |
Before you start, make sure you have:
git clone https://github.com/Spensit/Ecommerce-Template.git
cd Ecommerce-Templatenpm installcp .env.example .env.localOpen .env.local and fill in your values:
# ─── Spensit API (required) ──────────────────────────────────────────────────
NEXT_PUBLIC_API_URL=https://api.spensit.com
NEXT_PUBLIC_DOMAIN=localhost # or your production domain, e.g. mystore.com
NEXT_PUBLIC_BRAND_ID=your-brand-uuid # copy from Spensit dashboard
SPENSIT_API_KEY=sk_live_xxxxxxxxxxxx # copy from Spensit Developer API page
SPENSIT_BRAND_ID=your-brand-uuid # same value as NEXT_PUBLIC_BRAND_ID
# ─── Optional ────────────────────────────────────────────────────────────────
NEXT_PUBLIC_DEFAULT_CURRENCY=USD # leave blank to use your brand's defaultnpm run devOpen http://localhost:3000 — your store is live! 🎉
Sign up for free at spensit.com.
- After signing in, click your profile avatar in the top-right corner
- Select "Developer API" from the dropdown
- Click "Generate New API Key" (or copy an existing one)
- Paste it as
SPENSIT_API_KEYin your.env.local
Important
Your API key is shown only once when generated — save it immediately.
This key must stay server-side only — never use it in NEXT_PUBLIC_* variables.
On the same Developer API page, your Brand ID (a UUID) is displayed. Copy it and set both NEXT_PUBLIC_BRAND_ID and SPENSIT_BRAND_ID in your .env.local.
Set NEXT_PUBLIC_DOMAIN to the domain the Spensit API should accept requests from:
| Environment | Value |
|---|---|
| Local development | localhost |
| Production | mystore.com (no https://, no trailing slash) |
Tip
You can whitelist multiple domains in your Spensit dashboard — use localhost for development and your real domain for production.
Everything is managed from your Spensit Dashboard — no code changes required.
- Log in to spensit.com
- Navigate to Products in the sidebar
- Click "Add Product" and fill in name, description, category, pricing, images, variants, and stock
- Click Save — your product is instantly live on your storefront ✅
- In your dashboard, navigate to Payments
- Connect your preferred payment providers via SpensPay
- Enable the currencies and methods you want to accept
- Hit Save — your checkout is ready to take orders ✅
Tip
For the full setup guide including payment configuration, visit the Spensit Docs.
Make it yours — customise your storefront any way you like.
Edit src/config/site.ts — the only file you need to touch to fully rebrand:
export const siteConfig = {
name: 'My Awesome Store',
tagline: 'Premium quality clothing',
description: 'SEO meta description for Google',
url: 'https://mystore.com',
hero: {
headline: 'New Season. New You.',
subheadline: 'Free shipping on orders over $50.',
ctaLabel: 'Shop Now',
backgroundImage: 'https://your-image-url.com/hero.jpg',
},
saleBanner: {
copy: 'Up to 60% off — this weekend only',
},
footer: {
legal: '© 2025 My Awesome Store. All rights reserved.',
},
}Replace src/app/icon.png with your own PNG (square works best).
Edit src/app/globals.css using CSS custom properties:
:root {
--color-primary: #your-brand-color;
--color-sale: #your-sale-color;
}src/
├── app/ # Next.js App Router
│ ├── api/ # Server-side API proxy routes
│ │ ├── checkout/ # POST /api/checkout
│ │ └── customers/ # Customer & order routes
│ ├── products/[id]/ # Product detail page
│ ├── shop/ # Shop / listing page
│ └── layout.tsx # Root layout (fonts, providers)
├── components/
│ ├── cart/ # CartDrawer, CartItem, CartSummary
│ ├── home/ # Hero, FeaturedProducts, SaleBanner
│ ├── layout/ # Navbar, Footer
│ ├── product/ # ProductInfo, ImageGallery, VariantSelector
│ ├── shop/ # ProductCard, FilterSidebar, ProductGrid
│ └── ui/ # Badge, Button — reusable primitives
├── config/
│ └── site.ts # ← Rebrand here — all UI copy in one place
├── context/
│ ├── CartContext.tsx # Cart state (add, remove, update qty)
│ └── CurrencyContext.tsx # Currency symbol formatting
└── lib/
├── api/
│ ├── client.ts # SpensitAPIClient + singleton
│ └── types.ts # All TypeScript interfaces
├── currency-symbols.ts # 80+ ISO 4217 → symbol mappings
└── utils/ # formatPrice, filter helpers
| Command | Description |
|---|---|
npm run dev |
Start development server at localhost:3000 |
npm run build |
Build for production |
npm run start |
Start production server (run build first) |
npm run lint |
Run ESLint |
- Push your repo to GitHub
- Go to vercel.com → New Project → import your repo
- Add your environment variables in the Vercel dashboard:
NEXT_PUBLIC_API_URL
NEXT_PUBLIC_DOMAIN ← set to your Vercel / custom domain
NEXT_PUBLIC_BRAND_ID
SPENSIT_API_KEY
SPENSIT_BRAND_ID
- Click Deploy 🚀
Tip
Update NEXT_PUBLIC_DOMAIN to your production domain (e.g. mystore.com) and make sure it's whitelisted in your Spensit dashboard.
npm run build
npm run startSet the same five environment variables in your platform's settings panel.
| Resource | Link |
|---|---|
| 📖 Full Setup & Customisation Docs | my.spensit.com/customsitedocs |
| 🌐 Live Demo | template.spensit.site |
| 🔌 API Routes Reference | API_ROUTES.md |
| 🛠️ Node.js Integration Guide | NODEJS_IMPLEMENTATION_GUIDE.md |
| 💡 Client Code Examples | CLIENT_EXAMPLES.md |
Pull requests are welcome! Please open an issue first to discuss major changes.
git checkout -b feature/my-feature
git commit -m 'feat: add my feature'
git push origin feature/my-feature
# then open a Pull RequestMIT © Spensit