- Golang installed
- Postgres installed
- DBMate installed. Or you can use dbmate via docker instead (using
make
command) - Docker (optional, if you want to run via docker instead)
- Clone the repo
- Copy and paste
.env.sample
to.env
. And the config in.env
file. - Make sure a database in ready in your Postgres
- Run a migrations using dbmate to create a table and seed data.
dbmate -u "<database_url>" up
. Example :dbmate -u "postgres://postgres:@localhost:5432/postgres" up
. Make sure the database is same as defined in.env
file - Run
make dev
to run the server. It will running on port6060
by default. - The API docs is available via Swagger. You can open it in http://localhost:6060/swagger/index.html
- You can try directly in Swagger.
- Clone the repo
- Run your docker
- Run
make compose-up
. It will prepare all you need to run the app. Spin up a Postgres container, build the app, and do a db migration. - The API docs is available via Swagger. You can open it in http://localhost:6060/swagger/index.html
- You can try directly in Swagger.