# Migration Guide — qadvertising.in → qadvertising-2026

This document explains how the original Q`Advertising website was modernized into a
new, redesigned 2026 project. The original project is preserved untouched; this new
project lives in a separate folder and is independently runnable.

## 1. Original stack

| Concern | Original |
|---|---|
| Framework | Laravel 5.5.\* (EOL) |
| PHP | `>=7.0.0` (ran on PHP 7.4) |
| Frontend framework | Vue 2.5.7 |
| Build tool | Laravel Mix (webpack) |
| CSS | bootstrap-sass 3.3.7 (Bootstrap 4 from CDN at runtime) |
| HTTP client / state | axios 0.17, jQuery 3.2, owl.carousel |
| Auth | 3 custom session guards (`web`, `admin`, `seller`) + custom OTP email verification |
| Validation | Mix of Laravel `Validator` and a custom `App\Classes\{CSRFToken, ValidateRequest, Request}` mini-framework |
| Payments | Paytm (custom checksum in `helper.php` + duplicated `PaytmChecksum`) + Stripe |
| DB | MySQL, no foreign keys; 27 migrations; products + a polymorphic CMS (pages/services/articles/contents) |
| Images/fonts | Procedural / CDN (Signika, Raleway, Font Awesome kit) |
| Other | `google/apiclient`, `laravel/socialite`, `gumlet/php-image-resize`, `voku/pagination` |

## 2. New stack (2026)

| Concern | New |
|---|---|
| Framework | Laravel 13.32 (`^13.17`) |
| PHP | 8.3.33 (`^8.3`) |
| Frontend framework | Vue 3.5 (`@inertiajs/vue3` 2.x) — Inertia.js, SSR-ready |
| Build tool | Vite 8 (`@vitejs/plugin-vue`) |
| CSS | Tailwind CSS v4 (CSS-first `@theme`, `@tailwindcss/vite`) — no `tailwind.config.js` |
| Type system | TypeScript 5.6 + `vue-tsc` |
| Auth | Laravel Breeze (Inertia + Vue + TS) — single session guard + `is_admin` flag + `admin` middleware |
| Validation | Laravel `Validator` / Form Requests (custom mini-framework dropped) |
| DB | MySQL by default, sqlite for tests; clean schema with real foreign keys |
| Fonts | Inter Variable (UI + headings) via `@fontsource-variable` (bundled, no CDN) |
| Routes (typed) | Ziggy (server routes exposed to Vue with full type info) |
| Testing | Pest / PHPUnit 12 |

## 3. What was changed

- **Stack replacement:** new project created from `laravel/laravel` (Laravel 13) +
  `laravel/breeze` (Inertia + Vue + TypeScript + SSR). Blade templating was replaced
  with Vue 3 Inertia pages; Laravel Mix/webpack was replaced with Vite.
- **Design system:** a from-scratch Tailwind v4 design system (`resources/css/app.css`)
  derived from the site's service-navigation visual reference — light backgrounds, strong
  dark typography (Inter throughout), bright green (`#16a34a`) as the brand accent / active
  state, blue (`#2563eb`) for interactive service links, thin subtle borders, flat surfaces,
  and generous whitespace. Reusable components: `UiButton`, `SectionHeading`,
  `CategoryCard`, `ServiceCard`, `AppHeader` (icon+label nav with green active state),
  `AppFooter`, `Icon`, `PublicLayout`.
- **Two homepages:** Homepage 1 (`/`) modernizes the original homepage's content
  ("Q is Evolving", the marketing directions, legal services, the 5 pillars).
  Homepage 2 (`/home-2`) is a new, alternative editorial/index design direction using
  the same real business content.
- **Data model:** consolidated the original split products/services/CMS into a clean
  `categories → subcategories → services` catalog plus a simple `pages` table for
  static content. Real foreign keys replace the original's integer-only FK columns.
- **Auth:** replaced 3 separate guards with one Breeze-powered session guard; admin
  access is granted via an `is_admin` flag enforced by an `admin` middleware alias.
- **Content preserved verbatim** where possible (hero copy, about page, refund policy,
  service taxonomy, contacts, addresses, GSTIN).

## 4. What was intentionally preserved

- Company identity: name, tagline, contacts (3 numbers), two Delhi office addresses,
  emails, GSTIN `07BFJPR1705N1Z3`, founding year 2017, mission statement.
- The 5 service pillars and their full sub-taxonomy from the original header nav.
- Homepage content/intent ("Q is Evolving / Explore our Ideas", marketing directions,
  "Q equipped with analytics-oriented business development", legal services section).
- About, Contact, Terms, Privacy, and Refund pages (refund policy text verbatim).
- The contact-form enquiry workflow (now persisted to a `contact_messages` table).

## 5. What was intentionally not migrated (and why)

- **Seller area:** disabled in the original (`sellerRoutes.php` was commented out).
  Dropped from the new project; can be reintroduced as a role later.
- **Paytm / Stripe payments + cart/checkout:** the original cart/checkout/Paytm flow
  was incomplete/broken (dead routes, `dd()` debug stubs, duplicated join tables).
  The redesigned site routes service enquiries to a contact form instead of a broken
  payment flow. A production checkout would be reintroduced as a new feature.
- **Custom mini-framework** (`App\Classes\{CSRFToken, ValidateRequest, Request,
  Session, Redirect, Mail, Database, ErrorHandler}`): replaced by Laravel's native
  equivalents.
- **Duplicated Paytm checksum** in `helper.php`: dropped (kept only the SDK version).
- **`google/apiclient`, Socialite, `gumlet/php-image-resize`, `voku/pagination`:** not
  referenced by any live route in the original; not reintroduced to avoid unused deps.
- **No invented business claims:** no fake testimonials, customer logos, awards, or
  statistics were added.

## 6. Packages replaced and why

| Replaced | With | Why |
|---|---|---|
| Laravel 5.5 | Laravel 13 | 5.5 is EOL and incompatible with PHP 8 |
| Vue 2.5 | Vue 3.5 | Vue 2 reached EOL (Dec 2023) |
| Laravel Mix (webpack) | Vite 8 | Faster, current standard for Laravel |
| bootstrap-sass 3 / Bootstrap 4 CDN | Tailwind CSS v4 | Modern, maintainable, no CDN runtime dependency |
| Custom CSRF/Validation classes | Laravel native | Avoid maintaining a parallel mini-framework |
| 3 custom auth guards | Breeze + `is_admin` | Simpler, standard, single source of truth |
| owl.carousel / jQuery | native Vue + CSS | Remove unnecessary JS weight |
| CDN fonts | `@fontsource-variable` | Bundled, faster, no external requests |

## 7. Compatibility considerations

- The new project uses a **separate database** (`qadvertising_2026`); the original
  `qadvertising_dev` database and the original project folder are untouched.
- PHP 8.3 is required. The original project still requires PHP 7.x and is unaffected.
- Schema is new (not a 1:1 copy of the original 27 tables) because the original mixed a
  legacy e-commerce schema with a CMS. Data is re-seeded from real content, not copied
  row-by-row. To import real production content later, map the original `categories` /
  `subcategories` / `pages` rows into the new tables (column mapping is straightforward).
- Inertia SSR is built (`vite build --ssr`) but **disabled by default** (client-side
  render) to keep local dev simple. Enable via `config/inertia.php` + the node SSR
  worker for production SSR.

## 8. How to run the new project

```bash
cd D:\DeveloperSpace\q\qadvertising-2026

# PHP 8.3+ must be on PATH. Composer + npm install:
composer install
npm install

# Configure .env (DB credentials) then:
php artisan key:generate
php artisan migrate --force        # creates tables
php artisan db:seed                 # seeds catalog + pages + admin user

# Build frontend:
npm run build                       # or: npm run dev (watch)

# Serve:
php artisan serve --port=8001
# → http://127.0.0.1:8001
```

### Seeded accounts
- Admin: `admin@qadvertising.in` / `qadvertising2026` → `/admin`
- Demo user: `test@example.com` / `password`

### Key routes
| Route | Page |
|---|---|
| `/` | Homepage 1 (modernized) |
| `/home-2` | Homepage 2 (new design) |
| `/category/{slug}` | Service pillar |
| `/services/{category}/{service}` | Service detail |
| `/about` `/contact` `/terms` `/privacy` `/refund` | Static pages |
| `/login` `/register` | Auth (Breeze) |
| `/admin` | Admin dashboard (admin-only) |
