fix: Mermaid.js Prompt Enforcement #123
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant improvements to documentation, backend stability, and frontend-backend integration for the GitDiagram project. The main changes include the addition of comprehensive English and Korean README files, a push guide, enhanced backend CORS support for Codespaces, stricter Mermaid.js prompt enforcement, and updated frontend API routes to proxy requests through Next.js for improved reliability and compatibility.
Documentation Improvements:
README.en.md
) and Korean (README.ko.md
) README files, including self-hosting instructions, tech stack, architecture, and troubleshooting tips. The mainREADME.md
now links to the English version and is rewritten in Korean for localization. [1] [2] [3]PUSH_GUIDE.md
) describing how to initialize and push the project to a new repository, including frontend and backend startup instructions.Backend Stability and Codespaces Support:
origins
inbackend/app/main.py
to support multiple localhost ports and dynamic Codespaces domains, improving development experience in cloud environments.Mermaid.js Prompt Enforcement:
backend/app/prompts.py
to strictly enforce Mermaid v11.4.1 syntax and supported diagram types, preventing invalid or invented types and improving diagram stability. [1] [2] [3]Frontend API Integration and SSR Stability:
src/app/api/generate/stream/route.ts
andsrc/app/api/generate/cost/route.ts
) to proxy backend requests for streaming and cost estimation, resolving mixed-content and local development issues. [1] [2]src/hooks/useDiagram.ts
to use the new API routes for streaming, reset state before generation, and improve error handling. [1] [2] [3]suppressHydrationWarning
to<html>
and<body>
insrc/app/layout.tsx
to prevent hydration warnings from browser extensions and SSR mismatches.Minor Code Quality Fixes:
src/lib/fetch-backend.ts
for readability.