mogutouERP 是一个前后端分离的微型进存销系统,采用 Gin + Vue 开发

Related tags

Caching erp
Overview

mogutouERP 蘑菇头进存销管理系统

Go Report Card Codacy Badge

mogutouERP 是一个前后端分离的微型进存销系统,采用 Gin + Vue 开发。

演示地址 http://demo.mogutou.xyz

账号: 11223344552

密码: mogutou

主要功能及效果图

  • 员工账号管理
  • 采购订单管理
  • 销售订单管理
  • 商品信息、库存管理
  • 财务信息报表

财务信息,添加员工,商品进价管理等操作只有管理员账号可以查看并操作

image image image image image

本地运行使用

后端

准备一个 mysql本地 Docker 启一个 mysql,或者其它方式启动。

在 mysql 中创建一个 database

下载本仓库源码(后端)

git clone https://github.com/Allenxuxu/mogutouERP.git

进入源码目录查看并修改 conf 目录下的配置文件(mysql 连接信息)

cd mogutouERP/conf
vi conf.json

最后 cd 回顶层目录启动程序

cd ..
make run

前端

下载前端仓库源码

git clone https://github.com/Allenxuxu/mogutouERP-vue
cd mogutouERP-vue
npm install
# develop
npm run dev

然后查看浏览器 http://localhost:9528

登陆

默认管理员登陆账号和密码都是 11223344556 , 登陆后修改。

前后端分离部署

后端部署

数据库

后端数据存储使用 mysql 数据库,需要提前在 mysql 中建库,数据库名称随意定义,只需与配置文件中一致即可。无需提前建表,项目中采用 Gorm 自动生成。

配置文件

在服务器上创建一个目录存放配置文件, 并创建两个配置文件(仓库源码 conf 目录中为 模版)

cd /opt/mogutouERP-demo

mkdir conf && touch conf.json  jwt.json

配置文件内容模版如下

conf.json

{
    "mysql": {
        "name": "root",
        "password": "123",
        "DBname": "mgt",
        "addr": "127.0.0.1:3306"
    },
    "listen": "127.0.0.1:8088"
}

jwt.json

{
    "jwt-key": "asdfasf"
}

Docker 运行

docker pull xuxu123/mogutou:v0.1.0

这里网络模式 --net=host , 主要是考虑大多数人都是在本机安装的 mysql,服务在容器中无法通过 127.0.0.1 直接访问 mysql 。并不建议采用 host 网络模式,但是作为演示这是最方便的。

docker run --name mogutou -v /opt/mogutouERP-demo/conf:/etc/conf  --net=host -d   xuxu123/mogutou:v0.1.0

查看输出日志,确认服务正常启动

docker logs mogutou

前端部署

修改 config 目录下 prod.env.js 中的 BASE_API ,改成你的域名或者服务器公网 IP 加端口即可

'use strict'
module.exports = {
  NODE_ENV: '"production"',
  BASE_API: '"https://xxx.xxxxx.com/api/v1"'
}

进入仓库顶层目录 build 生成静态文件

npm run build

生成 dist 目录,将 dist 目录拷贝到服务器中,使用 nginx反向代理就可以了

Nginx 参考配置

server {
    listen 80;
    server_name demo.mogutou.xyz;

    root /opt/mogutouERP-demo/dist;
    index index.html;

    location / {
       try_files $uri $uri/ /index.html;
    }

    location /api {
       proxy_pass http://127.0.0.1:8088;
    }
}
You might also like...
vue.js(element框架)+golang(beego框架)开发的运维发布系统,支持git,jenkins版本发布,go ssh,BT两种文件传输方式选择,支持部署前准备任务和部署后任务钩子函数
vue.js(element框架)+golang(beego框架)开发的运维发布系统,支持git,jenkins版本发布,go ssh,BT两种文件传输方式选择,支持部署前准备任务和部署后任务钩子函数

该项目已停止开发,不再新增功能,十分欢迎开发同学贡献PR。本项目适合有vue+go开发经验的同学作为二次开发框架,不适合小白用户使用,请慎重选择! gopub(基于vue.js element框架+golang beego框架开发)是一个基于运维场景设计的企业级运维发布系统。配置简单、功能完善、界面

beego 与 Ant Design Pro Vue 基础权限系统

beego Ant Design Pro Vue RBAC beego 与 Ant Design Pro Vue 基础权限系统 后端: http://beego.me ORM: gorm https://gorm.io/zh_CN/docs/ Ant Design Pro Vue文档: https:

快速crud开发框架,甚至于一行代码不用敲;自动根据数据库表结构自动生成crud代码;低代码开发框架;至少减少百分90%工作量;可快速把现有系统转成GfEasy版本;后端使用GoFrame开发;后台前端使用 cool-admin-vue;后台使用自适应布局,手机、PC完美使用。
快速crud开发框架,甚至于一行代码不用敲;自动根据数据库表结构自动生成crud代码;低代码开发框架;至少减少百分90%工作量;可快速把现有系统转成GfEasy版本;后端使用GoFrame开发;后台前端使用 cool-admin-vue;后台使用自适应布局,手机、PC完美使用。

GoFrame: GfEasy GfEasy So Easy 快速crud开发框架,甚至于一行代码不用敲 自动根据数据库表结构自动生成crud代码 低代码开发框架 至少减少百分90%工作量 可快速把现有系统转成GfEasy版本 后端使用GoFrame开发;后台前端使用 cool-admin-vue

Go backend for the Vue-Go personal digital library application

Motivation Create a backend that connects to a cloud storage, so to store and retrieve my personal books. Barebone application State “DONE” from “NEXT

Implementação em vue.js do famoso jogo Game of Life de John Horton Conway

Game of Life Time de desenvolvimento Gabriel Izoton Mateus Santos Desenvolvimento Local npm install npm start Para uma melhor experiência de desenvolv

A poetry website created by Go and Vue.
A poetry website created by Go and Vue.

中华诗词 基于Go语言和Vue构建的前后端分离项目。( A poetry website created by Go and Vue. ) 中华诗词收录了上至先秦,下至当代共计五万余首诗词,完全免费并开放所有诗词内容和程序源代码,您可自由复制、修改、传播诗词内容和程序源码。 特色 后端采用GoFra

A real-time serverless chat application with Go and Vue 3
A real-time serverless chat application with Go and Vue 3

sls-chat-app A real-time serverless chat application with Go and Vue 3. For the

Cleanv - Golang SDK for Vue Projects.  It is able to structure a clean code/arch pattern
Cleanv - Golang SDK for Vue Projects. It is able to structure a clean code/arch pattern

Cleanv - Golang SDK for Vue Projects Why? This project is part of my personal portfolio, so, I'll be happy if you could provide me any feedback about

Golang & vue web serve
Golang & vue web serve

go_web 本项目源自blog 目前主要功能为个人博客服务

gin auto binding,grpc, and annotated route,gin 注解路由, grpc,自动参数绑定工具
gin auto binding,grpc, and annotated route,gin 注解路由, grpc,自动参数绑定工具

中文文档 Automatic parameter binding base on go-gin doc Golang gin automatic parameter binding Support for RPC automatic mapping Support object registrati

Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.
Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.

Gin Web Framework Gin is a web framework written in Go (Golang). It features a martini-like API with performance that is up to 40 times faster thanks

Gin best practices, gin development scaffolding, too late to explain, get on the bus.

Table of Contents generated with DocToc gin_scaffold 现在开始 文件分层 log / redis / mysql / http.client 常用方法 swagger文档生成 gin_scaffold Gin best practices, gin

gin-gonic/gin  metrics for prometheus.
gin-gonic/gin metrics for prometheus.

gin-metrics gin-gonic/gin metrics exporter for Prometheus. 中文 Introduction gin-metrics defines some metrics for gin http-server. There have easy way t

A high performance gin middleware to cache http response. Compared to gin-contrib/cache, It has a huge performance improvement. 高性能gin缓存中间件,相比于官方版本,有明显性能提升。 Swagger + Gin = SwaGin, a web framework based on Gin and Swagger
Swagger + Gin = SwaGin, a web framework based on Gin and Swagger

Swagger + Gin = SwaGin Introduction SwaGin is a web framework based on Gin and Swagger, which wraps Gin and provides built-in swagger api docs and req

Swagger + Gin = SwaGin, a web framework based on Gin and Swagger
Swagger + Gin = SwaGin, a web framework based on Gin and Swagger

Swagger + Gin = SwaGin Introduction SwaGin is a web framework based on Gin and Swagger, which wraps Gin and provides built-in swagger api docs and req

A single sign-on solution based on go-oauth2 / oauth2 and gin-gonic/gin

A single sign-on solution based on go-oauth2 / oauth2 and gin-gonic/gin

Go (Golang) API REST with Gin FrameworkGo (Golang) API REST with Gin Framework

go-rest-api-aml-service Go (Golang) API REST with Gin Framework 1. Project Description Build REST APIs to support AML service with the support of exte

Simple to do list API with Gin and Gorm (with Postgres)Simple to do list API with Gin and Gorm (with Postgres)

go-todo Simple to do list API with Gin and Gorm (with Postgres) Docker Clone this repository and run: docker-compose up You can then hit the followin

Comments
  • 你好,编译的时候出现报错

    你好,编译的时候出现报错

    go build -o mogutou main.go router.go router.go:4:2: cannot find package "github.com/Allenxuxu/mogutouERP/api" in any of: /usr/local/Cellar/go/1.13.4/libexec/src/github.com/Allenxuxu/mogutouERP/api (from $GOROOT) /Users/jacky/go/src/github.com/Allenxuxu/mogutouERP/api (from $GOPATH) router.go:5:2: cannot find package "github.com/Allenxuxu/mogutouERP/middleware" in any of: /usr/local/Cellar/go/1.13.4/libexec/src/github.com/Allenxuxu/mogutouERP/middleware (from $GOROOT) /Users/jacky/go/src/github.com/Allenxuxu/mogutouERP/middleware (from $GOPATH) main.go:7:2: cannot find package "github.com/Allenxuxu/mogutouERP/tree/master/models" in any of: /usr/local/Cellar/go/1.13.4/libexec/src/github.com/Allenxuxu/mogutouERP/tree/master/models (from $GOROOT) /Users/jacky/go/src/github.com/Allenxuxu/mogutouERP/tree/master/models (from $GOPATH) main.go:8:2: cannot find package "github.com/Allenxuxu/mogutouERP/tree/master/pkg/token" in any of: /usr/local/Cellar/go/1.13.4/libexec/src/github.com/Allenxuxu/mogutouERP/tree/master/pkg/token (from $GOROOT) /Users/jacky/go/src/github.com/Allenxuxu/mogutouERP/tree/master/pkg/token (from $GOPATH) router.go:6:2: cannot find package "github.com/gin-contrib/cors" in any of: /usr/local/Cellar/go/1.13.4/libexec/src/github.com/gin-contrib/cors (from $GOROOT) /Users/jacky/go/src/github.com/gin-contrib/cors (from $GOPATH) main.go:9:2: cannot find package "github.com/gin-gonic/gin" in any of: /usr/local/Cellar/go/1.13.4/libexec/src/github.com/gin-gonic/gin (from $GOROOT) /Users/jacky/go/src/github.com/gin-gonic/gin (from $GOPATH) main.go:10:2: cannot find package "github.com/jinzhu/gorm/dialects/mysql" in any of: /usr/local/Cellar/go/1.13.4/libexec/src/github.com/jinzhu/gorm/dialects/mysql (from $GOROOT) /Users/jacky/go/src/github.com/jinzhu/gorm/dialects/mysql (from $GOPATH) main.go:11:2: cannot find package "github.com/micro/go-micro/config" in any of: /usr/local/Cellar/go/1.13.4/libexec/src/github.com/micro/go-micro/config (from $GOROOT) /Users/jacky/go/src/github.com/micro/go-micro/config (from $GOPATH) main.go:12:2: cannot find package "github.com/micro/go-micro/config/source/file" in any of: /usr/local/Cellar/go/1.13.4/libexec/src/github.com/micro/go-micro/config/source/file (from $GOROOT) /Users/jacky/go/src/github.com/micro/go-micro/config/source/file (from $GOPATH) make: *** [build] Error 1

    google了一下没找到解决办法,请问怎么弄?macos下的go环境 谢谢

    opened by zjjacky 8
  • Gorm选择与字段冲突

    Gorm选择与字段冲突

    2022/10/26 20:26:18 D:/golang/data/src/mogutouERP/mogutouERP/models/purchaseOrder.go:162 [error] invalid field found for struct github.com/Allenxuxu/mogutouERP/models.PurchaseOrderInfo's field Goods, need to define a valid foreign key for relations or it need to implement the Valuer/Scanner interface

    func getPurchaseOrder(tx *gorm.DB, orderID string) (*PurchaseOrderInfo, error) {
    	var order PurchaseOrderInfo
    	err := tx.Table("purchase_orders").Select(
    		"id, created_at, operator, amount, remarks, state, freight").Where("id = ?", orderID).First(&order).Error
    	if err != nil {
    		return nil, err
    	}
    
    	err = tx.Raw(`select t2.id, t2.name, t2.colour, t2.size, t2.brand, t1.number from purchase_goods as t1 left outer join
    			commodities as t2 on t1.goods_id = t2.id where t1.purchase_order_id = ?`, orderID).Scan(&order.Goods).Error
    	if err != nil {
    		return nil, err
    	}
    	return &order, nil
    }
    

    order 的数据结构是:

    type PurchaseOrderInfo struct {
    	PurchaseOrder
    	Goods []Commodity
    }
    
    type PurchaseOrder struct {
    	gorm.Model
    	Operator string `gorm:"size:255"`
    	Remarks  string
    	Amount   float32
    	Freight  float32
    	State    string `gorm:"default:'未完成'"`
    }
    
    // Commodity 商品表
    type Commodity struct {
    	ID            string `gorm:"primary_key"`
    	Name          string
    	Colour        string
    	Size          string
    	Brand         string
    	Number        uint
    	PresaleNumber uint
    	SalesVolume   uint
    	Price         float32
    	PurchasePrice float32
    }
    
    opened by gebilxs 4
Owner
徐旭
礼法岂是为吾辈而设
徐旭
Gin-cache - Gin cache middleware with golang

Gin-cache - Gin cache middleware with golang

Anson 37 Nov 28, 2022
beego-vue-admin基于当前流行技术组合的前后端RBAC管理系统:Go1.15.x+Beego2.x+Jwt+Redis+Mysql8+Vue 的前后端分离系统,权限控制采用 RBAC,支持数据字典与数据权限管理,支持动态路由等

beego-vue-admin 后台管理系统 项目简介 beego-vue-admin基于当前流行技术组合的前后端RBAC管理系统:Go1.15.x+Beego2.x+Jwt+Redis+Mysql8+Vue 的前后端分离系统,权限控制采用 RBAC,支持数据字典与数据权限管理,支持动态路由等 体验

null 131 Dec 30, 2022
基于 Goland + Gin + Logrus+ OpenCv 4 + WebSocket + YoloV4 + Redis + Vue 3 的直播流(支持RTSP、RTMP、FLV、HLS)在线场景智能识别系统

基于 Goland + Gin + OpenCv 4 + WebSocket + YoloV4 + Redis + Logrus + Vue 3 + TypeScript 目前市面上AI在Go中的应用和相关使用较少,Go这门语言是我比较喜欢的;另外就是自己在AI部门从事多年该项工作,但是没有接触这块

pfhds 38 Nov 29, 2022
A ToDoList Demo based on Vue+Gin+Gorm+mysql

bubble清单 一个基于gin+gorm开发的练手小项目,通过该项目可初识go web开发该有的姿势。 前端页面基于vue和ElementUI开发,对前端不熟悉的童鞋可直接下载templates和static文件夹下的内容使用。 使用指南 下载 [email protected]:mao888/GoWe

胡超 6 Mar 16, 2022
Automated penetration and auxiliary systems, providing XSS, XXE, DNS log, SSRF, RCE, web netcat and other Servers,gin-vue-admin

Simple DNS log Server,easy to ACME DNS challenge log easy send to elasticsearch https://github.com/hktalent/DNS_Server go4Hacker Automated penetration

51pwn 69 Dec 30, 2022
Gin-errorhandling - Gin Error Handling Middleware is a middleware for the popular Gin framework

Gin Error Handling Middleware Gin Error Handling Middleware is a middleware for

Joseph Woodward 9 Sep 19, 2022
Build awesome Golang desktop apps and beautiful interfaces with Vue.js, React.js, Framework 7, and more...

Guark Guark allows you to build beautiful user interfaces using modern web technologies such as Vue.js, React.js..., while your app logic handled and

Guark. 633 Jan 1, 2023
YSHOP-GO基于当前流行技术组合的前后端RBAC管理系统:Go1.15.x+Beego2.x+Jwt+Redis+Mysql8+Vue 的前后端分离系统,权限控制采用 RBAC,支持数据字典与数据权限管理,支持动态路由等

YSHOP-GO 后台管理系统 项目简介 YSHOP-GO基于当前流行技术组合的前后端RBAC管理系统:Go1.15.x+Beego2.x+Jwt+Redis+Mysql8+Vue 的前后端分离系统,权限控制采用 RBAC,支持数据字典与数据权限管理,支持动态路由等 体验地址: https://go

null 131 Dec 30, 2022
Generate a modern Web project with Go and Angular, React or Vue in seconds 🚀

Goxygen Generate a Web project with Go and Angular, React or Vue. Goxygen aims at saving your time while setting up a new project. It creates a skelet

Sasha Shpota 2.5k Jan 5, 2023
The best HTTP Static File Server, write with golang+vue

gohttpserver Goal: Make the best HTTP File Server. Features: Human-friendly UI, file uploading support, direct QR-code generation for Apple & Android

Sound Sun 1.9k Dec 30, 2022