{"id":32600602,"url":"https://github.com/mbredikhin/snippy","last_synced_at":"2026-05-05T04:35:37.990Z","repository":{"id":117764207,"uuid":"337836496","full_name":"mbredikhin/snippy","owner":"mbredikhin","description":"Backend of the Snippy web service","archived":false,"fork":false,"pushed_at":"2024-07-04T20:44:33.000Z","size":82,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-03T16:42:01.154Z","etag":null,"topics":["gin","go","postgresql","redis"],"latest_commit_sha":null,"homepage":"","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/mbredikhin.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-02-10T19:51:18.000Z","updated_at":"2025-03-20T06:12:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"53df7f79-9bc0-4fa4-8fea-3535311e1b7e","html_url":"https://github.com/mbredikhin/snippy","commit_stats":null,"previous_names":["mbredikhin/snippets"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mbredikhin/snippy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbredikhin%2Fsnippy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbredikhin%2Fsnippy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbredikhin%2Fsnippy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbredikhin%2Fsnippy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbredikhin","download_url":"https://codeload.github.com/mbredikhin/snippy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbredikhin%2Fsnippy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32635809,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"online","status_checked_at":"2026-05-05T02:00:06.033Z","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":["gin","go","postgresql","redis"],"created_at":"2025-10-30T07:01:03.289Z","updated_at":"2026-05-05T04:35:37.985Z","avatar_url":"https://github.com/mbredikhin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Snippy\n\nBackend of the Snippy service - lightning-fast solution for managing code snippets.\n\n## Installation and run\n\n```sh\ngit clone git@github.com:mbredikhin/snippy.git \u0026\u0026 cd snippy\n# Build services\nmake build\n# Create and start containers\nmake run\n# Run database migrations\nmake migrate-up\n# Seed database\nmake db-seed\n# API host name: http://localhost:8001\n# curl -X POST --data '{\"username\":\"username\", \"password\":\"password\"}' http://localhost:8001/auth/sign-in\n# curl -X POST --data '{\"name\":\"My snippets collection\"}' --header 'Authorization: Bearer {{token}}' http://localhost:8001/api/lists\n```\n\n## API Reference\n\n[\u003cimg src=\"https://run.pstmn.io/button.svg\" alt=\"Run In Postman\" style=\"width: 128px; height: 32px;\"\u003e](https://god.gw.postman.com/run-collection/12758470-78ec42b6-b8e1-4935-ba76-d7e701cf4f37?action=collection%2Ffork\u0026source=rip_markdown\u0026collection-url=entityId%3D12758470-78ec42b6-b8e1-4935-ba76-d7e701cf4f37%26entityType%3Dcollection%26workspaceId%3D26ed6946-1a78-42a3-a05e-6b50744b4675)\n\n#### Register new user\n\n```http\n  POST /auth/sign-up\n```\n\nBody:\n\n| Key        | Type     | Description                 |\n| :--------- | :------- | :-------------------------- |\n| `username` | `string` | **Required**. Your username |\n| `password` | `string` | **Required**. Your password |\n| `name`     | `string` | Your full name              |\n\nResponse\n\n```\n{\n    \"status\": \"ok\"\n}\n```\n\n#### Login with username and password\n\n```http\n  POST /auth/sign-in\n```\n\nBody:\n\n| Key        | Type     | Description                 |\n| :--------- | :------- | :-------------------------- |\n| `username` | `string` | **Required**. Your username |\n| `password` | `string` | **Required**. Your password |\n\nResponse\n\n```\n{\n    \"data\": {\n        \"token\": string\n    }\n}\n```\n\nSend given token in Authorization HTTP header – `Authorization: \"Bearer %s\" `\n\n#### Create a new list of snippets\n\n```http\n  POST /api/lists\n```\n\nBody:\n\n| Key    | Type     | Description                   |\n| :----- | :------- | :---------------------------- |\n| `name` | `string` | **Required**. Collection name |\n\nResponse\n\n```\n{\n    \"data\": {\n        \"id\": number,\n        \"name\": string\n    }\n}\n```\n\n#### Get all lists\n\n```http\n  GET /api/lists\n```\n\nQuery parameters:\n\n| Parameter | Type     | Description      |\n| :-------- | :------- | :--------------- |\n| `page`    | `number` | Page             |\n| `limit`   | `number` | Pagination limit |\n\nResponse\n\n```\n{\n    \"data\": [\n        {\n            \"id\": number,\n            \"name\": string\n        }\n    ]\n}\n```\n\n#### Get list by id\n\n```http\n  GET /api/lists/:id\n```\n\nQuery parameters:\n\n| Parameter | Type     | Description                 |\n| :-------- | :------- | :-------------------------- |\n| `id`      | `number` | **Required**. Collection ID |\n\nResponse\n\n```\n{\n    \"data\": {\n        \"id\": number,\n        \"name\": string\n    }\n}\n```\n\n#### Update list\n\n```http\n  PUT /api/lists/:id\n```\n\nBody:\n\n| Key    | Type     | Description                   |\n| :----- | :------- | :---------------------------- |\n| `name` | `string` | **Required**. Collection name |\n\nResponse\n\n```\n{\n    \"data\": {\n        \"id\": number,\n        \"name\": string\n    }\n}\n```\n\n#### Delete list\n\n```http\n  DELETE /api/lists/:id\n```\n\nBody:\n\n| Key  | Type     | Description                 |\n| :--- | :------- | :-------------------------- |\n| `id` | `number` | **Required**. Collection ID |\n\nResponse\n\n```\n{\n    \"data\": {\n        \"id\": number\n    }\n}\n```\n\n#### Add language\n\n```http\n  POST /api/languages\n```\n\nBody:\n\n| Key    | Type     | Description                 |\n| :----- | :------- | :-------------------------- |\n| `name` | `string` | **Required**. Language name |\n\nResponse\n\n```\n{\n    \"data\": {\n        \"id\": number\n    }\n}\n```\n\n#### Get list of languages\n\n```http\n  GET /api/languages\n```\n\nResponse\n\n```\n{\n    \"data\": [\n        {\n            \"id\": number,\n            \"name\": string\n        }\n    ]\n}\n```\n\n#### Create new snippet\n\n```http\n  POST /api/lists/:id/snippets\n```\n\nBody:\n\n| Key           | Type     | Description                    |\n| :------------ | :------- | :----------------------------- |\n| `name`        | `string` | **Required**. Snippet name     |\n| `language_id` | `number` | **Required**. Language ID      |\n| `description` | `string` | **Required**. Text description |\n| `content`     | `string` | **Required**. Snippet content  |\n\nResponse\n\n```\n{\n    \"data\": {\n        \"id\": number\n    }\n}\n```\n\n#### Get all snippets of the list\n\n```http\n  GET /api/lists/:id/snippets\n```\n\nQuery parameters:\n\n| Parameter | Type       | Description                                        |\n| :-------- | :--------- | :------------------------------------------------- |\n| `tag_ids` | `number[]` | Filters snippets with any of entered tags assigned |\n| `page`    | `number`   | Page                                               |\n| `limit`   | `number`   | Pagination limit                                   |\n\nResponse\n\n```\n{\n    \"data\": [\n        {\n            \"id\": number,\n            \"list_id\": number,\n            \"name\": string,\n            \"language_id\": number,\n            \"description\": string,\n            \"content\": string\n        }\n    ]\n}\n```\n\n#### Get snippet\n\n```http\n  GET /api/snippets/:id\n```\n\nResponse\n\n```\n{\n    \"data\": {\n        \"id\": number,\n        \"list_id\": number,\n        \"name\": string,\n        \"language_id\": number,\n        \"description\": number,\n        \"content\": string\n    }\n}\n```\n\n#### Update snippet\n\n```http\n  PUT /api/snippets/:id\n```\n\nBody:\n\n| Key           | Type     | Description                    |\n| :------------ | :------- | :----------------------------- |\n| `name`        | `string` | **Required**. Snippet name     |\n| `language_id` | `number` | **Required**. Language ID      |\n| `list_id`     | `number` | **Required**. Collection ID    |\n| `description` | `string` | **Required**. Text description |\n| `content`     | `string` | **Required**. Snippet content  |\n\nResponse\n\n```\n{\n    \"status\": \"ok\"\n}\n```\n\n#### Delete snippet\n\n```http\n  DELETE /api/snippets/:id\n```\n\nResponse\n\n```\n{\n    \"status\": \"ok\"\n}\n```\n\n#### Add snippet to favourites\n\n```http\n  POST /api/snippets/favourites\n```\n\nBody:\n\n| Key  | Type     | Description              |\n| :--- | :------- | :----------------------- |\n| `id` | `number` | **Required**. Snippet ID |\n\nResponse\n\n```\n{\n    \"status\": \"ok\"\n}\n```\n\n#### Remove snippet from favourites\n\n```http\n  DELETE /api/snippets/favourites\n```\n\nBody:\n\n| Key  | Type     | Description              |\n| :--- | :------- | :----------------------- |\n| `id` | `number` | **Required**. Snippet ID |\n\nResponse\n\n```\n{\n    \"status\": \"ok\"\n}\n```\n\n#### Get ids of favourite snippets\n\n```http\n  GET /api/snippets/favourites\n```\n\nResponse\n\n```\n{\n    \"data\": [number]\n}\n```\n\n#### Add tag\n\n```http\n  POST /api/tags\n```\n\nBody:\n\n| Key    | Type     | Description          |\n| :----- | :------- | :------------------- |\n| `name` | `string` | **Required**. Tag ID |\n\nResponse\n\n```\n{\n    \"data\": {\n        \"id\": number\n    }\n}\n```\n\n#### Update tag\n\n```http\n  PUT /api/tags/:id\n```\n\nBody:\n\n| Key  | Type     | Description          |\n| :--- | :------- | :------------------- |\n| `id` | `number` | **Required**. Tag ID |\n\nResponse\n\n```\n{\n    \"status\": \"ok\"\n}\n```\n\n#### Delete tag\n\n```http\n  DELETE /api/tags/:id\n```\n\nResponse\n\n```\n{\n    \"status\": \"ok\"\n}\n```\n\n#### Get tag\n\n```http\n  GET /api/tags/:id\n```\n\nResponse\n\n```\n{\n    \"data\": {\n        \"id\": number,\n        \"name\": string\n    }\n}\n```\n\n#### Get list of tags\n\n```http\n  GET /api/tags\n```\n\nResponse\n\n```\n{\n    \"data\": [\n        {\n            \"id\": number,\n            \"name\": string\n        }\n    ]\n}\n```\n\n#### Get list of tags assigned to the snippet\n\n```http\n  GET /api/snippets/:id/tags\n```\n\nResponse\n\n```\n{\n    \"data\": [number]\n}\n```\n\n#### Assign tag to the snippet\n\n```http\n  POST /api/snippets/:id/tags\n```\n\nBody:\n\n| Key      | Type     | Description          |\n| :------- | :------- | :------------------- |\n| `tag_id` | `number` | **Required**. Tag ID |\n\nResponse\n\n```\n{\n    \"status\": \"ok\"\n}\n```\n\n#### Unassign tag from the snippet\n\n```http\n  DELETE /api/snippets/:id/tags\n```\n\nBody:\n\n| Key      | Type     | Description          |\n| :------- | :------- | :------------------- |\n| `tag_id` | `number` | **Required**. Tag ID |\n\nResponse\n\n```\n{\n    \"status\": \"ok\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbredikhin%2Fsnippy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbredikhin%2Fsnippy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbredikhin%2Fsnippy/lists"}