This document outlines the complete implementation of the ad boost feature for the classified ads platform, following the PRD requirements and jiji.ng benchmark functionality.
The ad boost feature allows users to pay to promote their ads for increased visibility and priority placement in listings. Boosted ads appear first in search results and have visual indicators to distinguish them from regular ads.
- 7 days: ₦1,000
- 14 days: ₦1,800
- 30 days: ₦3,500
The boost functionality uses existing database tables:
adstable: Containsis_boosted(boolean) andboost_expires_at(timestamp) columnspaymentstable: Tracks all boost payments with polymorphic relationship
AdController enhanced with boost functionality:
// Get boost pricing options
GET /api/ads/boost/pricing
// Initiate boost payment (requires auth)
POST /api/ads/{id}/boost
Parameters: boost_days (7,14,30), email
// Verify boost payment (requires auth)
POST /api/ads/boost/verify
Parameters: reference
// Check boost expiry (admin/cron)
POST /api/ads/boost/check-expiryCreated app/Services/PaystackService.php for payment integration:
- Initialize payments
- Verify payments
- List transactions
- Priority Listing: Boosted ads appear first using
ORDER BY is_boosted DESC, boost_expires_at DESC - Expiry Management:
checkBoostExpiry()method to deactivate expired boosts - Payment Flow: Initialize → Redirect to Paystack → Verify → Activate boost
BoostAd Component (src/components/BoostAd.jsx):
- Modern UI with pricing cards
- Package selection (7, 14, 30 days)
- Email input for payment receipt
- Integration with Paystack payment flow
PaymentCallback Component (src/pages/PaymentCallback.jsx):
- Handles payment verification after Paystack redirect
- Shows success/error states
- Navigation back to ad or dashboard
Dashboard Component enhanced with:
- Boost status column in ads table
- Boost action buttons for eligible ads
- Visual indicators for boosted ads
- Real-time boost status updates
AdList Component enhanced with:
- Visual boost indicators (star icons, colored borders)
- "Featured" badges for boosted ads
- Priority positioning for boosted ads
- Gradient overlay for boosted ad cards
Boosted ads display:
- Primary colored borders
- Star icons
- "Boosted" and "Featured" chips
- Gradient overlay bars
- Enhanced hover effects
Add to .env:
PAYSTACK_PUBLIC_KEY=pk_test_xxxxxxxxxx
PAYSTACK_SECRET_KEY=sk_test_xxxxxxxxxx
PAYSTACK_PAYMENT_URL=https://api.paystack.coAdded payment callback route:
<Route path="/payment/callback" element={<PaymentCallback />} />- Boost Initiation: User clicks boost button on ad
- Package Selection: User selects boost duration (7, 14, or 30 days)
- Payment: Redirects to Paystack for secure payment
- Verification: Returns to app, payment is verified
- Activation: Ad boost is activated with expiry date
- Display: Ad appears with boost indicators and priority placement
- Authentication Required: All boost operations require user authentication
- Ownership Validation: Users can only boost their own ads
- Payment Verification: Server-side payment verification with Paystack
- Secure References: Unique payment references prevent replay attacks
- Increased Visibility: Boosted ads appear first in listings
- Visual Distinction: Multiple visual indicators highlight boosted ads
- Revenue Generation: Monetization through ad boost payments
- User Experience: Smooth payment flow with clear feedback
- Expiry Checks: Automated system to deactivate expired boosts
- Payment Tracking: Complete audit trail of all boost payments
- Analytics Ready: Boost data available for reporting and analytics
- Auto-renewal: Option for users to auto-renew boost
- Bulk Boost: Allow boosting multiple ads simultaneously
- Dynamic Pricing: Adjust pricing based on demand
- Geographic Boost: Location-specific boost options
To test the boost feature:
- Ensure Paystack test keys are configured
- Create an ad through the platform
- Navigate to Dashboard and click boost button on the ad
- Select a package and complete payment flow
- Verify ad appears with boost indicators in listings
- Check payment record in admin panel
The implementation follows the PRD specifications and provides a complete, production-ready ad boost feature with secure payment processing and comprehensive user experience.