Environment Configuration
Properly configuring your environment variables is critical for deploying Tune Me In to production. This guide covers all necessary configuration for both Shopify and Sanity integrations.Required Environment Variables
Server Configuration
PORT environment variable in server.js:44 to determine which port to listen on:
Shopify Configuration
Shopify settings are configured inshopify.config.js. You’ll need to update these values with your own store credentials:
Required Shopify Credentials
shopify.config.js
unauthenticated_read_product_listingsunauthenticated_read_product_inventoryunauthenticated_read_collection_listings
Shopify API Version
The project usesgraphqlApiVersion: 'unstable'. For production, pin to a specific API version:
Sanity Configuration
Sanity CMS settings are configured insanity.config.js:
Required Sanity Credentials
sanity.config.js
Vite Configuration
Thevite.config.js file imports and uses the Shopify configuration:
vite.config.js
Platform-Specific Configuration
Fly.io Environment Variables
Set secrets using the Fly CLI:Cloudflare Workers
Add environment variables in the Cloudflare dashboard:- Go to Workers → Your Worker → Settings
- Click Variables → Add variable
- Add each environment variable
- For sensitive values, check Encrypt
Docker Environment Variables
Pass environment variables when running containers:.env file with Docker Compose:
docker-compose.yml
Security Best Practices
.env.development - Local development.env.staging - Staging environment.env.production - Production environmentTesting Configuration
Before deploying, verify your configuration locally:- The server starts without errors
- Shopify products load correctly
- Sanity content appears as expected
- No credential warnings in logs
Next Steps
Deployment Overview
Learn about hosting options and the build process
Sanity Connect Setup
Configure Sanity Connect for automatic Shopify data sync