-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from voltgizerz/develop
Develop to Master 23/06/2024
- Loading branch information
Showing
42 changed files
with
1,483 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,7 @@ | |
logs | ||
./coverage.out | ||
config.production.yml | ||
app.exe | ||
app.exe | ||
tmp | ||
main.exe | ||
coverage.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
# REST API Go for POS | ||
Simple REST APIs with for POS Software | ||
This project provides simple REST APIs for POS (Point of Sale) software. | ||
# Build With | ||
- Go 1.20 or higher | ||
- Fiber | ||
- MySQL | ||
- JWT Auth | ||
|
||
# How to Run Project | ||
|
||
Follow these steps to run the project: | ||
|
||
1. Setup your database envrionment. | ||
1. Setup Your Database Environment | ||
|
||
2. Run the application using the following command: `go run ./cmd/app.go` | ||
2. Run Database Migrations `goose -dir=./database/migrations mysql "root@tcp(localhost:3306)/db_pos?parseTime=true" up` | ||
|
||
3. Run the Application `go run ./cmd/app.go` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
root = "." | ||
testdata_dir = "testdata" | ||
tmp_dir = "tmp" | ||
|
||
[build] | ||
args_bin = [] | ||
bin = "./main.exe" | ||
cmd = "go build -o main.exe ./cmd" | ||
delay = 1000 | ||
exclude_dir = ["assets", "tmp", "vendor", "testdata"] | ||
exclude_file = [] | ||
exclude_regex = ["_test.go"] | ||
exclude_unchanged = false | ||
follow_symlink = false | ||
full_bin = "" | ||
include_dir = [] | ||
include_ext = ["go", "tpl", "tmpl", "html"] | ||
include_file = [] | ||
kill_delay = "0s" | ||
log = "build-errors.log" | ||
poll = false | ||
poll_interval = 0 | ||
post_cmd = [] | ||
pre_cmd = [] | ||
rerun = false | ||
rerun_delay = 500 | ||
send_interrupt = false | ||
stop_on_error = false | ||
|
||
[color] | ||
app = "" | ||
build = "yellow" | ||
main = "magenta" | ||
runner = "green" | ||
watcher = "cyan" | ||
|
||
[log] | ||
main_only = false | ||
time = false | ||
|
||
[misc] | ||
clean_on_exit = false | ||
|
||
[screen] | ||
clear_on_rebuild = false | ||
keep_scroll = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
-- +goose Up | ||
-- +goose StatementBegin | ||
CREATE TABLE `food_menus` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
`name` varchar(300) DEFAULT NULL, | ||
`thumbnail` text, | ||
`price` float DEFAULT NULL, | ||
`is_active` int(11) DEFAULT NULL, | ||
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
`user_id` bigint(20) DEFAULT NULL, | ||
`deleted_at` timestamp NULL DEFAULT NULL, | ||
PRIMARY KEY (`id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; | ||
-- +goose StatementEnd | ||
|
||
-- +goose Down | ||
-- +goose StatementBegin | ||
DROP TABLE `food_menus` | ||
-- +goose StatementEnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"_type":"export","__export_format":4,"__export_date":"2024-06-23T07:24:07.426Z","__export_source":"insomnia.desktop.app:v9.2.0","resources":[{"_id":"req_27faf4acf7d94c2f8ee446ce1274b3a5","parentId":"wrk_33553d20fe564d8ab097ea6088332cce","modified":1719125283185,"created":1719125200207,"url":"127.0.0.1:8080/api/v1/auth/login","name":"Login User","description":"","method":"POST","body":{"mimeType":"application/x-www-form-urlencoded","params":[{"id":"pair_ca5c1bbd010143de9ad7090b685485f6","name":"username","value":"testusername","description":""},{"id":"pair_11ebd58f85514c21b6b8ce67947815bf","name":"password","value":"passcode123","description":""}]},"preRequestScript":"","parameters":[],"headers":[{"name":"Content-Type","value":"application/x-www-form-urlencoded"},{"name":"User-Agent","value":"insomnia/9.2.0"}],"authentication":{},"metaSortKey":-1719125200207,"isPrivate":false,"pathParameters":[],"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"wrk_33553d20fe564d8ab097ea6088332cce","parentId":null,"modified":1719039673832,"created":1719039673832,"name":"Go API ","description":"","scope":"collection","_type":"workspace"},{"_id":"req_1400b2c944bd4240b7f176437966392e","parentId":"wrk_33553d20fe564d8ab097ea6088332cce","modified":1719125210749,"created":1719124956560,"url":"127.0.0.1:8080/api/v1/auth/register","name":"Register New User","description":"","method":"POST","body":{"mimeType":"application/x-www-form-urlencoded","params":[{"id":"pair_05dc401783214e82a42ad53258104db8","name":"name","value":"name-test","description":""},{"id":"pair_24963cb8d30b425e812788697a19c817","name":"email","value":"test@gmail.com","description":""},{"id":"pair_faff0d81521f4f0d92e01492d4270e35","name":"password","value":"passcode123","description":""},{"id":"pair_4380821141cd42f09f43a31f7fe43e47","name":"confirmpassword","value":"passcode123","description":""},{"id":"pair_bba8b5099ccd4e1394d1384abfe26038","name":"username","value":"testusername","description":""}]},"preRequestScript":"","parameters":[],"headers":[{"name":"Content-Type","value":"application/x-www-form-urlencoded"},{"name":"User-Agent","value":"insomnia/9.2.0"}],"authentication":{},"metaSortKey":-1719124956560,"isPrivate":false,"pathParameters":[],"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_e17fb461fdad4260a62874423c3407cb","parentId":"wrk_33553d20fe564d8ab097ea6088332cce","modified":1719127358730,"created":1719036049829,"url":"127.0.0.1:8080/api/v1/menu/1","name":"Delete By Menu Id","description":"","method":"DELETE","body":{"mimeType":"application/x-www-form-urlencoded","params":[]},"preRequestScript":"","parameters":[],"headers":[{"name":"Content-Type","value":"application/x-www-form-urlencoded"},{"name":"User-Agent","value":"insomnia/9.2.0"}],"authentication":{"type":"bearer","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHBpcmVkX2F0IjoxNzE5MjExNjg1LCJpc19hY3RpdmUiOnRydWUsInJvbGVfaWQiOjEsInVzZXJfaWQiOjEsInVzZXJuYW1lIjoidGVzdHVzZXJuYW1lIn0.bNMip3ymFcTF-jxvVvPbqq7YGYZreIuX2uBVp3ZgV70"},"metaSortKey":-1719036049829,"isPrivate":false,"pathParameters":[],"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_e2a1a598078d438aa430a7a174409ef6","parentId":"wrk_33553d20fe564d8ab097ea6088332cce","modified":1719127355300,"created":1719036016759,"url":"127.0.0.1:8080/api/v1/menu/1","name":"Update Menu By Menu Id","description":"","method":"PATCH","body":{"mimeType":"application/x-www-form-urlencoded","params":[{"id":"pair_3be9954a1d1443e7851c76422f49cfc4","name":"name","value":"Ayam Goreng 11","description":""},{"id":"pair_a20ab4671593420b99d57fe4f0e9e6d6","name":"thumbnail","value":"gegel.comcc","description":""},{"id":"pair_70a43e9006fc4823b40a44572325b037","name":"price","value":"1232222","description":""},{"id":"pair_06b82172c08341f3b40a8bbda281aafe","name":"userid","value":"1","description":""},{"id":"pair_c9a14508f96d4c828d12b4ee34906369","name":"isactive","value":"1","description":""}]},"preRequestScript":"","parameters":[],"headers":[{"name":"Content-Type","value":"application/x-www-form-urlencoded"},{"name":"User-Agent","value":"insomnia/9.2.0"}],"authentication":{"type":"bearer","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHBpcmVkX2F0IjoxNzE5MjExNjg1LCJpc19hY3RpdmUiOnRydWUsInJvbGVfaWQiOjEsInVzZXJfaWQiOjEsInVzZXJuYW1lIjoidGVzdHVzZXJuYW1lIn0.bNMip3ymFcTF-jxvVvPbqq7YGYZreIuX2uBVp3ZgV70"},"metaSortKey":-1719036016759,"isPrivate":false,"pathParameters":[],"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_0f26ea45076541b08ccad21f3dab899c","parentId":"wrk_33553d20fe564d8ab097ea6088332cce","modified":1719127330364,"created":1719035726253,"url":"127.0.0.1:8080/api/v1/menu/user/1","name":"Delete Batch By User Id","description":"","method":"DELETE","body":{"mimeType":"application/x-www-form-urlencoded","params":[{"id":"pair_5ad1404a7f0d4bd1be5ea45284009f2a","name":"userid","value":"1","description":""}]},"preRequestScript":"","parameters":[],"headers":[{"name":"Content-Type","value":"application/x-www-form-urlencoded"},{"name":"User-Agent","value":"insomnia/9.2.0"}],"authentication":{"type":"bearer","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHBpcmVkX2F0IjoxNzE5MjExNjg1LCJpc19hY3RpdmUiOnRydWUsInJvbGVfaWQiOjEsInVzZXJfaWQiOjEsInVzZXJuYW1lIjoidGVzdHVzZXJuYW1lIn0.bNMip3ymFcTF-jxvVvPbqq7YGYZreIuX2uBVp3ZgV70"},"metaSortKey":-1719035726253,"isPrivate":false,"pathParameters":[],"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_51334c4bd8a64cd1bf07fad2be756d25","parentId":"wrk_33553d20fe564d8ab097ea6088332cce","modified":1719127341228,"created":1718992253922,"url":"127.0.0.1:8080/api/v1/menu/1","name":"Get Menu","description":"","method":"GET","body":{"mimeType":"application/x-www-form-urlencoded","params":[]},"preRequestScript":"","parameters":[{"id":"pair_966a197268b44f4e93817109444ca73d","name":"","value":"","description":""}],"headers":[{"name":"Content-Type","value":"application/x-www-form-urlencoded"},{"name":"User-Agent","value":"insomnia/9.2.0"}],"authentication":{"type":"bearer","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHBpcmVkX2F0IjoxNzE5MjExNjg1LCJpc19hY3RpdmUiOnRydWUsInJvbGVfaWQiOjEsInVzZXJfaWQiOjEsInVzZXJuYW1lIjoidGVzdHVzZXJuYW1lIn0.bNMip3ymFcTF-jxvVvPbqq7YGYZreIuX2uBVp3ZgV70"},"metaSortKey":-1718992253922,"isPrivate":false,"pathParameters":[],"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_e8a655aef15149dba34a572adfeca736","parentId":"wrk_33553d20fe564d8ab097ea6088332cce","modified":1719127349313,"created":1718969498802,"url":"127.0.0.1:8080/api/v1/menu/","name":"Add Menu","description":"","method":"POST","body":{"mimeType":"application/x-www-form-urlencoded","params":[{"id":"pair_fef0594ecb8340a3b003269f65dcb791","name":"name","value":"Nasi Goreng","description":""},{"id":"pair_b5a602dda9524ec88e2009be7f4b4c75","name":"thumbnail","value":"google.com","description":""},{"id":"pair_ae082c6db13c41fab752cb668f88e188","name":"price","value":"10000","description":""},{"id":"pair_df1950bf66cd474f87c88611ab9ddbf6","name":"userid","value":"1","description":""},{"id":"pair_bb985bd330654094ba96e764a51e65de","name":"isactive","value":"0","description":""}]},"preRequestScript":"","parameters":[],"headers":[{"name":"Content-Type","value":"application/x-www-form-urlencoded"},{"name":"User-Agent","value":"insomnia/9.2.0"}],"authentication":{"type":"bearer","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHBpcmVkX2F0IjoxNzE5MjExNjg1LCJpc19hY3RpdmUiOnRydWUsInJvbGVfaWQiOjEsInVzZXJfaWQiOjEsInVzZXJuYW1lIjoidGVzdHVzZXJuYW1lIn0.bNMip3ymFcTF-jxvVvPbqq7YGYZreIuX2uBVp3ZgV70"},"metaSortKey":-1718969498802,"isPrivate":false,"pathParameters":[],"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"env_f08ebae3ac20411f9717505e52ebcded","parentId":"wrk_33553d20fe564d8ab097ea6088332cce","modified":1717862513529,"created":1717862513529,"name":"Base Environment","data":{},"dataPropertyOrder":null,"color":null,"isPrivate":false,"metaSortKey":1717862513529,"_type":"environment"},{"_id":"jar_ab65d293fddc42468581f9b2495630f7","parentId":"wrk_33553d20fe564d8ab097ea6088332cce","modified":1717862513532,"created":1717862513532,"name":"Default Jar","cookies":[],"_type":"cookie_jar"}]} |
Oops, something went wrong.