Examples: Directus + Next.js + Trigger.dev Scenarios
Complete walkthroughs for building common application types with this stack. Each scenario shows the full flow from Directus data model through Next.js rendering, and — where applicable — through Trigger.dev background work and back to Directus.
Available Scenarios
| Scenario | Description | Key Patterns |
|---|---|---|
| Blog | Content blog with posts, authors, and categories | M2O relations, images, ISR, SEO metadata, RSS feed |
| Product Catalog | E-commerce catalog with products, categories, and filtering | M2M relations, search params, image gallery, dynamic filters |
| AI Enrichment Pipeline | Directus article created → background LLM enrichment → write tags/summary back → revalidate | Directus Flow webhook, tasks.trigger(), idempotency, Directus SDK in task, close-the-loop revalidation |
| Scheduled Data Sync | Daily cron pulls from external API → upserts into Directus → revalidates dashboard | schedules.task(), cron strings, upsert patterns, dashboard revalidation |
How to Use
- Pick the scenario closest to what you are building
- Read the full walkthrough in
references/scenarios/ - Adapt the collections, fields, and page structure to your needs
- Follow the
full-featuretemplate for each new feature you add - If your feature needs background work, also read
background-tasks(for event-driven) orscheduled-tasks(for cron)
Each scenario includes:
- Directus collection schema (fields, relations, permissions)
- TypeScript interfaces
- Complete Next.js page code (listing, detail, metadata)
- Trigger.dev task definition (for AI/schedule scenarios)
- Image handling patterns
- Revalidation strategy