Giter Site home page Giter Site logo

go-starter's Introduction

Go-Starter

App Screenshot

What is Go-Starter?

This tool helps you to do the tedious work of setting configuration and creating layers for the REST API

go-starter command

 go-starter help

	┌─┐┌─┐   ┌─┐┌┬┐┌─┐┬─┐┌┬┐┌─┐┬─┐
	│ ┬│ │───└─┐ │ ├─┤├┬┘ │ ├┤ ├┬┘
	└─┘└─┘   └─┘ ┴ ┴ ┴┴└─ ┴ └─┘┴└─
	 
Usage: go-starter [OPTIONS]

Options:
  -f string
    	starter configuration file (default "starter.yaml")
  help
    	show help message

Examples:
  go-starter new      Generate configuration file
  go-starter          Run the application
  go-starter -f=configuration.yaml[default: starter.yaml] Specify a custom configuration file

generate starter configuration

go-starter new

	┌─┐┌─┐   ┌─┐┌┬┐┌─┐┬─┐┌┬┐┌─┐┬─┐
	│ ┬│ │───└─┐ │ ├─┤├┬┘ │ ├┤ ├┬┘
	└─┘└─┘   └─┘ ┴ ┴ ┴┴└─ ┴ └─┘┴└─
	 
2024/01/18 16:46:54 Success generate starter.yaml

starter.yaml is a go-starter configuration:

version: "1"
package: your-name-app
database: database

database support :

  • mysql
  • mongodb
  • postgres

generate structure project

 go-starter

	┌─┐┌─┐   ┌─┐┌┬┐┌─┐┬─┐┌┬┐┌─┐┬─┐
	│ ┬│ │───└─┐ │ ├─┤├┬┘ │ ├┤ ├┬┘
	└─┘└─┘   └─┘ ┴ ┴ ┴┴└─ ┴ └─┘┴└─
	 
layer 'cmd' created successfully.
layer 'api' created successfully.
layer 'db/migrations' created successfully.
layer 'internals/config' created successfully.
layer 'internals/delivery/http' created successfully.
layer 'internals/delivery/messaging' created successfully.
layer 'internals/gateway' created successfully.
layer 'internals/models' created successfully.
layer 'internals/repository' created successfully.
layer 'internals/usecase' created successfully.
layer 'internals/helpers' created successfully.
layer 'tests' created successfully.

Structure

Structure reference

├── api
├── cmd
│   └── main.go
├── config.dev.yaml
├── db
│   └── migrations
├── docker-compose.yaml
├── go.mod
├── internals
│   ├── config
│   │   ├── mysql.go ## filename following the database
│   │   └── viper.go
│   ├── delivery
│   │   ├── http
│   │   └── messaging
│   ├── gateway
│   ├── helpers
│   │   └── error.go
│   ├── models
│   ├── repository
│   └── usecase
├── starter.yaml
└── tests

About go-starter

This tool adopt
gorm
mongo client
viper

Database support:

Database Support
MySQL
PostgreSQL
MongoDB

Installation

go install github.com/fanchann/go-starter@latest

see older version here version

Running Your App

After generating the template, enter the folder that has been generated by go-starter, and then add dependencies using the following command.

go mod tidy

This command will download and install the required dependencies for your project
After success install dependencies, run app with command :

go run cmd/main.go

Authors

go-starter's People

Contributors

fanchann avatar

Stargazers

 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.