# Swadeshi Disha — Website

A Laravel 13 + Tailwind CSS v4 website for Swadeshi Disha / Keramruth, built as a multi-page,
multi-language (Kannada, English, Hindi, Telugu, Tamil) site with a simple admin panel so the
client can manage products and content themselves. The site is architected so it can grow into
full e-commerce later without a rebuild.

## First-time setup (in Laragon / any local PHP environment)

Run these from the project root (`E:\laragon\www\kramruth`):

```bash
composer install
copy .env.example .env        # (cp .env.example .env on Mac/Linux)
php artisan key:generate
php artisan migrate --seed
php artisan storage:link
npm install
npm run build
```

Then open **http://kramruth.test** (or whatever host Laragon assigns) in your browser.

For day-to-day development, run `npm run dev` in a separate terminal instead of `npm run build` —
it gives you instant hot-reload while you or the client are working on content.

## Admin panel

- URL: `/admin/login`
- Seeded login: **admin@swadeshidisha.com** / **ChangeMe@2026**

**Change this password immediately** (there's no self-service "change password" screen yet —
easiest way for now is `php artisan tinker` → `User::first()->update(['password' => 'new-password'])`,
or add a proper profile/password screen later).

From the admin panel you can manage:
- **Categories** — the product groupings shown on the site (color-coded, with an image).
- **Products** — name/description/price/photos in all 5 languages, per category.
- **Health Library** — the articles shown on the public "Health Library" page.
- **Testimonials** — customer quotes shown on the homepage.
- **Messages** — everything submitted through the public Contact form.
- **Site Settings** — phone, WhatsApp, email, address, social links, Google Maps embed.

## Auto-translate in the admin panel

Every content form (Categories, Products, Health Library, Testimonials) has a small **✨
Auto-translate** button above each set of language fields. Type your text into whichever language
you're comfortable with (usually Kannada), click the button, and it fills in the other 4 languages
for you — you still review and can edit every field before saving, so nothing publishes without a
human look.

This is powered by the Google Cloud Translation API and needs a one-time setup:

1. Go to [console.cloud.google.com](https://console.cloud.google.com) and create a project (or use
   an existing one).
2. In the search bar, find and enable **"Cloud Translation API"**.
3. Go to **APIs & Services → Credentials → Create Credentials → API key**. Copy the key.
4. Open `.env` in the project root and set: `GOOGLE_TRANSLATE_API_KEY=your-key-here`
5. Restart `php artisan serve` / reload the site if it was already running.

**Cost:** Google gives 500,000 characters free every month, which comfortably covers normal
day-to-day catalog updates for a site this size; after that it's roughly ₹1,700 (~$20 USD) per
million characters. There's no monthly fee — you only pay for what you actually translate. If you'd
rather not set this up right away, the site works exactly the same without it — the button will
just show a message saying it isn't configured yet, and you can keep typing all 5 languages by
hand as before.

As with any machine translation, it's a starting point rather than a final answer — especially for
health-related product copy, it's worth having a native speaker glance over anything auto-translated
before it goes live.

## Important: this ships with placeholder content

Since the real product catalog (photos, prices, exact names) wasn't available yet, the site was
seeded with a **realistic placeholder catalog** based on the products visible in the Keramruth /
Swadeshi Disha brochures (Virgin Coconut Oil, the five Ayurvedic wellness capsules, the millet food
mixes, Crunch snacks, personal care items, and Nutri Coffee) — 6 categories, ~17 products, 5
articles, 3 testimonials. **None of this should be treated as final** — replace it from the admin
panel as soon as the client shares real product details and photos. Prices were deliberately left
blank so the site shows "Price on request" until real pricing is entered.

The product/article copy was written to be safe, general wellness language (e.g. "may support...")
rather than the stronger disease-cure claims that appear in the original brochures — health/wellness
product marketing claims are regulated in India (FSSAI, Consumer Protection Act), so it's worth
having the client (or their compliance advisor) review and approve final wording before launch,
especially for the Ayurvedic capsules.

## Languages

Kannada is the default/primary language (`/kn/...`); English, Hindi, Telugu and Tamil are also
wired up (`/en/...`, `/hi/...`, `/te/...`, `/ta/...`). The site's own UI text (navigation, buttons,
labels — see `lang/{locale}/site.php`) is fully translated into all 5 languages.

Product, category and article **content** (names, descriptions, article bodies) is seeded in all
5 languages — Kannada, English, Hindi, Telugu and Tamil. If you ever add a new item and leave a
language blank, the site automatically falls back to Kannada (then English) rather than showing a
blank space, so nothing breaks while you fill in the rest from the admin panel.

Because this covers a health/wellness brand, we'd recommend a native speaker (rather than only
machine translation) review the Hindi/Telugu/Tamil copy before it goes live — happy to help
coordinate that.

## Adding more languages later

1. Add the locale to `config/site.php` (`locales` array).
2. Create `lang/{code}/site.php` (copy `lang/en/site.php` and translate the values).
3. That's it — the language switcher, routes and translatable content fields pick it up
   automatically.

## Architecture notes

- **No JS framework** on the public site — plain Blade + a small `resources/js/app.js` for the
  mobile menu, dropdowns, image gallery and scroll-reveal animations. Keeps the site fast and easy
  to hand off.
- **Translatable content** uses a small custom trait (`app/Support/HasTranslations.php`) that
  stores each translatable field as JSON (`{"kn": "...", "en": "..."}`) rather than a separate
  package — one less dependency to maintain.
- **Images** are stored via Laravel's public disk (`storage/app/public`, symlinked to
  `public/storage`) — make sure `php artisan storage:link` has been run, including after moving to
  a new server.
- **Admin auth** uses Laravel's built-in session auth with an `is_admin` flag on the `users` table
  — no extra package. To add another admin user: `php artisan tinker` →
  `User::create(['name' => '...', 'email' => '...', 'password' => '...', 'is_admin' => true])`.

## Moving toward e-commerce later

The data model (`products` table with price/mrp, categories, images) is already shaped for a cart.
When you're ready, the natural next steps are: a `cart`/`order`/`order_items` schema, a payment
gateway integration (Razorpay is the common choice for Indian D2C brands), and turning the
"WhatsApp / Call" buttons on the product page into an "Add to Cart" flow. None of the current
structure needs to be undone to get there.
