Gobook
Gobook is a golang boilerplate with web framework Gin & Gorm ORM.
Features:
- MVC Pattern
- Login, Register, Logout & Profile System
- Middleware System with JWT and UniqueKey
- Paginations Request
- Example Books CRUD
- Support with MySQL
- Validator System
- Relation Has One
- Env Configurations
- Helper Command
- ORM Features
- Auto Generated Code
- Support MySQL & PostgreSQL
Installing
- Setup gobook bash using command
wget https://leeyurani.com/gobook.sh chmod +x gobook.sh ./gobook.sh setup alias gobook='$HOME/gobook.sh'
- Make sure your GOPATH and GOROOT already defined. This is an example of my path:
export GOROOT=/usr/local/go export GOPATH=/Volumes/YURANI/Software\ Development/Golang export PATH=$PATH:$GOROOT/bin:$GOPATH
GOROOT is the place where you install the golang software, and GOPATH is the place your golang project stored
- Install required library
gobook install
- Setup your .env Database Credentials
- Migrate your model using command
gobook migrate
How To Add New Library
gobook install <packagename>
Example command
gobook install github.com/google/uuid
How To Add New Model
- Use this following command to make a new model
gobook make model <name>
- Migrate your database using command
gobook migrate
How To Add New Controller
- Use this following command to make a new controller
gobook make controller <name>
Database Setup
We use .env file to keep the configurations, just open the .env file and edit your database credentials here
Using MySQL
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_USERNAME=root DB_PASSWORD=password DB_NAME=gobook
Using PostgreSQL
DB_CONNECTION=postgres DB_HOST=127.0.0.1 DB_PORT=5432 DB_USERNAME=postgres DB_PASSWORD=password DB_NAME=gobook
Commands
Start server using
gobook start
Migrate Database
gobook migrate
Install Required Package
gobook install <packagename>
Make New Controller
gobook make controller <name>
Make New Model
gobook make model <name>
Show Help
gobook help
Postman Collection
Check this collection if you want to see the example requests Gobook Collection
Download Gobook source code on GitHub
https://github.com/yusriltakeuchi/gobook
Provides the list of the opensource Flutter apps collection with GitHub repository.