Giter VIP home page Giter VIP logo

gblog's Introduction

博客-gBlog

描述

本项目暂时只包含博客系统的后端部分,只提供了博客系统所需的接口,前端部分暂时未着手制作。

技术选型

  1. web框架: gin
  2. 数据库: mysql
  3. orm: gorm
  4. 缓存: redis
  5. 配置文件: yaml.v3
  6. 文件存储: 七牛云
  7. 用户认证: jwt

TODO

  • 前期准备
    • 配置文件
    • gorm
    • 日志
    • 路由
  • swag文档
  • 配置管理
  • 图片管理
  • 广告管理
  • 菜单管理
  • 用户管理
  • 标签管理
  • 文章管理
  • 评论管理

项目结构

-gBlog
    |-api 接口目录
    |-config 配置目录
    |-core 服务内核目录
    |-docs 文档目录
    |-flag 命令行操作目录
    |-global 全局变量目录
    |-middleware 中间件目录
    |-models 数据库模型目录
    |-plugins 外部插件目录
    |-routers 路由目录
    |-service 公共服务目录
    |-uploads 文件目录
    |-utils 工具目录
    |-conf.yaml 配置文件
    |-main.go 程序入口

使用说明

前期准备

  1. 克隆本项目到本地

    $ git clone https://github.com/moment22l/gBlog.git
    $ cd gblog
    
  2. 打开本地mysql以及redis服务

  3. 修改conf.yaml中的配置数据,以适配本机配置

  4. 数据库迁移,使用如下命令

    $ go run main.go -db
    
  5. 创建管理员用户,使用如下命令并根据提示输入信息

    $ go run main.go -u admin
    

启动服务器

$ go run main.go

注意事项

  1. 如需使用图片文件上传,请自行到七牛云官网申请七牛云存储空间,并修改conf.yaml中相关内容
    • access_key
    • secret_key
    • bucket 空间名称
    • cdn 外网加速地址
    • zone 存储地区
    • size 限制图片大小
  2. 如需使用邮件订阅,请自行在第三方邮箱申请服务,并修改conf.yaml中相关内容
    • host smtp服务器地址
    • port 服务器端口
    • user 发送方邮箱
    • auth_code 授权码
    • default_from_email 发送方名称

gblog's People

Contributors

moment22l avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.