- Install Go
- Start DB with
docker run --name crunch-postgres -p 5432:5432 -e POSTGRES_USER=username -e POSTGRES_PASSWORD=password -e POSTGRES_DB=catalog-service -d postgres:12
- Run
copy .env.example .env
- Run
go run main.go
Run tests with go test -cover ./...
Create the database mocks with mockgen -source=db/interface.go -destination=test_helper/mocks/mock_db/mock_db.go
Create the deliverect service mocks with mockgen -source=services/deliverect/interface.go -destination=test_helper/mocks/mock_deliverect/mock_deliverect.go
- Install
brew install golang-migrate
- Start postgres docker locally:
docker run --name merchant-service-postgres -p 5432:5432 -e POSTGRES_USER=username -e POSTGRES_PASSWORD=password -e POSTGRES_DB=catalog-service -d postgres:12
cp .env.example .env
andsource .env
Execute migrations in the db:
migrate -path migrations -database $DATABASE_URL -verbose up
Roll the migrations back:
migrate -path migrations -database $DATABASE_URL -verbose down
Create a migration:
migrate create -ext sql -dir migrations -seq name
We use Auth0 for authentication and authorization in the crunch dashboard. Protected routes have to use the middleware Auth0Auth.
We use Firebase for the authentication in the crunch app. Protected routes have to use the middleware FirebaseAuth.
Redis is used to cache the store menus.