Code Monkey home page Code Monkey logo

gin_weibo's Introduction

Gin Weibo App

参考 L01 Laravel 教程 - Web 开发实战入门,使用 Golang (Gin、Gorm) 改写。

项目结构和风格模仿 Laravel。

相关项目

L02 Laravel 教程 - Web 开发实战进阶、L03 Laravel 教程 - 实战构架 API 服务器、L04 Laravel 教程 - 微信小程序从零到发布:golang bbs 项目

L05 Laravel 教程 - 电商实战、L06 Laravel 教程 - 电商进阶:golang 商城项目

启动

# 需先安装 fresh (https://github.com/gravityblast/fresh)
# 启动前建议配置环境变量: GOPROXY=https://goproxy.io

cd gin_weibo
cp ./config.example.yaml ./config.yaml
make dev # 或者也可直接 fresh -c ./fresh.conf
# 项目相关命令参见 Makefile

部署

cd gin_weibo
make
./deploy start

项目目录结构

展开查看

├── app              项目核心逻辑代码
│    ├── auth        用户相关
│    ├── controllers 控制器
│    ├── helpers     工具方法
│    ├── models      模型
│    ├── policies    权限校验
│    ├── requests    参数校验
│    ├── services    复杂查询
│    └── view_models 数据转换
│
├── config           配置中心
│
├── database         数据库
│    └── factory     数据 mock
│
├── middleware       中间件
│    └── wrapper     controller 包裹函数
│
├── pkg              项目依赖
│
├── public           项目静态文件
│
├── resources        前端源码
│    └── view        go 模板文件
│
├── routes           路由
│    └── routes.go   路由注册
│    └── api.go      api 路由注册
│    └── web.go      页面路由注册
│    └── named       命名路由模块
│
├── storage          存放日志等文件
│
├── main.go          项目入口
│
├── config.yaml      项目配置
│
├── deploy.sh        部署脚本
│
└── Makefile         Makefile 文件

实现功能

  • CSRF 验证
  • flash 消息闪现
  • 记忆上次表单提交的数据
  • 参数校验模块
  • 命名路由
  • 分页
  • 发送邮件
  • 用户权限模块
  • 日志
  • 前端构建 (typescript、sass ...)

1

2

3

4

5

6

7

8

9


gin_weibo's People

Contributors

away0x avatar billiskilled 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.