# The Hindu News — Laravel Application

A full-featured news website built with Laravel 11, designed with The Hindu's layout and UI patterns.

## Requirements
- PHP 8.2+
- MySQL 5.7+ / MariaDB 10.4+
- Composer
- Node.js (optional, for asset compilation)

## Setup Instructions

### 1. Clone / Extract the project
```bash
# Extract the zip, then:
cd hindunews
```

### 2. Install dependencies
```bash
composer install --optimize-autoloader --no-dev
```

### 3. Environment setup
```bash
cp .env.example .env
php artisan key:generate
```
Edit `.env` and set:
- `APP_URL` — your site URL
- `DB_DATABASE`, `DB_USERNAME`, `DB_PASSWORD`

### 4. Database setup
```bash
# Import the SQL seed file:
mysql -u root -p hindu_news < database/hindu_news.sql

# OR run migrations + seed manually:
php artisan migrate
# Then import sample data manually
```

### 5. Storage link
```bash
php artisan storage:link
```

### 6. Upload images
Upload news images to: `public/assets/upload/news/`
Upload author photos to: `public/assets/upload/authors/`
Upload category banners to: `public/assets/upload/categories/`

### 7. Serve locally
```bash
php artisan serve
```

### 8. Production
```bash
php artisan config:cache
php artisan route:cache
php artisan view:cache
php artisan optimize
```

## Site Structure

### Pages
| URL | Description |
|---|---|
| `/` | Homepage with all sections |
| `/category/{slug}` | Category listing |
| `/author/{slug}` | Author profile |
| `/{category}/{slug}` | Article detail |
| `/search?q=` | Search results |
| `/about` | About page |
| `/privacy-policy` | Privacy Policy |
| `/sitemap.xml` | Sitemap index |

### Homepage Sections (HomeController)
1. **Top News** — hero + sub-items + middle headlines + right feed
2. **Spotlight** — most-covered category, topic strip
3. **For You** — 4 cards, one per category
4. **Editor's Pick** — left hero + middle 2-stack + cities/states panels
5. **Section One** — second-heaviest category, main + 4 sub-items
6. **Most Popular** — 6-card grid
7. **Section Two** — 4-card category grid
8. **Section Three** — environment/science 2-col layout
9. **Featured Sections** — 4-column category showcase
10. **Latest Feed** — paginated news cards

### SEO Features
- Dynamic `<title>`, `<meta>`, `<canonical>` on every page
- Open Graph + Twitter Card tags
- JSON-LD structured data (WebSite on home, NewsArticle on detail)
- Google News sitemap (`/sitemap-news.xml`) — last 2 days
- Full articles sitemap (`/sitemap-articles.xml`)
- Categories, authors and pages sitemaps
- GEO meta tags (geo.region, geo.position, ICBM)
- AIO/news_keywords meta tag
- X-Robots-Tag: noindex on search and feed pages
- Reading progress bar on article pages
- Schema.org Author, Publisher markup

### Database Tables
- `tbl_category` — news categories with slugs and SEO fields
- `tbl_authors` — author profiles with social links
- `tbl_news` — articles with full metadata
- `subscribers` — newsletter subscribers

## Admin (CMS)
This project ships as the **front-end only**. To manage content, connect a CMS panel or use phpMyAdmin/Adminer to insert records into `tbl_news`, `tbl_category` and `tbl_authors`. A Laravel Nova or Filament admin panel can be added as a separate package.

## Performance Tips
- Enable OPcache in PHP
- Use Redis for caching (`CACHE_STORE=redis`)
- Set up a CDN for static assets
- Use `php artisan optimize` in production
- The `AppServiceProvider` caches nav categories for 1 hour

## Customisation
- Change site name/URL in `.env`
- Add/edit categories in `tbl_category`
- GEO tags: update `SITE_REGION`, `SITE_ICBM`, `SITE_GEO_PLACENAME` in `.env`
- Logo: replace `public/img/thehindu-logo.svg`
