vuerecipe Buffalo+Vue.js轻量全栈方案

Buffalo 的后端生成器配上 Vue.js,搭配起来还挺顺手的。用buffalo db create -a一键建库,配置database.yml也不难,改下用户名、密码、host 就能跑。前后端分离开发场景里,这套组合算是比较轻量的,开发速度快,写得也干净。嗯,像表单、分页这类小功能,Vue 那边搞定,Buffalo 后端负责接口输出,响应也快,体验还不错。

Buffalo 的数据库操作是通过它自带的命令行工具搞定的,不用自己手写一堆 SQL,挺适合想快速搭起项目的你。比如你已经装好了 Postgres,那就直接跑:

$ buffalo db create -a

顺带提一句,database.yml这个文件你要提前改好,不然连不上库会报错。路径就默认在项目根目录。

要是你平时习惯前后端解耦,这种 Buffalo + Vue 的结构蛮适合搞 REST 接口的,前端 Vue 单页应用搞交互,后端只管返回 JSON 响应,逻辑清晰。

哦对,前端新手可以先看看这些入门资料,比较好上手:

如果你项目还打算对接 Swagger、TypeORM 这些,Nestjs 样板项目也可以参考下,思路上挺接近的。

建议:数据库记得先启动,Postgres 不会自动帮你装;前端建议独立起服务,调接口方便也好测。

zip
vuerecipe-master.zip 预估大小:50个文件
folder
vuerecipe-master 文件夹
file
.dockerignore 25B
file
go.mod 1KB
file
main.go 138B
folder
grifts 文件夹
file
db.go 1KB
file
init.go 149B
folder
models 文件夹
file
member_test.go 112B
file
member.go 2KB
file
band_test.go 110B
file
band.go 2KB
file
models_test.go 211B
file
models.go 371B
file
yarn.lock 212KB
file
go.sum 99KB
folder
locales 文件夹
file
all.en-us.yaml 144B
file
webpack.config.js 3KB
folder
migrations 文件夹
file
20171016201737_create_bands.down.fizz 19B
file
schema.sql 2KB
file
20171016201758_create_members.up.fizz 173B
file
20171016201737_create_bands.up.fizz 129B
file
20171016201758_create_members.down.fizz 21B
file
20171017144655_add_index_on_members.up.fizz 36B
folder
20171017144655_add_index_on_members.down.fizz 文件夹
file
.babelrc 38B
file
Dockerfile 848B
file
.codeclimate.yml 273B
folder
config 文件夹
file
buffalo-plugins.toml 82B
file
buffalo-app.toml 229B
folder
assets 文件夹
folder
images 文件夹
file
logo.svg 64KB
folder
js 文件夹
file
application.js 546B
folder
components 文件夹
file
band.vue 640B
file
members.vue 809B
folder
css 文件夹
file
application.scss 180B
folder
actions 文件夹
file
home_test.go 184B
file
bands.go 4KB
file
actions_test.go 217B
file
render.go 523B
file
home.go 216B
file
app.go 2KB
file
members_test.go 692B
file
members.go 5KB
file
bands_test.go 678B
file
README.md 1KB
file
.buffalo.dev.yml 264B
file
docker-compose.yml 131B
folder
templates 文件夹
file
application.plush.html 432B
file
_flash.plush.html 394B
file
index.plush.html 93B
file
.gitignore 126B
file
database.yml 382B
file
package.json 1KB
zip 文件大小:153.66KB