krishna-opticals

Krishna Opticals — GitHub Pages storefront

A React + TypeScript + Vite storefront designed for GitHub Pages. The catalogue is seeded from the 50-row starter Excel catalogue.

Run on Windows

  1. Install Node.js LTS, Git for Windows and VS Code.
  2. Open PowerShell in this project folder.
  3. Run:

    cd frontend
    npm install
    npm run dev
    
  4. Open the local URL printed by Vite (normally http://localhost:5173).

Build locally

cd frontend
npm run build
npm run preview

Publish free on GitHub Pages

  1. Create a GitHub repository named krishna-opticals.
  2. Upload/push the contents of this project to the repository’s main branch.
  3. In GitHub, open Settings → Pages.
  4. Set Build and deployment source to GitHub Actions.
  5. The workflow at .github/workflows/deploy.yml builds frontend and deploys it to GitHub Pages.
  6. The Vite base path is / because the project is configured for the custom domain krishnaopticals.cv. If you want to use the default username.github.io/krishna-opticals/ project URL without the custom domain, update the base path to /krishna-opticals/.
  7. The frontend/public/CNAME file is set to krishnaopticals.cv. Configure the DNS records at your domain registrar using the values GitHub Pages displays, then enable HTTPS in Settings → Pages.

Important: current static-site limitations

GitHub Pages serves static files only. This starter includes a catalogue, search, category filters, product detail modal, wishlist toggle and browser-local cart. It does not include a secure backend, persistent shared inventory, customer accounts, admin dashboard, order database, prescription uploads, live shipping or payment processing.

The checkout button is intentionally an enquiry placeholder. In frontend/src/App.tsx, set whatsappNumber to the store’s WhatsApp number (country code + number, digits only) to enable WhatsApp order enquiries. Do not collect or send prescription details through an unprotected WhatsApp link.

For real online checkout, create a separately hosted backend/API and verify Razorpay orders and webhooks server-side. Never put secret keys in this repository or frontend code.

Catalogue safety / publishing checklist

All seeded entries are draft sample listings with stock quantity zero. Product names, brand/model references, prices, supplier availability, product claims and technical specifications must be verified before making products purchasable. Add licensed product photos and confirm all relevant optical, prescription, labelling and consumer-law requirements.