A
AdSathi Docs v1.0.0
⚡ Complete Production Documentation

AdSathi Documentation Hub

Welcome to the official developer and administrator handbook for AdSathi — the high-converting WhatsApp & Instagram advertising marketplace and pay-per-click (PPC) bidding platform.

1 System Overview & Core Purpose

AdSathi is a turnkey digital ad template marketplace and performance PPC network. It connects D2C ecommerce brands, local businesses, and creators with buyers through high-converting direct-to-WhatsApp and Instagram sales funnels.

💬 Direct WhatsApp Funnels

1-click WhatsApp DM initiations with pre-filled lead messages.

💳 Wallet PPC Bidding

Real-time micro-deductions per click ($0.09 CPC) & impression ($0.05 CPM).

📊 Analytics & Leaderboards

Chart.js revenue growth graphs and top-converting ad leaderboards.

2 Technology Architecture & Requirements

Server & Language Requirements
  • • PHP Version: PHP 8.0 or higher (8.1, 8.2, 8.3, 8.4)
  • • Database: MySQL 5.7+ / MariaDB 10.3+
  • • PHP Extensions: PDO, PDO_MySQL, GD, MBString, cURL, JSON
  • • Web Server: Apache (`mod_rewrite` enabled) or Nginx
Frontend Frameworks & Styling
  • • CSS & Styling: Tailwind CSS + Custom Responsive Layout Utility Engine
  • • Typography: Google Fonts (Sora, Inter, JetBrains Mono)
  • • Charts & Graphs: Chart.js 4.x for real-time analytics
  • • Icons: Heroicons SVG system

3 Full Installation & Deployment Guide

RECOMMENDED Method A: Interactive Web Installer (4 Easy Steps)

Open your browser and navigate to http://yourdomain.com/install/.

Step 1: Requirements Check

Verifies PHP version and directory write permissions for uploads/ and config/.

Step 2: DB Connection & SQL Import

Test connection via AJAX and auto-imports install/database/database.sql.

Step 3: Super Admin Setup

Creates your primary administrator login credentials with secure bcrypt hashing.

Step 4: Lock & Launch

Generates config/db.php and creates security lock install/installed.lock.

Method B: Manual Shared Hosting / cPanel Setup

  1. Upload all files to your cPanel public_html or subdirectory folder.
  2. Create a MySQL Database & User in cPanel MySQL Database Wizard.
  3. Import install/database/database.sql using phpMyAdmin.
  4. Edit config/db.php and update DB_HOST, DB_USER, DB_PASS, and DB_NAME.

Method C: Nginx VPS Configuration

For Ubuntu/Debian Nginx servers, copy the provided sample config from nginx.conf.example to /etc/nginx/sites-available/adssathi:

server {
    listen 80;
    server_name yourdomain.com;
    root /var/www/adssathi;
    index index.php;

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

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

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
    }
}

4 Database Schema & SQL Tables Overview

All SQL DDL definitions and initial seed configurations are centrally stored in install/database/database.sql.

users Stores accounts, password hashes, roles (admin/user), wallet balances & last_seen timestamp.
InnoDB
ads Stores ad creatives, copy, destination WA numbers, daily budgets, CPC/CPM rates, views, and chats.
InnoDB
wallet_transactions High-precision DECIMAL(12,6) ledger logging wallet top-ups, click fees ($0.09) and CPM impression deductions.
InnoDB
settings Key-value table for site name, logo, support emails, Razorpay, UPI QR, and Stripe credentials.
InnoDB
pages Dynamic CMS legal & info pages (Privacy Policy, Terms, Refund Policy, About Us, Contact).
InnoDB
withdrawals Payout request records for advertisers requesting earnings or wallet refunds.
InnoDB

5 Advertiser & Public Marketplace Features

🔍 Search Engine & Filters

Header search inputs (#searchInputDesktop & #searchInputMobile) feature 300ms debouncing, real-time query synchronization, category pills (WhatsApp, E-commerce, Tech, Fashion, Real Estate), and instant view switching.

📱 Advertiser Campaign Hub (/my-ads)

Advertisers manage all campaigns with live status indicators (live, paused, pending, rejected). Features campaign editing, status toggles, and taken-down safety locks preventing unauthorized republishing.

🎨 Creator Studio Drawer

Interactive drawer allowing advertisers to build campaign creatives, upload custom media thumbnails, configure target locations, WhatsApp numbers, pre-filled lead messages, and daily budgets.

💳 Multipay Wallet System

Instant wallet top-ups via Razorpay, UPI QR (Instant Intent), Stripe Checkout, or Manual Bank Deposit with proof upload.

6 Super Admin Management Suite (/admin)

📈 Executive Analytics

Chart.js line graphs for revenue growth and doughnut charts for click vs impression engagement breakdown.

🏆 Master Leaderboard

Ranked campaign leaderboard with rank medals (🥇 #1, 🥈 #2, 🥉 #3) and CTR metrics.

⚡ Live Traffic Stream

Real-time activity stream monitor tracking active online users (last_seen filter) and database event streams.

7 API Endpoints & Integration Reference

GET /api/get_ads.php
Fetch active marketplace ads with search & category filters
POST /api/interact_ad.php
Log WhatsApp click / view & deduct PPC fee from advertiser wallet
POST /api/create_ad.php
Create a new ad campaign submission
GET /health.php
System & Database health check diagnostic endpoint

8 FAQs & Troubleshooting

Q: Uploaded image is not displaying on ad cards. How to fix?

Ensure uploads/ directory has write permissions (chmod 775 or 777). formatAssetUrl() handles path formatting automatically.

Q: How to reset Admin Password if forgotten?

Execute in phpMyAdmin: UPDATE users SET password = '$2y$10$X87q8sQ1hQ3H0JkQ7m1UueXm.E3v3R2gT8LzW.3Q8zJ0/r/c5j4O2' WHERE email = 'admin@gmail.com'; (Resets password to admin123).

9 Visual Platform Screenshots (24)

High-resolution visual tour of the Web Installer, User Marketplace, and Master Admin Control Center.