{"id":16901443,"url":"https://github.com/aalug/blog-go","last_synced_at":"2026-04-11T04:32:24.010Z","repository":{"id":176546695,"uuid":"652021575","full_name":"aalug/blog-go","owner":"aalug","description":"Blog API built with Go and Gin","archived":false,"fork":false,"pushed_at":"2023-08-20T12:33:41.000Z","size":2536,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-28T10:48:06.857Z","etag":null,"topics":["api","gin","go","golang","postgresql","rest-api"],"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/aalug.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":"2023-06-10T20:43:10.000Z","updated_at":"2023-07-08T09:18:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"ed24c49e-ff1f-4fdb-8b80-5bf54be5b51e","html_url":"https://github.com/aalug/blog-go","commit_stats":null,"previous_names":["aalug/blog-go"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aalug/blog-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aalug%2Fblog-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aalug%2Fblog-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aalug%2Fblog-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aalug%2Fblog-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aalug","download_url":"https://codeload.github.com/aalug/blog-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aalug%2Fblog-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31669114,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"online","status_checked_at":"2026-04-11T02:00:05.776Z","response_time":54,"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","gin","go","golang","postgresql","rest-api"],"created_at":"2024-10-13T17:59:44.014Z","updated_at":"2026-04-11T04:32:23.984Z","avatar_url":"https://github.com/aalug.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Blog \r\n\r\n### Built in Go 1.20\r\n\r\n### The app uses:\r\n- Postgres\r\n- Docker\r\n- [Gin](https://github.com/gin-gonic/gin)\r\n- gRPC\r\n- [asynq](https://github.com/hibiken/asynq)\r\n- [golang-migrate](https://github.com/golang-migrate/migrate)\r\n- [sqlc](https://github.com/kyleconroy/sqlc)\r\n- [testify](https://github.com/stretchr/testify)\r\n- [PASETO Security Tokens](https://github.com/o1egl/paseto)\r\n- [jordan-wright/email](https://github.com/jordan-wright/email)\r\n\r\n## Getting started\r\n1. Clone the repository\r\n2. Go to the project's root directory\r\n3. Rename `app.env.sample` to `app.env` and replace the values\r\n4. Run in your terminal:\r\n    - `docker-compose up --build` to run the containers\r\n5. Now everything should be ready and server running on `SERVER_ADDRESS` specified in `app.env`\r\n\r\n## Testing\r\n1. Run the postgres container (`docker-compose up`)\r\n2. Run in your terminal:\r\n    - `make test` to run all tests\r\n   or\r\n    - `make test_coverage p={PATH}` - to get the coverage in the HTML format - where `{PATH}` is the path to the target directory for which you want to generate test coverage. The `{PATH}` should be replaced with the actual path you want to use. For example `./api`\r\n   or\r\n    - use standard `go test` commands (e.g. `go test -v ./api`)\r\n\r\n## API endpoints\r\n#### Users\r\n - `/users` - handles POST requests to create users.\r\n - `/users/login` - handles POST requests to log in users.\r\n\r\n### Tokens/Session\r\n - `/tokens/renew` - handles  POST requests to renew the access tokens.\r\n\r\n#### Category\r\n - `/category` - handles POST requests to create categories\r\n - `/category/{name}` - handles DELETE requests to delete a category\r\n\r\n### Posts\r\n- `/posts` - handles POST requests to create posts.\r\n- `/posts/{id}` - handles DELETE requests to delete a post.\r\n- `/posts/id/{id}` and `/posts/title/{slug}` - handles GET requests to get post details.\r\n- `/posts/all` - handles GET requests to list all posts. Query params: `page`, `page_size`.\r\n- `/posts/author` - handles GET requests to list posts created by author \r\nwith given name (that username or email contain given string). \r\nQuery params: `page`, `page_size`, `author`.\r\n- `/posts/category` - handles GET requests to list posts from the given category.\r\nQuery params: `page`, `page_size`, `category_id`.\r\n- `/posts/tags` - handles GET requests to list posts with given tags.\r\nQuery params: `page`, `page_size`, `tag_ids` where `tag_ids` is \r\ncomma-separated int format (e.g. `\u0026tag_ids=1,2,3`).\r\n- `/posts/{id}` - handles PATCH requests to update the post.\r\n\r\n### Comments\r\n- `/comments` - handles POST requests to create a comment.\r\n- `/comments/{id}` - handles DELETE requests to delete a comment.\r\n- `/comments/{id}` - handles PATCH requests to update a comment.\r\n- `/comments/{post_id}` - handles GET requests to list comments of a post.\r\nQuery params: `page` and `page_size`.\r\n\r\n## Documentation\r\n### API\r\nThe API (HTTP gateway) documentation can be found at\r\n[this swaggerhub page](https://app.swaggerhub.com/apis-docs/AAGULCZYNSKI/blog-go/1.0)\r\nand (after running the server) at http://localhost:8080/docs/\r\n\r\n### Database\r\nThe database's schema and intricate details can be found on \r\ndedicated webpage, which provides a comprehensive overview \r\nof the data structure, tables, relationships, and other essential \r\ninformation. To explore the database further, please visit\r\nthis [dbdocs.io webpage](https://dbdocs.io/aalug/blog_go).\r\nPassword: `bloggopassword`\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faalug%2Fblog-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faalug%2Fblog-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faalug%2Fblog-go/lists"}