Git Product home page Git Product logo

alchemist's Introduction

Alchemist.go it's a command cli powered by Go, it's command allow you to transmute an Alchemist web service with Go, based on the hexagonal architecture. Our transmutation command create for you all the handlers, services, models and repositories.

Requirements

  • Go 1.15 or higher

Installation

In order to install alchemist cli, run this command at your terminal in the root:

go get github.com/joaquincamara/alchemist@latest

Commands

To invoque any of the ancestral spells of our book of Alchemy we need first to prepare our transmutation circle:

  1. mkdir myApp && cd myApp

  2. Create a alchemist.yaml file with the next structure:

appName: example.com/myUser/MyApp
internal: 
  domainName: 
    model:
      Property: int `json:"Property,omitempty"`
      Property: string `json:"Property"`
      Property: string `json:"Property"`
projectVersion: v0.1.0

Inside the internal section you need to specify the name of all the domains that your application is going to have and also the name of the properties of each domain.

Example:

appName: example.com/myUser/MyApp
internal: 
  aboutMe: 
    model:
      Id: int `json:"Id,omitempty"`
      Info: string `json:"Title"`
      Title: string `json:"Info"`
  coolFeatures: 
    model: 
      Id: int `json:"Id,omitempty"`
      Name: string `json:"Name"`
projectVersion: v0.1.0
  1. Use the special word "alchemist" at the terminal in you working directory, This gonna open the door to the world of alchemy and bring all the resources to transmute a new alchemist's project:
  • $ alchemist transmute

Alchemist project example:

curriculum
│   README.md
│   alchemist.yaml    
│   go.mod
│   .gitignore
│
└───api
│   │   aboutMeHandler.go
│   │   coolFeaturesHandler.go
│   
└───cmd
│   │   main.go
│
└───internal
│   │   
│   └───aboutMe
│   │   │   model.go
│   │   │   repository.go
│   │   │   service.go
│   │
│   └───coolFeatures
│       │   model.go
│       │   repository.go
│       │   service.go

Alchemist Router

We know that sometimes you do not need all our transmutations to achieve your projects goals, so if you want to create a router without our base project, you can use just the Silver.go router library for your transmutations.

In order to use the alchemist server library, just run in you project folder:

go get github.com/joaquincamara/silver

Simple Silver server

package main

import (
"log"
"net/http"
alchemy "github.com/joaquincamara/silver"
)

func main() {
	router := silver.NewRouter()

	router.Use(middlewares.Recovery)

	router.GET("/", silver.AlchemyDoor)
	silver.Start("8080", router)
}

Silver.go website: Silver.go.

we know, we know, we are still in baby steps but fraid not, we are working in new transmutatios

Future plans:

  • Add microservices and go kit support.

  • Add unit tests to our transmutations.

  • Add cli command to create a basic database connection.

Dependencies:

Our transmutations are possible by:

======================

My eternal gratitude to my mentor Eduardo Villaseñor https://github.com/eduvim

======================

Alchemist.go version: 0.1.5

======================

alchemist's People

Contributors

joaquincamara avatar

Stargazers

 avatar Angel D. Munoz avatar Alejandra Bricio avatar J3MR avatar Rafael Carrillo avatar Gustavo Lara avatar - avatar Erick Delfin avatar Gerardo Vázquez avatar Saidel Lopez avatar Abraham Hurtado avatar Tona González avatar Andres Fuentes Hernandez avatar Carlos Proaño avatar

Watchers

James Cloos avatar  avatar J3MR avatar

alchemist's Issues

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.