Skip to content
/ go-web-app Public template

A web app template and Cli with structures inspired by RoR/Laravel/AdonisJS.

License

Notifications You must be signed in to change notification settings

TeaEntityLab/go-web-app

Repository files navigation

go-web-app

tag Go Report Card codecov Travis CI Build Status GoDoc

license stars forks

A web app template and Cli with structures inspired by RoR/Laravel/AdonisJS.

Branch: FastHttp

Branch: Gin

Features

  • cli (urfave/cli)
    • Generate Model/Migration/Seeder
    • seed
    • migrate
  • DB (gorm)
  • Env/Logger (caarlos0/env logrus)
  • Basic Auth middleware
  • APIDocs serve/gen (swaggo)

Why

It's nice to write something in RoR ways.

I hope you'll enjoy this template

Example

Run:

./run.sh app

# Run with Docs:
ENABLE_DOCUMENT=true ./run.sh app

Generate Docs (swaggo):

cd app; ./generateDocs.sh; cd ..

CLI:

# Help
DB_ENDPOINTS=mydb.sqlite3 DB_TYPE=sqlite ./cli.sh help

# Make
DB_ENDPOINTS=mydb.sqlite3 DB_TYPE=sqlite ./cli.sh make:model
DB_ENDPOINTS=mydb.sqlite3 DB_TYPE=sqlite ./cli.sh make:migration
DB_ENDPOINTS=mydb.sqlite3 DB_TYPE=sqlite ./cli.sh make:seeder

# Migrate
DB_ENDPOINTS=mydb.sqlite3 DB_TYPE=sqlite ./cli.sh migrate
DB_ENDPOINTS=mydb.sqlite3 DB_TYPE=sqlite ./cli.sh migrate:rollback
DB_ENDPOINTS=mydb.sqlite3 DB_TYPE=sqlite ./cli.sh migrate:refresh

# Seed
DB_ENDPOINTS=mydb.sqlite3 DB_TYPE=sqlite ./cli.sh seed

Mod Dependencies/Suggestions

WSGI/Routing/Auth

Log/Error

  • errors "github.com/pkg/errors"
  • logrus "github.com/sirupsen/logrus"
  • slack-go "github.com/johntdyer/slack-go"

Cache/Data/Serialize

  • Cache
    • LRUCache github.com/hashicorp/golang-lru
    • Redis gopkg.in/redis.v5
  • Data/Serialize
    • jsoniter github.com/json-iterator/go
    • jsondiff github.com/nsf/jsondiff
    • diffmatchpatch github.com/sergi/go-diff/diffmatchpatch
    • hashring github.com/serialx/hashring
  • XID github.com/rs/xid
  • Net golang.org/x/net

Cli/Etc

About

A web app template and Cli with structures inspired by RoR/Laravel/AdonisJS.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published