- PHP 60.4%
- Blade 36.4%
- Dockerfile 1.7%
- Shell 1%
- JavaScript 0.5%
|
All checks were successful
Build and Push / build (push) Successful in 22s
Reviewed-on: #8 |
||
|---|---|---|
| .claude/skills | ||
| .forgejo/workflows | ||
| app | ||
| bootstrap | ||
| config | ||
| database | ||
| docker | ||
| public | ||
| resources | ||
| routes | ||
| storage | ||
| tests | ||
| .dockerignore | ||
| .editorconfig | ||
| .env.example | ||
| .gitattributes | ||
| .gitignore | ||
| artisan | ||
| composer.json | ||
| composer.lock | ||
| docker-compose.yml | ||
| docker-entrypoint.sh | ||
| Dockerfile | ||
| package-lock.json | ||
| package.json | ||
| phpunit.xml | ||
| postcss.config.js | ||
| README.md | ||
| tailwind.config.js | ||
| vite.config.js | ||
Etsy Merchant Feeds
This is a very simple Laravel app to generate Google Merchant Data Feeds from an Etsy Shop.
Features
- Build simple XML feeds from your Etsy store listings in a format that's compatible with Google Merchant Feeds, for use in Google Shopping Ads, Facebook, Instagram product tagging, etc.
- The product URLs will use your own domain and redirect from there to Etsy. This will allow you to verify your own domain within Instagram, rather than using Etsy's, which is required in order to be able to use product tagging withing Instagram.
- Optionally, supply custom UTM tags for your product URLs, in order to enable tracking in Google Analytics.
- Optionally, supply a custom Google Product Category for your feed.
- You may connect multiple Etsy stores, or the same store multiple times, with different UTM tags.
- You can choose to update feeds on various configurable schedules, or manually.
- You may redirect the homepage to your Etsy store, if desired.
Limitations
- You can only supply one Google Product Category for the entirety of your feed. You cannot (yet) select categories per product.
- Multi-store support is experimental.
- You need to be comfortable hosting a simple PHP app.
- The name is boring, and the logo is ugly 😬
Get your Etsy API key
In order to use this tool, you need an Etsy API key. Etsy can take some time (several days) to approve applications for such a key, so it's recommended to start this right away:
- Go to etsy.com/developers/register
- Fill in the required details. As part of this, you'll need to provide a callback URL. This is
https://example.com/etsy/callback(Replaceexample.comwith your own domain). - Take a note of your KEYSTRING and SHARED SECRET.
Installation
Etsy Merchant Feeds can be run two ways: natively on a server with PHP, or as a container using the prebuilt image and the provided docker-compose.yml. Either way you'll need the Etsy API key above and a domain (or subdomain) pointing at your server.
Running with Docker
A prebuilt image is published to code.thms.uk/michael/etsy-merchant-feed and run via the provided docker-compose.yml. This is the simplest way to host the app: you don't need PHP, a web server, or a copy of the source on the host - only Docker and the compose file. The scheduler runs as its own container, so no cron entry is required.
- Put
docker-compose.ymlin a directory on your server and create a.envbeside it (copy from.env.example). Set at least:APP_URL=https://example.comETSY_KEYSTRING={YOUR_KEYSTRING}ETSY_SHARED_SECRET={YOUR_SHARED_SECRET}APP_KEY— generate one and paste it in:docker compose run --rm app php artisan key:generate --show
- Start the stack (the
initservice applies database migrations automatically):docker compose pull docker compose up -d - Register a user:
docker compose exec app php artisan user:register - The app serves plain HTTP on port 8080. Put it behind a TLS-terminating reverse proxy (nginx, Caddy, a Cloudflare Tunnel, etc.) pointing at the container, then open
https://example.com/dashboard, log in, and connect your Etsy store.
The SQLite database and application data persist in the ./data and ./storage directories beside the compose file.
Updating
docker compose pull
docker compose up -d
Running natively
If you prefer to run etsy-merchant-feed natively, you can also do so:
Pre-requisites
- A server running PHP 8.5 with the following extensions installed:
php8.5-cliphp8.5-commonphp8.5-fpmphp8.5-opcachephp8.5-readlinephp8.5-sqlite3php8.5-xml
- A webserver (e.g. nginx).
- Recommended: Set up HTTPS using Let's Encrypt or similar.
- Some willingness to dive into code.
Steps
- Clone this repo. The rest of this guide will assume you have cloned this into
/var/www/example.com. - Change into your directory and copy the
.env.examplefile:
cd /var/www/example.com
cp .env.example .env
- Open the
.envfile and adjust these values for your environment. You will need to provide at least the following configuration options (replacehttps://example.comwith your own URL and{YOUR_KEYSTRING}with the KEYSTRING you received from Etsy)APP_URL=https://example.comETSY_KEYSTRING={YOUR_KEYSTRING}ETSY_SHARED_SECRET={YOUR_SHARED_SECRET}
- Run the following commands to install all requirements:
composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader
php artisan key:generate --force
php artisan migrate --force
php artisan optimize
npm install
npm run build
- Run
php artisan user:registerto register a user. - Open your application in the browser at
https://example.com/dashboard. Log in and follow the prompts to connect to your Etsy store. - Set up your cronjobs by runing
crontab -eand adding the following line:
* * * * * cd /var/www/example.com && php artisan schedule:run >> /dev/null 2>&1
Web server configuration
You might want to refer to the Laravel documentation for more information on how to configure your web server.
Updating
Any time you wish to update Etsy Merchant Feeds follow these steps:
git pullyour clone of the repo.- Run the following commands to update everything:
composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader
php artisan migrate --force
php artisan optimize
npm install
npm run build
Building and deploying the image
Pushes to main trigger a Forgejo Actions workflow (.forgejo/workflows/build.yml) that builds the image and pushes it to the registry.