Giter Site home page Giter Site logo

vuurpyl / cli Goto Github PK

View Code? Open in Web Editor NEW

This project forked from create-go-app/cli

0.0 0.0 0.0 4.61 MB

✨ A powerful CLI for the Create Go App project. Create a new production-ready project with backend, frontend and deploy automation by running one CLI command!

Home Page: https://create-go.app

License: Apache License 2.0

Go 98.93% Dockerfile 1.07%

cli's Introduction


Create Go App CLI

Create a new production-ready project with backend (Golang), frontend (JavaScript, TypeScript)
and deploy automation (Ansible, Docker) by running one CLI command.

Focus on writing code and thinking of business-logic! The CLI will take care of the rest.

cli version go version go cover go report license

First of all, download and install Go. Version 1.11 or higher is required.

Next, download the latest version of the Create Go App CLI to your system:

go get github.com/create-go-app/cli

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

Let's create a new project via interactive console UI (or CUI for short) into current folder:

cgapp create

Okay, it works! Now, you can run this project on your local machine or deploy to a remote server. Project works in isolated Docker containers and automates via Ansible playbook:

cgapp deploy

That's all you need to start! 🎉

If you don't want to install Create Go App CLI to your system, you feel free to using our official Docker image and run CLI from isolated container:

docker run --rm -it -v ${PWD}:${PWD} -w ${PWD} koddr/cgapp:latest

With this Docker image, you do not have to worry about installing tools/CLI of frontend UI libraries/frameworks. Everything is already included: create-react-app, preact-cli, vue-cli, ng-cli and degit (for Svelte and Sapper).

Available commands for official Docker image:

🔔 Please note: a deploy command is currently unavailable in this image.

📺 Video screencast

A short video screencast to introduce main features of the Create Go App CLI.

youtube preview
🔗 https://youtu.be/5-DNZFU9TOQ

Unfortunately, we are unable to include all helpful documentation to the README file. That's why, the best way to better explore all the features of the Create Go App CLI is to read the Official Documentation.

🔥 We've put together a subject index specifically for you, so you can find any answer you want in seconds!

CLI command for generate a default .cgapp.yml config file in current folder:

cgapp init

📺 Preview: https://recordit.co/yvlnIu8Lyp

Generated config file
# Project config.
project:
  # Backend for your project.
  # (Required)
  # String:
  #   - `net/http`
  #   - `fiber`
  #   - `echo`
  #   - `gin`
  # User template: supported, set to URL (without protocol),
  # like `github.com/user/template`
  - backend: fiber

  # Frontend for your project.
  # (Optional, to skip set to `none`)
  # String:
  #   - `react`
  #     - `react:<template>`
  #   - `preact`
  #     - `preact:<template>`
  #   - `vue`
  #     - `vue:<user/repo>` (for preset from GitHub)
  #     - `vue:<gitlab|bitbucket>:<user/repo>` (for presets from others)
  #   - `angular`
  #   - `svelte`
  #   - `sapper`
  #     - `sapper:<webpack>`
  # User template: supported, set to URL (without protocol),
  # like `github.com/user/template`
  - frontend: svelte

  # Web/Proxy server for your project.
  # (Optional, to skip set to `none`)
  # String: `nginx`
  # User template: supported, set to URL (without protocol),
  # like `github.com/user/template`
  - webserver: nginx

# Automation config.
roles:
  # Ansible roles for deploy your project.
  # (Optional, to skip set to empty or comment)
  # Objects list.
  - deploy:
    # Username of remote's server or local's user.
    # (Required)
    username: root

    # If you need to deploy (or run) a project asking for a password
    # for the user, set `become` to `true`. This is equivalent of
    # `--ask-become-pass`, a standard Ansible argument
    # to ask for a privilege escalation password.
    # (Optional)
    become: true

    # Host name from your inventory file (usually, at /etc/ansible/hosts).
    # (Required)
    host: localhost

    # Name of Docker network
    # (Required)
    network: cgapp_network

    # Filename of Ansible playbook in the root of the Create Go App project.
    # If you want to rename it, do it, but not to change destination of file!
    # (Required)
    playbook: deploy-playbook.yml

CLI command to create a new project with the selected configuration.

There's two ways to create a new project:

  • With an interactive console UI (or CUI).
  • From configuration file (by default, in $PWD/.cgapp.yml).

Create with the interactive console UI

Run create command without any arguments:

cgapp create

📺 Preview: https://recordit.co/LTxFQloedn

Create from the config file

Run create command with --use-config (or -c) argument:

cgapp create --use-config

CLI command for deploy Docker containers with your project to a remote server.

☝️ You should only run this command from the root folder of your project, which created with the cgapp create command! It's a necessary condition for everything to work perfectly.

There's, also, two ways to deploy your project:

  • With an interactive console UI (or CUI).
  • From configuration file (by default, in $PWD/.cgapp.yml).

Deploy with the interactive console UI

Run deploy command without any arguments:

cgapp deploy

📺 Preview: https://recordit.co/ewjG9dgMPX

Deploy from the config file

Run deploy command with --use-config (or -c) argument:

cgapp deploy --use-config

Backend:

Frontend:

  • reactReact frontend app.
    • react:<template> — CRA generated template for React app.
  • preactPreact frontend app.
    • preact:<template> — Preact CLI generated template for Preact app.
  • vueVue.js frontend app.
    • vue:<user/repo> — Preset for generating Vue.js app from GitHub.
    • vue:<gitlab|bitbucket>:<user/repo> — Preset for generating Vue.js app from GitLab/BitBucket/etc.
  • angularAngular frontend app.
  • svelteSvelte frontend app.
  • sapperSapper frontend app for static websites.
    • sapper:<webpack> — Preset for generating Sapper with Webpack bundler.

☝️ Please note, that since version v1.3.0, frontend templates (in the classical sense) are not supported by the Create Go App CLI. Those templates, that we created (react-js, react-ts and preact-js), are still available, but only for use as user's custom templates.

Now, the frontend part of your project will be generated using official CLI from the authors of each frontend UI library/framework (under the hood). So, you'll always get the latest version of React, Preact, Vue.js, Angular, Svelte or Sapper for your project from their authors!

Web/Proxy server:

🤔 Why another CLI?

When we started this project, we asked ourselves this question too and... came to the conclusion, that approximately 8 out of 10 routine operations at the start of a new project and/or the deployment of an existing one can be automated. And it would be better to have all the necessary functions inside one CLI. That's why we transferred all our experience to the Create Go App CLI, which we use ourselves!

So, yes, this CLI gives you the ability to prepare everything you need to start a new project (as create-react-app for the React.js ecosystem does) and deploy an existing project to a remote server in configured and fully isolated Docker containers.

⭐️ Project assistance

If you want to say thank you or/and support active development of Create Go App CLI:

Together, we can make this project better every day! 😘

⚠️ License

Create Go App CLI is free and open-source software licensed under the Apache 2.0 License. Official logo was created by Vic Shóstak and distributed under Creative Commons license (CC BY-SA 4.0 International).

cli's People

Contributors

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