GithubHelp home page GithubHelp logo

groovili / go-wagen Goto Github PK

View Code? Open in Web Editor NEW
33.0 2.0 3.0 38 KB

Single binary web application generator for Go

License: MIT License

Go 97.07% Makefile 2.93%
golang boilerplate generator tool project-template project-boilerplate webapp app-template go go-tool

go-wagen's Introduction

go-wagen

Go Report Card

Single binary web application generator for Go.

Creates boilerplate and does routine on a project start.

Less than in a minute you've got simple, clean and dockerized app:

asciicast

Generates:

  • project layout, according to community best practices
  • Makefile for wrapping project related routines
  • Dockerfile and docker-compose for local development
  • containers for code, tests and golangci-lint
  • configuration management with viper
  • logging with logrus or zap
  • routing with gorilla/mux or chi
  • default health check, http handler and logger middleware

go-wagen is a starter pack for typical web application in Golang.

It doesn't aim to generalize the whole project workflow, push framework, or architecture. Consists of framework-agnostic components that are very common.

All contributions, issues, requests or feedback are warmly welcome.

Installation

Install pre-built binary on releases page:

  1. curl -LJO https://github.com/groovili/go-wagen/releases/download/v1.0.0/go-wagen-osx.tar.gz
  2. tar -f go-wagen-osx.tar.gz -x

or build from source code:

  1. git clone https://github.com/groovili/go-wagen && cd go-wagen
  2. make install - will install packr to wrap templates to binary
  3. make build

Binary doesn't need to be in $GOPATH and works without any dependencies.

Usage

  1. ./go-wagen --path=/absoule/path/to/project and select dependencies
  2. cd /absoule/path/to/project
  3. go mod vendor
  4. make run - will build and run container with code
  5. make test - to run container with tests
  6. make lint - to run linter for source code

Structure

Application generated with go-wagen will have following structure:

├── Makefile
├── cmd
│   └── example
│       └── example.go - app entrypoint
├── config - config presets for each env of default pipline
│   ├── app.dev.yml
│   ├── app.local.yml
│   └── app.yml
├── deploy
│   ├── Dockerfile
│   └── docker-compose.yml
├── go.mod
├── internal - for shared internal tools
├── server
│   ├── handlers
│   │   ├── hello.go
│   │   └── ping.go
│   └── middleware
│       └── log.go
├── storage - db/storages
└── vendor - downloaded modules

go-wagen's People

Contributors

groovili 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

Watchers

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