A backend based on MVC pattern built using Golang + MySQL.
This app:
go get github.com/vabshere/github.com/vabshere/vernacular-auth
External packages:
go get http://golang.org/x/crypto/bcrypt
go get github.com/go-sql-driver/mysql
go get github.com/gorilla/mux
MySQL:
You will also need to install MySQL Server. This project was built using version 8.0
. Refer the offficial docs for installation.
Update connectDb()
function in basic/models/user.go
with your username, password and database-name. Ensure you have a table named user
in your database. CREATE TABLE
for the table user
:
CREATE TABLE user (
id int NOT NULL AUTO_INCREMENT PRIMARY KEY UNIQUE,
email varchar(50) DEFAULT NULL UNIQUE,
name varchar(30) DEFAULT NULL,
password binary(60) DEFAULT NULL,
);
Run go run /path/to/main.go
. This should start the local server on any interface :8080
.