Giter Site home page Giter Site logo

barca-cli's Introduction

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

barca-cli's People

Contributors

ahsouza avatar

Stargazers

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