This guide is intended for developers contributing to Altly for WordPress. It covers repository structure, getting started with local development, and our overall development workflow.


Repository Structure


Getting Started

  1. Clone the Repository:

    git clone <https://github.com/prolific-digital/altly-wp.git>
    cd altly-wp
    
  2. Install Dependencies:

    Use either npm or yarn:

    npm install
    # or
    yarn
    
  3. Environment Setup:

    Create a .env.local file in the project root to configure the external API endpoints that the plugin uses to connect to Altly. These environment variables are critical for proper integration:

    REACT_APP_API_VALIDATE_URL=http://localhost:3000/v2/validate
    REACT_APP_API_QUEUE_URL=http://localhost:3000/v2/queue
    

    If you are not running the API locally, update these values to:

    REACT_APP_API_VALIDATE_URL=https://api.altly.io/v2/validate
    REACT_APP_API_QUEUE_URL=https://api.altly.io/v2/queue
    
  4. Start the Development Server:

    Run:

    npm run dev
    # or
    yarn dev
    

    This command compiles your files on the fly while watching for changes, so you can preview your updates in real time. Note: HMR (Hot Module Replacement) is not used because WordPress requires these assets to be hosted and accessed as static files.

    Open your browser and visit your local WordPress site, for example:

    http://your-local-wordpress-site/wp-admin/upload.php?page=altly


Development Workflow

Compiling and Testing

Versioning

Branching and Commit Strategy