Code Monkey home page Code Monkey logo

weave's Introduction

Weave

workflows Go Report Card codecov GitHub license


English | 中文

Weave is a Go + Vue3 application starter, simple but functional, supported by gin, gorm, redis, postgres, vue, element-plus, websocket and much more.

See Demo.

Login Home
Dashboard App
Web Shell Web Code Editor

Demo

Demo website: see https://qingwave.github.io/weave/

Run ui with docker(no server and databases)

docker run -d -p 8080:80 --name weave-frontend qingwave/weave-frontend:mock

Features

Server support features:

  • Restful api, write by gin
  • MVC structure
  • Postgres storage, via gorm
  • Swagger doc, support by swag
  • Structured log, support by logrus
  • Prometheus monitor
  • PProf debug
  • Graceful shutdown
  • Authentication, support jwt
  • Request rate limit, server level or user ip
  • OAuth Login and store hashed password
  • Redis cache
  • RBAC supported
  • Container application management, support docker and kubernetes
  • Post management

Frontend support features:

  • Vue3 supported
  • UI with element-plus
  • Build with vite
  • Charts integration, support by echarts
  • WebShell supported
  • Windi CSS
  • OAuth Login
  • Web code editor, support by codemirror
  • MarkDown preview and editor

TODOs

  • Redis cache
  • Request rate limit
  • Authentication
  • WebSocket
  • Trace
  • UI
  • WebShell
  • Dark theme
  • Mobile UI

Get started

Before starting, you should already install golang, docker and nodejs in your develop env.

Run server

Env:

  • golang (1.18 or later)

Install dependencies, postgresql, redis, swag

make init

run locally

make run

run server in docker

# build image
make docker-build-server
# run server
make docker-run-server

For Windows, you can run script in Makefile manually

Test api

See more api in http://localhost:8080/index See swagger http://localhost:8080/swagger/index.html#/

Register user

curl -XPOST http://localhost:8080/api/v1/auth/user -d '{"name": "zhang3", "email": "[email protected]","password": "123456"}'

Login, get jwt token

Only admin user can access any apis, other user need create RBAC policy

curl -XPOST http://localhost:8080/api/v1/auth/token -d '{"name": "admin", "password": "123456"}'

Response as follows, set token in Authorization Header

{
  "code": 200,
  "msg": "success",
  "data": {
    "token": "xxx",
    "describe": "set token in Authorization Header, [Authorization: Bearer {token}]"
  }
}

Get users

token=xxx
curl -X 'GET' 'http://localhost:8080/api/v1/users' -H "Authorization: Bearer $token"

Run UI

Assume you have installed Nodejs, if not, install it by nvm

Run ui with mockjs

cd web
npm run mock

If your frontend deploy in the remote, please change server.host and server.https in vite.config.js.

Run ui with command make ui or

cd web
npm i
npm run dev 

Default admin user admin/123456 or demo user demo/123456

Only admin user can access all api, other user must config RBAC at first

Explore in http://127.0.0.1:8081

run frontend in docker

# build image
make docker-build-ui
# run frontend
make docker-run-ui

More ui in img

  • Login page login

  • Dashboard page dashboard

  • App page app

  • Webshell page webshell

  • Blog list Blog

  • Article article

Documents

weave's People

Contributors

dependabot[bot] avatar qingwave avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

weave's Issues

something wrong with container.Config

Hi, in the ContainerConfig() function, the created container cannot open the console without adding the OpenStdin parameter. What is the reason for this, please? such as:

 config := &container.Config{
		Image:        con.Image,
		Cmd:          con.Cmd,
		
		OpenStdin:    true,

		Labels: labels,
	}

[Bug]: 401 error

Describe the bug
A clear and concise description of what the bug is.
1706609992000
1706609992000

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Enviroment(please complete the following information):

  • OS: [e.g. Linux 4.19]
  • Browser [e.g. chrome]
  • Golang Version [e.g. 1.18]

Additional context
Add any other context about the problem here.

make init 出错

✘  ~/Documents/MossonProject/weave   master  make run
go run -mod vendor main.go

sigs.k8s.io/json/internal/golang/encoding/json

vendor/sigs.k8s.io/json/internal/golang/encoding/json/encode.go:1249:12: sf.IsExported undefined (type reflect.StructField has no field or method IsExported)
vendor/sigs.k8s.io/json/internal/golang/encoding/json/encode.go:1255:18: sf.IsExported undefined (type reflect.StructField has no field or method IsExported)

[Feature]: Need detail documents

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

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.