List the prerequisites required to run your project. Include any software or tools that need to be installed.
- Go Language | Document
brew install go
- Air | Go Package | Document
go install github.com/cosmtrek/air@latest
- Docker | Document
- Docker Compose | Document
for mac brew install docker brew install docker-compose
How to installing and setting up your service.
-
Clone repository
git clone https://github.com/KhingNoi/internTest01.git -
Install dependency package
go get
-
For Localhost | Use
airpackage to build and run the projectair
-
Install go migate
go install -tags 'mysql' github.com/golang-migrate/migrate/v4/cmd/migrate@v4.15.0if there's a stable and newer version you better install that instead.
-
Run migreate to check versioning should comes out a version number
migrate -version
-
Create migration file by using command
make create-migrations <file name>
Up and down file will created empty you should add on migration code yourself (gpt able to do this)
-
Run migrations using command
make migrations-up make migrations-down*If you run migration up and “no change” even if in your db not have given table or some error occorred run migration down to clear all cache before you run migration up
-
start the container(s) using docker or docker Compose. Include any necessary commands or configuration files.
docker-compose up -d
-
If using docker directly Document Pull MySQL image (if not already pulled)
docker pull mysql/mysql-server:tag
Start MySQL container
docker run --name=mysql1 -d mysql/mysql-server:tag
- When we system not found
aircommand, we should set PATH environment variable in~/.bashrc,~/.bash_profile,~/.zshrcexport PATH=$PATH:$(go env GOPATH)/bin
- Orange Background => commit
- White Background => uncommit
- Postman collection is located in the postman_collection folder.
- figma click here

