Privy Take Home Test.
This project go-cake
is api for cake
Mahendra Fakhrul Fathan (mahendrafathan@gmail.com)
Please install Docker then install Docker Compose on your laptop to run this app easily.
- Clone the repo
- Change directory to the folder
cd /go-cake
- Run the app using docker compose:
docker-compose up --build -d
, this might takes 2 - 3 mins, so please wait - You're good to go! The app will serve on port
9090
, please kindly check api curl documentation at the end of this page - You can check db using admirer, it's serve on
8080
- Docker will build and set Mysql DB Based on
.env
file - Docker will build and run golang application
⋅⋅* Download all application dependencies
⋅⋅* Run unit test from
unitTest.sh
, if unit test failed or coverage below 10%, application will not running
If you want to see how unit test works and coverage please run chmod +x ./unitTest.sh && ./unitTest.sh
Please change on .env
file
.
├── Dockerfile
├── README.md
├── common
│ ├── db
│ │ └── database.go
│ └── logger
│ └── logger.go
├── controllers
│ ├── cake.go
│ └── interfaces.go
├── doc
│ └── openapi.yaml
├── docker-compose.yml
├── go.mod
├── go.sum
├── helpers
│ └── response.go
├── init
│ └── init.sql
├── main.go
├── makefile
├── models
│ └── cake.go
├── repositories
│ ├── cake.go
│ └── cake_mysql.go
├── routes
│ ├── middleware.go
│ └── router.go
└── unitTest.sh
Please refer to documentation