Files
mmkk/start-fixed.sh
guo liwei 9b3f959c3d Initial commit: Markdown editor with file management and regex tools
项目特性:
- 完整的Markdown编辑器,支持实时预览
- 文件管理功能,支持保存/加载/删除文件
- 正则表达式工具,支持批量文本替换
- 前后端分离架构
- 响应式设计

技术栈:
- 前端:React + TypeScript + Vite
- 后端:Python Flask
- Markdown解析:Python-Markdown

包含组件:
- WorkingMarkdownEditor: 基础功能版本
- FullMarkdownEditor: 完整功能版本
- SimpleMarkdownEditor: 简化版本
2025-08-03 06:21:02 +08:00

84 lines
1.6 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Markdown编辑器启动脚本 - 修复版
echo "🚀 启动Markdown编辑器..."
# 检查Python环境
if ! command -v python3 &> /dev/null; then
echo "❌ Python3 未安装"
exit 1
fi
# 检查Node.js环境
if ! command -v node &> /dev/null; then
echo "❌ Node.js 未安装"
exit 1
fi
# 创建虚拟环境并安装后端依赖
echo "📦 设置后端环境..."
cd backend
if [ ! -d "venv" ]; then
echo "创建虚拟环境..."
python3 -m venv venv
fi
source venv/bin/activate
echo "安装Python依赖..."
pip install -r requirements.txt
# 创建workspace目录
mkdir -p workspace
echo "🔧 启动后端服务..."
python app.py &
BACKEND_PID=$!
cd ..
# 安装前端依赖
echo "📦 设置前端环境..."
cd frontend
if [ ! -d "node_modules" ]; then
echo "安装Node.js依赖..."
npm install --legacy-peer-deps
fi
echo "🔧 启动前端服务..."
npm run dev &
FRONTEND_PID=$!
cd ..
# 等待服务启动
echo "⏳ 等待服务启动..."
sleep 3
echo "✅ 服务启动完成!"
echo "后端服务: http://localhost:5000"
echo "前端服务: http://localhost:3000"
echo ""
echo "📝 使用说明:"
echo "1. 打开 http://localhost:3000 访问应用"
echo "2. 使用左侧文件浏览器管理文件"
echo "3. 中间编辑器输入Markdown右侧实时预览"
echo "4. 按 Ctrl+Shift+F 打开正则表达式工具"
echo ""
echo "按 Ctrl+C 停止服务"
# 捕获中断信号并清理
cleanup() {
echo "🛑 正在停止服务..."
kill $BACKEND_PID 2>/dev/null || true
kill $FRONTEND_PID 2>/dev/null || true
wait
echo "✅ 服务已停止"
exit 0
}
trap cleanup INT TERM
# 等待进程
wait