Skip to content

nuxt-content/studio

Repository files navigation

Nuxt Studio

npm version npm downloads License


โš ๏ธ Alpha Version

Current Status: Alpha Testing

Nuxt Studio is currently in alpha and now includes both the Monaco code editor and the new TipTap visual editor for Markdown content. This phase focuses on testing and stabilizing core functionality:

  • โœ… File operations (create, edit, delete, rename)
  • โœ… Content editing with Monaco code editor
  • โœ… NEW: Visual editing with TipTap editor for Markdown
  • โœ… Media management and uploads
  • โœ… GitHub authentication and publishing workflow

The TipTap visual editor provides a WYSIWYG editing experience for Markdown content, including support for MDC components, with seamless conversion between visual and code modes.

Read the announcement blog post for more details.


Visual edition in production for your Nuxt Content website.

Originally offered as a standalone premium platform at https://nuxt.studio, Studio has evolved into a free, open-source, and self-hostable Nuxt module. Enable your entire team to edit website content right in production.

Current Features (Alpha):

  • ๐Ÿ’ป Monaco Code Editor - Code editor for enhanced Markdown with MDC syntax, YAML, and JSON
  • โœจ TipTap Visual Editor - Markdown editor with MDC component support
  • ๐Ÿ”„ Real-time Preview - See your changes instantly on your production website
  • ๐Ÿ” GitHub Authentication - Secure OAuth-based login with GitHub
  • ๐Ÿ“ File Management - Create, edit, delete, and rename content files (content/ directory)
  • ๐Ÿ–ผ๏ธ Media Management - Centralized media library for all your assets (public/ directory) with visual media picker
  • ๐ŸŒณ Git Integration - Commit changes directly from your production website and just wait your CI/CD pipeline to deploy your changes
  • ๐Ÿš€ Development Mode - Directly edit your content files and media files in your local filesystem using the module interface

Coming in Beta:

  • ๐Ÿ“ Frontmatter Form Editor - Edit frontmatter metadata with auto-generated forms based on collection schemas
  • ๐ŸŽจ Vue Component Props Editor - Visual interface for editing Vue component props and slots
  • ๐Ÿ” Google OAuth Authentication - Secure OAuth-based login with Google

Future Features:

  • ๐Ÿ“‚ Collections view - View and manage your content collections in a unified interface
  • ๐Ÿ–ผ๏ธ Media optimization - Optimize your media files in the editor
  • ๐Ÿค– AI Content Assistant โ€” Receive smart, AI-powered suggestions to enhance your content creation flow
  • ๐Ÿ’ก Community-driven Features โ€” Have an idea? Share your suggestions to shape the future of Nuxt Studio

Resources

Quick Setup

Note: This alpha release provides both a Monaco code editor and a TipTap visual WYSIWYG editor for Markdown content. You can switch between them at any time.

1. Install

Install the module in your Nuxt application:

npx nuxi module add nuxt-studio@alpha

2. Configure

Add it to your nuxt.config.ts and configure your repository:

export default defineNuxtConfig({
  modules: [
    '@nuxt/content',
    'nuxt-studio'
  ],
  
  studio: {
    // Studio admin route (default: '/_studio')
    route: '/_studio',
    
    // Git repository configuration (owner and repo are required)
    repository: {
      provider: 'github', // 'github' or 'gitlab'
      owner: 'your-username', // your GitHub/GitLab username or organization
      repo: 'your-repo', // your repository name
      branch: 'main', // the branch to commit to (default: main)
    }
  }
})

3. Dev Mode

๐Ÿš€ That's all you need to enable Studio locally!

Run your Nuxt app and navigate to /_studio to start editing. Any file changes will be synchronized in real time with the file system.

Note: The publish system is only available in production mode. Use your classical workflow (IDE, CLI, GitHub Desktop...) to publish your changes locally.

4. Production Mode

To enable publishing directly from your production website, you need to configure OAuth authentication.

Create a GitHub OAuth App

  1. Go to GitHub Developer Settings
  2. Click "New OAuth App"
  3. Fill in the application details:
    • Application name: Your App Name
    • Homepage URL: Your website homepage URL
    • Authorization callback URL: ${YOUR_WEBSITE_URL}/_studio/auth/github
  4. Copy the Client ID and generate a Client Secret
  5. Add them to your deployment environment variables:
STUDIO_GITHUB_CLIENT_ID=your_github_client_id
STUDIO_GITHUB_CLIENT_SECRET=your_github_client_secret

Note: GitLab is also supported. See the providers documentation for setup instructions.

Deployment

Nuxt Studio requires server-side routes for authentication. Your site must be deployed on a platform that supports SSR using nuxt build.

If you want to pre-render all your pages, use hybrid rendering:

export default defineNuxtConfig({
  nitro: {
    prerender: {
      routes: ['/'],
      crawlLinks: true
    }
  }
})

Configuration Options

export default defineNuxtConfig({
  studio: {
    // Studio admin login route
    route: '/_studio', // default

    // Git repository configuration
    repository: {
      provider: 'github', // 'github' or 'gitlab' (default: 'github')
      owner: 'your-username', // your GitHub/GitLab owner (required)
      repo: 'your-repo', // your repository name (required)
      branch: 'main', // branch to commit to (default: 'main')
      rootDir: '', // subdirectory for monorepos (default: '')
      private: true, // request access to private repos (default: true)
    },
  }
})

Contributing

You must clone the repository and create a local GitHub OAuth App (pointing to http://localhost:3000 as callback URL).

Set your GitHub OAuth credentials in the .env file.

Development Setup

# Install dependencies
pnpm install

# Generate type stubs
pnpm dev:prepare

# Build the app and service worker
pnpm prepack

# Terminal 1: Start the playground
pnpm dev

# Terminal 2: Start the app dev server
pnpm dev:app

# Login at http://localhost:3000/admin

Project Structure

studio/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ app/           # Studio editor Vue app
โ”‚   โ””โ”€โ”€ module/        # Nuxt module
โ”œโ”€โ”€ playground/        # Development playground
โ”‚   โ”œโ”€โ”€ docus/         # Docus example
โ”‚   โ””โ”€โ”€ minimal/       # Minimal example

Testing

# Run tests
pnpm test

# Run type checking
pnpm typecheck

# Run linter
pnpm lint

Roadmap

โœ… Phase 1 - Alpha (Current)

  • Monaco code editor
  • TipTap visual editor with MDC support
  • Editor mode switching (code โ†” visual)
  • File operations (create, edit, delete, rename)
  • Media management with visual picker
  • Enhanced component slot editing
  • GitHub authentication
  • GitLab provider support
  • Development mode (experimental)
  • Git integration
  • Real-time preview
  • Google OAuth authentication

๐Ÿšง Phase 2 - Beta (In Development)

  • Frontmatter edition as form (schema-based)
  • YAML and JSON edition as form (schema-based)
  • Vue Component props editor (visual interface)

๐Ÿ”ฎ Future

  • Other provider support
  • Advanced conflict resolution
  • Pull request generation (from a branch to the main one)
  • AI-powered content suggestions

Links

License

Published under the MIT license.