SiamCafe.net Blog
Technology

Mintlify Docs Internal Developer Platform

mintlify docs internal developer platform
Mintlify Docs Internal Developer Platform | SiamCafe Blog
2025-11-16· อ. บอม — SiamCafe.net· 8,526 คำ

Mintlify Developer Docs

Mintlify Documentation API Internal Developer Platform MDX OpenAPI Swagger Developer Portal Search Analytics Code Snippets Dark Mode Versioning GitHub Auto-deploy

Doc ToolFormatOpenAPISelf-hostเหมาะกับ
MintlifyMDXAuto-generateไม่Beautiful API Docs
DocusaurusMDXPluginใช่Flexible OSS
GitBookWYSIWYGLimitedไม่Non-technical
ReadMeMDXInteractiveไม่API-first
Swagger UIOpenAPINativeใช่Basic API Ref

Mintlify Setup

# === Mintlify Configuration ===

# Install CLI
# npm i -g mintlify
# mintlify dev  # Local preview at localhost:3000

# Project Structure
# docs/
# ├── mint.json           # Configuration
# ├── introduction.mdx    # Landing page
# ├── quickstart.mdx      # Getting started
# ├── api-reference/
# │   ├── openapi.yaml    # OpenAPI spec
# │   ├── authentication.mdx
# │   ├── products.mdx
# │   └── orders.mdx
# ├── guides/
# │   ├── getting-started.mdx
# │   ├── webhooks.mdx
# │   └── best-practices.mdx
# └── images/

# mint.json — Configuration
# {
#   "name": "MyApp API",
#   "logo": { "dark": "/logo-dark.svg", "light": "/logo-light.svg" },
#   "favicon": "/favicon.svg",
#   "colors": { "primary": "#3B82F6", "light": "#60A5FA", "dark": "#1E40AF" },
#   "topbarLinks": [
#     { "name": "Dashboard", "url": "https://app.myapi.com" }
#   ],
#   "tabs": [
#     { "name": "API Reference", "url": "api-reference" },
#     { "name": "Guides", "url": "guides" }
#   ],
#   "navigation": [
#     {
#       "group": "Getting Started",
#       "pages": ["introduction", "quickstart", "authentication"]
#     },
#     {
#       "group": "API Reference",
#       "pages": [
#         "api-reference/products",
#         "api-reference/orders",
#         "api-reference/customers"
#       ]
#     }
#   ],
#   "openapi": "api-reference/openapi.yaml",
#   "api": {
#     "baseUrl": "https://api.myapp.com/v1",
#     "auth": { "method": "bearer" }
#   }
# }

from dataclasses import dataclass

@dataclass
class DocSection:
    section: str
    pages: int
    format: str
    auto_generated: bool
    last_updated: str

sections = [
    DocSection("Introduction", 3, "MDX", False, "2025-01-15"),
    DocSection("Authentication", 2, "MDX", False, "2025-01-10"),
    DocSection("API Reference", 15, "OpenAPI + MDX", True, "2025-01-20"),
    DocSection("Guides", 8, "MDX", False, "2025-01-18"),
    DocSection("SDKs", 4, "MDX", False, "2025-01-12"),
    DocSection("Changelog", 12, "MDX", False, "2025-01-20"),
    DocSection("FAQ", 5, "MDX", False, "2025-01-15"),
]

print("=== Documentation Sections ===")
total_pages = sum(s.pages for s in sections)
for s in sections:
    auto = "Auto" if s.auto_generated else "Manual"
    print(f"  [{auto}] {s.section}: {s.pages} pages")
    print(f"    Format: {s.format} | Updated: {s.last_updated}")
print(f"\n  Total: {total_pages} pages")

OpenAPI Integration

# === OpenAPI Spec ===

# openapi.yaml
# openapi: 3.1.0
# info:
#   title: MyApp API
#   version: 2.0.0
#   description: API for MyApp platform
# servers:
#   - url: https://api.myapp.com/v1
# security:
#   - bearerAuth: []
# paths:
#   /products:
#     get:
#       summary: List products
#       operationId: listProducts
#       parameters:
#         - name: page
#           in: query
#           schema: { type: integer, default: 1 }
#         - name: limit
#           in: query
#           schema: { type: integer, default: 20 }
#       responses:
#         200:
#           description: Success
#           content:
#             application/json:
#               schema:
#                 type: object
#                 properties:
#                   data:
#                     type: array
#                     items: { $ref: '#/components/schemas/Product' }
#                   pagination:
#                     $ref: '#/components/schemas/Pagination'
#     post:
#       summary: Create product
#       operationId: createProduct
#       requestBody:
#         content:
#           application/json:
#             schema: { $ref: '#/components/schemas/CreateProduct' }
#       responses:
#         201:
#           description: Created

# MDX Page with API Playground
# ---
# title: List Products
# api: GET /products
# ---
#
# ## Parameters
# 
#   Page number for pagination
# 
#
# 
#   Items per page (max 100)
# 
#
# ## Response
# 
#   Array of product objects
# 

@dataclass
class APIEndpoint:
    method: str
    path: str
    description: str
    params: int
    examples: int
    status: str

endpoints = [
    APIEndpoint("GET", "/products", "List products", 4, 3, "Stable"),
    APIEndpoint("POST", "/products", "Create product", 0, 2, "Stable"),
    APIEndpoint("GET", "/products/:id", "Get product", 1, 2, "Stable"),
    APIEndpoint("PUT", "/products/:id", "Update product", 0, 2, "Stable"),
    APIEndpoint("GET", "/orders", "List orders", 5, 3, "Stable"),
    APIEndpoint("POST", "/orders", "Create order", 0, 2, "Stable"),
    APIEndpoint("POST", "/webhooks", "Register webhook", 0, 2, "Beta"),
]

print("\n=== API Endpoints ===")
for e in endpoints:
    print(f"  [{e.status}] {e.method} {e.path}")
    print(f"    {e.description} | Params: {e.params} | Examples: {e.examples}")

Developer Portal

# === Internal Developer Portal ===

# Backstage Integration
# backstage/
# ├── catalog-info.yaml   # Service catalog
# ├── docs/               # TechDocs (Mintlify)
# └── templates/          # Scaffolding templates

# catalog-info.yaml
# apiVersion: backstage.io/v1alpha1
# kind: API
# metadata:
#   name: myapp-api
#   description: MyApp REST API
#   annotations:
#     mintlify/docs-url: https://docs.myapp.com
# spec:
#   type: openapi
#   lifecycle: production
#   owner: team-platform
#   definition:
#     $text: ./openapi.yaml

# CI/CD — Auto-deploy Docs
# name: Deploy Docs
# on:
#   push:
#     branches: [main]
#     paths: ['docs/**']
# jobs:
#   deploy:
#     runs-on: ubuntu-latest
#     steps:
#       - uses: actions/checkout@v4
#       - name: Deploy to Mintlify
#         run: npx mintlify deploy
#         env:
#           MINTLIFY_TOKEN: }

platform_components = {
    "API Documentation": "Mintlify — Auto-generate จาก OpenAPI",
    "Service Catalog": "Backstage — รวม Service ทุกตัว",
    "API Gateway": "Kong / Traefik — Routing Auth Rate Limit",
    "SDK Generation": "OpenAPI Generator — Auto SDK",
    "Monitoring": "Grafana — API Performance Dashboard",
    "Changelog": "GitHub Releases — Automated Changelog",
    "API Playground": "Mintlify Built-in — Try API in Docs",
    "Search": "Mintlify Built-in — Full-text Search",
}

print("Developer Portal Components:")
for component, tool in platform_components.items():
    print(f"  [{component}]: {tool}")

metrics = {
    "Total Doc Pages": "49",
    "API Endpoints Documented": "28",
    "Monthly Visitors": "2,500",
    "Search Queries/day": "150",
    "Avg Time on Page": "3.5 minutes",
    "SDK Downloads/week": "450",
    "API Playground Usage": "1,200/month",
}

print(f"\n\nDocs Analytics:")
for k, v in metrics.items():
    print(f"  {k}: {v}")

เคล็ดลับ

Mintlify คืออะไร

Documentation Platform API Docs MDX React OpenAPI Auto-generate Search Analytics Code Snippets Dark Mode Versioning GitHub Free Plan สวยงาม

Internal Developer Platform คืออะไร

IDP Self-service Portal Documentation API Catalog Service Template CI/CD ลดภาระ Platform Team Developer Productive Backstage Port Cortex

สร้าง API Documentation อย่างไร

OpenAPI Spec Swagger Endpoint Request Response Mintlify Auto-generate MDX Guide Tutorial Code Examples Authentication Pagination Versioning GitHub

เปรียบเทียบ Mintlify กับ Documentation Tool อื่น

Mintlify สวย OpenAPI MDX Free Docusaurus ฟรี React Self-host GitBook WYSIWYG แพง ReadMe Interactive Swagger Basic ฟรี

สรุป

Mintlify Docs Internal Developer Platform API Documentation MDX OpenAPI Auto-generate Backstage Developer Portal Search Analytics Code Examples Versioning GitHub CI/CD

📖 บทความที่เกี่ยวข้อง

Mintlify Docs Container Orchestrationอ่านบทความ → React Server Components Internal Developer Platformอ่านบทความ → Mintlify Docs Developer Experience DXอ่านบทความ → Mintlify Docs API Integration เชื่อมต่อระบบอ่านบทความ → Mintlify Docs DevSecOps Integrationอ่านบทความ →

📚 ดูบทความทั้งหมด →