Prerequisites
Before setting up Dashboard Dilemmas, ensure you have the following installed:- Node.js v18 or higher
- MySQL database server
- Apache web server (for production deployment)
- Git for version control
Installation
Configure Database
Create a Add your WordPress database credentials:
.env file in the root directory. You can copy from .env.example:.env
Set Up Database Schema
Run the setup script to create the necessary database tables:This script creates the following tables:
de_app_users- Application usersde_app_games- Game sessionsde_app_clients- Client organizationsde_app_answers- User responsesde_app_areas- Business areasde_app_comparison- Comparison analytics
Configure Application Settings
Edit
includes/config.php to configure your environment:includes/config.php
Get your Gemini API key from Google AI Studio
Database Schema Files
Thesql/ directory contains various schema and migration files:
database.sql- Main database schemausers.sql- User table schemaareas_schema.sql- Business areas schemacompare_schema.sql- Comparison feature schemaupdate_analytics_schema.sql- Analytics tablesadd_performance_indexes.sql- Performance optimization indexesoptimizations.sql- Additional database optimizationsmock_comparison_data.sql- Sample data for testing
Development Tools
Thedev/ directory contains helpful utilities:
Checks
check-user.php- Verify user authenticationcheck_columns.php- Validate database columnscheck_games.php- Test game data integrity
Debug Scripts
debug_areas.php- Debug area functionalitydebug_db.php- Database connection testingdebug_pagination.php- Pagination testingdebug_relation.php- Relationship validationdebug_schema.php- Schema inspectiondebug_winners.php- Winners calculation testing
Tests
test-hash.php- Password hashing teststest-session.php- Session management teststest-smtp.php- Email sending teststest-wp-auth.php- WordPress authentication teststest-wp-mail.php- WordPress mail integration tests
Troubleshooting
Database Connection Issues
If you encounter database connection errors:- Verify MySQL is running
- Check credentials in
.envfile - Run
dev/debug/debug_db.phpto test connection
SMTP Configuration
Test email functionality:WordPress Integration
The application integrates with WordPress for authentication. Ensure:- WordPress is installed and accessible
WP_PATHandWP_SITE_URLare correctly configured inincludes/config.php- WordPress database tables are accessible
Next Steps
File Structure
Understand the project organization
Deployment
Deploy to production