开始之前需要配置数据库环境,sql 脚本参考
- cd backend
- go mod tidy
- cd cmd
- go build . 5 ./cmd.exe (windows系统为例)
- cd frontend
- yarn
- yarn dev
需要在 linux 系统下编译 go 项目为 linux 可执行文件,并移动到 docker/apps 目录下
- cd docker
- docker create network message
- docker-compose up
- 访问 http://localhost:9000/portainer 查看容器运行情况
- 访问 http://localhost/dist/index.html 查看项目前端页面
- 用户未登录时,可查看所有留言信息
- 翻页效果展示
- 用户发表留言,在未登录时点击发表,弹出登陆模态框,提示登陆(登陆之后头像变为用户名第一个字母或汉字)
- 发表留言之后,自动刷新当前页面。