README
ΒΆ

Create Go App CLI
Set up a new Go (Golang) full stack app by running one CLI command!
β‘οΈ Quick start
Let's create a new app into ./app folder with Fiber as backend and Preact as frontend:
cgapp create -p ./app -b fiber -f preact
That's all you need to start! π
βοΈ Installation
First of all, download and install Go. Version 1.11 or higher is required.
Installation is done by using the go build command with $GOPATH/bin:
go build -i -o $GOPATH/bin/cgapp github.com/create-go-app/cli
Check, that the CLI is installed correctly by the --version (or -v) command:
cgapp --version
# cgapp version X.X.X
~ Alternative installations
We're using a GoReleaser project for shipping standalone Create Go App CLI version to all major desktop platforms: Apple macOS, GNU/Linux, MS Windows. By default, for amd64 (x86_64) architecture.
If you need this version, please go to the repository release page and download zipped archive.
π Commands & Options
cgapp [command] [command options] [arguments...]
βοΈ Tip: you can see all available commands by running command with
--help(or-h) option.
create
Creates a new Go app.
cgapp create --help
NAME:
cgapp create - create a new Go app
USAGE:
cgapp create [command options] [arguments...]
OPTIONS:
--path value, -p value path to create app, ex. ~/projects/my-app (default: ".")
--backend value, -b value backend for your app, ex. Fiber, Echo (default: "net/http")
--frontend value, -f value frontend for your app, ex. Preact, React.js, React.ts (default: "none")
--webserver value, -w value web/proxy server for your app, ex. Nginx (default: "none")
--database value, -d value database for your app, ex. Postgres (default: "none")
--help, -h show help
π Please note: by default,
cgapp createcommand without any options will create into current folder default backend (net/http) without frontend or configured Docker containers!
π Available production-ready app templates
Golang:
net/httpcreate-go-app/net_http-go-template β Backend template with built-in net/http (pkg/net/http).fibercreate-go-app/fiber-go-template β Backend template with Fiber (gofiber/fiber).echoWIP create-go-app/echo-go-template β Backend template with Echo (labstack/echo).
JavaScript:
react-jscreate-go-app/react-js-template β Frontend template with React.js (facebook/react).react-tscreate-go-app/react-ts-template β Frontend template with React.js TypeScript (facebook/react).preactcreate-go-app/preact-js-template β Frontend template with Preact (preactjs/preact).
π³ Available production-ready Docker containers
Web/Proxy server:
nginxcreate-go-app/nginx-docker β Docker container with Nginx.
Database:
postgresWIP create-go-app/postgres-docker β Docker container with PostgreSQL.
π€ User templates & containers
Create Go App CLI provide creation your own template, instead of those prepared by authors. It's easy! π
Just specify backend (-b), frontend (-f), webserver (-w) and database (-d) with addresses to your repositories and run:
cgapp create \
-b github.com/user/my-back-template \
-f gitlab.com/user/my-front-template \
-w github.com/user/my-webserver-container-template \
-d bitbucket.org/user/my-database-container-template
π Please note: the
https://protocol will add automatically!
π€ FAQ
β What do you use to automate the server deployment process?
Each project is created with the required set of configs to start the build and deployment process on the production server or local machine. We use a helpful tool, called Ansible for automate this.
In the root folder of the project you will find deploy-playbook.yml file. Is the Ansible playbook describing the build app & deployment to server process.
π Hey! Don't worry, if you are not familiar with this technology, read this article from the docs. Besides, you can ask us about it in one of the issues.
β What does this playbook do?
- Builds production-ready backend (Go) & frontend (JavaScript, TypeScript) apps, that you have chosen
- Provides the best practices for web server and database configuration
- Configures Docker network with containers for backend, static files from frontend, web server and database
- Runs these Docker containers on your remote server or local machine
π We recommend to using the default configs, but you are free to change them any way you want!
β What should I do for deploy my project?
- Check, that you have Ansible
v2.9.x(or later) is installed. - Add the right host to your inventory file (
/etc/ansible/hosts) on your local machine. - Be sure, that you generate & add private SSH key to your remote server and hold private key on your local machine.
- Run the Ansible playbook by this command (from the root folder of your project):
ansible-playbook \
deploy-playbook.yml \
-u <USER> \
--extra-vars "host=<HOST> network_name=<NETWORK_NAME>"
<USER>is an username of remote's server user (for example,root)<HOST>is a host name from your inventory file<NETWORK_NAME>is a network name for your Docker containers
β Are there any video examples of working with the Create Go App CLI?
β How to update CLI to latest version?
You can just re-build the CLI. The latest version will be downloaded and installed automatically:
go build -i -o $GOPATH/bin/cgapp github.com/create-go-app/cli
If you're using standalone version, please go to the release page and download archive with a new version.
βοΈ Project assistance
If you want to say thank you or/and support active development create-go-app/cli:
- Add a :octocat: GitHub Star to the project.
- Twit about project on your Twitter.
- Donate some money to project author via PayPal: @paypal.me/koddr.
- Join DigitalOcean at our referral link (your profit is $100 and we get $25).
- Buy awesome domain name with 5% discount at REG.COM.
Thanks for your support! π Together, we make this project better every day.
~ Sponsors
| Logo | Description | URL |
|---|---|---|
![]() |
True web artisans β Team who making UX efficiency review, friendly UI design, smart backend microservices, high-quality web apps and many more. | https://1wa.co |
β οΈ License
MIT Β© Vic ShΓ³stak & True web artisans.
Documentation
ΒΆ
There is no documentation for this package.

