# gin-hexo **Repository Path**: attacker/gin-hexo ## Basic Information - **Project Name**: gin-hexo - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2026-03-30 - **Last Updated**: 2026-09-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # gin-hexo 基于 Gin + Vue 3 的前后端分离博客系统,支持 Markdown 编辑、多主题切换、评论、微信公众号同步和 AI 写作。 仓库:[https://gitee.com/attacker/gin-hexo](https://gitee.com/attacker/gin-hexo) ## 功能特性 - Markdown 文章编辑(实时预览) - 分类、标签、专栏、独立页面 - 文章置顶、密码保护、阅读统计 - 评论系统、文章搜索 - 4 款 Hexo 风格前台主题:Butterfly / Fluid / Icarus / Matery - 微信公众号草稿同步 / 群发 - 后台 RBAC、定时任务、系统监控 - AI 写作助手(可配置 LLM) - Docker 一键部署 ## 技术栈 | 端 | 技术 | | --- | --- | | 后端 | Go 1.23、Gin、GORM、SQLite3 / MySQL、JWT | | 前端 | Vue 3、Vite、Element Plus、Pinia、Vue Router | | 部署 | Docker、Nginx、supervisord | ## 项目结构 ``` backend/ # Go / Gin API frontend/ # Vue 3 前台 + 管理后台 docker/ # Nginx / supervisord 配置 docs/ # 设计与评估文档 theme/ # Hexo 主题参考(git submodule) Dockerfile docker-compose.yml run.sh # 本地一键启停 ``` ## 快速开始 ### 方式一:本地开发 ```bash # 克隆(含子模块) git clone --recurse-submodules https://gitee.com/attacker/gin-hexo.git cd gin-hexo # 后端 cd backend go mod tidy go run main.go # 前端(另开终端) cd frontend npm install npm run dev ``` - 博客前台:http://localhost:5181/ - 管理后台:http://localhost:5181/admin - 后端 API:http://localhost:9001/api - 默认账号:`admin` / `admin` 也可使用仓库根目录脚本: ```bash ./run.sh start # 同时启动前后端 ./run.sh status ./run.sh stop ``` ### 方式二:Docker 部署 ```bash # 生产环境请先设置 JWT 密钥 export JWT_SECRET=$(openssl rand -hex 32) docker compose up -d --build ``` 访问 http://localhost (80 端口)。数据、上传文件、日志通过 named volume 持久化。 ## 环境变量(后端) | 变量 | 默认值 | 说明 | | --- | --- | --- | | `PORT` | `9001` | 后端监听端口 | | `GIN_MODE` | `debug` | `debug` / `release` | | `DB_DRIVER` | `sqlite` | `sqlite` / `mysql` | | `DB_NAME` | `db.sqlite3` | SQLite 文件路径或 MySQL 库名 | | `JWT_SECRET` | 空(开发随机) | 生产必须设置 | | `CORS_ORIGINS` | localhost 开发地址 | 逗号分隔 | 前端开发环境见 `frontend/.env.development`,生产构建默认 `VITE_API_BASE_URL=/api`。 ## 主题参考 前台样式参考以下 Hexo 主题(`theme/` 目录为 submodule): - [Butterfly](https://github.com/jerryc127/hexo-theme-butterfly) - [Fluid](https://github.com/fluid-dev/hexo-theme-fluid) - [Icarus](https://github.com/ppoffice/hexo-theme-icarus) - [Matery](https://github.com/blinkfox/hexo-theme-matery) ```bash git submodule update --init --recursive ``` ## 许可证 MIT License