This site is not affiliated with or endorsed by Vercel, Inc. Read the docs, then deploy or run each experiment yourself.
AI

Diagram to Mermaid

Description or diagram image - Mermaid source with an accuracy caveat. Honest 503 without AI.

Run this experiment yourself

Demos are not embedded on this site. Deploy a standalone copy on Vercel or run the experiment app locally.

Local development

cd apps/experiments/diagram-to-mermaid
pnpm install
pnpm dev

Then open http://localhost:3010.

This is an experimental demo. Use it as a starting point for your own projects. Mermaid is a draft — verify before shipping.

Diagram to Mermaid is a Wave 3 Batch H composition lab. Pure helpers live in logic.ts; missing providers or stores degrade honestly (never fabricate AI output).

Features

  • Text and/or image - Mermaid
  • Explicit accuracy caveat
  • Honest 503

Server Reference

POST /api/mermaid

{ "description": "User to API to DB" }
StatusCause
200Success
400Missing input
503No AI provider

Implementation Details

Validate

Inputs are length-capped in logic.ts; APIs return 400 for missing fields.

Run

Route Handlers compose AI SDK, Redis/Neon, or ImageResponse as documented. Fallbacks include honest notes.

Limitations

  • Not a guaranteed-correct diagram converter.
  • Complex diagrams may need edits.
  • No live Mermaid renderer in the API.

Use in your project

Copy the Route Handler(s) and logic.ts from apps/experiments/diagram-to-mermaid/.

Deployment

Deploy on Vercel

Local Development

cd apps/experiments/diagram-to-mermaid
pnpm install
pnpm dev

Configuration

VariableRequiredPurpose
AI_GATEWAY_API_KEYYes (or OpenAI)Preferred AI provider

Next Steps

On this page