Documentation Index
Fetch the complete documentation index at: https://docs.metabind.ai/llms.txt
Use this file to discover all available pages before exploring further.
Metabind CMS Deployment Guide
Environments
Development
- URL: https://dev.metabind.ai
- API: https://api-dev.metabind.ai
- WebSocket: wss://ws-api-dev.metabind.ai
- CDN: https://cdn-dev.metabind.ai
- Branch:
develop - Deployment: Automatic on merge
Production
- URL: https://www.metabind.ai
- API: https://api.metabind.ai
- WebSocket: wss://ws-api.metabind.ai
- CDN: https://cdn.metabind.ai
- Branch:
main - Deployment: Manual approval required
Deployment Process
Development Deployment (Automatic)
- Create feature branch from
develop - Make changes and test locally
- Create PR to
develop - After review, merge PR
- Automatic deployment to dev.metabind.ai
Production Deployment (Manual Approval)
- Ensure all changes are tested on dev environment
- Create PR from
developtomain - Review changes thoroughly
- Merge PR to
main - GitHub Actions will request manual approval
- Go to Actions tab → Click on the workflow run → Review and approve
- Deployment proceeds to www.metabind.ai
Release Creation (Optional)
For formal releases with version tags:- Go to Actions → “Create Release” workflow
- Click “Run workflow”
- Enter version (e.g.,
v1.0.0) - Check “pre-release” if applicable
- This creates a release branch and draft release
Infrastructure
AWS Resources
Web app (apps/web)
- S3:
metabind-frontend-dev,metabind-frontend-prod - CloudFront:
E37V5H2J99LGBJ(dev.metabind.ai),EAMI96CJSLZDO(www.metabind.ai) - CloudFront Function:
metabind-spa-router-dev/metabind-spa-router-prod(scripts/cloudfront-spa-router-{dev,prod}.js)
apps/admin)
- S3:
metabind-admin-frontend-dev,metabind-admin-frontend-prod - CloudFront:
E2MNYOF85I3JOS(admin-dev.metabind.ai),EB5ZZU3F8KVDC(admin.metabind.ai)
apps/mcpdemo and any future demo SPAs)
- S3:
metabind-demos-frontend-dev,metabind-demos-frontend-prod(prod not provisioned yet) - CloudFront:
E3MLU9J4RCFSFL(demos-dev.metabind.ai), prod TBD - CloudFront Function:
metabind-demos-router-dev/metabind-demos-router-prod(scripts/cloudfront-demos-router-{dev,prod}.js) — generic path-prefix SPA router; rewrites/<app>and/<app>/*to/<app>/index.html. Adding a new demo does NOT require editing this function. - Hosted demos:
https://demos-dev.metabind.ai/mcpdemo/—apps/mcpdemo(deployed)
- S3:
composer-assets-dev-545009866099,composer-assets-prod-545009866099 - CloudFront:
E328NBYMS2ZFH8(dev),E1QSR9ILBT29B6(prod)
Z04180633NM341WZWTA7Z (metabind.ai).
Demos distribution — operating guide
Provisioning a NEW environment (one-time per env)
The demos distribution is created/maintained byscripts/setup-demos-distribution.sh. It’s idempotent — re-running it is safe.
DISTRIBUTION_ID, BUCKET_NAME, and FUNCTION_NAME. For prod, after the first run, paste the printed DISTRIBUTION_ID into:
package.json: replace__DEMOS_PROD_DIST_ID__in thedeploy:prod:mcpdemo*scripts.scripts/deploy-demos-cloudfront-function.sh: replace the emptyDISTRIBUTION_ID=""in the prod branch.
DISTRIBUTION_ID (E3MLU9J4RCFSFL) is already wired in.
Adding a NEW demo app
-
Build it with
base: '/<app-name>/'in its Vite config (mirrors whatapps/mcpdemo/vite.config.tsdoes). -
Add deploy scripts to root
package.jsonmirroring the mcpdemo pattern: -
Build + deploy:
pnpm run deploy:dev:<app>:local -
Live at
https://demos-dev.metabind.ai/<app>/— no infrastructure changes needed.
Updating the demos CloudFront Function
The function is generic and shouldn’t need code changes. If it does:- Edit
scripts/cloudfront-demos-router-{dev,prod}.js. AWS_PROFILE=yap ./scripts/deploy-demos-cloudfront-function.sh dev- Same for prod when ready.
E2E validation
Environment Variables
Environment-specific configs are set during build:VITE_API_URL: API endpointVITE_WS_URL: WebSocket endpointVITE_CDN_URL: CDN endpointVITE_ENV: Environment nameVITE_USER_POOL_ID: Cognito User Pool IDVITE_USER_POOL_CLIENT_ID: Cognito User Pool Client ID
Local Development
Setup
Building Locally
Manual Deployment
Security
GitHub Secrets Required
AWS_ACCESS_KEY_ID: AWS deployment credentialsAWS_SECRET_ACCESS_KEY: AWS deployment credentials
Production Environment Protection
- Requires manual approval from designated reviewers
- Configure in: Settings → Environments → production
Rollback Procedure
Quick Rollback
- Go to GitHub Actions
- Find the last successful deployment
- Click “Re-run all jobs”
- Approve deployment
S3 Versioning Rollback
- Go to AWS S3 Console
- Navigate to the production bucket
- Use “Show versions” to see previous deployments
- Restore previous version if needed
Monitoring
CloudFront Cache
- Invalidations happen automatically on deploy
- Manual invalidation:
aws cloudfront create-invalidation --distribution-id EAMI96CJSLZDO --paths '/*'
Deployment Status
- Check GitHub Actions for deployment logs
- CloudFront distribution status in AWS Console
- Test endpoints after deployment
Team Workflow
Feature Development
- Create feature branch from
develop - Implement and test locally
- Create PR to
develop - Code review by team
- Merge triggers auto-deploy to dev
Production Release
- Test thoroughly on dev environment
- Create release PR from
developtomain - Team reviews release notes
- Merge PR (doesn’t auto-deploy)
- Designated approver triggers production deployment
- Verify production deployment
Important Notes
- Never commit
.env.localor any file with secrets - Always test on dev before releasing to prod
- CloudFront cache takes ~5-10 minutes to fully propagate
- DNS changes can take up to 48 hours (though usually much faster)
- Production deployments should be done during low-traffic periods
Troubleshooting
Build Failures
- Check Node.js version (should be 20)
- Verify PNPM version matches workflows
- Clear node_modules and pnpm store
Deployment Failures
- Check AWS credentials are valid
- Verify S3 bucket permissions
- Check CloudFront distribution status
Cache Issues
- Force CloudFront invalidation
- Clear browser cache
- Check cache headers in S3