{"id":21714335,"url":"https://github.com/somespecialone/likes-counter","last_synced_at":"2025-07-18T15:32:23.167Z","repository":{"id":193029273,"uuid":"687427840","full_name":"somespecialone/likes-counter","owner":"somespecialone","description":"💜 An easy-to-integrate like counter for your website","archived":false,"fork":false,"pushed_at":"2023-12-21T11:20:06.000Z","size":575,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-07-30T18:05:08.577Z","etag":null,"topics":["deta","nitro","serverless","typescript","vitest","web"],"latest_commit_sha":null,"homepage":"https://somespecialone.github.io/likes-counter/","language":"TypeScript","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/somespecialone.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}},"created_at":"2023-09-05T10:41:15.000Z","updated_at":"2023-10-27T14:49:41.000Z","dependencies_parsed_at":"2023-12-21T13:12:52.886Z","dependency_job_id":null,"html_url":"https://github.com/somespecialone/likes-counter","commit_stats":null,"previous_names":["somespecialone/likes-counter"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somespecialone%2Flikes-counter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somespecialone%2Flikes-counter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somespecialone%2Flikes-counter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somespecialone%2Flikes-counter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/somespecialone","download_url":"https://codeload.github.com/somespecialone/likes-counter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226423056,"owners_count":17622610,"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":["deta","nitro","serverless","typescript","vitest","web"],"created_at":"2024-11-26T00:34:19.382Z","updated_at":"2024-11-26T00:34:20.055Z","avatar_url":"https://github.com/somespecialone.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Likes Counter\n\n[![Likes](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Flc.somespecial.one%2Fdemo-page%3A%3A10%2Fdemo-user-id\u0026query=%24.totalLikes\u0026label=%E2%9D%A4%EF%B8%8F)](https://lc.somespecial.one)\n[![Views](https://vc.somespecial.one/likes-counter-repo/badge?label=++%F0%9F%91%80\u0026color=red)](https://github.com/somespecialone/views-counter)\n[![Made in Ukraine](https://img.shields.io/badge/made_in-ukraine-ffd700.svg?labelColor=0057b7)](https://stand-with-ukraine.pp.ua)\n[![license](https://img.shields.io/github/license/somespecialone/likes-counter)](https://github.com/somespecialone/likes-counter/blob/master/LICENSE)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat)](https://github.com/prettier/prettier)\n[![Test](https://github.com/somespecialone/likes-counter/actions/workflows/test.yml/badge.svg)](https://github.com/somespecialone/likes-counter/actions/workflows/tests.yml)\n[![Deploy](https://github.com/somespecialone/likes-counter/actions/workflows/deploy.yml/badge.svg)](https://github.com/somespecialone/likes-counter/actions/workflows/deploy.yml)\n[![Demo](https://github.com/somespecialone/likes-counter/actions/workflows/demo.yml/badge.svg)](https://github.com/somespecialone/likes-counter/actions/workflows/demo.yml)\n[![codecov](https://codecov.io/gh/somespecialone/likes-counter/graph/badge.svg?token=4NXSdyL5wc)](https://codecov.io/gh/somespecialone/likes-counter)\n\nAn easy-to-integrate like counter for your website.\n\n[![Install on Space](https://deta.space/buttons/light.svg)](https://deta.space/discovery/@somespecialone/likescounter)\n\n\u003e [!NOTE]\n\u003e Try demo **[here](https://somespecialone.github.io/likes-counter)**. Also look\n\u003e at the singling [views-counter](https://github.com/somespecialone/views-counter)\n\u003e\n\u003e API of the app is available at address: https://lc.somespecial.one.\n\u003e But please, if you tend to use it heavily, consider to installing the app on `Deta Space` by yourself with button above!\n\n## How to use\n\nApp exposes json API routes.\n\n### Generate route\n\nGenerate unique user id, if you don't want ot make it by yourself on client side.\n\nHave `len` query param - length of generated id. Default `len` value is 10.\n\n\u003e GET `/generate`\n\n```json\n{\n  \"id\": \"generated id\"\n}\n```\n\n### Like routes\n\n* `slug` - unique key for page/post/etc.\n* `userId` - unique user id. Can be generated in `/generate` route.\n\n\u003e GET `:slug/:userId`\n\n```json\n{\n  \"userLikes\": 0,\n  \"totalLikes\": 0\n}\n```\n\n\u003e POST `:slug/:userId`\n\nPayload (body) must be JSON and contain `count` field. For example:\n\n```json\n{\n  \"count\": 1\n}\n```\n\nResponse is `null`\n\n### Maximum likes number\n\nBy default, the maximum number of the likes is limited to 1.\nTo set your own option you can add `::{your max likes number}` postfix to `slug`.\nFor example `super-unique-slug::10` will set max number to 10 for the current route.\n\nApp can use `NITRO_DEF_MAX_LIKES_COUNT` env variable to set default number, [know more](#deployment-)\n\n## Deployment ⚒️\n\n### Deta Space 🚀🌌\nYou can install app on `Deta Space` with button above.\n\n### Providers\n\nIf this is not an option for you, application code can be built for these [providers](https://nitro.unjs.io/deploy), so\njust clone the repo and use your provider.\n\n### Env variables\n\nApp use `Deta Base` for database, so `DETA_PROJECT_KEY` or `NITRO_DETA_PROJECT_KEY` are required.\n\n* `DETA_PROJECT_KEY`/`NITRO_DETA_PROJECT_KEY` - deta project key, required if app installed not in `Deta Space`. Read\n  more [there](https://deta.space/docs/en/use/your-data/collections#data-keys)\n* `NITRO_DEF_MAX_LIKES_COUNT` - max number of likes. Default 1\n* `NITRO_DEF_ID_LENGTH` - length of generated id. Default 10\n* `NITRO_ALLOW_ORIGIN` - allow origin header. Default *\n\n## Tests 🧪\n\nClone repo and run `test` script with your package manager or\n\n```sh\nvitest\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsomespecialone%2Flikes-counter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsomespecialone%2Flikes-counter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsomespecialone%2Flikes-counter/lists"}