|
| 1 | +# GameStore WordPress Theme & Blocks |
| 2 | + |
| 3 | +> 📖 **Documentation Language**: [Русский](./docs/ru/README.md) | **English** (current) |
| 4 | +
|
| 5 | +A modern WordPress block theme for gaming stores, built with full-site editing support and custom React-based blocks. |
| 6 | + |
| 7 | +## 🎮 Project Overview |
| 8 | + |
| 9 | +GameStore is a comprehensive WordPress solution featuring: |
| 10 | + |
| 11 | +- **Block Theme**: Modern FSE (Full Site Editing) theme optimized for gaming stores |
| 12 | +- **Custom Blocks**: React-based Gutenberg blocks for enhanced functionality |
| 13 | +- **Core Plugin**: Essential functionality and customizations |
| 14 | +- **MU Plugin**: Must-use plugin for site-wide features |
| 15 | +- **Automated Deployment**: GitHub Actions CI/CD pipeline |
| 16 | + |
| 17 | +## 🏗️ Project Structure |
| 18 | + |
| 19 | +``` |
| 20 | +game-store/ |
| 21 | +├── .github/workflows/ |
| 22 | +│ └── CICD.yml # Automated deployment pipeline |
| 23 | +├── docs/ |
| 24 | +│ └── ru/ # Russian documentation |
| 25 | +├── mu-plugins/ |
| 26 | +│ └── gamestore-general.php # Must-use plugin |
| 27 | +├── plugins/ |
| 28 | +│ ├── blocks-gamestore/ # Custom React blocks |
| 29 | +│ └── core-gamestore/ # Core functionality plugin |
| 30 | +├── themes/ |
| 31 | +│ └── game-store/ # Main block theme |
| 32 | +├── docker-compose.yml # Local development environment |
| 33 | +├── wp-version-control.cfg # WordPress version management |
| 34 | +└── README.md # This file |
| 35 | +``` |
| 36 | + |
| 37 | +## 🔧 Components |
| 38 | + |
| 39 | +### Theme: `game-store` |
| 40 | +- **Type**: Block Theme (FSE) |
| 41 | +- **Author**: GKVSO |
| 42 | +- **Features**: |
| 43 | + - Full Site Editing support |
| 44 | + - Custom color palette for gaming aesthetics |
| 45 | + - Responsive design patterns |
| 46 | + - Gaming-optimized layouts |
| 47 | + |
| 48 | +### Plugin: `blocks-gamestore` |
| 49 | +- **Type**: Custom Gutenberg Blocks |
| 50 | +- **Technology**: React, WordPress Scripts |
| 51 | +- **Features**: |
| 52 | + - Custom gaming-related blocks |
| 53 | + - Modern build pipeline with `@wordpress/scripts` |
| 54 | + - Block manifest optimization |
| 55 | + |
| 56 | +### Plugin: `core-gamestore` |
| 57 | +- **Type**: Core Functionality |
| 58 | +- **Features**: Essential site customizations and utilities |
| 59 | + |
| 60 | +### MU Plugin: `gamestore-general` |
| 61 | +- **Type**: Must-Use Plugin |
| 62 | +- **Features**: Site-wide functionality that cannot be deactivated |
| 63 | + |
| 64 | +## 🚀 Development Setup |
| 65 | + |
| 66 | +### Prerequisites |
| 67 | +- Node.js 18+ |
| 68 | +- Docker & Docker Compose |
| 69 | +- Git |
| 70 | + |
| 71 | +### Local Development |
| 72 | + |
| 73 | +1. **Clone the repository** |
| 74 | + ```bash |
| 75 | + git clone https://github.com/GKVSO/GameStore.git> |
| 76 | + cd game-store |
| 77 | + ``` |
| 78 | + |
| 79 | +2. **Start development environment** |
| 80 | + ```bash |
| 81 | + docker-compose up -d |
| 82 | + ``` |
| 83 | + |
| 84 | +3. **Build custom blocks** |
| 85 | + ```bash |
| 86 | + cd plugins/blocks-gamestore |
| 87 | + npm install |
| 88 | + npm run start |
| 89 | + ``` |
| 90 | + |
| 91 | +### Block Development Commands |
| 92 | + |
| 93 | +```bash |
| 94 | +# Development mode with hot reload |
| 95 | +npm run start |
| 96 | + |
| 97 | +# Production build |
| 98 | +npm run build |
| 99 | + |
| 100 | +# Code formatting |
| 101 | +npm run format |
| 102 | + |
| 103 | +# Linting |
| 104 | +npm run lint:js |
| 105 | +npm run lint:css |
| 106 | + |
| 107 | +# Create plugin zip |
| 108 | +npm run plugin-zip |
| 109 | +``` |
| 110 | + |
| 111 | +## 🔐 CI/CD Configuration |
| 112 | + |
| 113 | +### Required GitHub Secrets |
| 114 | + |
| 115 | +The automated deployment requires the following secrets to be configured in your GitHub repository: |
| 116 | + |
| 117 | +| Secret Name | Description | Example | |
| 118 | +|-------------|-------------|---------| |
| 119 | +| `SERVER_HOST` | Server IP address or domain | `192.168.1.100` or `example.com` | |
| 120 | +| `SERVER_USER` | SSH username | `ubuntu` | |
| 121 | +| `SERVER_SSH_PASSWORD` | SSH password | `your-secure-password` | |
| 122 | +| `SERVER_PORT` | SSH port (usually 22) | `22` | |
| 123 | +| `SERVER_DEV_TARGET_PATH` | Development deployment path | `/var/www/dev.example.com` | |
| 124 | +| `SERVER_PROD_TARGET_PATH` | Production deployment path | `/var/www/example.com` | |
| 125 | + |
| 126 | +### Setting Up Secrets |
| 127 | + |
| 128 | +1. Go to your GitHub repository |
| 129 | +2. Navigate to **Settings** → **Secrets and variables** → **Actions** |
| 130 | +3. Click **New repository secret** |
| 131 | +4. Add each secret with its corresponding value |
| 132 | + |
| 133 | +### WordPress Version Control |
| 134 | + |
| 135 | +The `wp-version-control.cfg` file contains the WordPress download URL: |
| 136 | +``` |
| 137 | +https://wordpress.org/latest.zip |
| 138 | +``` |
| 139 | + |
| 140 | +This ensures consistent WordPress versions across deployments. |
| 141 | + |
| 142 | +## 🚀 Deployment Process |
| 143 | + |
| 144 | +### Trigger Events |
| 145 | + |
| 146 | +- **Development Deployment**: Push to `dev` branch |
| 147 | +- **Production Deployment**: Create a release |
| 148 | + |
| 149 | +### Deployment Stages |
| 150 | + |
| 151 | +1. **Preparation** |
| 152 | + - Download WordPress from `wp-version-control.cfg` |
| 153 | + - Package plugins, themes, and mu-plugins |
| 154 | + |
| 155 | +2. **File Transfer** |
| 156 | + - Upload WordPress and content packages to server |
| 157 | + - Enable maintenance mode |
| 158 | + |
| 159 | +3. **WordPress Core Update** |
| 160 | + - Backup existing configuration |
| 161 | + - Replace WordPress core files (preserving `wp-config.php`) |
| 162 | + - Update admin and includes directories |
| 163 | + |
| 164 | +4. **Content Update** |
| 165 | + - Update plugins, themes, and mu-plugins |
| 166 | + - Preserve existing uploads and configurations |
| 167 | + |
| 168 | +5. **Cleanup** |
| 169 | + - Disable maintenance mode |
| 170 | + - Remove temporary files |
| 171 | + - Verify deployment |
| 172 | + |
| 173 | +### Deployment Features |
| 174 | + |
| 175 | +- **Zero-downtime deployment**: Maintenance mode prevents broken states |
| 176 | +- **Selective updates**: Preserves `wp-config.php` and uploads |
| 177 | +- **Automatic cleanup**: Removes temporary files post-deployment |
| 178 | +- **Environment-specific paths**: Different paths for dev/prod |
| 179 | + |
| 180 | +## 🛠️ Development Workflow |
| 181 | + |
| 182 | +### Working with Blocks |
| 183 | + |
| 184 | +1. **Create new block** |
| 185 | + ```bash |
| 186 | + cd plugins/blocks-gamestore |
| 187 | + npx @wordpress/create-block new-block-name |
| 188 | + ``` |
| 189 | + |
| 190 | +2. **Development workflow** |
| 191 | + ```bash |
| 192 | + npm run start # Start development server |
| 193 | + # Edit files in src/ |
| 194 | + # Browser auto-refreshes |
| 195 | + ``` |
| 196 | + |
| 197 | +3. **Production build** |
| 198 | + ```bash |
| 199 | + npm run build |
| 200 | + ``` |
| 201 | + |
| 202 | +### Theme Development |
| 203 | + |
| 204 | +- Edit template files in `themes/game-store/templates/` |
| 205 | +- Modify patterns in `themes/game-store/patterns/` |
| 206 | +- Update styles in `themes/game-store/style.css` |
| 207 | +- Configure theme in `themes/game-store/theme.json` |
| 208 | + |
| 209 | +## 📝 Contributing |
| 210 | + |
| 211 | +1. Fork the repository |
| 212 | +2. Create a feature branch |
| 213 | +3. Make changes following WordPress coding standards |
| 214 | +4. Test locally with Docker |
| 215 | +5. Submit a pull request |
| 216 | + |
| 217 | +## 📄 License |
| 218 | + |
| 219 | +This project is licensed under the GPL v2 or later - see the [LICENSE](LICENSE) file for details. |
| 220 | + |
| 221 | +## 👨💻 Author |
| 222 | + |
| 223 | +**GKVSO** |
| 224 | +- Telegram: [@GKVSO](https://t.me/GKVSO) |
| 225 | + |
| 226 | +--- |
| 227 | + |
| 228 | +📖 **Documentation**: [Русская версия](./docs/ru/README.md) | **English** (current) |
0 commit comments