{"id":15178939,"url":"https://github.com/ericz99/go-server-api","last_synced_at":"2026-03-01T02:01:49.488Z","repository":{"id":126123404,"uuid":"247162947","full_name":"ericz99/go-server-api","owner":"ericz99","description":"Simple RESTful API Server example.","archived":false,"fork":false,"pushed_at":"2020-03-17T22:23:02.000Z","size":26,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-16T10:20:29.948Z","etag":null,"topics":["api-server","example-project","golang","gorm-orm","mysql-database"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericz99.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-13T21:15:57.000Z","updated_at":"2024-11-04T15:18:55.000Z","dependencies_parsed_at":"2023-07-09T05:15:33.199Z","dependency_job_id":null,"html_url":"https://github.com/ericz99/go-server-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ericz99/go-server-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericz99%2Fgo-server-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericz99%2Fgo-server-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericz99%2Fgo-server-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericz99%2Fgo-server-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericz99","download_url":"https://codeload.github.com/ericz99/go-server-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericz99%2Fgo-server-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29958393,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T01:47:18.291Z","status":"online","status_checked_at":"2026-03-01T02:00:07.437Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-server","example-project","golang","gorm-orm","mysql-database"],"created_at":"2024-09-27T15:42:28.540Z","updated_at":"2026-03-01T02:01:49.468Z","avatar_url":"https://github.com/ericz99.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Server REST API Example\n\nA RESTful API example for simple book application in Golang\n\n## Installation \u0026 Run\n\n```bash\n# Download this project\ngo get github.com/ericz99/go-server-api\n```\n\nBefore running API server, you should set the database config with yours or set the your database config with my values on [config.go](https://github.com/ericz99/go-server-api/blob/master/config/config.go)\n\nAlso, please change .env.example -\u003e .env and update the all fields.\n\n```bash\n# production env mode\nmode = development\n\n# database config\ndb_name = testdb\ndb_pass = passwrod\ndb_user = root\ndb_type = mysql\ndb_host = localhost\ndb_port = 3306\n\n# server port\nport = 8080\n\n# for jwt secret key\nsecret_key = feTATm1?@d+1GKG\n```\n\n```bash\n# Build and Run\ncd go-server-api\ngo build\n./go-server-api - [if you\\'re using linux/macos]\ngo-server-api - [if you\\'re using windows]\n\n# API Endpoint (VERSION 1) : http://localhost:8080/api/v1\n# API Endpoint (VERSION 2) : http://localhost:8080/api/v2\n# API Auth Endpoint : http://localhost:8080/api/auth\n```\n\n## API\n\n## Auth Endpoint - Using auth endpoint\n\n#### /register\n\n- `POST` : Create new user\n\n#Post Params\n\n```\n{\n\t\"name\": \"Hello World\",\n\t\"email\": \"test@yahoo.com\",\n\t\"password\": \"asdfasdf\"\n}\n```\n\n#### /login\n\n- `POST` : Login User\n\n#Post Params\n\n```\n{\n\t\"email\": \"test@yahoo.com\",\n\t\"password\": \"asdfasdf\"\n}\n```\n\n## Protected Endpoint - Using either V1 or V2 endpoint\n\nPlease add `x-auth-token` in your header in order to get authorized to any of these endpoint below!\n\n#### /book/save\n\n- `POST` : Save a book\n\n#### /books\n\n- `GET` : Get all book\n\n#### /book/:id\n\n- `GET` : Get a book\n- `DELETE` : Delete a book\n\n#Post Params\n\n```\n{\n\t\"title\": \"LOL: Book PT 2\",\n\t\"isbn\": \"isbn-6s9\",\n\t\"author\": {\n\t\t\"name\": \"Bob\"\n\t}\n}\n```\n\n## Todo\n\n- [x] Support basic REST APIs.\n- [x] Support GORM/Database\n- [x] Support Authentication with user for securing the APIs.\n- [x] Make convenient wrappers for creating API handlers.\n- [ ] Write the tests for all APIs.\n- [x] Organize the code with packages\n- [ ] Make docs with GoDoc\n- [ ] Building a deployment process\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericz99%2Fgo-server-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericz99%2Fgo-server-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericz99%2Fgo-server-api/lists"}