Skip to content

danisbagus/matchoshop

Repository files navigation

matchoshop

E-commerce for men's product

Requirements

Setup

Prepare necessary environment by rename .env.example to .env

HOST=
PORT=9000
DATABASE_URL=postgres://postgres:mypass@localhost:8010/matchoshop
DB_SSL_MODE=disable
TIMEZONE=Asia/Jakarta

Export database environment for migration config

export DATABASE_URL=postgres://postgres:mypass@localhost:8010/matchoshop
export DB_SSL_MODE=disable

Run database container

docker-compose up

Run the App

Get packages

go get .

Delete unused packages if necessary

go mod tidy

Update package vendor

go mod vendor

Build the app

go build -o bin/matchoshop -v .

Run the App

./bin/matchoshop

Migration

Create new migration

goose create AddSomeColumns

Up migration

goose up

Down migration

goose down

Check migration status

goose status

Mockup

Generate new mockup object

mockery --all --dir=internal  --output=internal/mocks

Unit Test

Run unit test

go test -v ./path/to/test_file

go test -v ./internal/core/service

Run unit test specific function

go test -v [function name]

go test -v -run TestProductCategory_Create_Success

Deployment

Deploy to heroku server

git push heroku master

About

E-commerce for men's products

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages