{"id":19459245,"url":"https://github.com/putukrisna6/golang-api","last_synced_at":"2026-03-17T13:03:44.713Z","repository":{"id":42736832,"uuid":"466230837","full_name":"putukrisna6/golang-api","owner":"putukrisna6","description":"RESTful Go API with Docker","archived":false,"fork":false,"pushed_at":"2022-03-27T06:35:18.000Z","size":117,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T17:39:56.958Z","etag":null,"topics":["api","caching","docker","docker-compose","gin","golang","gorm","jwt","mysql","portainer-ce","redis","rest-api"],"latest_commit_sha":null,"homepage":"https://simple-rest-go.herokuapp.com/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/putukrisna6.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-04T18:30:54.000Z","updated_at":"2023-01-30T08:07:29.000Z","dependencies_parsed_at":"2022-09-19T02:13:05.969Z","dependency_job_id":null,"html_url":"https://github.com/putukrisna6/golang-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/putukrisna6%2Fgolang-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/putukrisna6%2Fgolang-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/putukrisna6%2Fgolang-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/putukrisna6%2Fgolang-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/putukrisna6","download_url":"https://codeload.github.com/putukrisna6/golang-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250774833,"owners_count":21485234,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","caching","docker","docker-compose","gin","golang","gorm","jwt","mysql","portainer-ce","redis","rest-api"],"created_at":"2024-11-10T17:30:56.874Z","updated_at":"2026-03-17T13:03:39.638Z","avatar_url":"https://github.com/putukrisna6.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple REST API Go App\n\n## Features:\n- Gin for the web framework\n- Gorm for ORM\n- jwt-go for authentication\n- Redis for caching\n- MariaDB for main db\n- phpMyAdmin for db management\n- Portainer for container management\n\n## How to use:\n- Clone the repo\n- Setup your .env file\n- Run `docker-compose up -d`\n\n## Misc info:\n### phpMyAdmin\n- access via `http://localhost:8085/` or through the \"Open in Browser\" in Docker Desktop\n- by default: server is `db`, username is `root`, and password is `test`. configurable within `docker-compose.yml`\n### Portainer\n- access via `http://localhost:9000/`\n- feel free to set the password and username when running it for the first time\n### Testing\n- open your browser and go to `http://localhost:8080/`, if all is fine you would be greeted by `Hello, World`\n- use Postman or similar tools and set the url to `http://localhost:8080/`\n- do not forget to set the `Authorization` key within `Headers` on your requests on some routes protected by the jwt middleware\n- available routes: \n  - POST   /api/auth/login\n  - POST   /api/auth/register\n  - GET    /api/users/profile\n  - PUT    /api/users\n  - GET    /api/books\n  - POST   /api/books\n  - GET    /api/books/:id\n  - PUT    /api/books\n  - DELETE /api/books/:id\n  - GET    /api/receipts/all\n  - POST   /api/receipts\n  - GET    /api/receipts/:id\n  - PUT    /api/receipts\n  - DELETE /api/receipts/:id\n  - GET    /       \n\n- some jquery request I used to test the APIs from another domain\n  ```js\n  $.ajax({\n        url: \"http://localhost:8080/api/receipts/all\"\n  })\n  ```\n\n  ```js\n  $.ajax({\n        url: \"http://localhost:8080/api/receipts/1\"\n  })\n  ```\n  ```js\n  $.ajax({\n        type: 'POST',\n        url: \"http://localhost:8080/api/receipts\",\n        data: {\"amount\":3,\"total\":67},\n        dataType: \"json\",\n        success: function(resultData) { alert(\"Save Complete\") }\n  });\n  ```\n  ```js\n  $.ajax({\n        type: 'PUT',\n        url: \"http://localhost:8080/api/receipts\",\n        data: {\"id\":4,\"amount\":323,\"total\":6723.2},\n        dataType: \"json\",\n        success: function(resultData) { alert(\"Update Complete\") }\n  });\n  ```\n  ```js\n  $.ajax({\n      type: 'DELETE',\n      url: \"http://localhost:8080/api/receipts/4\",\n      dataType: \"json\",\n      success: function(resultData) { alert(\"Delete Complete\") }\n  });\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fputukrisna6%2Fgolang-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fputukrisna6%2Fgolang-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fputukrisna6%2Fgolang-api/lists"}