https://github.com/hrz8/gokomodo-challenge
https://github.com/hrz8/gokomodo-challenge
go golang rest-api
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/hrz8/gokomodo-challenge
- Owner: hrz8
- Created: 2022-11-30T16:09:38.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-01T00:27:58.000Z (over 3 years ago)
- Last Synced: 2025-04-25T11:51:56.360Z (about 1 year ago)
- Topics: go, golang, rest-api
- Language: Go
- Homepage: https://documenter.getpostman.com/view/6786432/2s8Yt1qovX
- Size: 58.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gokomodo-challenge
Full API Doc: [DOCUMENTATION](https://documenter.getpostman.com/view/6786432/2s8Yt1qovX) ๐
## What's going on here?
- [Stack used ๐ฅ](#stack-used-)
- [Before Run โ๏ธ](#before-run-%EF%B8%8F)
* [Clone Repo ๐พ](#clone-repo-)
- [How to Run ๐](#how-to-run-)
* [Run Locally ๐](#run-locally-)
* [Debugging ๐ต๏ธโโ๏ธ](#debugging-%EF%B8%8F%EF%B8%8F)
* [Dockering ๐ณ](#dockering-)
- [How to Use ๐ป](#how-to-use-)
## Stack used ๐ฅ
- SQLite3
- Golang
- Echo Framework
## Before Run โ๏ธ
โ๏ธ This app needed `gcc` to run since sqlite3 library required that. Here is the article about that [here](https://7thzero.com/blog/golang-w-sqlite3-docker-scratch-image).
### Clone Repo ๐พ
Clone this repo using `Download` button or bash ๐จโ๐ป
```bash
$ git clone https://github.com/hrz8/gokomodo-challenge.git
```
## How to Run ๐
### Run Locally ๐
This command below will compiling the `main.go` and all used packaged into binary file at the first and run the binary right after that.
```bash
$ make run
```
It will running in the localhost with the `3000` port given `http://localhost:3000`.
### Debugging ๐ต๏ธโโ๏ธ
Debug app using VsCode Debugger Tool
- Select your debugger to be set as `Launch server`
- Press `F5` to run the debugging
- Done!
### Dockering ๐ณ
- Image Builds (Example)
```bash
# build as docker image
$ make docker-build
# make sure docker image already registered
$ docker image ls
# start the container
# you will automatically see the logs of the app as well
$ make docker-start
# check endpoint
$ curl --location --request POST 'http://localhost:3000/seller/register' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "your name",
"email": "your@email.com",
"password": "password",
"address": "your address"
}'
```
- Docker Compose (Example)
```bash
# you will automatically see the logs of the app as well
$ make docker-compose
# check endpoint
$ curl --location --request POST 'http://localhost:3000/seller/register' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "your name",
"email": "your@email.com",
"password": "password",
"address": "your address"
}'
```
## How to Use ๐ป
This application based on RESTful API, so the usage will required to do the HTTP request to each available endpoint below. Full Documentation of how to use each endpoint is in the link right here: [DOCUMENTATION](https://documenter.getpostman.com/view/6786432/2s8Yt1qovX) ๐
## Test ๐งช
Test unit.
```bash
$ make test
```
Test lint.
```bash
$ make lint
```
## Author โน๏ธ
Hirzi Nurfakhrian