go-admin

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2021 License: MIT Imports: 12 Imported by: 0

README

Go Admin

Master

RBAC scaffolding based on Gin + Gorm + Casbin + Dig

How to run

Required
  • Postgres
  • Redis
Config

Simply run make startup, or run following commands step - by - step:

  • Copy config file: cp config/config.sample.yaml config/config.yaml

  • You should modify config/config.yaml

database:
  host: localhost
  port: 5432
  name: goadmin
  env: production
  user: postgres
  password: 1234
  sslmode: disable

redis:
  enable: true
  host: localhost
  port: 6397
  password:
  database: 0

cache:
  enable: true
  expiry_time: 3600
Migration - Create Admin User
$ make admin
Run
$ go run main.go 
Run with docker
$ docker-compose up -d
Document
  • API document at: http://localhost:8888/swagger/index.html
Structure
├── app
│   ├── api             # Handle request & response
│   ├── dbs             # Database Layer
│   ├── middleware      # Middlewares
│   │   ├── cache           # Cache middleware
│   │   ├── jwt             # JWT middleware
│   │   └── roles           # Authorization middleware
│   ├── migration       # Migration
│   ├── mocks           # Mocks
│   ├── models          # Models
│   ├── repositories    # Repository Layer
│   │   └── impl            # Implement repositories
│   ├── router          # Router api
│   ├── schema          # Schemas
│   ├── services        # Business Logic Layer
│   │   └── impl            # Implement services
│   └── test            # Test
├── cmd                 # Contains commands 
├── config              # Config files 
├── docs                # Swagger API document
├── pkg                 # Internal packages
│   ├── app                 # App packages
│   ├── errors              # Errors packages
│   ├── http                # HTTP packages
│   ├── jwt                 # JWT packages
│   └── utils               # Utils packages
├── scripts             # Scripts
Techstack
  • RESTful API
  • Gorm
  • Swagger
  • Logging
  • Jwt-go
  • Gin
  • Graceful restart or stop (fvbock/endless)
  • Cron Job
  • Redis
  • Dig (Dependency Injection)

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL