Golang+Vue3 application starter, Simple but functional.
Weave is a Go + Vue3 application starter that is designed to be simple yet functional. It is supported by various technologies including gin, gorm, redis, postgres, vue, element-plus, websocket, and more. Weave provides server support features such as a RESTful API, MVC structure, Postgres storage, Swagger documentation, structured log, Prometheus monitor, PProf debug, graceful shutdown, authentication with JWT, request rate limit, OAuth login, Redis cache, RBAC support, and container application management with support for Docker and Kubernetes. On the frontend, Weave offers features such as Vue3 support, UI with element-plus, integration with charts using echarts, WebShell support, Windi CSS, OAuth login, web code editor with support for codemirror, Markdown preview and editor, and more.
Server support features:
Frontend support features:
Before starting, make sure you have golang, Docker, and Node.js installed in your development environment.
Environment:
Install dependencies:
go get -u github.com/swaggo/swag
go get -u github.com/gin-gonic/gin
go get -u github.com/jinzhu/gorm
go get github.com/gin-contrib/cors
go get github.com/swaggo/gin-swagger
go get github.com/swaggo/gin-swagger/swaggerFiles
go get github.com/swaggo/gin-swagger/swaggerFiles
go get github.com/sirupsen/logrus
go get github.com/go-redis/redis
go get github.com/prometheus/client_golang/prometheus
go get golang.org/x/time/rate
To run the server locally:
go run main.go
To run the server in Docker:
docker-compose up
For Windows, you can manually run the script in Makefile.
To test the API, visit http://localhost:8080/index and see more API documentation at http://localhost:8080/swagger/index.html#/
To get users, make the following request:
GET /users
Assuming you have installed Node.js, run the UI with mockjs.
If your frontend is deployed remotely, please change server.host
and server.https
in vite.config.js.
To run the UI:
make ui
Default admin user credentials: admin/123456 or demo user credentials: demo/123456
Only admin users can access all APIs, other users must configure RBAC.
Explore the UI at http://127.0.0.1:8081
To run the frontend in Docker:
docker-compose -f docker-compose.ui.yml up
Weave is a Go + Vue3 application starter that provides a range of features for building web applications. It offers server support features such as a RESTful API, database storage, logging, monitoring, authentication, rate limiting, and more. On the frontend, it offers UI components, chart integration, and tools for code editing and Markdown editing. The installation process involves setting up the server, testing the API, and running the UI locally or in Docker. Weave is a versatile tool for building web applications in Go and Vue3.