A Golang solution of tools for building a full stack web application.
Goals of the Project
Below are some targeted goals:
- Http & Https Redirection & HTTP 2.0 with Golang 1.8 and gin-gonic/gin
- Extension packages for common functions including:
- File IO Management & Manipulation
- Zip File Compression & Decompression
- Database extensions and drivers for the following:
- Supported databases:
- Create SQL Schema (DDL) from JSON Configuration.
- Create Golang ORM packages for RDBMS Transactions & Queries.
- Supported databases:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap mongodb/brew
brew install mongodb-community
brew services start mongodb/brew/mongodb-community
Install NPM and Node JS
npm install --global firstname.lastname@example.org
sudo vim /etc/sudoers
yourusername ALL = NOPASSWD: ALL
Add your gopath bin directory to your PATH and set NODE_ENV=development
export PATH="$PATH:/Users/davidrenne/go/bin" export NODE_ENV=development
To start a new project with go modules (1.13) GoCore run the following steps in a new console window.
go mod init github.com/your_example/repo_project
go get github.com/DanielRenne/GoCore
1.5. To start a new project with a version prior to go modules.
`go get github.com/DanielRenne/GoCore/...`
Add to your Operating Systems Path the ~/go/bin directory
Build GoCore App
A sample project generator is available to build a GoCore project.
go install github.com/DanielRenne/GoCore/core/goCoreCreateApp
And install the binary for fetching the project template files
go install github.com/DanielRenne/GoCore/getAppTemplate
Follow the prompts to generate your app and it will copy the templates found in GoCore/tools/appFiles into your project directory github.com/username/appName. Note you probably should install nodejs, npm and nvm before generating an app.
GoCore has built in functions to read json configuration files to generate SQL Tables, indexes, primary & foreign keys, NOSQL Collections & Buckets, auto-generated Golang model code files, auto-generated REST web api code files, and swagger.io schema files application. See BuildCore Readme for details.
Run Your GoCore App
Run the following to start your app
Open a web browser to: http://127.0.0.1:8080
Login as admin/admin and setup application roles etc. More documentation to come later on application specific setup.
How to build your own web project in GoCore
See Application Settings within docs for information on what webConfig.json allows for.
IMPORTANT NOTE for HTTPS (TLS) Security
GoCore comes default with an open ssl generated Cert and PEM files that are NOT secret as they are available via the open source repository. Make sure you replace both these files located in the
keys directory. To do this we recommend in Linux running the following command and copying the output files to the
keys directory. Alternatively cert and pem files generated by a valid Certificate Authority like GoDaddy or Verisign when you reach production with an online domain.
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout key.pem -out cert.pem
NOTE: We also recommend NOT to store your secret key files in source control. We recommend ignoring the keys directory for source control.
NOTE: key files are ingored when running
getCore as to not overwrite your keys.
Additional Info on Golang https: https://www.kaihag.com/https-and-go/
Building a Database Model with SQLite3
####NOTE: Because SQLite3 requires gcc externally we separated the driver for compiling reasons. Windows users we recommend installing gcc as a prerequisite for the sqlite3 golang module to compile via tdb-gcc. Be sure to install 64 bit for 64 bit machines.
####More SQLite tools to verify your data in Windows SQLite Studio
To create a SQLite3 Database schema and model package for your application run the following:
go install github.com/DanielRenne/GoCore/buildCoreLite
api provides an API router and controller Registry to route controller api's.
|api provides an API router and controller Registry to route controller api's.|
Package atomicTypes provides object locking / unlocking for setting and getting.
|Package atomicTypes provides object locking / unlocking for setting and getting.|
Package fileCache will provide simple file content caching tools for in-Memory access to files.
|Package fileCache will provide simple file content caching tools for in-Memory access to files.|
Package store provides a registry and interface to interact with a store repository against model entities.
|Package store provides a registry and interface to interact with a store repository against model entities.|