/* DigiMint - Single-file React app (App.jsx) README / Setup 1. Create a new Vite React project: npm create vite@latest digimint -- --template react cd digimint 2. Install dependencies (Tailwind CSS): npm install npm install -D tailwindcss postcss autoprefixer npx tailwindcss init -p 3. Configure Tailwind (tailwind.config.cjs): module.exports = { content: ["./index.html", "./src/**/*.{js,jsx,ts,tsx}"], theme: { extend: {} }, plugins: [], } 4. Add Tailwind imports to src/index.css: @tailwind base; @tailwind components; @tailwind utilities; 5. Replace src/App.jsx with this file. Import index.css in src/main.jsx import './index.css' 6. Run dev server: npm run dev Notes: - This is a frontend-only demo that simulates selling digital products. - For real payments integrate Stripe/PayPal server-side. - File delivery is simulated: protected delivery should be handled server-side with expiring links. Components included (in one file for convenience): - Header, Hero, Features - ProductList, ProductCard, ProductModal - Cart (localStorage-backed) - AdminUpload (simulate adding new digital products) - Checkout (simulated) Name: DigiMint */ import React, { useEffect, useState } from 'react' // Utility: Local storage helper const useLocalStorage = (key, initial) => { const [state, setState] = useState(() => { try { const raw = localStorage.getItem(key) return raw ? JSON.parse(raw) : initial } catch (e) { return initial } }) useEffect(() => { localStorage.setItem(key, JSON.stringify(state)) }, [key, state]) return [state, setState] } // Sample seed products const SAMPLE_PRODUCTS = [ { id: 'p1', title: 'Minimalist Social Media Templates - Figma', price: 12.0, description: 'A pack of 20 clean social media templates for Figma/Sketch. Ready for brands.', tags: ['templates', 'figma', 'social'], cover: 'https://images.unsplash.com/photo-1522202176988-66273c2fd55f?w=1200&q=80', fileName: 'social-templates.zip', fileUrl: '#', }, { id: 'p2', title: 'E-book: 30 Days to Better Productivity', price: 7.99, description: 'A short actionable e-book full of exercises & trackers you can use immediately.', tags: ['ebook', 'productivity'], cover: 'https://images.unsplash.com/photo-1483058712412-4245e9b90334?w=1200&q=80', fileName: 'productivity-ebook.pdf', fileUrl: '#', }, { id: 'p3', title: 'Set of 50 High-Res Textures', price: 9.5, description: 'PNG textures for backgrounds and overlays. 2048x2048 high-res files.', tags: ['textures', 'graphics'], cover: 'https://images.unsplash.com/photo-1503602642458-232111445657?w=1200&q=80', fileName: 'textures-50.zip', fileUrl: '#', }, ] // ----- Header ----- function Header({ cart, onOpenCart }) { return (
DigiMint — sell digital products with confidence
Beautiful product pages, simple checkout, and a delightful buyer experience. Perfect for e-books, templates, music, fonts and more.
No coding required. Payments are simulated in this demo.
Why creators choose DigiMint
Beautiful product pages
Clean, minimal product listings that highlight your work.
Instant delivery
Automated downloads after purchase (demo). Real setups use secure links.
Easy admin
Upload new products, set prices, and manage listings from the dashboard.
{p.title}
{p.description}
${p.price.toFixed(2)}
{product.title}
{product.description}
${product.price.toFixed(2)}
Tags: {product.tags.join(', ')}
Cart
{cartItems.length === 0 &&
))}
Your cart is empty.
}
{cartItems.map((it) => (
{it.title}
Qty: {it.qty}
${(it.price * it.qty).toFixed(2)}
Subtotal
${subtotal.toFixed(2)}
Admin — Upload product
Products
setQuery(e.target.value)} placeholder="Search products..." className="border rounded px-3 py-2" />
{visible.map((p) => (
setSelected(prod)} />
))}
Recent purchases (simulated)
{justBought ? (
{justBought.map((b) => (
Download
))}
) : (
{b.title}
{b.fileName}
No recent purchases in this demo.
)}