Coder Social home page Coder Social logo

go-coldbrew / cookiecutter-coldbrew Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 1.0 3.32 MB

A cookiecutter template to build golang services powered by ColdBrew

License: MIT License

Python 15.27% Dockerfile 5.87% Makefile 14.21% Go 64.66%
coldbrew cookiecutter docker golang lightweight microservice framework

cookiecutter-coldbrew's Introduction

cookiecutter-coldbrew

Powered by Cookiecutter, Cookiecutter Coldbrew is a framework for jumpstarting production-ready go projects quickly.

Features

  • Generous Makefile with management commands
  • injects build time and git hash at build time.
  • Powered by ColdBrew

Constraints

  • Uses mod for dependency management
  • Only maintained 3rd party libraries are used.
  • Use multistage docker builds for super small docker images
  • Make sure '$GOBIN' is set in PATH

Docker

This template uses docker multistage builds to make images slimmer and containers only the final project binary and assets with no source code whatsoever.

Usage

Let's pretend you want to create a project called "echoserver".

Rather than starting from scratch maybe copying some files and then editing the results to include your name, email, and various configuration issues that always get forgotten until the worst possible moment, get cookiecutter to do all the work.

Prerequisites

First, get Cookiecutter. Trust me, it's awesome:

$ pip install cookiecutter

Alternatively, you can install cookiecutter with homebrew:

$ brew install cookiecutter

Using the ColdBrew Cookiecutter Template

To run it based on this template, type:

$ cookiecutter gh:go-coldbrew/cookiecutter-coldbrew

You will be asked about your basic info (name, project name, app name, etc.). This info will be used to customise your new project.

Providing your app information to the cookiecutter

Warning: After this point, change 'github.com/ankurs', 'MyApp', etc to your own information.

Answer the prompts with your own desired options. For example:

source_path [github.com/ankurs]: github.com/ankurs
app_name [MyApp]: MyApp
grpc_package [github.com.ankurs]: github.com.ankurs
service_name [MySvc]: MySvc
project_short_description [A Golang project.]: A Golang project
docker_image [alpine:latest]:
docker_build_image [golang]:
Select docker_build_image_version:
1 - 1.19
2 - 1.20
Choose from 1, 2 [1]: 2

Checkout your new project

Enter the project and take a look around:

$ cd MyApp/
$ ls

Run make help to see the available management commands, or just run make build to build your project.

$ make run

Working with your new project

Your project is now ready to be worked on. You can find the generated README.md file in the project root directory. It contains a lot of useful information about the project. You can also find the generated Dockerfile in the project root directory. It contains a lot of useful commands to build, test, and run your project. You can also find the generated Makefile in the project root directory. It contains a lot of useful commands to build, test, and run your project. You can run make help to see the available management commands.

cookiecutter-coldbrew's People

Contributors

ankurs avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

unlimiton

cookiecutter-coldbrew's Issues

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.