🌟 Doxify——漂亮的文档,生产就绪

Doxify是一个现代化的文档平台,具有漂亮的CMS、MD/MDX解析、主题定制和静态导出功能,现在已针对生产部署进行了强化。
______________________________________________________________________
✨ 特性
- 🎨 漂亮的CMS界面 -灵感源自Supabase的设计,具有直观的用户界面
- 📝 MDX支持 -使用增强的Markdown编写(MDX+自定义块)
- 🔥 实时预览 -键入时立即看到更改
- 🎨 主题定制 -完全控制颜色、字体和样式
- 📦 静态导出 -生成可用于生产的Next.js网站
- 🏗️ 微服务架构 -可扩展和可维护的后端
- 🔒 安全认证 -JWT访问令牌+刷新轮换(15m/30d)
- 🛡️ 网关保护 -速率限制、CORS分配列表、头盔、身份验证保护
- 🐳 Docker就绪 -多阶段构建和组合编排
🏗️ 架构(高级)
Doxify使用微服务架构:
┌─────────────────┐
│ API Gateway │
│ :4000 │
└────────┬────────┘
│
┌────┴─────────────────┐
│ │
┌───▼────┐ ┌────────┐ ┌─────┐
│ Auth │ │Projects│ │Pages│
│ :4001 │ │ :4002 │ │:4003│
└────────┘ └────────┘ └─────┘
│ │
┌────────┐ ┌──▼──┐ ┌───▼───┐
│ Parser │ │Theme│ │ Export│
│ :4004 │ │:4005│ │ :4006 │
└────────┘ └─────┘ └───────┘
│
┌─────▼─────┐
│ MongoDB │
│ :27017 │
└───────────┘🚀 快速入门(Docker)
先决条件
- Docker&Docker编写
1.克隆和配置
git clone https://github.com/mihir-rabari/doxify.git
cd doxify
cp .env.example .env2.开始一切
# Build and start all services (frontend, gateway, microservices, MongoDB)
docker-compose -f docker-compose.production.yml up --build -d
# Tail logs
docker-compose -f docker-compose.production.yml logs -f这将开始:
- 前端: http://localhost:3000
- API网关: http://localhost:4000
- MongoDB: 端口27017
- 全部9个微服务
3.创建你的第一个项目
- 访问http://localhost:3000/register
- 创建账户
- 创建新的文档项目
- 开始在MDX中编写
- 自定义主题
- 导出为静态站点
📁 项目结构
doxify/
├── services/ # Microservices
│ ├── api-gateway/ # Main entry point (port 4000)
│ ├── auth-service/ # User authentication (port 4001)
│ ├── projects-service/ # Project management (port 4002)
│ ├── pages-service/ # Page CRUD (port 4003)
│ ├── parser-service/ # MDX parsing (port 4004)
│ ├── theme-service/ # Theme customization (port 4005)
│ └── export-service/ # Static site export (port 4006)
├── apps/
│ └── web/ # Frontend (Vite + React + TypeScript)
├── shared/
│ └── types/ # Shared TypeScript types
├── agents/ # AI context documentation
├── docker-compose.yml # Docker configuration
├── backend.md # Backend API documentation
└── README.md # This file🛠️ 技术栈
后端
- 运行时间: Node.js 20
- 框架: Express.js
- 语言: TypeScript
- 数据库: MongoDB 7
- 分析器: 统一、评论、重新打字
- 身份验证: JWT(jsonwebtoken)
- 集装箱化: 码头工人
前端
- 框架: 反应18
- 构建工具: 维特
- 语言: TypeScript
- 造型: 顺风CSS
- 国家: 状态 + React Query
- 路由器: React路由器v6
- UI组件: Radix UI
- 图标: Lucide反应
📖 API表面(通过网关)
基本URL: http://localhost:4000
- 认证:
/api/auth/* - 项目:
/api/projects/* - 页:
/api/pages/* - 主题:
/api/theme/* - 出口:
/api/export/* - 查看器(公共):
/api/view/*
费率限制文档: /api/rate-limits
🔧 环境配置
复制 .env.example 到 .env 并根据需要进行调整。关键变量:
# Gateway
JWT_SECRET=change-this-secret
ALLOWED_ORIGINS=http://localhost:5173,http://localhost:3000
# Auth tokens
JWT_EXPIRES_IN=15m
REFRESH_JWT_SECRET=change-this-refresh-secret
REFRESH_TOKEN_EXPIRES_IN=30d
REFRESH_TOKEN_COOKIE=true
# CSRF
CSRF_ENABLED=true
# Frontend
VITE_API_URL=http://localhost:4000🐳 Docker命令
# Start all services
docker-compose -f docker-compose.production.yml up -d
# Stop services
docker-compose -f docker-compose.production.yml down
# View logs
docker-compose -f docker-compose.production.yml logs -f
# Rebuild & restart
docker-compose -f docker-compose.production.yml up --build -d
# Clean reset
docker-compose -f docker-compose.production.yml down -v🎨 默认主题
Doxify使用Supabase风格的调色板:
Primary: #3ECF8E (green)
Secondary: #1F1F1F (dark gray)
Background: #FFFFFF (white)
Foreground: #1F1F1F (text)🧪 健康与测试(手册)
# Health checks
curl -s http://localhost:4000/health | jq
curl -s http://localhost:4000/api/rate-limits | jq
curl -s http://localhost:4001/health | jq # auth-service计划:
- 单元测试(Vitest)和E2E(剧作家)
🚀 生产部署
部署到任何VPS(DigitalOcean、AWS等)
# On your server
git clone https://github.com/mihir-rabari/doxify.git
cd doxify
cp .env.example .env
# Edit .env with production values
docker-compose -f docker-compose.production.yml up --build -d就是这样!您的Doxify实例已上线。
📋 路线图
MVP(当前)
- \[x\] 后端微服务
- \[x\] 前端CMS接口
- \[x\] MDX解析
- \[x\] 主题定制
- \[x\] 静态站点导出
未来功能
- \[\]实时协作(Y.js)
- \[\]人工智能内容生成
- \[\]全球搜索(MeiliSearch)
- \[\]版本控制
- \[\]用于AI代理的MCP服务器
- \[\]GitHub同步
- \[\]模板市场
- \[\]部署按钮(一键Vercel/Netlify)
🤝 贡献
欢迎投稿!请随时提交拉取请求。
- 分叉存储库
- 创建功能分支(
git checkout -b feature/AmazingFeature) - 提交您的更改(
git commit -m 'Add some AmazingFeature') - 推到分支(
git push origin feature/AmazingFeature) - 打开拉取请求
📄 许可证
该项目根据MIT许可证获得许可。
👨💻 作者
米希尔·拉巴里 -独立开发者
我根据我的项目需求构建工具。如果它对我有效,我会发货。
______________________________________________________________________
内置❤️ 独立开发者解决自己的问题
