The official Directus website - a sophisticated marketing site built with Nuxt 3, TypeScript, and a block-based CMS architecture powered by Directus headless CMS.
π Live Site: directus.io ποΈ Built with: Nuxt 3, TypeScript, Vue 3, Tailwind CSS π± Features: SSG, Visual Editing, Analytics, Marketplace Search
- Node.js >= 20.0.0
- pnpm >= 8.15.0 (package manager is enforced)
# Install dependencies
pnpm install
# Start development server
pnpm dev
# Build for production
pnpm build
# Type checking
pnpm typecheck
# Linting & formatting
pnpm lint
pnpm format
# Bundle analysis
pnpm analyze
- π Nuxt - Vue.js framework with SSR/SSG capabilities
- π TypeScript - Strict typing with full type checking enabled
- π¨ Tailwind CSS - Utility-first CSS framework
- π¦ Directus SDK - Headless CMS integration with custom schema
- π PostHog - Analytics and feature flags (custom module)
- π Typesense - Search functionality for marketplace
- πΌοΈ Nuxt Image - Optimized image handling with multiple providers
Dynamic content management with reusable blocks:
- PageBuilder.vue - Core component that renders sections containing blocks
- PageSection.vue - Handles section-level styling and spacing
- Block Components - Located in
components/Block/
, each block type has its own component
- Schema Types - Comprehensive TypeScript definitions in
types/schema/
- Rate Limiting - Built-in API throttling (10 requests per 500ms)
- Visual Editing - Live preview and editing capabilities
- Typesense Integration - Fast search for extensions, integrations, and templates
- Domain Services - Organized by collection type in
layers/marketplace/
- Indexing API - Secure endpoints for content indexing
βββ components/ # Vue components (Base, Block, Nav, etc.)
βββ composables/ # Reusable Vue composition functions
βββ layouts/ # Page layouts (default, blank, tv)
βββ pages/ # File-based routing with dynamic content
βββ plugins/ # Nuxt plugins (Directus, PostHog, etc.)
βββ middleware/ # Route middleware
βββ server/ # Server-side API endpoints
βββ types/schema/ # TypeScript definitions for Directus schema
βββ layers/marketplace/ # Marketplace functionality (Nuxt layer)
βββ modules/ # Custom Nuxt modules
βββ scripts/ # Utility scripts
Create your .env file by copying the .env example:
cp .env.example .env
Then update the following variables in your .env
file:
# CMS Integration
DIRECTUS_URL=https://your-directus-instance.com
DIRECTUS_TV_URL=https://your-directus-tv-instance.com
# Site Configuration
NUXT_PUBLIC_SITE_URL=https://directus.io # or http://localhost:3000
NUXT_PUBLIC_ENABLE_VISUAL_EDITING=true
# Analytics
GOOGLE_TAG_MANAGER_ID=GTM-XXXXXXX
POSTHOG_API_KEY=your-posthog-key
POSTHOG_API_HOST=https://app.posthog.com
# Marketplace Registry
DIRECTUS_MARKETPLACE_REGISTRY_URL=https://registry.directus.io
DIRECTUS_MARKETPLACE_REGISTRY_TOKEN=your-registry-token
# Search (Typesense)
TYPESENSE_URL=https://your-typesense-cluster.com
TYPESENSE_PUBLIC_API_KEY=your-public-key
TYPESENSE_PRIVATE_API_KEY=your-private-key
# Indexing Security - generate a secure API key
TYPESENSE_INDEXING_API_KEY=$(openssl rand -hex 32)
The marketplace search uses Typesense for indexing extensions, integrations, and templates.
With the dev server running, use these npm scripts:
# Index all collections
pnpm run index:all
# Index specific collections
pnpm run index:extensions
pnpm run index:integrations
pnpm run index:templates
POST /api/search/indexing/all
- Index all collectionsPOST /api/search/indexing/extensions
- Index extensions onlyPOST /api/search/indexing/integrations
- Index integrations onlyPOST /api/search/indexing/templates
- Index templates only
All endpoints require the X-API-Key
header with your TYPESENSE_INDEXING_API_KEY
.
"Invalid or missing API key"
- Make sure
TYPESENSE_INDEXING_API_KEY
is set in your.env
file - Check that you're passing the key in the
X-API-Key
header
"TYPESENSE_INDEXING_API_KEY not configured"
- The environment variable isn't set on the server
- Add it to your deployment environment variables
Connection errors
- Make sure the dev server is running
- Check that
NUXT_PUBLIC_SITE_URL
points to the correct URL
The site is deployed on Netlify with automatic builds from the main branch.
Build Settings:
- Build Command:
pnpm build
- Publish Directory:
.output/public
- Node Version: 20+
Environment Variables: Set all required environment variables in Netlify's site settings.
- Static Site Generation - Pre-rendered pages for optimal performance
- Image Optimization - Multiple providers (Directus, Directus TV)
- Build Cache - Shared prerender data and build caching enabled
- Bundle Analysis - Use
pnpm analyze
to monitor bundle size
The website uses a sophisticated block-based content system:
- Content Editors create pages using blocks in Directus
- PageBuilder.vue dynamically renders these blocks
- Block Components in
components/Block/
handle each block type - TypeScript Types ensure type safety across the entire system
- Pages - Dynamic pages with blocks (
pages/[...permalink].vue
) - Blog Posts - Articles and announcements (
pages/blog/[slug].vue
) - Features - Product feature pages (
pages/features/[slug].vue
) - Team - Team member profiles (
pages/team/[slug].vue
) - Case Studies - Customer success stories (
pages/case-studies/[slug].vue
) - TV - Video content and shows (
pages/tv/
)
Content editors can use Directus Visual Editor for:
- Live Preview - See changes in real-time
- Block-level Editing - Edit content directly on the page
- Modal Interface - Rich editing experience
- PostHog Module (
modules/posthog/
) - Analytics with feature flags - Prerender Module (
modules/prerender.ts
) - Static site generation config - Redirects Module (
modules/redirects.ts
) - URL redirect handling