
This project is a comprehensive full-stack application combining React frontend, WordPress content management, and Laravel backend API for enhanced functionality and performance.
- Frontend: React.js with modern UI components
- Content Management: WordPress integration via REST API
- Backend API: Laravel for advanced features and caching
- Database: MySQL for data persistence
- Caching: Redis for improved performance
- Containerization: Docker for easy deployment
- π Display WordPress posts with pagination
- π Advanced search functionality
- π·οΈ Category and tag filtering
- π Blog statistics dashboard
- π± Responsive design
- β‘ Fast loading with modern React
- π High-performance API layer
- πΎ Redis-based caching
- π Authentication with Laravel Sanctum
- π‘οΈ Rate limiting and security
- π Enhanced analytics and metrics
- π Real-time content synchronization
- π° Content management via WordPress.com API
- πΌοΈ Featured image support
- π€ Author and metadata handling
- π¨ Rich content rendering
# Install Node.js dependencies for React
npm install
# Install PHP dependencies for Laravel
cd laravel-backend
composer install
cd ..
# Setup Laravel environment
npm run laravel:setup
# Run database migrations
npm run laravel:migrate
# Start both React and Laravel servers concurrently
npm run dev:full
# Or start individually:
# React frontend (port 3000)
npm start
# Laravel backend (port 8000)
npm run laravel:serve
- React Frontend: http://localhost:3000
- Laravel API: http://localhost:8000/api
- API Health Check: http://localhost:8000/api/health
# Start all services (React + Laravel + WordPress + MySQL + Redis)
npm run docker:prod
# Or run in background
npm run docker:prod:bg
- React App: http://localhost:3000
- Laravel API: http://localhost:8001
- WordPress: http://localhost:8080
- phpMyAdmin: http://localhost:8081
- Redis: localhost:6379
npm install
Update your WordPress site URL in src/services/wordpressApi.js
:
const WP_API_BASE_URL = 'https://your-wordpress-site.com/wp-json/wp/v2';
npm start
For detailed WordPress configuration instructions, see WORDPRESS_SETUP.md.
Verify your WordPress REST API is working by visiting:
https://your-wordpress-site.com/wp-json/wp/v2/posts
Runs the app in development mode.
Open http://localhost:3000 to view it in your browser.
Launches the test runner in the interactive watch mode.
Builds the app for production to the build
folder.
Start development environment with Docker (React + WordPress + MySQL)
Start development environment in background
Start production environment with Docker
Stop all Docker services
Build production Docker image
For detailed Docker instructions, see DOCKER_SETUP.md.
react-wordpress/
βββ src/ # React frontend source
β βββ components/ # React components
β β βββ BlogStats.js # WordPress statistics
β β βββ WordPressPosts.js # Posts display
β β βββ WordPressSearch.js # Search functionality
β β βββ LaravelDashboard.js # Laravel backend dashboard
β βββ services/ # API services
β β βββ wordpressApi.js # WordPress API integration
β β βββ laravelApi.js # Laravel API integration
β βββ App.js # Main React application
βββ laravel-backend/ # Laravel API backend
β βββ app/ # Laravel application
β β βββ Http/Controllers/ # API controllers
β β βββ Services/ # Business logic services
β β βββ Models/ # Eloquent models
β βββ config/ # Configuration files
β βββ routes/ # API routes
β βββ database/ # Migrations and seeders
βββ public/ # React build output
βββ docker-compose.yml # Docker production setup
βββ docker-compose.dev.yml # Docker development setup
βββ README.md # This file
βββ LARAVEL_SETUP.md # Laravel setup guide
βββ LARAVEL_WORDPRESS.md # Technical integration guide
βββ package.json # Node.js dependencies and scripts
# Setup everything at once
npm run setup:all
# Start both React and Laravel servers
npm run dev:full
# Start all services with Docker
npm run docker:dev
npm start # Start React development server
npm run build # Build for production
npm test # Run tests
npm run laravel:install # Install PHP dependencies
npm run laravel:setup # Setup Laravel environment
npm run laravel:serve # Start Laravel server
npm run laravel:migrate # Run database migrations
npm run laravel:test # Run Laravel tests
npm run docker:prod # Production Docker setup
npm run docker:dev # Development Docker setup
npm run docker:stop # Stop all containers
- Modify CSS files in
src/components/
for component-specific styles - Update
src/App.css
for global application styles - All styles are responsive and mobile-friendly
- Update
src/config/wordpress.js
for WordPress settings - Modify
src/services/wordpressApi.js
to add new API methods
If you encounter CORS errors, you may need to configure your WordPress server to allow cross-origin requests. See WORDPRESS_SETUP.md for solutions.
Test your WordPress REST API directly:
https://your-wordpress-site.com/wp-json/wp/v2/posts
- laravel-backend directory with full Laravel application
- RESTful API endpoints for WordPress integration
- Advanced caching with Redis support
- Rate limiting and security middleware
- CORS configuration for React frontend
- WordPressService: Advanced API integration with caching
- WordPressController: RESTful endpoints for all WordPress operations
- Middleware: CORS, rate limiting, and authentication
- Configuration: Environment-based WordPress and cache settings
- Docker Support: Full containerization with Nginx
- LaravelApiService: Complete API client for Laravel backend
- LaravelDashboard: Beautiful dashboard component for monitoring
- Tabbed Interface: Switch between WordPress content and Laravel backend
- Real-time Status: API health monitoring and performance metrics
- Updated docker-compose.yml with Laravel, Redis, and Nginx
- Production-ready containerization
- Multi-service orchestration
- LARAVEL_SETUP.md: Complete setup guide
- Updated README.md: Full-stack documentation
- LARAVEL_WORDPRESS.md: Technical integration guide
- High Performance: Redis caching for WordPress API responses
- Security: Rate limiting, CORS protection, input validation
- Monitoring: Real-time API status and performance metrics
- Scalability: Microservices architecture ready
- Developer Experience: Rich tooling and automated workflows
- React Frontend: http://localhost:3000
- Laravel API: http://localhost:8000 (local) or http://localhost:8001 (Docker)
- WordPress: http://localhost:8080 (Docker)
- API Health: http://localhost:8000/api/health
- GET /api/wordpress/posts - Enhanced WordPress posts
- GET /api/wordpress/search - Advanced search with caching
- GET /api/wordpress/stats - Blog statistics
- GET /api/health - API health check
- DELETE /api/wordpress/cache - Cache management
- React Frontend - Modern UI with tabbed interface
- Laravel Backend - High-performance API layer with caching
- WordPress Content - Content management via REST API
- The Laravel backend adds significant value with caching, rate limiting, enhanced error handling, and provides a foundation for advanced features like authentication, analytics, and real-time synchronization.
- React 19.1.0
- Axios for HTTP requests
- WordPress REST API
- Modern CSS with Flexbox/Grid
- Responsive design principles