Introduction
KekaiHost is a complete web hosting panel with subdomain hosting, wallet system, affiliate program, and mPanel file manager. Perfect for starting your own web hosting business.
Key Features:
- User Auth + Google OAuth
- Subdomain Hosting
- File Manager (mPanel)
- Wallet + Razorpay + PayPal
- Affiliate Program
- Admin Dashboard
- Password Reset via Email
- Chunked File Upload
Requirements
Server Requirements
- PHP 8.0 or higher
- MySQL 5.7+ / MariaDB 10.3+
- Apache with mod_rewrite
- PDO MySQL Extension
- OpenSSL Extension
- Mbstring Extension
- JSON Extension
- cURL Extension (recommended)
- FileInfo Extension (recommended)
For Development
- Node.js 16+ (for Tailwind CSS)
- NPM or Yarn
Recommended
- HTTPS/SSL Certificate
- Wildcard DNS for subdomains
- SMTP server for emails
Installation Guide
1Upload Files to Server
Upload all files to your web server's public directory (htdocs, www, public_html)
# Using Git
cd /var/www/html/
git clone https://github.com/your-repo/kekaihost.git
# Or upload via FTP/SFTP
Upload all files to your hosting root folder2Set Directory Permissions
Make storage directory writable for file uploads and sessions
chmod -R 755 storage/
chmod -R 755 public/assets/uploads/3Run the Installation Wizard
Open the installer in your browser
https://yourdomain.com/install/The wizard will check requirements, set up database, and create admin account.
4Installation Wizard Steps
Step 1: Requirements Check
Verifies PHP version, extensions, and folder permissions
Step 2: Database Setup
Enter MySQL host, database name, username, and password. Database is auto-created if it doesn't exist.
Step 3: Admin Account
Create your administrator username, email, and password (min 8 characters)
Step 4: Site Configuration
Set site name, main domain (for subdomains), and support email
Step 5: Integrations (Optional)
Configure Google OAuth, Razorpay, PayPal, SMTP email, and cPanel API
5Delete Install Folder
⚠️ IMPORTANT: Delete the install folder after installation for security!
rm -rf install/6Setup Wildcard DNS (For Subdomains)
Point *.yourdomain.com to your server IP for subdomain hosting
# DNS A Record
*.yourdomain.com → YOUR_SERVER_IP
# Example
*.kekaihost.com → 123.45.67.897Build CSS (Optional - Development)
If you want to customize styles, build Tailwind CSS
npm install
npm run build # Production build
npm run dev # Watch mode for developmentZIP Package — What's Inside
When you download KekaiHost from Codester you will receive one main ZIP that contains 2 ZIP files + a documentations/ folder:
This documentation you are reading right now. No need to upload it to your server.
Full fresh installation package. Contains all files, installer wizard, database schema, and assets.
Contains only changed/new files since the last version. Does NOT include the installer or database schema.
Important — How to Extract
Extract directly to your root folder
Both ZIPs are structured so that all files and folders sit at the root level of the archive. Extract them directly into your server root (e.g. public_html/ or htdocs/) — do not create a subfolder first.
Wrong — extracts into a nested folder
public_html/
└── kekaihost-v2.0.0/ # ❌ extra folder
├── index.php
├── .htaccess
└── ...Correct — all files at root
public_html/
├── index.php # ✅ correct
├── .htaccess
├── src/
├── storage/
└── ...
New Buyers
Fresh Installation — kekaihost-v2.0.0.zip
- Extract
kekaihost-v2.0.0.zipdirectly into your server'spublic_html/root - All files (
index.php,.htaccess,src/,storage/, etc.) should be at the root — not inside a subfolder - Open
https://yourdomain.com/install/in your browser - Follow the 5-step installation wizard
- Delete the
install/folder after installation
Existing Buyers
Updating from a Previous Version — kekaihost-update-v2.0.0.zip
Back up your server files and database before updating.
- Take a full backup of your existing
public_html/and database - Extract
kekaihost-update-v2.0.0.zipinto your server root — overwrite existing files when prompted - Your
.envfile is not included in the update ZIP — your existing config is safe - Your
storage/folder (user files) is not overwritten - Check
CHANGELOG.mdfor any manual DB migration steps required - Clear browser cache after updating
Safe files — never overwritten by update ZIP: .env, storage/users/, assets/uploads/
Configuration
.env File (Auto-generated by Installer)
# Application
APP_NAME="KekaiHost"
APP_ENV=production
APP_DEBUG=false
APP_URL=https://yourdomain.com/
# Database
DB_HOST=localhost
DB_NAME=kekaihost
DB_USER=root
DB_PASS=your_password
# Domain
SITE_DOMAIN=yourdomain.com
BASE_URL=https://yourdomain.com/
# Google OAuth (Optional)
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_REDIRECT_URI=https://yourdomain.com/auth/google/callback
# Razorpay (Optional)
RAZORPAY_KEY_ID=
RAZORPAY_KEY_SECRET=
# PayPal (Optional)
PAYPAL_CLIENT_ID=
PAYPAL_CLIENT_SECRET=
PAYPAL_MODE=sandbox # sandbox or live
# SMTP Email (Optional)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your@gmail.com
SMTP_PASS=app_password
SMTP_FROM=noreply@yourdomain.com
SMTP_FROM_NAME=KekaiHostThe installer automatically creates this file. You can edit it manually later if needed.
Folder Structure
kekaihost/
├── .env # Configuration (auto-generated)
├── .htaccess # URL rewriting & security
├── .installed # Install lock file
├── public/ # Web accessible root
│ ├── index.php # Main router
│ └── assets/ # CSS, JS, images
│ ├── css/
│ ├── js/
│ └── uploads/
├── src/ # Application code
│ ├── bootstrap.php # Core initialization
│ ├── controllers/ # API handlers
│ │ ├── api.php
│ │ ├── api_cpanel.php
│ │ ├── api_paypal.php
│ │ └── auth.php
│ ├── models/ # Database models
│ │ ├── User.php
│ │ ├── Plan.php
│ │ └── Wallet.php
│ ├── views/ # Page templates
│ │ ├── admin/ # Admin pages
│ │ ├── cpanel/ # mPanel pages
│ │ └── *.php # User pages
│ ├── utils/ # Helper functions
│ └── cron/ # Scheduled tasks
├── storage/ # User data (writable)
│ ├── users/ # User hosting files
│ ├── sessions/ # PHP sessions
│ ├── logs/ # Error logs
│ ├── cache/ # Cached data
│ ├── backups/ # Site backups
│ └── emails/ # Email backups (dev)
├── install/ # Installer (DELETE after install!)
│ ├── index.php
│ └── assets/sql/schema.sql
└── documentations/ # This documentationDatabase Schema
All tables are auto-created during installation from install/assets/sql/schema.sql
| Table | Description |
|---|---|
users | User accounts with profile, plan, storage info |
plans | Hosting plans (storage limits, pricing) |
hosting_plans | Additional hosting packages |
user_hostings | User subdomain hosting accounts |
files | Uploaded files tracking |
domains | User registered domains |
main_domains | Admin-managed main domains for subdomains |
tlds | Available TLD extensions |
wallets | User wallet balances |
wallet_transactions | Wallet credit/debit history |
affiliates | Affiliate program data |
referrals | Referral signups tracking |
razorpay_orders | Razorpay payment orders |
paypal_orders | PayPal payment orders |
transactions | Plan purchase transactions |
site_settings | Dynamic site configuration |
password_resets | Password reset tokens |
support_tickets | Customer support tickets |
activity_logs | User activity logging |
Features
User System
Registration, Google OAuth, Profile, Avatar, Password Reset
Domain System
Subdomain hosting, Custom domains, TLDs, DNS management
Wallet System
Add funds via Razorpay/PayPal, Transaction history, Balance tracking
Affiliate Program
Referral links, Commission tiers (Bronze/Silver/Gold), Payouts
Robust Upload
Chunked uploads, Retry on failure, Resume capability, Progress tracking
Email System
SMTP support, Password reset emails, Notification emails
Admin Panel
Access: yoursite.com/admin
- User Management
- Plans Management
- Domain/TLD Management
- Razorpay Settings
- Site Settings
- Statistics
mPanel (File Manager)
Built-in file manager similar to cPanel. Users can manage their hosting files through a modern web interface.
File Manager Features:
Supported File Types
- HTML, CSS, JavaScript
- PHP files
- Images (PNG, JPG, GIF, SVG)
- JSON, XML, TXT
- ZIP archives
Storage Management
- Real-time disk usage display
- Plan storage limits enforced
- File count limits per plan
- Progress bar for uploads
- Retry failed uploads automatically
API Reference
| Endpoint | Method | Description |
|---|---|---|
/api/register | POST | User registration |
/api/login | POST | User login |
/api/forgot-password | POST | Password reset email |
/api/reset-password | POST | Reset password with token |
/api/upload | POST | Upload file (chunked support) |
/api/delete | POST | Delete file/folder |
/api/plans | GET | Get all plans |
/api/plans/buy | POST | Buy plan with wallet |
/api/razorpay/create | POST | Create Razorpay order |
/api/razorpay/verify | POST | Verify Razorpay payment |
/api/paypal/create | POST | Create PayPal order |
/api/paypal/capture | POST | Capture PayPal payment |
/api/google/auth | GET | Google OAuth redirect |
/api/google/callback | GET | Google OAuth callback |
/api/cpanel/* | POST | File manager operations |
cPanel API Integration
Overview
KekaiHost integrates with cPanel UAPI to manage subdomains, files, MySQL databases, and email accounts. This is optional - the system works with wildcard DNS as an alternative.
Note: cPanel integration requires a valid cPanel account with API Token access. Set CPANEL_ENABLED=true in .env to enable.
Configuration (.env)
# cPanel API Settings
CPANEL_ENABLED=true
CPANEL_HOST=yourdomain.com
CPANEL_USER=cpanel_username
CPANEL_TOKEN=your_api_token
# MySQL via cPanel (optional)
CPANEL_MYSQL_HOST=localhost
CPANEL_MYSQL_USER=cpanel_user
CPANEL_MYSQL_PASS=mysql_passwordGenerate API Token: cPanel → Security → Manage API Tokens → Create
Available Functions (src/utils/cpanel.php)
| Function | cPanel Module | Description |
|---|---|---|
cpanel_api_request() | Core | Make raw API request to cPanel UAPI |
is_cpanel_enabled() | Core | Check if cPanel integration is enabled |
get_cpanel_config() | Core | Get cPanel configuration from .env |
Subdomain Management
| Function | cPanel API | Description |
|---|---|---|
cpanel_create_subdomain($subdomain, $docRoot) | SubDomain::addsubdomain | Create new subdomain |
cpanel_delete_subdomain($subdomain) | SubDomain::delsubdomain | Delete subdomain |
cpanel_list_subdomains() | SubDomain::listsubdomains | List all subdomains |
cpanel_create_subdomain_with_folder($name, $domain) | SubDomain::addsubdomain | Create subdomain with home folder |
sync_user_subdomain($subdomain) | SubDomain::addsubdomain | Sync user subdomain on registration |
remove_user_subdomain($subdomain) | SubDomain::delsubdomain | Remove subdomain on user delete |
// Example: Create subdomain
$result = cpanel_create_subdomain('mysite', 'public_html/sites/mysite');
// Returns: ['success' => true, 'subdomain' => 'mysite.domain.com']File Manager
| Function | cPanel API | Description |
|---|---|---|
cpanel_create_folder_in_home($name) | Fileman::mkdir | Create folder in home directory |
cpanel_write_file($path, $content) | Fileman::save_file_content | Write/create file with content |
cpanel_read_file_content($dir, $file) | Fileman::get_file_content | Read file content |
cpanel_fetch_raw_file($path, $maxBytes) | Fileman::get_file_content | Fetch raw file (handles Maildir) |
MySQL Database Management
| Function | cPanel API | Description |
|---|---|---|
cpanel_create_database($name) | Mysql::create_database | Create MySQL database |
cpanel_delete_database($name) | Mysql::delete_database | Delete MySQL database |
cpanel_list_databases() | Mysql::list_databases | List all databases |
cpanel_create_database_user($user, $pass) | Mysql::create_user | Create database user |
cpanel_delete_database_user($user) | Mysql::delete_user | Delete database user |
cpanel_list_database_users() | Mysql::list_users | List all database users |
cpanel_set_privileges($user, $db, $privs) | Mysql::set_privileges_on_database | Grant privileges to user |
cpanel_get_mysql_server() | Mysql::get_server_information | Get MySQL server info |
// Example: Create database with user
$db = cpanel_create_database('myapp_db');
$user = cpanel_create_database_user('myapp_user', 'SecurePass123!');
cpanel_set_privileges('myapp_user', 'myapp_db', 'ALL PRIVILEGES');Other Functions
| Function | cPanel API | Description |
|---|---|---|
cpanel_get_disk_usage() | Quota::get_quota_info | Get disk usage stats |
cpanel_create_addon_domain($domain, $sub, $doc) | AddonDomain::addaddondomain | Create addon domain |
cpanel_log($type, $message) | - | Log cPanel operations to file |
Raw API Request Format
All cPanel UAPI calls use this format:
// URL Format
https://{host}:2083/execute/{Module}/{function}?param1=value1¶m2=value2
// Authorization Header
Authorization: cpanel {username}:{api_token}
// Example: Create subdomain
$result = cpanel_api_request('SubDomain', 'addsubdomain', [
'domain' => 'mysite',
'rootdomain' => 'example.com',
'dir' => 'public_html/mysite'
]);API Response Format
// Success Response
{
"status": 1,
"data": { ... },
"messages": null,
"errors": null
}
// Error Response
{
"status": 0,
"data": null,
"errors": ["Error message here"]
}Full cPanel UAPI docs: api.docs.cpanel.net
Payment Integration
Razorpay Setup (India)
- Create account at razorpay.com
- Go to Settings → API Keys
- Generate Key ID & Key Secret
- Add to .env or Admin → Razorpay Settings
- Enable Razorpay from Admin Panel
RAZORPAY_KEY_ID=rzp_live_xxx
RAZORPAY_KEY_SECRET=xxxPayPal Setup (International)
- Create app at developer.paypal.com
- Go to My Apps & Credentials
- Create new REST API app
- Copy Client ID & Secret
- Set mode: sandbox (test) or live
PAYPAL_CLIENT_ID=Axx...
PAYPAL_CLIENT_SECRET=xxx
PAYPAL_MODE=liveCustomization
Tailwind CSS
Modify styles in src/assets/tailwind_input.css
npm install
npm run dev # Watch mode
npm run build # ProductionAdmin Customization
From Admin Panel you can customize:
- Site name, logo, favicon
- Home page content
- Terms, Privacy, DMCA pages
- Currency and exchange rates
- Payment gateway settings
Troubleshooting
404 Not Found Error
mod_rewrite not enabled or .htaccess not working.
sudo a2enmod rewrite
sudo systemctl restart apache2Also check AllowOverride All is set in Apache config.
Database Connection Failed
Check your .env file credentials are correct.
DB_HOST=localhost
DB_NAME=kekaihost
DB_USER=root
DB_PASS=your_passwordFile Upload Failed
Storage folder not writable or PHP upload limits too low.
chmod -R 755 storage/
chown -R www-data:www-data storage/Also check php.ini: upload_max_filesize, post_max_size, max_execution_time
Emails Not Sending
SMTP credentials incorrect or port blocked by server.
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your@gmail.com
SMTP_PASS=app_password # Use App Password, not regular passwordSession Issues / Keeps Logging Out
Session folder not writable or PHP session issues.
chmod 755 storage/sessions/
chown www-data:www-data storage/sessions/Payment Gateway Errors
Check API keys are correct and mode matches (sandbox/live).
- • Razorpay: Test keys start with
rzp_test_ - • PayPal: Set PAYPAL_MODE=sandbox for testing
- • Make sure webhook URLs are accessible
Subdomain Not Working
Wildcard DNS and SSL not configured.
- • Add wildcard DNS:
*.yourdomain.com → Server IP - • Install wildcard SSL certificate
- • Check Apache/Nginx vhost configuration
Blank Page / 500 Error
Check PHP error logs for details.
tail -f /var/log/apache2/error.log
# Or check storage/logs/License & Support
Regular License
- Use on only 1 domain
- Use for personal or client project
- End product cannot be sold
- Lifetime updates included
- 6 months support
Perfect for personal websites, portfolios, or single client projects.
Extended License
- Use on unlimited domains
- Use for personal or client project
- End product CAN be sold
- Lifetime updates included
- 12 months priority support
- SaaS / Subscription usage allowed
Ideal for commercial products, SaaS, or reselling to clients.
What's Included in Support?
Report any bugs and we'll fix them in the next update.
Get help via email within 24-48 business hours.
Get all future updates and new features for free.
Stripe Payment Gateway
Overview
Stripe uses Checkout Sessions (hosted payment page). No Stripe SDK needed — direct cURL calls. Supports cards, Apple Pay, Google Pay, SEPA, and more.
Cards
Visa, Mastercard, Amex
Apple / Google Pay
One-tap checkout
50+ Currencies
Global payments
Admin Setup — /admin-stripe
| Setting | Description | Example |
|---|---|---|
Publishable Key | Frontend key (starts pk_) | pk_test_51... |
Secret Key | Backend key (starts sk_) | sk_test_51... |
Webhook Secret | Webhook signing secret | whsec_... |
Currency | Checkout currency code | usd, inr, eur |
Min/Max Deposit | Wallet deposit limits | 1 – 10000 |
Payment Flow
- User clicks Pay with Stripe on wallet/plans/hosting page
- Frontend POSTs to
POST /api/stripe/create-session - Server creates a Stripe Checkout Session via cURL
- User is redirected to Stripe-hosted payment page
- After payment, Stripe redirects to
GET /api/stripe/success?session_id=... - Server verifies the session, activates plan/hosting or credits wallet
- User is redirected to
/wallet?stripe=success
Webhook fallback: POST /api/stripe/webhook handles checkout.session.completed event.
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/stripe/create-session | Create Stripe Checkout Session |
| GET | /api/stripe/success | Success redirect handler |
| POST | /api/stripe/webhook | Stripe webhook receiver |
Webhook Setup
Add this URL in Stripe Dashboard → Webhooks:
https://yourdomain.com/api/stripe/webhookRequired event: checkout.session.completed
Test card: 4242 4242 4242 4242 · Any future date · Any CVV
DB Table — stripe_orders
| Column | Type | Description |
|---|---|---|
| id | INT | Auto increment PK |
| user_id | INT | User who paid |
| session_id | VARCHAR | Stripe Checkout Session ID |
| payment_intent_id | VARCHAR | Stripe PaymentIntent ID |
| amount | DECIMAL | Amount in currency |
| currency | VARCHAR | e.g. usd, inr |
| type | VARCHAR | wallet / plan / hosting / domain |
| item_id | INT | Plan ID (if applicable) |
| status | ENUM | pending / completed / failed |
Table is auto-created on first Stripe API call.
Offline Payment System
Overview
Users can pay via Bank Transfer, UPI, Cash, or Crypto and submit the transaction reference. Admin reviews and approves manually — plan/hosting activates only after admin approval.
User Flow
- Select Offline Payment at checkout
- View bank / UPI / payment details shown in modal
- Transfer amount manually
- Submit form: payment method + transaction/reference number + optional notes
- Request saved as pending
- Admin approves → plan/hosting instantly activated + email notification
Admin Management — /admin-offline-payments
- Filter by Pending / Approved / Rejected / All
- Pending count badge shown in sidebar
- Approve — activates plan/hosting/wallet immediately
- Reject — enter rejection reason, user notified by email
Admin Settings — /admin-settings
| Setting | Description |
|---|---|
| Enable Offline Payment | Toggle on/off for all pages |
| Payment Instructions | Text shown to user above the form |
| Bank / Payment Details | Multi-line bank account / UPI / crypto details shown to user |
API Endpoints
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| POST | /api/offline-payment/submit | User | Submit payment request |
| GET | /api/offline-payment/list | Admin | List all requests |
| POST | /api/offline-payment/approve | Admin | Approve & activate |
| POST | /api/offline-payment/reject | Admin | Reject with reason |
DB Table — offline_payments
| Column | Type | Description |
|---|---|---|
| id | INT | Auto increment PK |
| user_id | INT | Requesting user |
| type | ENUM | plan / hosting / wallet |
| item_id | INT | Plan ID (if applicable) |
| amount | DECIMAL | Amount in USD |
| payment_method | VARCHAR | bank_transfer / upi / cash / crypto |
| ref_number | VARCHAR | UTR / TXN / reference number |
| notes | TEXT | Optional user notes |
| status | ENUM | pending / approved / rejected |
| rejection_reason | TEXT | Reason if rejected |
| reviewed_by | INT | Admin user ID |
| reviewed_at | TIMESTAMP | When reviewed |
Table is auto-created when the page loads.
Multi-Currency System
How It Works
- DB stores prices in USD — all plan prices are in USD
- Users select display currency — via header dropdown (48 currencies)
- Live exchange rates — fetched from
exchangerate-api.com, cached 1 hour - Client-side conversion — prices update instantly without page reload
- Admin always sees USD — cookie/session override ignored for admins
User Currency Selection
- Desktop: Currency dropdown in header (coins icon)
- Mobile: Currency panel inside sidebar menu
- Selection saved in
user_currencycookie (1 year) - Searchable dropdown — type currency name or code
PHP Helper Functions
| Function | Returns | Description |
|---|---|---|
get_currency_code() | string | User's selected currency code (e.g. INR) |
get_currency_symbol() | string | Currency symbol (e.g. ₹) |
convert_currency($usd) | float | Convert USD amount to user's currency |
get_exchange_rate($code) | float | Exchange rate from USD to given code |
format_converted_price($usd) | string | Formatted string with symbol + converted amount |
get_all_currencies() | array | All 48 supported currencies with symbol + name |
Client-Side Conversion
Add data-usd-price attribute to any price element to enable auto-conversion:
<!-- Amount auto-converts when currency changes -->
<span data-usd-price="19.00">$19.00</span>
<!-- Symbol auto-updates -->
<span data-currency-symbol>$</span>JS fetches rates from /api/currency and updates all matching elements on currency select.
Exchange Rate API
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/currency | Returns USD-based live exchange rates (cached 1 hour) |
// Response
{ "success": true, "base": "USD", "rates": { "INR": 83.5, "EUR": 0.92, ... } }Language & Translation
Overview
Uses Google Translate widget (free) to translate all page content. Supports 100+ languages. No API key required.
UI Placement
| Device | Location | Features |
|---|---|---|
| Desktop (≥640px) | Header — language icon button | Searchable inline dropdown, 100+ languages |
| Mobile (<640px) | Profile sidebar (logged-in) or hamburger sidebar (guest) | Collapsible accordion with search, no popup |
How It Works
- User selects language from custom HTML dropdown (not native select)
- Selection saved to
kekaihost_translate_langin localStorage googtranscookie set with value/en/[lang]- Google Translate widget reads cookie and translates page
- Selection persists across pages via cookie + localStorage
Exclude Elements from Translation
<!-- Add class="notranslate" and translate="no" -->
<span class="notranslate" translate="no">KekaiHost</span>Live Chat System
Overview
Built-in live chat — no third-party service needed. Polling-based (every 3 seconds). Supports both online (live) and offline (leave a message) modes.
User Widget
- Floating button bottom-right — violet gradient, pulsing green dot when online
- Logged-in users: chat starts automatically
- Guest users: enter name + email first, then chat
- Offline mode: leave a message form (name, email, message)
- Unread badge on toggle button when panel is closed
- Auto-polls every 3 seconds for new admin replies
Admin Panel — /admin-chat
- Session list with All / Pending / Open / Closed tabs
- Status badges — pending (amber), open (green), closed (grey)
- Unread count per session + total badge in sidebar
- Full conversation view + reply box
- Close session button
- Collapsible settings: Online/Offline toggle, welcome message, offline message
- Fully mobile responsive
API Endpoints
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| POST | /api/chat/start | Any | Start or resume session |
| POST | /api/chat/send | User | Send a message |
| GET | /api/chat/poll | User | Poll for new messages |
| POST | /api/chat/close | User | Close session |
| GET | /api/chat/admin-list | Admin | List all sessions |
| GET | /api/chat/admin-messages | Admin | Get session messages |
| POST | /api/chat/admin-send | Admin | Send admin reply |
| POST | /api/chat/admin-close | Admin | Close session |
| POST | /api/chat/admin-settings | Admin | Save chat settings |
| GET | /api/chat/admin-get-settings | Admin | Get chat settings |
DB Tables
| Table | Description |
|---|---|
chat_sessions | id, user_id, guest_name, guest_email, status (open/closed/pending), last_message_at |
chat_messages | id, session_id, sender_type (user/admin/system), sender_name, message, is_read |
chat_settings | online_status, welcome_message, offline_message |
All tables auto-created on first chat API call.
Background Animation Effects
Overview
Animated canvas background visible on all pages. Uses HTML5 Canvas API. Renders behind all content (z-index: 0) and never blocks clicks (pointer-events: none).
Floating + twinkle
Connect nearby particles
Pulsing radial gradients
Elliptical soft glow
Random twinkle
Random intervals
Implementation
Canvas is injected in src/views/header.php just before the nav element. It auto-resizes on window resize.
<!-- In header.php -->
<canvas id="bgCanvas"></canvas>
/* CSS */
#bgCanvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }Dark vs Light Theme
Effect intensity adapts to theme — dark theme has stronger orbs and more visible particles. Light theme uses subtle, low-opacity version. Controlled by PHP variable $isDark.
Admin Panel — Today's Updates
All Admin Pages
| Page | URL | What's New |
|---|---|---|
| Stripe Settings | /admin-stripe | Full Stripe gateway configuration |
| Offline Payments | /admin-offline-payments | Review, approve, reject manual payments |
| Live Chat | /admin-chat | Real-time chat management with mobile-responsive UI |
| Site Settings | /admin-settings | Offline payment settings (instructions, bank details) |
| Analytics | /admin-analytics | 90-day chart horizontal scroll fix |
Admin Currency — Always USD
Admin panel always displays prices in USD regardless of any cookie. This is enforced in get_currency_code() and get_currency_symbol() which check $_SESSION['is_admin'] first.
A 🪙 USD badge is shown in the admin header to confirm this.
Layout Fixes
- All admin pages use
max-w-full— no more right-side gaps - Main content background matches sidebar dark purple gradient
- All INR/₹ references replaced with USD/$