barca-cli

command module
v0.0.0-...-6c31ca2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

README

GitHub Readme Stats

Barca CLI

Barca CLI is a project generator written in GO and its purpose is to build and configure HTTP servers, web proxy, SPA/PWA, Blog and custom landing page. It's easy, fast and productive.

GitHub issues GitHub pull requests GitHub Release Date GitHub repo size

abrir emblema coletivo

<img alt="colaboradores financeiros" src="https://opencollective.com/barca-cli/tiers/badge.svg" />

Français · 简体中文 · Español · русский . 日本語 · Deutsch · Italiano · 한국어 . Українська . Português Brasileiro .

Using the Tool

CLI (Command-Line Interface) is an environment where users can enter command lines to perform tasks in operating systems or in programming jobs.




Downloads all modules in the file to the local cache

go mod download


Run go run main.go with argument --help to list all CLI commands and flags

Example:

go run main.go --help


To build an HTTP Web Server, let's mention init and api arguments to start a simple Rest API.
Example:

go run main.go init api <project-name>


barca-cli




Specifying Language

You can translate barca-cli resource messages by specifying after --lang flag

Example:

go run main.go --lang francais init api <project-name>


barca-cli

Generate REST API

It is very simple to generate an API with Barca CLI, with a few commands you will allow the construction of the project the way you want.

The following is an example of how to generate a REST API in Node.js and configure your environment.


1. Web Server 2. Controllers, Routes & Models 3. Database

Configure Server

Let's mention flags to configure the project, this is an example using the Express.js framework as a server running on port 4200.


go run main.go --framework express --port 4200 init api <your-project>


barca-cli-express-api



Specifying your language:


go run main.go --language francais --framework express --port 4200 init api <your-project>


barca-cli-api-language-i18n



Add DB Templates


After building the server, let's add models to our project, specify the Database type that will be used with the --database flag and the table/collection with --collection. In the following example it is showing how to insert a user model for Database MySQL



go run main.go --database mysql --collection users  add model <your-project>


barca-cli-insert-models



Integrate MySQL

Now we need to inform by flags the settings to access and connect to our server MySQL


go run main.go --dbname testdb --host 127.0.0.1 --user root --password 12345 integrate mysql <seu-projeto>


barca-cli-mysql-integrate



Contribuidores

Caros amigos(a) contribuidores no projeto

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL