Skip to documentation content
NexPress NexPress

Documentation Translation Options

Curated native guides + 100+ instant world languages

1. Native Offline Editions (100% Verified)

2. Quick Auto-Translate (Code blocks stay protected)

3. Full 100+ Language Picker (Google Translate)

RTL Auto-Support
Complete Technical & Editorial Manual Active Theme: V2

Documentation & Installation Guide

Everything needed to deploy, configure, customize, and monetize your Laravel 12 multi-theme newsroom portal—covering server setup, all 10 themes, AI auto-blogging, 23 ad placements, ePaper editions, REST APIs, and SEO automation.

01

Platform Overview & Architecture

NexPress is an enterprise-grade digital news portal, multi-edition digital newspaper (ePaper), AI-powered editorial workspace, and multimedia video platform. Built with Laravel 12, it combines a reactive Inertia v2 + Vue 3 administration studio with a fast server-rendered Blade multi-theme frontend powered by cached read queries and WebP asset optimization.

Backend Core

Laravel 12 / PHP 8.2+

Admin Panel

Inertia v2 + Vue 3

Public UI

10 Tailwind v4 Themes

Quality & Tests

Pest 3 + Larastan

Key Repository Directories
app/
├── Console/Commands/       # WordPress importer, slug regenerator, sitemap ping, FB diagnose
├── Http/Controllers/       # Web, Admin (Inertia), & Mobile API v1 controllers
├── Providers/ThemeServiceProvider.php  # Dynamic theme view resolver (v1..v10 + base)
└── Services/               # FrontendService, SeoService, AdService, PostSlugService, AI
config/
├── theme.php               # Active THEME switcher & available 10-theme registry
└── ai.php                  # xAI (Grok), OpenAI, & Gemini SDK configuration
resources/
├── css/theme-v{1..10}.css  # Individual Tailwind CSS v4 theme bundles
├── js/pages/admin/         # Vue 3 Admin Dashboard pages
└── views/themes/           # base/ partials + v1..v10 frontend templates
routes/
├── web.php                 # Public newsroom, ePaper, Shorts, Docs, Sitemaps, Forms
├── admin.php               # Authenticated RBAC Admin Studio routes
└── api.php                 # Headless Mobile App REST API (/api/v1/*)
02

Server Requirements & Extensions

Ensure your hosting environment satisfies these requirements before installation:

System requirements
Component Required Version / Modules Purpose & Notes
PHP Runtime 8.2, 8.3, 8.4, or 8.5 Required by composer.json (^8.2); OPcache recommended for production
Database Engine MySQL 8.0+ / MariaDB 10.4+ / SQLite SQLite works for local preview; MySQL/MariaDB recommended in production
PHP Extensions bcmath, ctype, curl, dom, fileinfo, mbstring, openssl, pcre, pdo, xml, zip Standard Laravel 12 extensions enabled via cPanel PHP Selector or apt
Image Processing GD Library with WebP support Powers automatic WebP conversion & caching at /media-webp/{path}
Package Managers Composer v2.5+ & Node.js 18+ / NPM Composer builds PHP autoload; Node compiles Tailwind CSS v4 & Vue 3 bundles
Web Server Nginx, Apache (mod_rewrite), or LiteSpeed Document root must point directly to the /public directory
03

Step-by-Step Installation & Admin Setup

Deploy locally or on a VPS in minutes using Composer and Vite:

Step 1 — Install PHP & Frontend Dependencies and Compile Assets
composer install --no-dev --optimize-autoloader
npm install
npm run build
Step 2 — Configure Environment (.env), Active Theme & Database
cp .env.example .env
php artisan key:generate

# Important .env production settings:
APP_ENV=production
APP_DEBUG=false
APP_URL=https://yourdomain.com
THEME=v2
FILESYSTEM_DISK=public
QUEUE_CONNECTION=database
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_DATABASE=your_db
DB_USERNAME=your_user
DB_PASSWORD=strong_password
Step 3 — Run Database Migrations, Seeders & Public Storage Symlink
php artisan migrate --seed
php artisan storage:link
php artisan optimize

Seeded Super Admin Credentials & Security Notice

Running AdminUserSeeder (included in DatabaseSeeder) creates the initial Super Admin account: Email [email protected] / Password nexpress@432!. Log in at /login and immediately change both email and password under /settings/password, or customize database/seeders/AdminUserSeeder.php before seeding production.

04

cPanel, Nginx VPS & Queue Workers

Shared Hosting / cPanel Checklist

  1. Set domain Document Root to /public (never expose .env or root folders).
  2. Verify PHP 8.2+ and extensions (gd, fileinfo, mbstring, pdo_mysql) in Select PHP Version.
  3. Ensure storage/ and bootstrap/cache/ have writable permissions (775 or 755).
  4. Schedule a 1-minute cPanel Cron Job running php /home/user/site/artisan schedule:run.
Production Nginx Server Block (/etc/nginx/sites-available/nexpress)
server {
    listen 80;
    server_name yourdomain.com www.yourdomain.com;
    root /var/www/your-domain.com/public;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-Content-Type-Options "nosniff";
    client_max_body_size 64M;

    index index.php;
    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }
    error_page 404 /index.php;

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
        fastcgi_hide_header X-Powered-By;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}
Systemd Queue Worker (included in repo as nexpress-queue-worker.service.example)
[Unit]
Description=NexPress Queue Worker
After=network.target mysql.service

[Service]
Type=simple
User=www-data
Group=www-data
Restart=always
RestartSec=5
WorkingDirectory=/var/www/your-domain.com
ExecStart=/usr/bin/php /var/www/your-domain.com/artisan queue:work database --queue=default --sleep=3 --tries=3 --timeout=120 --max-time=3600
ExecReload=/usr/bin/php /var/www/your-domain.com/artisan queue:restart
KillSignal=SIGTERM
TimeoutStopSec=60

[Install]
WantedBy=multi-user.target
05

All 10 Built-In Professional Themes

Ten complete frontend designs live in resources/views/themes/v1 through v10 and share base partials via ThemeServiceProvider. Switch the active theme anytime by setting THEME=vX in .env (defaults to v2 in config/theme.php) and clearing config cache:

V1: Classic Broadside

v1

Traditional Hindi broadsheet layout with heritage columns, maroon headers, and serif typography.

V2: Modern Crimson Newsroom

Active v2

Default newsroom design (config/theme.php fallback) with crisp white cards, crimson accents, and fast tickers.

V3: Editorial Longform

v3

Deep indigo newsroom layout featuring generous whitespace, pull quotes, and distraction-free reading flow.

V4: Magazine Warm Paper

v4

Warm paper texture, terracotta accents, multi-tab lead showcase, homepage quote box, and columnist cards.

V5: Card Masonry Portal

v5

SaaS-inspired card grid with elevated shadows, pill badges, indigo chips, and structured sidebars.

V6: Dark Neon Edition

v6

Dark-mode first night canvas (#0c1017) with glowing amber highlights tailored for late-evening readers.

V7: Cyber Tech Monospace

v7

Geometric dark slate UI with electric cyan borders, monospace timestamps, and structured news dispatches.

V8: Lifestyle & Columnist Sand

v8

Warm sand backdrop, soft rounded-3xl blocks, serif headlines, and prominent author commentary sections.

V9: Cinema Dark Broadcast

v9

Video-first television dark canvas highlighting multimedia reels, red LIVE indicators, and broadcast carousels.

V10: Swiss Neo-Brutalist Bold

v10

High-contrast 4px solid ink borders, electric yellow (#FACC15) surfaces, hard offset shadows, and bold uppercase type.

Switching Active Theme via .env & Refreshing Caches
# In .env:
THEME=v10

# Refresh config & compiled views:
php artisan optimize:clear
06

Theme Customization, Menus & 5 Homepage Layouts

Tailwind CSS v4 Design Tokens

Each theme loads a dedicated entry file resources/css/theme-v{1..10}.css compiled in vite.config.ts. Adjust @theme variables (fonts, ink, paper surfaces, accent colors) and run npm run build.

5 Category Section Layouts & Quote Box

Arrange navigation in /admin/menus (supports nested dropdown children). Homepage sections render all 5 layouts: grid, hero, list, compact, and sub_category_grid, plus Quote Box (/admin/settings?tab=homepage) and Branded Share Image watermark settings (tab=share).

07

Articles, Pages, Authors & Live Updates

  • TinyMCE Editor & Media Library: Full rich-text publishing with tables, embeds, quotes, post duplication, soft-delete trash/restore, and bulk trash/force-delete.
  • Automatic Hindi-to-English SEO Slugs: Powered by PostSlugService (Google Translate + AI fallback) and posts:regenerate-slugs CLI command.
  • Live News Timeline: Attach chronological timestamped updates directly inside ongoing stories via /admin/posts/{post}/live-updates, plus highlight badges and highlighted_title.
  • Custom CMS Pages & Assets: Build static pages with optional per-page custom_css and custom_js injected via page-head-assets.
  • Public Author Directory & Profiles: Author roster at /authors and individual reporter profiles at /author/{user} showing bio, title, avatar fallback, and published counts.
08

Breaking News Ticker Engine

  • Managed inside /admin/breaking-news with active toggles, target URLs, and priority sort ordering.
  • Configure marquee scroll duration dynamically via breaking-news.speed (clamped cleanly from 8s fast to 90s slow).
  • Styled cohesively for every theme (v1 through v10 brutalist yellow-and-ink pill) inside themes/base/partials/breaking-ticker.blade.php.
09

ePaper Multi-Edition Digital Newspaper

  • Archive browsing at /epaper and interactive issue reader at /epaper/{epaper:slug}.
  • Supports multi-page high-resolution edition images and PDF replicas, date-indexed publishing, bulk activate/deactivate in /admin/epapers, and homepage edition carousel integration.
10

Videos Hub, Vertical Shorts & On-Demand WebP Proxy

  • Video Hub (/videos) & Detail (/videos/{slug}): Supports YouTube embeds, auto-fetched video metadata (/admin/videos/fetch-metadata), Vimeo, and MP4 streams.
  • Scroll-Snap Vertical Shorts (/videos/shorts): Mobile-first fullscreen vertical swipe player styled via .shorts-container and scroll-snap-type: y mandatory.
  • WebP Media Optimization (/media-webp/{path}): Transparently converts PNG/JPG images to cached WebP (quality 80, 1-year HTTP cache headers) via PHP GD to boost Core Web Vitals.
11

Form Builder, Built-In CAPTCHA & Citizen Article Conversion

  • Organize intake campaigns in /admin/form-groups and /admin/forms; publish publicly at /forms/{slug} ("Submit News" button in the header).
  • Protected by built-in rate-limited CAPTCHA challenge (/forms/{slug}/captcha) and submission throttling (5 req/min).
  • Moderate submissions under /admin/form-entries: download attached files, mark Verify/Reject/Spam, add editorial notes, or click Convert to Post (form-entries.convert).
12

AI Content Studio & Autonomous Auto-Blogging

Powered by the official laravel/ai SDK with multi-provider support configured in config/ai.php (xAI Grok with optional web search, OpenAI, and Google Gemini):

Editorial Assistant Tools (/admin/ai/*)

Inside the article editor, reporters can trigger AI draft generation, headline brainstorming (ai.title), excerpt summaries (ai.excerpt), SEO metadata (ai.seo), and prose polishing (ai.improve).

Autonomous Schedules (/admin/ai-schedules)

Create recurring AI topic beats, test connections (/admin/ai-settings), trigger manual Run Now jobs, and audit full run logs in /admin/ai-history. Dispatched every minute via ai-blog:schedules-dispatch.

AI SDK Environment Keys (.env)
AI_SDK_DEFAULT_PROVIDER=xai
AI_DEFAULT_PROVIDER=grok
AI_CONTENT_TEMPERATURE=0.4
AI_GROK_WEB_SEARCH_DEFAULT=false

XAI_API_KEY=
XAI_MODEL=grok-4.3

OPENAI_API_KEY=
OPENAI_MODEL=gpt-5.4-mini

GEMINI_API_KEY=
GEMINI_MODEL=gemini-2.0-flash-lite
13

Ad Monetization & All 23 Ad Placement Slugs

Manage HTML/AdSense scripts or direct image banners in /admin/ads and map them to the 23 canonical placements seeded by AdPlacementSeeder:

All 23 Ad Placements
Placement Slug Display Name Location & Behavior
header-desktop Header Desktop Desktop header leaderboard (728x90 / 970x90)
header-mobile Header Mobile Mobile header banner slot (320x100 / 320x50)
header-banner Header Banner Generic top-of-page fallback banner across themes
sidebar-top Sidebar Top Upper widget region in main sidebar (300x250)
sidebar-mid Sidebar Mid Middle widget region between trending & categories
sidebar-bottom Sidebar Bottom Lower sticky sidebar slot (300x600 / 300x250)
sidebar-desktop Sidebar Desktop Legacy desktop sidebar fallback alias
before-title Before Title Renders immediately above article or page H1
after-title After Title Directly beneath article headline & metadata
after-featured-image After Featured Image Positioned between lead photo and body paragraphs
post-1st-p Post 1st Paragraph Auto-injected inside body after paragraph #1
post-2nd-p Post 2nd Paragraph Auto-injected inside body after paragraph #2
post-3rd-p Post 3rd Paragraph Auto-injected inside body after paragraph #3
in-article In Article Mid-article & repeating inline desktop unit
between-content-mobile Between Content Mobile Responsive mobile-only mid-article slot
after-content After Content Immediately after article body & before author box
home-after-trending Home After Trending Homepage strip directly below trending stories
home-mid-content Home Mid Content Homepage unit between category sections & videos
category-top Category Top Archive masthead leaderboard above category grid
category-inline Category Inline Injected inside category grids every 4–6 articles
footer-banner Footer Banner Full-width pre-footer strip across layout
footer Footer Centered 728x90 unit above site footer
sticky-footer-mobile Sticky Footer Mobile Pinned bottom anchor unit on small screens (320x50)
14

SEO Sitemaps, IndexNow, Schema, LLMs.txt & Facebook

  • XML Sitemaps & Crawlers: Root sitemap index at /sitemap.xml, chunked article feeds at /sitemap_v{1..10}.xml, CMS pages at /sitemap_pages.xml, customizable /robots.txt, IndexNow key verification at /indexnow-key.txt, and AI citation manifesto at /llms.txt.
  • JSON-LD Structured Data: Automated NewsArticle, WebSite, and BreadcrumbList schemas via SeoService.
  • Facebook Graph Auto-Publishing: Configure FACEBOOK_PAGE_ID, FACEBOOK_PAGE_ACCESS_TOKEN, and custom message template ({title}, {excerpt}, {url}) in /admin/settings?tab=social, then validate live with php artisan facebook:diagnose --probe.
15

First-Party Analytics, Viewability & External Pixels

  • Built-In Privacy-Friendly Telemetry: Beacons at /api/analytics/ad-impression, /ad-click, and /post-engagement feed real-time tabs under /admin/dashboard/{overview|posts|ads|reports} plus CSV export at /admin/analytics/export.
  • External Pixels (/admin/settings?tab=analytics): Paste Google Analytics 4 (G-...), Google Tag Manager (GTM-...), Meta Pixel ID, and custom <head> / <body> verification scripts.
16

Headless Mobile App REST API (/api/v1) & PWA

Built-in Flutter / React Native / Android / iOS API routes in routes/api.php with Sanctum OTP authentication, push notifications (/admin/notifications), mobile analytics (/admin/mobile-analytics), and offline PWA shell (public/offline.html, public/service-worker.ts):

Mobile REST API v1 Endpoints
Method Endpoint Path Auth Description
GET /api/v1/home Public Returns home feed payload (hero, trending, sections, videos, epapers)
GET /api/v1/settings Public Fetches mobile app config, branding logos, and social links
GET /api/v1/posts Public Paginated articles list; /breaking, /trending, /{slug}, /{slug}/related
GET /api/v1/categories Public Category list, /menu navigation tree, and /{slug}/posts feed
GET /api/v1/videos Public Standard videos, /videos/shorts feed, /{video}, and /{video}/share
GET /api/v1/epapers Public Digital ePaper editions list and /{slug} issue pages
GET /api/v1/ads/{placement} Public Resolves active ad creative for mobile placement slots
POST /api/v1/devices/register Public Registers FCM/APNs push notification token for app devices
POST /api/v1/analytics/track Public Accepts mobile impressions, ad-click, mobile-read, & notification-click events
POST /api/v1/auth/send-otp Public Passwordless OTP login + /verify-otp returning Sanctum API bearer token
GET /api/v1/bookmarks Sanctum Authenticated user saved articles, /posts/{id}/bookmark, and /like toggles
17

Roles, Permissions (RBAC), 2FA & Super Admin System Console

  • Granular RBAC (Spatie Laravel Permission): Ships with 4 pre-seeded roles (Super Admin, Admin, Editor, Author) editable under /admin/roles and /admin/permissions.
  • Two-Factor Authentication: Built-in Fortify TOTP 2FA setup and recovery codes available at /settings/two-factor.
  • Super Admin System Controls (/admin/system): Protected by role:super-admin middleware; lets Super Admins clear Laravel App Cache, PHP OPcache, Nginx FastCGI Cache, and trigger safe Nginx reload directly from the UI.
18

Scheduled Cron Jobs & Artisan CLI Reference

Single Production Crontab Entry (powers hourly analytics, 1-min AI schedules & daily sitemap ping)
* * * * * cd /var/www/your-domain.com && php artisan schedule:run >> /dev/null 2>&1
Custom Artisan Console Commands
Command Cadence Purpose
php artisan import:wordpress {url} --limit=100 --months=3 Manual Imports posts, categories, tags, & featured images from WordPress WP-JSON API
php artisan posts:regenerate-slugs --limit=500 --chunk=50 Manual Translates Devanagari headlines to clean English SEO URL slugs (add --force for all)
php artisan facebook:diagnose {postId?} --probe Manual Verifies Facebook Graph API token, page ID, queue health, & tests live post publish
php artisan sitemap:ping --url={optionalUrl} Daily Dispatches sitemap & URL notifications to Google, Bing, and IndexNow partners
php artisan analytics:aggregate-daily --today Hourly Aggregates raw view, session, and ad logs into daily stats (--all or --date=...)
php artisan analytics:prune-raw --hours=72 Hourly Prunes raw high-volume analytics rows older than 72 hours after aggregation
php artisan ai-blog:schedules-dispatch Every Min Checks active AI auto-blog schedules and queues article generation jobs
19

Troubleshooting & Frequently Asked Questions

Uploaded images or ePaper pages return 404 Not Found?

Run "php artisan storage:link" from project root so public/storage points to storage/app/public. Also ensure FILESYSTEM_DISK=public or local URL paths resolve cleanly, and verify storage/ directory permissions are 775/755.

How do I switch between themes v1–v10 and clear old views?

Open your .env file and update THEME=v10 (or any value from v1 to v10). Immediately run "php artisan optimize:clear" so Laravel clears any cached config and compiled Blade views.

"Unable to locate file in Vite manifest" error appears?

Run "npm install && npm run build" to compile production CSS/JS assets (including theme-v1.css through theme-v10.css, web.css, app.ts, and frontend.ts) into public/build/manifest.json.

How do I change the seeded Super Admin password or create a new admin?

DatabaseSeeder runs AdminUserSeeder which creates the initial Super Admin user. Log in and immediately change the password in Profile/Password Settings (/settings/password), or update AdminUserSeeder before seeding on production.

Scheduled AI Blog posts or Facebook auto-publishing are not triggering?

Both rely on Laravel Scheduler and Background Queues. Ensure cron executes "* * * * * cd /path/to/app && php artisan schedule:run" every minute, keep a queue worker running via systemd/Supervisor, and run "php artisan facebook:diagnose --probe" to verify Page tokens.

How do I configure Google AdSense ads.txt verification?

Place your ads.txt file directly inside the public/ directory (e.g. public/ads.txt) so it serves cleanly at https://yourdomain.com/ads.txt alongside robots.txt.