Skip to content

GKVSO/GameStore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

GameStore WordPress Theme & Blocks

๐Ÿ“– Documentation Language: ะ ัƒััะบะธะน | English (current)

A modern WordPress block theme for gaming stores, built with full-site editing support and custom React-based blocks.

๐ŸŽฎ Project Overview

  • Block Theme: Modern FSE (Full Site Editing) theme optimized for gaming stores
  • Custom Blocks: React-based Gutenberg blocks for enhanced functionality
  • Core Plugin: Essential functionality and customizations
  • MU Plugin: Must-use plugin for site-wide features
  • Automated Deployment: GitHub Actions CI/CD pipeline

๐Ÿ—๏ธ Project Structure

game-store/
โ”œโ”€โ”€ .github/workflows/
โ”‚   โ””โ”€โ”€ CICD.yml                 # Automated deployment pipeline
โ”œโ”€โ”€ docs/
โ”‚   โ””โ”€โ”€ ru/                      # Russian documentation
โ”œโ”€โ”€ mu-plugins/
โ”‚   โ””โ”€โ”€ gamestore-general.php    # Must-use plugin
โ”œโ”€โ”€ plugins/
โ”‚   โ”œโ”€โ”€ blocks-gamestore/        # Custom React blocks
โ”‚   โ””โ”€โ”€ core-gamestore/          # Core functionality plugin
โ”œโ”€โ”€ themes/
โ”‚   โ””โ”€โ”€ game-store/              # Main block theme
โ”œโ”€โ”€ docker-compose.yml           # Local development environment
โ”œโ”€โ”€ wp-version-control.cfg       # WordPress version management
โ””โ”€โ”€ README.md                    # This file

๐Ÿ”ง Project Architecture and Components

๐ŸŽจ Main Theme: themes/game-store/

Purpose: WordPress block theme with Full Site Editing (FSE) support

Key files and directories:

  • themes/game-store/style.css - main theme styles and meta information
  • themes/game-store/theme.json - theme configuration, color palette, typography
  • themes/game-store/templates/ - HTML templates for different page types
  • themes/game-store/patterns/ - ready-made block patterns for quick insertion
  • themes/game-store/parts/ - theme parts (header, footer)

Why needed: Provides the visual foundation of the site, defines the design system, colors, fonts, and overall appearance. FSE allows editing layouts through WordPress interface without code.

๐Ÿงฉ Custom Blocks: plugins/blocks-gamestore/

Purpose: React components for creating specialized Gutenberg blocks

Structure:

  • plugins/blocks-gamestore/src/ - source code of React-based blocks
  • plugins/blocks-gamestore/build/ - compiled blocks for production
  • plugins/blocks-gamestore/package.json - dependencies and build scripts

Why needed: Extends standard WordPress blocks with gaming store-specific elements (game cards, galleries, ratings, etc.). React provides interactivity and modern UX.

โš™๏ธ Core Plugin: plugins/core-gamestore/

Purpose: Centralized logic and site functionality

Contains:

  • Custom post types (for games, reviews)
  • API integrations (payment systems, game catalogs)
  • Administrative settings
  • WordPress hooks and filters

Why needed: Separates business logic from presentation, ensures function portability between themes, manages gaming store-specific data.

๐Ÿ”ง Must-Use Plugin: mu-plugins/gamestore-general.php

Purpose: Critical functionality that must always be active

Location: mu-plugins/ (Must Use plugins) - automatically activated

What it does:

  • Basic security settings
  • Essential redirects and rewrites
  • System hooks that cannot be disabled
  • Project constants initialization

Why separate folder: MU-plugins cannot be deactivated through WordPress admin, which is critical for site stability. They load before regular plugins and are always active.

๐Ÿš€ Development Setup

Prerequisites

  • Node.js 18+
  • Docker & Docker Compose
  • Git

Local Development

  1. Clone the repository

    git clone https://github.com/GKVSO/GameStore.git>
    cd game-store
  2. Start development environment

    docker-compose up -d
  3. Build custom blocks

    cd plugins/blocks-gamestore
    npm install
    npm run start

Block Development Commands

# Development mode with hot reload
npm run start

# Production build
npm run build

# Code formatting
npm run format

# Linting
npm run lint:js
npm run lint:css

# Create plugin zip
npm run plugin-zip

๐Ÿ” CI/CD Configuration

Required GitHub Secrets

The automated deployment requires the following secrets to be configured in your GitHub repository:

Secret Name Description Example
SERVER_HOST Server IP address or domain 192.168.1.100 or example.com
SERVER_USER SSH username ubuntu
SERVER_SSH_PASSWORD SSH password your-secure-password
SERVER_PORT SSH port (usually 22) 22
SERVER_DEV_TARGET_PATH Development deployment path /var/www/dev.example.com
SERVER_PROD_TARGET_PATH Production deployment path /var/www/example.com

Setting Up Secrets

  1. Go to your GitHub repository
  2. Navigate to Settings โ†’ Secrets and variables โ†’ Actions
  3. Click New repository secret
  4. Add each secret with its corresponding value

WordPress Version Control

The wp-version-control.cfg file contains the WordPress download URL:

https://wordpress.org/latest.zip

This ensures consistent WordPress versions across deployments.

๐Ÿš€ Deployment Process

Trigger Events

  • Automatic Development Deployment: Push to dev branch
  • Automatic Production Deployment: Create a release
  • Manual Deployment: Through GitHub Actions web interface with environment and WordPress version selection

Manual Deployment

  1. Go to your GitHub repository
  2. Open the Actions tab
  3. Select the GameStore Deploy workflow
  4. Click Run workflow
  5. Configure parameters:
    • Environment: dev or prod
    • WordPress version: leave empty to use version from wp-version-control.cfg or specify exact version (e.g., 6.3.2)

Deployment Stages

  1. Preparation

    • Download WordPress from wp-version-control.cfg
    • Package plugins, themes, and mu-plugins
  2. File Transfer

    • Upload WordPress and content packages to server
    • Enable maintenance mode
  3. WordPress Core Update

    • Backup existing configuration
    • Replace WordPress core files (preserving wp-config.php)
    • Update admin and includes directories
  4. Content Update

    • Update plugins, themes, and mu-plugins
    • Preserve existing uploads and configurations
  5. Cleanup

    • Disable maintenance mode
    • Remove temporary files
    • Verify deployment

Deployment Features

  • Zero-downtime deployment: Maintenance mode prevents broken states
  • Complete WordPress Core update: Unlike standard deployments that only update themes and plugins, this approach downloads and replaces the entire WordPress Core. This is critical for large-scale projects where strict version control is essential
  • WordPress version control: The wp-version-control.cfg file allows locking to a specific WordPress version across all environments, eliminating compatibility issues and ensuring stability
  • Selective updates: Preserves wp-config.php and uploads directory with media files
  • Automatic cleanup: Removes temporary files post-deployment
  • Environment-specific paths: Different paths for dev/prod

๐Ÿ› ๏ธ Development Workflow

Working with Blocks

  1. Create new block

    cd plugins/blocks-gamestore
    npx @wordpress/create-block new-block-name
  2. Development workflow

    npm run start  # Start development server
    # Edit files in src/
    # Browser auto-refreshes
  3. Production build

    npm run build

Theme Development

  • Edit template files in themes/game-store/templates/
  • Modify patterns in themes/game-store/patterns/
  • Update styles in themes/game-store/style.css
  • Configure theme in themes/game-store/theme.json

๐Ÿ“ Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make changes following WordPress coding standards
  4. Test locally with Docker
  5. Submit a pull request

๐Ÿ“„ License

This project is licensed under the GPL v2 or later - see the LICENSE file for details.

๐Ÿ‘จโ€๐Ÿ’ป Author

GKVSO


๐Ÿ“– Documentation: ะ ัƒััะบะฐั ะฒะตั€ัะธั | English (current)