Code Monkey home page Code Monkey logo

ginnuxt's Introduction

GinNuxt

  • support SSR and Single Page
  • use Gin and Nuxt3

Server

RBAC scaffolding based on GIN + Gorm 2.0 + CASBIN + WIRE (DI).

Features

  • Follow the RESTful API design specification
  • Use Casbin to implement fine-grained access to the interface design
  • Use Wire to resolve dependencies between modules
  • Provides rich Gin middlewares (JWTAuth,CORS,RequestLogger,RequestRateLimiter,TraceID,CasbinEnforce,Recover,GZIP)
  • Support Swagger

Dependent Tools

go get -u github.com/cosmtrek/air
go get -u github.com/google/wire/cmd/wire
go get -u github.com/swaggo/swag/cmd/swag
  • air -- Live reload for Go apps
  • wire -- Compile-time Dependency Injection for Go
  • swag -- Automatically generate RESTful API documentation with Swagger 2.0 for Go.

Dependent Library

  • Gin -- The fastest full-featured web framework for Go.
  • GORM -- The fantastic ORM library for Golang
  • Casbin -- An authorization library that supports access control models like ACL, RBAC, ABAC in Golang
  • Wire -- Compile-time Dependency Injection for Go

Getting Started

git clone https://github.com/mlsjla/GinNuxt

cd server

go run cmd/main/main.go web -c ./configs/config.toml -m ./configs/model.conf --menu ./configs/menu.yaml

# Or use Makefile: make start

The database and table structure will be automatically created during the startup process. After the startup is successful, you can access the swagger address through the browser: http://127.0.0.1:10088/swagger/index.html

Generate swagger documentation

swag init --parseDependency --generalInfo ./cmd/${APP}/main.go --output ./internal/app/swagger

# Or use Makefile: make swagger

Use wire to generate dependency injection

wire gen ./internal/app

# Or use Makefile: make wire

Project Layout

├── cmd
│   └── gin-nuxt-server
│       └── main.go       
├── configs
│   ├── config.toml       
│   ├── menu.yaml         
│   └── model.conf        
├── docs                  
├── internal
│   └── app
│       ├── api           
│       ├── config        
│       ├── contextx      
│       ├── dao           
│       ├── ginx          
│       ├── middleware    
│       ├── module        
│       ├── router        
│       ├── schema        
│       ├── service       
│       ├── swagger       
│       ├── test          
├── pkg
│   ├── auth              
│   │   └── jwtauth       
│   ├── errors            
│   ├── gormx             
│   ├── logger            
│   │   ├── hook
│   └── util              
│       ├── conv         
│       ├── hash         
│       ├── json
│       ├── snowflake
│       ├── structure
│       ├── trace
│       ├── uuid
│       └── yaml
└── scripts               

Web

Web based on - Nuxt3. We recommend to look at the documentation.

Setup

Make sure to install the dependencies

yarn install

Development

Start the development server on http://localhost:3000

yarn dev

Production

Build the application for production:

yarn build

Checkout the deployment documentation.

Thanks

ginnuxt's People

Contributors

mlsjla 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.