Skip to content

jsxiaosi/xiaosiBlog

Repository files navigation

xiaosiBlog

基于Nuxt3EggJs等主流技术开发的博客系统

预览地址:https://www.jsxiaosi.com/

特性

  • 最新技术栈:使用 Nuxt3/Vue3/EggJs 等前端前沿技术开发
  • 主题:可配置的主题

准备

  • nodegit -项目开发环境
  • Vite - 熟悉 vite 特性
  • Vue3 - 熟悉 Vue 基础语法
  • Es6+ - 熟悉 es6 基本语法
  • Nuxt3 - 熟悉 Nuxt 基本使用
  • EggJs - 熟悉 EggJs 基本使用
  • MySql - 熟悉 MySql 基本使用

安装使用

  • 获取项目代码(https or ssh)
git clone https://github.com/jsxiaosi/xiaosiBlog.git

git clone git@github.com:jsxiaosi/xiaosiBlog.git
  • 进入目录(注意:请使用pnpm
# 强制使用pnpm
pnpm install

服务端

安装 MySql

MySql 安装教程网上自行查找

  • 创建数据库:
CREATE DATABASE xiaosiblog
  • 连接数据库:
use xiaosiblog
  • 导入在项目根目录下 xiaosiblog.sql 的数据库配置
source ’文件的绝对路径‘/xiaosiblog.sql
  • 修改 EggJs 配置
    打开 service/config/config.default.ts
// 配置数据库
  config.mysql = {
    client: {
      // host
      host: 'localhost', // 连接地址
      // 端口号
      port: '3306', // 端口号默认是3306
      // 用户名
      user: 'root', // 连接用户名
      // 密码
      password: '123456', // 数据库密码
      // 数据库名
      database: 'xiaosiblog', //数据库名称
    },
    // 是否加载到 app 上,默认开启
    app: true,
    // 是否加载到 agent 上,默认关闭
    agent: false,
  };

开发环境

npm run dev:service

预览:http://127.0.0.1:7001

生产环境

  • 进入目录
cd service
  • 由于项目是使用 TypeScript 为开发语言生产环境运行时需要使用 tsc 将 ts 编译成 js,具体原因
npm run tsc
  • 启动
npm run start

后台

后台使用的是xiaosiAdmin模板开发,详细内容请查看项目详情

开发环境

npm run dev:admin

生产环境

  • 进入目录
cd service
  • 打包
npm run build

博客

开发环境

npm run dev:blog

预览:http://127.0.0.1:3000

生产环境

  • 进入目录
cd service
  • 打包
npm run build
  • 启动
npm run start

维护者

@jsxiaosi

License

MIT © 2022