A message board built in Golang
This project is for Go practicing and guided by Building Go Web Applications and Microservices Using Gin and Test-driven Development of Go Web Applications with Gin then modified by me.
Install Dependency
$ go mod download
Run Database
$ docker-compose up -d
Remember to create a database named GoBoard in the PostgreSQL server
Run
$ go run main.go
Test
$ go test -v tests/
This Compose file contains the following environment variables:
POSTGRES_USER
the default value is postgresPOSTGRES_PASSWORD
the default value is changemePGADMIN_PORT
the default value is 5050PGADMIN_DEFAULT_EMAIL
the default value is pgadmin4@pgadmin.orgPGADMIN_DEFAULT_PASSWORD
the default value is admin
localhost:5432
- Username: postgres (as a default)
- Password: changeme (as a default)
- URL:
http://localhost:5050
- Username: pgadmin4@pgadmin.org (as a default)
- Password: admin (as a default)
- Host name/address
postgres
- Port
5432
- Username as
POSTGRES_USER
, by default:postgres
- Password as
POSTGRES_PASSWORD
, by defaultchangeme
TODO:
- Display the list of all articles on the home page
- Display a single article on its own page
- Users register with a username and a password
- Login
- Log out
- Create new articles (logged in users only)
- Use PostgreSQL as database
- Mock GORM DB to test
- Deploy on cloud