Sarvadnya-Exports

Sarvadnya Exports — Website

Premium Indian pomegranate export company website. This phase adds the full public site — Home, About, Products, Gallery, and Contact (with the buyer lead form wired to Firestore + WhatsApp) — plus the Firestore rules and Cloud Function behind it. The Admin Dashboard is the one remaining phase (see Roadmap).

Design system

Getting started

npm install
cp .env.example .env.local   # fill in Firebase config
npm run dev

Visit http://localhost:3000.

What’s included so far

Public site

Backend / Firebase

Roadmap (next phase)

  1. Admin portal — Google Sign-In restricted to ADMIN_ALLOWED_EMAILS, dashboard cards (total/today/unread leads, countries), lead table with search/filter/ pagination, lead detail modal (mark read, delete, open WhatsApp, send email), analytics charts (top countries, monthly leads, quantity requested).
  2. Polish — PDF company profile download, dark mode, i18n readiness, EmailJS email notification, Lighthouse pass (SEO/Performance/Accessibility/Best Practices > 95).
cd functions
firebase functions:config:set \
  whatsapp.token="YOUR_CLOUD_API_TOKEN" \
  whatsapp.phone_number_id="YOUR_PHONE_NUMBER_ID" \
  whatsapp.business_number="91XXXXXXXXXX"
npm run deploy

Deployment

npm install -g firebase-tools
firebase login
firebase init hosting   # select "Next.js" framework support if prompted
firebase deploy

Deploying to GitHub Pages

GitHub Pages only serves static files — it can’t run the Next.js server, which is why adding a single index.html doesn’t work and GitHub falls back to rendering README.md. The real fix is a static export (output: "export" in next.config.ts, already set up in this project), which generates a full static site — index.html for every route, plus _next/, robots.txt, sitemap.xml, etc.

This repo includes .github/workflows/deploy.yml, which builds and publishes that export automatically. To turn it on:

  1. Push this project to a GitHub repo.
  2. Repo → Settings → Pages → Build and deployment → Source → select GitHub Actions.
  3. If you’re using Firebase (buyer lead form, etc.), add your .env.local values as repo secrets (Settings → Secrets and variables → Actions) with the same names as in .env.example — the workflow reads them from there at build time.
  4. Push to main. The Actions tab will show the build+deploy run; your site will be at https://<username>.github.io/<repo-name>/.

next.config.ts auto-detects the repo name from GitHub Actions and prefixes all links/ assets with /<repo-name> so they resolve correctly on a project page — no manual path edits needed. public/.nojekyll is required so GitHub Pages doesn’t try to run Jekyll over the _next/ folder (Jekyll ignores underscore-prefixed folders by default, which would otherwise 404 all your JS/CSS).

To build and preview the static export locally:

npm run build
npx serve out