📦 Installation
Follow this step-by-step guide to install and configure Threadwp on your WordPress site.
Prerequisites
System Requirements
Required Software
WordPress 5.6+ ✓ with PHP 7.4+
Node.js 16+ ✓ with npm or bun
MySQL/MariaDB ✓ database
Web server ✓ (Apache/Nginx) with WebSocket supportRecommended Setup
ServerVPS or dedicated hosting
MemoryMinimum 1GB RAM
SSLRequired for WebSocket
DomainWebSocket subdomain recommended
Installation Steps
1WordPress Plugin Setup
Install and configure the WordPress plugin
# Clone the repository
git clone https://github.com/Ri2rathod/threadwp.git
cd threadwp
# Install plugin in WordPress
cp -r wp-plugin/ /path/to/wordpress/wp-content/plugins/threadwp/
# Install PHP dependencies
cd /path/to/wordpress/wp-content/plugins/threadwp/
composer install2Frontend Build
Build the React frontend application
# Navigate to plugin directory
cd wp-plugin/
# Install dependencies
npm install
# or
bun install
# Build for production
npm run build
# or
bun run build
# For development
npm run dev
# or
bun run dev3Socket.IO Server Setup
Configure and start the WebSocket server
# Navigate to server directory
cd socket-server/
# Install dependencies
npm install
# or
bun install
# Configure environment
cp .env.example .env
# Edit .env with your settings
# Start server
npm start
# or
bun start
# For development with auto-reload
npm run dev
# or
bun run dev4WordPress Configuration
Set up database and API configuration
# Run database migrations
wp threadwp migrate:run --path=/path/to/wordpress
# Configure API settings in WordPress admin:
# Go to Settings > WPLC API
# - Enable API access
# - Generate API key
# - Configure user permissions5Environment Configuration
Create and configure the environment file
# WordPress Integration
WP_BASE_URL=https://yoursite.com
WP_API_NAMESPACE=threadwp-chat/v1
WP_API_KEY=your_generated_api_key_here
WP_API_TIMEOUT=10000
# Server Configuration
PORT=3001
NODE_ENV=production
# CORS Configuration
CORS_ORIGIN=https://yoursite.com
CORS_METHODS=GET,POST
# Socket.IO Configuration
SOCKET_PING_TIMEOUT=60000
SOCKET_PING_INTERVAL=25000Important Notes
WebSocket Configuration: Ensure your web server (Apache/Nginx) is configured to proxy WebSocket connections to the Socket.IO server on port 3001.
SSL Certificate: WebSocket connections require HTTPS in production. Make sure your SSL certificate covers both your main domain and any subdomains used for the WebSocket server.
Firewall Configuration: Open port 3001 for the Socket.IO server and ensure your firewall allows WebSocket connections.
🚀 Quick Start
For a quick test installation on a local development environment:
# Quick local setup
git clone https://github.com/Ri2rathod/threadwp.git
cd threadwp
# Install all dependencies
npm run install:all
# Start development servers
npm run dev:all
# Access your WordPress site with chat enabled