{"id":25211500,"url":"https://github.com/zeropsio/recipe-directus","last_synced_at":"2026-01-18T20:04:21.723Z","repository":{"id":274050246,"uuid":"921753781","full_name":"zeropsio/recipe-directus","owner":"zeropsio","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-24T12:07:53.000Z","size":186,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-23T05:50:33.727Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/zeropsio.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":"2025-01-24T14:53:23.000Z","updated_at":"2025-02-24T12:07:57.000Z","dependencies_parsed_at":"2025-02-24T13:22:09.416Z","dependency_job_id":"ad7e127c-8501-4f66-bd84-396eb4a089ae","html_url":"https://github.com/zeropsio/recipe-directus","commit_stats":null,"previous_names":["zeropsio/recipe-directus"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/zeropsio/recipe-directus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeropsio%2Frecipe-directus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeropsio%2Frecipe-directus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeropsio%2Frecipe-directus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeropsio%2Frecipe-directus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeropsio","download_url":"https://codeload.github.com/zeropsio/recipe-directus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeropsio%2Frecipe-directus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28549732,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T19:56:05.265Z","status":"ssl_error","status_checked_at":"2026-01-18T19:55:54.685Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-02-10T14:16:01.902Z","updated_at":"2026-01-18T20:04:21.704Z","avatar_url":"https://github.com/zeropsio.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zerops x Directus\n\nThis repository demonstrates how to set up and deploy Directus applications using Zerops.\n\n![DirectusZerops](https://github.com/zeropsio/recipe-shared-assets/blob/main/covers/svg/cover-directus.svg)\n\n[Directus](https://directus.io) is a real-time API and app dashboard that instantly transforms any SQL database into a powerful REST/GraphQL API and no-code app. This recipe showcases how to run a Directus instance on Zerops, including advanced features like schema migrations, email templating, and Object Storage integration, making it suitable for production deployments of any scale.\n\n## Deploy on Zerops\n\nYou can either click the deploy button to deploy development setup directly on Zerops or manually copy\nthe [import yaml](https://github.com/zeropsio/recipe-directus/blob/main/zerops-project-import.yml) to the\nimport dialog in the Zerops app.\n\n[![Deploy on Zerops](https://github.com/zeropsio/recipe-shared-assets/blob/main/deploy-button/green/deploy-button.svg)](https://app.zerops.io/recipe/directus)\n\n\u003cbr/\u003e\n\n\n## Recipe Features\n\n- Directus running on a load-balanced **Zerops Node.js** service\n- Zerops **PostgreSQL** service as the database\n- Zerops **Object Storage** (S3 compatible) service for file storage\n- Automated schema migrations using Directus snapshots\n- Custom email templates with Liquid templating\n- Logs accessible through Zerops GUI\n- Utilization of Zerops built-in **environment variables** system\n- Zero downtime deployment with Zerops readiness checks\n- Advanced app monitoring with health checks\n- Sample collection setup with \"images\" demonstration\n\n## Schema Management\n\nDirectus provides a powerful schema snapshot system for maintaining consistency across environments:\n\n1. Make a copy of `.env.example` named `.env` and update `DB_PASSWORD` with credentials from GUI\n2. Install the Zerops CLI tool `zcli` and authenticate\n3. Generate a schema snapshot:\n```shell\nzcli vpn up\nnpx directus schema snapshot \u003e snapshot.yaml\n```\n\nThe recipe includes a demo \"images\" collection in `snapshot.yaml`. Snapshots are automatically applied during deployment via `run.initCommands`.\n\n## Email Templates\n\nCustomize Directus email notifications by adding templates to the `./templates` directory. Templates should correspond to [base Directus templates](https://github.com/directus/directus/tree/main/api/src/services/mail/templates).\n\nExample template structure:\n```\n./templates/\n  └── user-invitation.liquid\n```\n\n## Project Customization\n\nTo adapt this recipe for your needs:\n\n1. Fork this repository\n2. Modify your Directus instance through the admin interface\n3. Create a new snapshot using the schema snapshot command\n4. Update environment variables and configurations as needed\n\nThe resulting setup will provide a ready-to-deploy Directus instance with your specific configurations.\n\n## Production Deployment Guidelines\n\n#### Database Layer\n- Enable **High Availability** mode for PostgreSQL service\n- Configure appropriate backup strategies\n\n#### Cache Layer\n- Upgrade Redis to **HA mode** for enhanced reliability\n- Zerops HA Redis (Valkey) implementation automatically handles master/replica routing:\n    - Write operations are directed to master\n    - Read operations are distributed across all nodes\n    - No manual sentinel configuration required\n\n### Multi-Container Setup\n\nWhen scaling Directus across multiple containers, implement these adjustments:\n\n1. **Redis Configuration**\n\nSee: https://docs.directus.io/self-hosted/config-options.html#redis\n\n### Email Configuration\n\nFor production environments:\n1. Replace the development `mailpit` service with a production-ready email service\n2. Configure appropriate email credentials in environment variables\n3. Verify email template rendering and delivery\n\n### Schema Management\n\nImplement robust schema version control:\n\n```bash\n# Wrap schema applications in execOnce to prevent duplicate migrations on multiple containers.\nzsc execOnce \"migrate-${appVersionId}\" -- directus schema apply --yes snapshot.yaml\n```\n\nThis approach ensures:\n- One-time execution of migrations\n- Version-specific schema updates\n- Reliable deployment across environments\n\n### Pre-Production Checklist\n\n- [ ] Enable HA mode for PostgreSQL\n- [ ] Configure HA Redis\n- [ ] Remove development services (e.g., mailpit)\n- [ ] Configure production email service\n- [ ] Review and update environment variables\n- [ ] Test schema migration process\n- [ ] Verify backup procedures\n- [ ] Review security settings\n\n\u003e **Note**: These guidelines represent baseline production considerations. Additional optimizations may be necessary based on specific use cases and requirements.\n\n## Additional Resources\n\n- [Zerops Documentation](https://docs.zerops.io)\n- [Directus Documentation](https://docs.directus.io)\n- [Join Zerops Community](https://discord.com/invite/WDvCZ54)\n\nNeed help setting your project up? Join the [Zerops Discord community](https://discord.com/invite/WDvCZ54).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeropsio%2Frecipe-directus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeropsio%2Frecipe-directus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeropsio%2Frecipe-directus/lists"}