This project ships following features
- Submit name, date of birth, bhone number, email, address, photo, and appointment time of patient
- View all the registered patient from website
- Authentication Using Jwt
- CORS
- Easy database migration
- gorm:
- jwt-go:
- echo:
- pusher-http-go:
- postgres:
- Go modules
- Built-in CORS Middleware
- Built-in JWT Middleware
- Feature PostgreSQL 14
- Environment support macOS Monterey 12.1
Using PostgreSQL 14, please follow my local information postgres to create the same information and connect database in my project
(
host = "localhost"
port = 5432
user = "postgres"
password = "postgres"
dbname = "mydb"
)
$ CREATE DATABASE mydb;
This project ships following step by step below to install
- Go to the golang.Then, pick up
go1.17.5.darwin-amd64.pkg
and dowload. Finally, install as the instructions appear - Make sure you installed zshrc.Then, Gopath, Path and Goroot are set to
~/.zshrc
:
$ export GO111MODULE=on
$GOPATH $HOME/go
export PATH=$PATH:$GOPATH/bin
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin
- Restart your
zshrc
$ source ~/.zshrc
- Verify that you've installed Go by opening a command prompt and type the following command:
$ go version
- After the installation, launch VSCode. Flow the instructions carefully to setup
Go
with VSCODE. For more information, please visit this link.
- Enable dependency tracking for my project, just use following command:
go mod init main
- Download essential library from your terminal in my project
go get github.com/dgrijalva/jwt-go
go get github.com/google/uuid
go get github.com/jinzhu/gorm
go get github.com/jinzhu/gorm/dialects/postgres
go get github.com/labstack/echo/v4
go get github.com/labstack/echo/v4/middleware
go get github.com/pusher/pusher-http-go
go get gopkg.in/go-playground/validator.v9
go get gopkg.in/gormigrate.v1
- Execute the fllowing command in VSCode to build my project
$ go build -v
- Run my binary file by type following command:
$ ./main
Please see it in folder Test
in my project
Download Postgres
For detailed guide, please visit this link.
Download Postman