Quick Start Guide
Quick Start Overview
Section titled “Quick Start Overview”This guide will help you get DealAI.lt up and running in your development environment. Follow these steps to set up the platform and verify that all components are working correctly.
Prerequisites Checklist
Section titled “Prerequisites Checklist”Before starting, ensure you have:
- Linux server (Ubuntu 20.04+ or Debian 10+)
- PHP 8.0 or higher installed
- PostgreSQL 13+ installed and running
- Elasticsearch 7.x installed and running
- Apache/Nginx web server configured
- WordPress 6.x installed
- Scrapyd server accessible
- Git for version control
- SSH access to your server
- Database credentials
- Administrative privileges
Installation Steps
Section titled “Installation Steps”Step 1: Clone the Theme
Section titled “Step 1: Clone the Theme”cd /var/www/html/wp-content/themes/git clone <repository-url> productscd productsStep 2: Configure Database Connection
Section titled “Step 2: Configure Database Connection”Create or edit the environment configuration file:
cp .env.example .envnano .envAdd your database credentials:
DB_HOST=162.55.174.116DB_PORT=5432DB_NAME=dealai_productsDB_USER=your_usernameDB_PASSWORD=your_password
ELASTICSEARCH_HOST=91.99.113.45ELASTICSEARCH_PORT=9200
SCRAPYD_HOST=78.56.0.236SCRAPYD_PORT=6800Step 3: Verify Database Connection
Section titled “Step 3: Verify Database Connection”Run the database verification script:
cd scriptsphp check-db.phpExpected output:
✓ Database connection successful✓ All required tables exist✓ Product count: 60,000+Step 4: Verify Elasticsearch Connection
Section titled “Step 4: Verify Elasticsearch Connection”Test the Elasticsearch connection:
php scripts/verify-setup.phpExpected output:
✓ Elasticsearch is accessible✓ Index 'products' exists✓ Lithuanian analyzer configuredStep 5: Activate WordPress Theme
Section titled “Step 5: Activate WordPress Theme”- Log into WordPress Admin Dashboard
- Navigate to Appearance → Themes
- Activate the Products theme
- Verify theme activation
Step 6: Set Up Cron Jobs
Section titled “Step 6: Set Up Cron Jobs”Add the following cron jobs for automation:
crontab -eAdd these entries:
# Elasticsearch Auto-Sync (every 5 minutes)*/5 * * * * /usr/bin/php /var/www/html/wp-content/themes/products/scripts/elasticsearch-auto-sync.php >> /var/log/elasticsearch-sync.log 2>&1
# Product Crawler Manager (every 15 minutes)*/15 * * * * /usr/bin/php /var/www/html/wp-content/themes/products/scripts/product-crawler-manager.php >> /var/log/crawler-manager.log 2>&1
# Screenshot Manager (daily at 2 AM)0 2 * * * /usr/bin/php /var/www/html/wp-content/themes/products/scripts/product-screenshot-manager.php >> /var/log/screenshot-manager.log 2>&1
# Category Update (daily at 3 AM)0 3 * * * /usr/bin/php /var/www/html/wp-content/themes/products/scripts/cron/update-core-categories.php >> /var/log/category-update.log 2>&1Step 7: Initial Data Sync
Section titled “Step 7: Initial Data Sync”Initialize the Elasticsearch index:
cd scriptsphp elasticsearch-auto-sync.phpThis will start the three-phase synchronization:
- Initialize - Set up the index
- Bulk Sync - Process all products in batches
- Incremental - Keep data up-to-date
Monitor progress in the Elasticsearch Console dashboard.
Step 8: Verify Installation
Section titled “Step 8: Verify Installation”Check that everything is working:
- Dashboard Access: Navigate to your WordPress site homepage
- Product Search: Go to
/search/page - Elasticsearch Console: Access
/elasticsearch-console/(admin only) - Product Management: Visit
/products/page
Quick Verification Tests
Section titled “Quick Verification Tests”Test 1: Search Functionality
Section titled “Test 1: Search Functionality”- Navigate to the search page
- Enter “laptop” in the search box
- Verify results are displayed with highlighting
- Apply filters (category, price range)
- Check pagination works
Test 2: Scrapyd Dashboard
Section titled “Test 2: Scrapyd Dashboard”- Navigate to the homepage (Scrapyd Control)
- Verify job statistics are displayed
- Check that charts render correctly
- Verify spider list is populated
Test 3: Product Details
Section titled “Test 3: Product Details”- Go to Product Management page
- Click on any product
- Verify all product details display:
- Images
- Pricing information
- Specifications
- External links
Test 4: Price History
Section titled “Test 4: Price History”- Select a product with history data
- Check that the price chart renders
- Verify historical data points
- Test date range filtering
Common First-Time Issues
Section titled “Common First-Time Issues”Database Connection Fails
Section titled “Database Connection Fails”Problem: “Could not connect to database”
Solution:
# Check PostgreSQL is runningsudo systemctl status postgresql
# Test connection manuallypsql -h 162.55.174.116 -U username -d dealai_products
# Verify credentials in .env fileElasticsearch Not Responding
Section titled “Elasticsearch Not Responding”Problem: “Elasticsearch connection failed”
Solution:
# Check Elasticsearch statuscurl http://91.99.113.45:9200/_cluster/health
# Verify network connectivityping 91.99.113.45
# Check firewall rulesWordPress Theme Not Activating
Section titled “WordPress Theme Not Activating”Problem: Theme activation fails
Solution:
# Check file permissionssudo chown -R www-data:www-data /var/www/html/wp-content/themes/products
# Verify PHP versionphp -v # Should be 8.0+
# Check for PHP errorstail -f /var/log/apache2/error.logScrapyd Not Accessible
Section titled “Scrapyd Not Accessible”Problem: “Cannot connect to Scrapyd”
Solution:
# Test Scrapyd endpointcurl http://78.56.0.236:6800/daemonstatus.json
# Verify Scrapyd is runningNext Steps
Section titled “Next Steps”Now that you have DealAI.lt running, explore these areas:
Learn the Architecture
Section titled “Learn the Architecture”Read the Architecture Overview to understand how components interact.
Explore Features
Section titled “Explore Features”- Product Search - Advanced search implementation
- Price History - Price tracking system
- Category Management - Hierarchical categories
Administrative Tasks
Section titled “Administrative Tasks”- Scrapyd Control - Managing web scraping
- Elasticsearch Console - Search monitoring
- Product Management - Catalog administration
Development
Section titled “Development”- File Structure - Navigate the codebase
- API Reference - Integration endpoints
- Development Setup - Development environment
Development Mode
Section titled “Development Mode”For development, enable WordPress debug mode:
// In wp-config.phpdefine('WP_DEBUG', true);define('WP_DEBUG_LOG', true);define('WP_DEBUG_DISPLAY', false);Monitor logs:
tail -f /var/www/html/wp-content/debug.logPerformance Tips
Section titled “Performance Tips”For Development
Section titled “For Development”- Use a local Elasticsearch instance
- Enable WordPress query monitor plugin
- Use browser dev tools for frontend debugging
For Production
Section titled “For Production”- Enable OPcache for PHP
- Configure PostgreSQL connection pooling
- Set up WordPress object caching (Redis/Memcached)
- Use a CDN for static assets
Getting Help
Section titled “Getting Help”If you encounter issues:
- Check logs: Review error logs in
/var/log/and WordPress debug log - Verify setup: Run
scripts/verify-setup.php - Troubleshooting: See Troubleshooting Guide
- API docs: Check API Documentation for integration issues
Summary
Section titled “Summary”You should now have:
- ✅ DealAI.lt theme installed and activated
- ✅ Database and Elasticsearch connections verified
- ✅ Cron jobs configured for automation
- ✅ Initial data synchronized
- ✅ All dashboards accessible
Continue with the Architecture Overview to understand the system in depth.