https://github.com/directus/website.git
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
# 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
components/Block/, each block type has its own componenttypes/schema/layers/marketplace/โโโ 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 onlyX-API-Key header with your TYPESENSE_INDEXING_API_KEY.
"Invalid or missing API key"
TYPESENSE_INDEXING_API_KEY is set in your .env fileX-API-Key headerNUXT_PUBLIC_SITE_URL points to the correct URLThe site is deployed on Netlify with automatic builds from the main branch.
Build Settings:
pnpm build.output/publicpnpm analyze to monitor bundle sizeThe website uses a sophisticated block-based content system:
components/Block/ handle each block typepages/[...permalink].vue)pages/blog/[slug].vue)pages/features/[slug].vue)pages/team/[slug].vue)pages/case-studies/[slug].vue)pages/tv/)Content editors can use Directus Visual Editor for:
modules/posthog/) - Analytics with feature flagsmodules/prerender.ts) - Static site generation configmodules/redirects.ts) - URL redirect handling