{"id":26221070,"url":"https://github.com/multiplehats/piggy","last_synced_at":"2025-07-22T17:02:56.544Z","repository":{"id":279043190,"uuid":"803720571","full_name":"multiplehats/piggy","owner":"multiplehats","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-10T16:11:25.000Z","size":4480,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-10T16:40:30.973Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/multiplehats.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-21T09:04:05.000Z","updated_at":"2025-03-07T12:15:59.000Z","dependencies_parsed_at":"2025-03-11T23:15:34.196Z","dependency_job_id":null,"html_url":"https://github.com/multiplehats/piggy","commit_stats":null,"previous_names":["multiplehats/piggy"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiplehats%2Fpiggy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiplehats%2Fpiggy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiplehats%2Fpiggy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiplehats%2Fpiggy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/multiplehats","download_url":"https://codeload.github.com/multiplehats/piggy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243248997,"owners_count":20260766,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-12T15:51:39.095Z","updated_at":"2025-03-12T15:51:39.668Z","avatar_url":"https://github.com/multiplehats.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Leat WordPress Integration\n\nThis repository contains the monorepo for the Leat WordPress/WooCommerce integration plugin and its related components. This plugin serves as a middleware layer connecting WordPress and WooCommerce stores to the Leat CRM platform.\n\n## Project Overview\n\nLeat is a standalone software solution for customer loyalty and email marketing. This integration plugin enables WordPress and WooCommerce users to connect their stores to the Leat platform, allowing them to leverage Leat's loyalty program, rewards, and marketing automation features both online and in-store.\n\nThe project uses a monorepo structure with Turborepo to manage the various components:\n\n- **WordPress Plugin**: The main integration plugin for WordPress\n- **Admin Interface**: Svelte-based admin dashboard for configuration\n- **Frontend Components**: Customer-facing components for the loyalty program\n- **WooCommerce Blocks**: Custom blocks for WooCommerce integration\n- **Shared Libraries**: Common utilities and types used across the project\n\n## Technology Stack\n\n- **Backend**: PHP 8.0+\n- **Frontend**: TypeScript, Svelte, React (WooCommerce Blocks)\n- **Build Tools**: Vite, Turborepo, PNPM\n- **Testing**: No tests yet.\n- **Styling**: The admin interface uses TailwindCSS, the frontend uses vanilla CSS.\n\n## Development Setup\n\nTo set up the development environment, follow these steps:\n\n### Prerequisites\n\n- Node.js 22.x or higher\n- PNPM 9.x or higher\n- PHP 8.0 or higher (64-bit)\n- WordPress 6.0+ development environment\n- WooCommerce 6.9+\n- Leat account (for API access)\n\n### Installation\n\n1. Clone this repository\n2. Install dependencies:\n    ```bash\n    pnpm install\n    ```\n\n### Make Scripts Executable\n\nIn the `apps/plugin` folder, you may need to ensure that the scripts are executable. Run the following command:\n\n```bash\nchmod +x ./bin/*\n```\n\nThese scripts are used to build the plugin.\n\n### Symlink the Plugin\n\nIt's often easier to symlink the plugin into your WordPress environment rather than clone the entire repository inside the `plugins` folder.\n\nTo create a symbolic link to your plugin in a WordPress environment, do the following:\n\n1. Navigate to your WordPress plugin folder. For example:\n\n```bash\ncd /path/to/wordpress/wp-content/plugins\n```\n\n2. Run the following command to create the symlink:\n\n```bash\nln -s /path/to/leat/apps/plugin leat\n```\n\nThis will create a symlink called `leat` in your WordPress plugins directory, pointing to the Leat plugin within your development environment.\n\n## Development Workflow\n\nThe project uses Turborepo to manage the build process and dependencies between packages. Here are some common commands:\n\n```bash\n# Start development server for all packages\npnpm dev\n\n# Start development server for admin interface only\npnpm dev:admin\n\n# Start development server for frontend components only\npnpm dev:frontend\n\n# Build all packages\npnpm build\n\n# Package the plugin for distribution\npnpm package-plugin\n\n# Run type checking\npnpm typecheck\n\n# Format code\npnpm format\n\n# Lint code\npnpm lint\n```\n\n## Project Structure\n\n- `apps/plugin/` - The main WordPress integration plugin\n- `packages/plugin-admin/` - Admin interface components\n- `packages/plugin-frontend/` - Frontend components for customers\n- `packages/wc-blocks/` - WooCommerce block integrations\n- `packages/types/` - Shared TypeScript types\n- `packages/lib/` - Shared utilities and libraries\n\n## Integration Features\n\nThis plugin connects WordPress/WooCommerce to the Leat platform, enabling:\n\n- **Customer Synchronization**: Automatically sync WordPress users with Leat CRM\n- **Order Tracking**: Send order data to Leat for points calculation and reward triggers\n- **Reward Redemption**: Allow customers to redeem Leat rewards in your WooCommerce store\n- **Loyalty Widget Integration**: Display loyalty program information to customers\n- **Admin Configuration**: Manage Leat connection settings from WordPress admin\n- **WooCommerce Checkout Integration**: Apply rewards and collect loyalty information during checkout\n\n## External Services\n\nThis plugin requires an API connection to [Leat](https://www.leat.com) and its business portal ([business.leat.eu](https://business.leat.com)) for core functionality. The plugin acts as a middleware layer, transmitting data between your WordPress site and the Leat platform.\n\n**Data transmitted includes**:\n\n- Customer information (email, name, order history, purchase categories)\n- WooCommerce order data (order totals, products purchased, dates)\n- Store configuration data\n- Reward and voucher definitions\n- Store performance metrics and analytics\n\nAll data is transmitted securely via HTTPS to Leat's servers in compliance with GDPR and other applicable privacy regulations.\n\n## Contributing\n\nWe welcome contributions! Please read our [Contributing Guidelines](CONTRIBUTING.md) before submitting pull requests.\n\n## License\n\nThis integration plugin is licensed under the GPL v2 or later - see the [LICENSE](/apps/plugin/license.txt) file for details.\n\n## Release Process\n\nTo create a new release of the Leat WordPress Integration plugin, follow these steps:\n\n### 1. Update Changelog\n\nAdd your changelog entries to `apps/plugin/readme.txt` in the Changelog section. Follow the existing format:\n\n```\n= x.x.x =\n\n* Feature: Description of new feature\n* Enhancement: Description of enhancement\n* Bug fix: Description of bug fix\n```\n\n### 2. Bump Version Numbers\n\nUpdate the version number in the following files:\n\n- `apps/plugin/package.json`: Update the `\"version\"` field\n- `apps/plugin/leat-crm.php`: Update both the `Version:` and `Stable tag:` fields in the plugin header\n\n### 3. Generate Translation Files\n\nGenerate the POT file for translations:\n\n```bash\ncd apps/plugin\npnpm run i18n\n```\n\nThis will create/update the `languages/leat.pot` file with the latest translatable strings.\n\n### 4. Test the Build\n\nBuild and package the plugin to ensure everything works correctly:\n\n```bash\npnpm build\npnpm package-plugin\n```\n\n### 5. Commit Changes\n\nCommit all your changes with a descriptive message:\n\n```bash\ngit add .\ngit commit -m \"chore: bump version to x.x.x\"\n```\n\n### 6. Create GitHub Release\n\n1. Create a new tag matching your version number:\n\n    ```bash\n    git tag vx.x.x\n    git push origin vx.x.x\n    ```\n\n2. Go to GitHub and create a new release using the tag you just pushed.\n    - Title: Version x.x.x\n    - Description: Copy the changelog entries for this version\n\n### 7. Deployment\n\nThe GitHub workflow will automatically deploy the plugin to the WordPress.org plugin repository when you publish the release. The workflow:\n\n1. Builds the plugin\n2. Packages it for distribution\n3. Deploys it to WordPress.org\n4. Attaches the zip file to the GitHub release\n\n### Troubleshooting\n\nIf the deployment fails, check:\n\n- GitHub Actions logs for any errors\n- Ensure the SVN_USERNAME and SVN_PASSWORD secrets are correctly set in the repository\n- Verify that the version numbers are consistent across all files\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiplehats%2Fpiggy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmultiplehats%2Fpiggy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiplehats%2Fpiggy/lists"}