Cli
✨ A complete and self-contained solution for developers of any qualification to create a production-ready project with backend (Go), frontend (JavaScript, TypeScript) and deploy automation (Ansible, Docker) by running only one CLI command.
Install / Use
/learn @create-go-app/CliREADME
[![Create Go App][repo_logo_img]][repo_url]
Create Go App CLI
[
][repo_url]<br/>
[![Wiki][repo_wiki_img]][repo_wiki_url]
[![License][repo_license_img]][repo_license_url]
Create a new production-ready project with backend (Golang), frontend (JavaScript, TypeScript) and deploy automation (Ansible, Docker) by running only one command. Focus on writing your code and thinking of the business-logic! The CLI will take care of the rest.
</div>⚡️ Quick start
First, download and install Go. Version 1.21 or
higher is required.
👆 You can also use Create Go App CLI via other Go versions: [
1.16][repo_v2_url], [1.17][repo_v3_url].
Installation is done by using the go install command:
go install github.com/create-go-app/cli/v4/cmd/cgapp@latest
Or see the repository's [Release page][repo_releases_url], if you want to
download a ready-made deb, rpm, apk or Arch Linux package.
Also, GNU/Linux and macOS users available way to install via [Homebrew][brew_url]:
# Tap a new formula:
brew tap create-go-app/tap
# Installation:
brew install create-go-app/tap/cgapp
Let's create a new project via interactive console UI (or CUI for short) in current folder:
cgapp create
Next, open the generated Ansible inventory file (called hosts.ini) and
fill in the variables according to your server configuration. And you're
ready to automatically deploy this project:
cgapp deploy
That's all you need to know to start! 🎉
🐳 Docker-way to quick start
If you don't want to install Create Go App CLI to your system, you feel free to using our official [Docker image][docker_url] and run CLI from isolated container:
docker run --rm -it -v ${PWD}:${PWD} -w ${PWD} koddr/cgapp:latest [COMMAND]
🔔 Please note: the
deploycommand is currently unavailable in this image.
📖 Project Wiki
The best way to better explore all the features of the Create Go App CLI is to read the project [Wiki][repo_wiki_url] and take part in [Discussions][repo_discussions_url] and/or [Issues][repo_issues_url].
Yes, the most frequently asked questions (FAQ) are also [here][repo_wiki_faq_url].
⚙️ Commands & Options
create
CLI command for create a new project with the interactive console UI.
cgapp create [OPTION]
| Option | Description | Type | Default | Required? |
| ------ | -------------------------------------------------------- | ------ | ------- | --------- |
| -t | Enables to define custom backend and frontend templates. | bool | false | No |
![cgapp_create][cgapp_create_gif]
- 📺 Full demo video: https://recordit.co/OQAwkZBrjN
- 📖 Docs: https://github.com/create-go-app/cli/wiki/Command-create
deploy
CLI command for deploy Docker containers with your project via Ansible to the remote server.
🔔 Make sure that you have [Python 3.8+][python_url] and [Ansible 2.9+][ansible_url] installed on your computer.
cgapp deploy [OPTION]
| Option | Description | Type | Default | Required? |
| ------ | ------------------------------------------------------------------------------------------------------ | ------ | ------- | --------- |
| -k | Prompt you to provide the remote user sudo password (a standard Ansible --ask-become-pass option). | bool | false | No |
![cgapp_deploy][cgapp_deploy_gif]
- 📺 Full demo video: https://recordit.co/ishTf0Au1x
- 📖 Docs: https://github.com/create-go-app/cli/wiki/Command-deploy
📝 Production-ready project templates
Backend
- Backend template with Golang built-in [net/http][net_http_url] package:
- [
net/http][cgapp_net-http-template_url] — simple REST API with CRUD and JWT auth.
- [
- Backend template with [Fiber][fiber_url]:
- [
fiber][cgapp_fiber-template_url] — complex REST API with CRUD, JWT auth with renew token, DB and cache.
- [
- Backend template with [go-chi][chi_url]:
- [
chi][cgapp_chi-template_url] — a basic application with health check.
- [
Frontend
Frontend part will be generated using awesome tool [Vite.js][vitejs_url] under the hood.
So, you'll always get the latest version of React, Preact, Vue, Svelte, Solid, Lit, Qwik, or pure JavaScript/TypeScript templates for your project.
| Name | Description | JavaScript | Typescript |
| --------------------------------- | -------------------------------- | ----------- | -------------- |
| Pure | A pure JavaScript/Typescript app | vanilla | vanilla-ts |
| [React][react_url] | A common React app | react | react-ts |
| [React (with SWC)][react_swc_url] | A React app with SWC | react-swc | react-swc-ts |
| [Preact][preact_url] | A common Preact app | preact | preact-ts |
| [Vue.js][vuejs_url] | A common Vue.js app | vue | vue-ts |
| [Svelte][svelte_url] | A common Svelte app | svelte | svelte-ts |
| [Solid][solid_url] | A common Solid app | solid | solid-ts |
| [Lit][lit_url] | A common Lit app | lit | lit-ts |
| [Qwik][qwik_url] | A common Qwik app | qwik | qwik-ts |
The Next.js and Nuxt frontend parts will be generated using the latest
create-next-app and nuxi utilities.
| Name | Description | JavaScript | Typescript |
| -------------------------- | ---------------------- | ---------- | ----------- |
| [Next.js][nextjs_url] | A common Next.js app | next | next-ts |
| [Nuxt][nuxt_url] | A common Nuxt v3 app | - | nuxt |
| [Sveltekit][sveltekit_url] | A common Sveltekit app | - | sveltekit |
❗️ Please make sure that you have
npmversion7or higher installed to create the frontend part of the project correctly. If you run thecgapp -createcommand using our [Docker image][docker_url],npmof the correct version is already included.
🚚 Pre-configured Ansible roles
Web/Proxy server
- Roles for run Docker container with [Traefik Proxy][traefik_url]:
traefik— configured Traefik container with a simple ACME challenge via CA server.traefik-acme-dns— configured Traefik container with a complex ACME challenge via DNS provider.
- Roles for run Docker container with [Nginx][nginx_url]:
nginx— pure Nginx container with "the best practice" configuration.
✌️ Since Create Go App CLI
v2.0.0, we're recommended to use Traefik Proxy as default proxy server for your projects. The main reason: this proxy provides automatic SSL certificates from Let's Encrypt out of the box. Also, Traefik was built on the Docker ecosystem and has a really good-looking and useful Web UI.
Database
- Roles for run Docker container with [PostgreSQL][postgresql_url]:
postgres— configured PostgreSQL container with apply migrations for backend.
Cache (key-value storage)
- Roles for run Docker container with [Redis][redis_url]:
redis— configured Redis container for backend.
⭐️ Project assistance
If you want to say thank you or/and support active development of
Create Go App CLI:
- Add a [GitHub Star][repo_url] to the project.
- Write interesting articles about project on [Dev.to][dev_to_url], or personal blog.
- Leave a review on our [ProductHunt][cgapp_product-hunt_url] page.
❗️ Support the author
You can support the author on [Boosty][boosty_url], both on a permanent and on a one-time basis.
All proceeds from this way will go to support my OSS projects and will energize me to create new products and articles for the community.
<a href="https://boosty.to/koddr/donate" target="_blank"><img width="300" alt="support me on Boosty" src="https://raw.githubusercontent.com/koddr/.github/main/images/boosty-badge.svg"/></a>
🏆 A win-win cooperation
And now, I invite you to participate in this project! Let's work together to create the most useful tool for developers on the web today.
- [Issues][repo_issues_url]: ask questions and submit your features.
- [Pull requests][repo_pull_request_url]: send your improvements to the current.
Together, we can make this project better every day! 😘
🔥 Other projects from the author
<a href="https://github.com/gowebly/gowebly" target="_blank"><img width="99%" alt="gowebly project" src="https://raw.githubusercontent.com/gowebly/.github/main/images/gowebly-project-banner.svg"/></a>
⚠️ License
[Create Go App CLI][repo_url] is free and open-source software licensed under
the [Apache 2.0 License][repo_license_url]. Official [logo][repo_logo_url] was
created by [Vic Shóstak][author] and distributed under
[Creative Commons][repo_cc_url] license (CC BY-SA 4.0 International).
