{"id":36649911,"url":"https://github.com/steffen25/golang.zone","last_synced_at":"2026-01-12T10:04:21.689Z","repository":{"id":48270176,"uuid":"92105291","full_name":"steffen25/golang.zone","owner":"steffen25","description":"Home of golang.zone","archived":false,"fork":false,"pushed_at":"2021-08-08T18:23:37.000Z","size":2784,"stargazers_count":41,"open_issues_count":0,"forks_count":10,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-12-16T02:57:32.105Z","etag":null,"topics":["api","go","golang","hackoctoberfest2k17","hackoctoberfest2k19","restful"],"latest_commit_sha":null,"homepage":"https://golang.zone","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/steffen25.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":"2017-05-22T22:35:35.000Z","updated_at":"2025-10-19T19:11:37.000Z","dependencies_parsed_at":"2022-09-13T08:31:02.607Z","dependency_job_id":null,"html_url":"https://github.com/steffen25/golang.zone","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/steffen25/golang.zone","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steffen25%2Fgolang.zone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steffen25%2Fgolang.zone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steffen25%2Fgolang.zone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steffen25%2Fgolang.zone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steffen25","download_url":"https://codeload.github.com/steffen25/golang.zone/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steffen25%2Fgolang.zone/sbom","scorecard":{"id":850822,"data":{"date":"2025-08-11","repo":{"name":"github.com/steffen25/golang.zone","commit":"5b087d42fc9a23b23b120805537eff6a0274cdef"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/17 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating golang:1.9.0 to golang:1.9.0@sha256:0bc4b605f127ebcda9c96d8b0411780e8dcc03ee695c5f9cdf6298f9977b8ca8","Warn: goCommand not pinned by hash: Dockerfile:3","Warn: goCommand not pinned by hash: Dockerfile:4","Info:   0 out of   1 containerImage dependencies pinned","Info:   0 out of   2 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 16 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T22:29:05.287Z","repository_id":48270176,"created_at":"2025-08-23T22:29:05.287Z","updated_at":"2025-08-23T22:29:05.287Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28337881,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","go","golang","hackoctoberfest2k17","hackoctoberfest2k19","restful"],"created_at":"2026-01-12T10:04:21.555Z","updated_at":"2026-01-12T10:04:21.645Z","avatar_url":"https://github.com/steffen25.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://i.imgur.com/rZY34qI.png\" height=\"130\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\n  \u003ca href=\"https://travis-ci.org/steffen25/golang.zone\"\u003e\n  \t\u003cimg src=\"https://travis-ci.org/steffen25/golang.zone.svg?branch=master\"\n  alt=\"\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://goreportcard.com/report/github.com/steffen25/golang.zone\"\u003e\n  \t\u003cimg src=\"https://goreportcard.com/badge/github.com/steffen25/golang.zone\" alt=\"\"\u003e\n  \u003c/a\u003e\n  \n  \u003ca href=\"https://coveralls.io/github/steffen25/golang.zone?branch=master\"\u003e\n  \t\u003cimg src=\"https://coveralls.io/repos/github/steffen25/golang.zone/badge.svg?branch=master\" alt=\"\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://golang.zone\"\u003e\n    \u003cimg src=\"https://img.shields.io/website-up-down-green-red/http/shields.io.svg?label=golang.zone\" \u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"LICENSE\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" alt=\"\"\u003e\u003c/a\u003e\n\n\u003c/p\u003e\n\n\n# golang.zone\n\nThe frontend app for this project is made with Vue.js and is open source \n\n[golang.zone-frontend](https://github.com/steffen25/golang.zone-frontend)\n\nThis repository holds the files for the REST API of https://golang.zone\n\nYou need to make a config file in the config directory - below is an example of what it could look like. You can also directly use the example file in the config directory just remember to remove the .example extension\n```json\n{\n  \"env\": \"local\",\n  \"mysql\": {\n    \"host\": \"app_mysql\",\n    \"username\": \"root\",\n    \"password\": \"password\",\n    \"database\": \"app\",\n    \"encoding\": \"utf8mb4\",\n    \"port\": \"3306\"\n  },\n  \"redis\": {\n    \"host\": \"app_redis\",\n    \"port\": 6379\n  },\n  \"jwt\": {\n      \"secret\": \"secret\",\n      \"public_key_path\": \"config/api.rsa.pub\",\n      \"private_key_path\": \"config/api.rsa\"\n  },\n  \"port\": 8080\n}\n```\nGenerate private key\n\n- openssl genrsa -out api.rsa keysize(2048 or 4096)\n\nGenerate public key\n- openssl rsa -in api.rsa -pubout \u003e api.rsa.pub\n\n\n### Prerequisites\n- Go 1.7+\n- Mysql\n- Redis (To revoke JWTs)\n\n### Endpoints\n\n\nUsers:\n\n| URL        \t\t\t\t\t\t\t\t| Method           \t| Info  |\n| ------------- \t\t\t\t\t\t\t|:-------------:\t| -----:|\n| http://127.0.0.1:8080/api/v1/users      \t\t\t| GET \t\t\t\t| Returns an array of users |\n| http://127.0.0.1:8080/api/v1/users      \t\t\t| POST \t\t\t\t| Endpoint to create a user |\n| http://127.0.0.1:8080/api/v1/users/{id}      \t\t| GET \t\t\t\t| Returns a single user specificed by a id |\n| http://127.0.0.1:8080/api/v1/users/{id}/posts    \t| GET \t\t\t\t| Returns an array of posts created by an user |\n\n\nPosts:\n\n| URL        \t\t\t\t\t\t\t\t\t| Method           \t| Info  |\n| ------------- \t\t\t\t\t\t\t\t|:-------------:\t| -----:|\n| http://127.0.0.1:8080/api/v1/posts      \t\t| GET \t\t\t\t| Returns an array of posts |\n| http://127.0.0.1:8080/api/v1/posts      \t\t| POST \t\t\t\t| Endpoint to create a post - proctected by a auth middleware that requires the user to be authenticated and be an admin |\n| http://127.0.0.1:8080/api/v1/images/upload    | POST \t\t\t\t| Endpoint to upload images to a post using a wysiwyg editor - proctected by a auth middleware that require the user to be authenticated and be an admin |\n| http://127.0.0.1:8080/api/v1/posts/{id}      \t| GET \t\t\t\t| Endpoint to retrieve a post specified by an id |\n| http://127.0.0.1:8080/api/v1/posts/{slug}     | GET \t\t\t\t| Endpoint to retrieve a post specified by a slug |\n| http://127.0.0.1:8080/api/v1/posts/{id}      \t| PUT \t\t\t\t| Endpoint to update a specific post - proctected by a auth middleware that requires the user to be authenticated and be an admin |\n\nAuth:\n\n| URL        \t\t\t\t\t\t\t\t\t\t\t\t| Method           \t| Info  |\n| ------------- \t\t\t\t\t\t\t\t\t\t\t|:-------------:\t| -----:|\n| http://127.0.0.1:8080/api/v1/auth/login      \t\t\t\t| POST \t\t\t\t| Endpoint to authenticate a user- returns a JWT that last for 24 hours |\n| http://127.0.0.1:8080/api/v1/auth/update      \t\t\t| PUT \t\t\t\t| Endpoint to update the current user that is logged in - proctected by a auth middleware |\n| http://127.0.0.1:8080/api/v1/auth/refresh      \t\t\t| GET \t\t\t\t| Endpoint to refresh a JWT - proctected by a auth middleware |\n| http://127.0.0.1:8080/api/v1/auth/logout      \t\t\t| GET \t\t\t\t| Logout the user from the API by revoking the user's JWT - proctected by a auth middleware |\n| http://127.0.0.1:8080/api/v1/auth/logout/all      \t\t| GET \t\t\t\t| Logout the user from all the places that he/she is logged in - proctected by a auth middleware |\n\n\nMisc:\n\n| URL        \t\t\t\t\t\t\t\t| Method           \t| Info  |\n| ------------- \t\t\t\t\t\t\t|:-------------:\t| -----:|\n| http://127.0.0.1:8080       \t\t\t\t| GET \t\t\t\t| A test endpoint to see the API is working (hello world) |\n| http://127.0.0.1:8080/api/v1/protected    | GET \t\t\t\t| A test endpoint to see the id of the user that is logged in - proctected by a auth middleware |\n\n\n### Example requests\n\n#### Paw\n\u003ci\u003eMac users only\u003c/i\u003e\n\n[golang.zone.paw](examples/golang.zone.paw)\n\nOpen the file with Paw then set the environment in the upper left corner\n\n#### Postman\n1. Import the [golang.zone.postman_collection.json](examples/golang.zone.postman_collection.json) in Postman\n2. Setup your environments by clicking the 🔩 icon just next to the 👁️ icon top in the top right corner\n3. You can also import the environments created by me, \n[golang.zone.Local.postman_environment.json](examples/golang.zone.Local.postman_environment.json), [golang.zone.Prod.postman_environment.json](examples/golang.zone.Prod.postman_environment.json)\ncontinue at step 8.\n4. I suggest creating 2 envs on called golang.zone Local and one called golang.zone Prod\n5. Create 3 keys BASE_URL, ACCESS_TOKEN and REFRESH_TOKEN\n6. Set the value of BASE_URL to http://localhost:8080 for the local env and https://golang.zone for the Prod env, leave the tokens value empty for now\n7. Click Add/Update.\n8. Go to the Login request and open up the Tests tab.\n9. Insert the code below then save and finally click send.\n```javascript\nvar jsonData = JSON.parse(responseBody);\npostman.setEnvironmentVariable(\"ACCESS_TOKEN\", jsonData.data.tokens.accessToken);\npostman.setEnvironmentVariable(\"REFRESH_TOKEN\", jsonData.data.tokens.refreshToken);\n```\n10. Now when you call endpoints that require authorization it will automatically insert the token value inside the Authorization header\n\n\n\n\n### Docker Development\nRun the following commands only before boostrapping the application.\n```sh\n# Migrate database\ndocker-compose run --rm --name app -p 8080:8080 app_api bash\n# Inside the app container\n# TODO: Clean up the migration\ngoose -dir ./db/migrations/ mysql \"app:password@(app_mysql:3306)/app\" up\n```\n\nDevelopment - Since linking the local folder to container we can edit code and run container.\n```sh\ndocker-compose up\n```\n\n# To do\n- [ ] Add categories for posts\n- [ ] Add tags for posts\n- [ ] Add featured image for posts\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteffen25%2Fgolang.zone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteffen25%2Fgolang.zone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteffen25%2Fgolang.zone/lists"}