readyGo v0.0.3.Many improvements heading towards v1.0.0
Jiten Palaparthi
Golang & Rust Consultant | Architect | Microservices & Cloud Expert | Corporate Trainer | AI & ML Enthusiast
There are many changes in the project from the time of inception.Now readyGo supports mongo and sql as well as the project backend.
Github: https://github.com/JitenPalaparthi/readyGo
Here is the architecture and overview of the project.
Overview
The phylosophy behind readyGo is "A Simple configuration should give a working project.".
- readyGo is a command line interface( probably the name of readyGo CLI would be readyGo itself) application, it is designed to scaffold creation of different types of go based projects.readyGo is designed for developers in mind. Ideally readyGo should provide ready to use application code. The code is generated based on configurations provided by the end user i.e "The great developer :)".
- By version 1 release, it will support http(as of v0.0.3 supported), grpc, CloudEvents template engines with various databases (sql/nosql), pub-sub and CloudEvents plugins and probably even more.
- The present version of readyGo is v0.0.3. It supports http+mongodb and http+sql (Postgres but with simple tweaks ca make it work for others like MySQL, CockroachDb etc..)
- There are two types of users for readyGo
- Developers: Minds who develop plugins in the form of templates for readyGo.
- Developers: Minds who develop applications using readyGo.
- Interestingly both the users are developers and so readyGo is developer's companion.
- What readyGo gives you is based on your applied configuration(a separate section for configurations) it outputs a working project. Working project means you can directly use the project as it is.
readGo cooks for you.As your business logic varies , you have to add the required spices according your taste but one thing . readyGo is not a template engine, it gives you a working project.
Architecture
- There are 3 components and 3 static file related stuff(called as box) in readyGo project .All static files are boxed so that readyGO cli is a single binary file.
- Config: Takes the incoming project specification configuration file and stores it in in memory for Generate usage. User has to supply this file through readyGo cli tool.
- Mappings: Takes mappings file as input and stores in memory for Generate usage
- Generate: Takes input from configure and mappings and generates Directories, Single-Files , Multiple-Files. (Future versions will contain shell executor as well as the future requirements demand)
- Templates: All templates (Go template files) to be stored in template directory.Based on these templates single-files and multiple files are generated by the generate.All templates are stored in box/templates/
- Static files : Static files are the files that will be copied as it is. Inside mappings they have to be specified which source file to be copied to which destination for each type of the project (http_mongo or http_sql etc).
- Mappings file : mappings.json file contains all mappings.Mappings are for directory creation, static files creation to respective directories and template files(single and multiple) files creation and copy to respective directories. mappings.json is stored in box/configs/mappings.json.
According to the above diagram here is the step by step explanation
Step 1. User gives a .json or .yaml configuration file through readyGo CLI. readyGo apply -f config.json
Step 2. The config component takes the input config file(step 1) and loads it into the generate component through in memory key/value storage(This step is done by Generate component with the help of config)
Step 3. The mappings component takes the mappings.json file(stored inside the binary), loads it into in memory key/value storage. This key/value storage data is used by generate component to generate files based on mappings.
Step 4. It is a box component(file store).It contains config, template and static files that are used by mappings and generate component.
Step 5. The generate component generates full golang project. The input for generate is mappings, templates ,static files and the the data captured and stored as key/value in memory by config file(user input). Templates also need data to fill and create single and multiple files. Data for templates comes from config file so that generate creates templates files as well.
Step 6. The output is generated as golang project directory and respective files for the type of the project(http_mongo,http_sql or grpc etc) to run.
Please follow the project
Disclaimer: There may be typos . Kindly excuse.