fiberforge

command module
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 1 Imported by: 0

README

FiberForge

FiberForge is a template-based code generator for creating simple Go Fiber backend applications configured for MySQL, Postgres or MongoDb.

Table of Contents

Features

  • Quickly generate a Go Fiber backend application with MySQL,Postgres or Mongodb integration.
  • Customizable template structure to fit your project needs.
  • Generates boilerplate code for models, routes, middleware, and database configurations.

Requirements

  • Go (at least Go 1.16)
  • MySQL/Postgres/MongoDB (whichever database you prefer)
Installation

Type go install github.com/v-pat/fiberforge@latest command in terminal.

Usage

  • Create a json or txt file of following format:

    {
      "appName":"<APP_NAME>",
      "database":"<mysql/postgres/mongodb>"
      "tables":[
          {
              "name":"<TABLE_NAME>",
              "columns":{
                  "FIRST_COLUMN_NAME":<VALUE>,
                    ...
                  "NTH_COLUMN_NAME":<VALUE>,
              },
          },
      ]
    }
    
  • Type fiberforge generate <FILE_PATH> in terminal and you will get a zip file of your project in same directory your terminal is in.

  • Thats it!! you can now get basic backend ready in few second. Enjoy coding 👍

Notes

  • Column of name id (in any case) would not be considered. As id column would be autogenerated and used as primarykey in generator.

  • In columns object VALUE denotes a data expected to be in the row of the column or what is type of that column. For example if a column would have int type values in it, then columns object would be like :

    "columns":{
        "age":24,
    },
    
  • Similarly if columns would have string or boolean type values in it, then columns object would be like:

    "columns":{
        "age":24,
        "name":"vpat",
        "is_developer":true,
    },
    
  • Please note that the values given in front of column names, will be used to only determine type of column and will not be added in database as first row of table.

  • Before running downloaded code, make sure you have service of your chosen database running and you should have a database of name of appName.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳