{"id":22727208,"url":"https://github.com/fuwn/mayu","last_synced_at":"2025-04-23T14:20:34.867Z","repository":{"id":239713112,"uuid":"800337198","full_name":"Fuwn/mayu","owner":"Fuwn","description":"⭐ Moe-Counter Compatible Website Hit Counter Written in Gleam","archived":false,"fork":false,"pushed_at":"2025-03-17T04:27:29.000Z","size":24505,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-21T08:11:24.644Z","etag":null,"topics":["counter","functional","gleam","moe","moe-counter","website"],"latest_commit_sha":null,"homepage":"https://mayu.due.moe","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Fuwn.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}},"created_at":"2024-05-14T06:29:10.000Z","updated_at":"2025-04-18T17:34:45.000Z","dependencies_parsed_at":"2024-05-21T21:24:36.913Z","dependency_job_id":"5c73e6b8-0612-4f6c-9f94-b6a0d5ab5509","html_url":"https://github.com/Fuwn/mayu","commit_stats":null,"previous_names":["fuwn/mayu"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fuwn%2Fmayu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fuwn%2Fmayu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fuwn%2Fmayu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fuwn%2Fmayu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fuwn","download_url":"https://codeload.github.com/Fuwn/mayu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250447982,"owners_count":21432166,"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":["counter","functional","gleam","moe","moe-counter","website"],"created_at":"2024-12-10T17:11:05.979Z","updated_at":"2025-04-23T14:20:34.847Z","avatar_url":"https://github.com/Fuwn.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⭐ Mayu\n\n\u003e Moe-Counter Compatible Website Hit Counter\n\nMayu is a drop-in replacement for [Moe-Counter](https://github.com/journey-ad/Moe-Counter) designed\nto be lightweight and easy to use.\n\nMayu is written in [Gleam](https://gleam.run) and uses [SQLite](https://sqlite.org) as its database.\n\n\u003cbr\u003e\n\n\u003cimg src=\"https://mayu.due.moe/get/@demo\" width=\"50%\"\u003e\n\n\u003cimg src=\"https://mayu.due.moe/get/@demo?theme=urushi\" width=\"50%\"\u003e\n\n\u003cbr\u003e\n\nDon't know Gleam or functional paradigms? Take a look at the [source tree](./src) and see just how\neasy it is to understand! It's all contained in under 300 (294) liberally newline'd lines of code!\n\n## Usage\n\nMayu currently has nine available themes selectable using the `theme` query parameter of any `get` operation.\n\nE.g., [mayu.due.moe/get/@demo?theme=urushi](https://mayu.due.moe/get/@demo?theme=urushi)\n\n- `asoul`\n- `gelbooru-h` (NSFW)\n- `gelbooru`\n- `moebooru-h` (NSFW)\n- `moebooru`\n- `rule34` (NSFW)\n- `urushi`\n- `lain`\n- `garukura`\n\nMayu will pad the counter number with zeroes until it reaches a length of 6 characters. You can modify this behavior by changing the `padding` query parameter of any `get` operation.\n\n### Local\n\n```bash\n$ git clone git@github.com:Fuwn/mayu.git\n$ cd mayu\n$ gleam run\n$ # or\n$ nix run\n```\n\n### Docker\n\n```shell\ndocker run --volume 'mayu:/mayu/data/' -p '80:3000' --rm fuwn/mayu:latest\n```\n\nThis Docker command uses a named volume, `mayu`, which allows the Mayu's database to persist between container restarts.\n\n### Database\n\nMayu will use SQLite by default and will place the database file, `count.db`, within the `data/` directory of the project's root directory.\n\nMayu has the same default database layout as Moe-Counter, so if you've already used Moe-Counter previously, Mayu will work off of any previously accumulated counter data, so long as you transfer the database file over.\n\nMayu additionally adds two database columns: `created_at` and `updated_at`, which will not affect standard operations in any way, but will allow for additional data to be available should you perform a `record` operation.\n\n### Routes\n\n- `/heart-beat`: `alive`\n- `/get/@name`: An `image/xml+svg` counter, defaulting to theme `asoul`, modifiable using the `theme` query parameter\n- `/record/@name`: JSON object containing the database's `name`, `num`, `created_at`, and `updated_at` fields for counter `name`\n\n## Resource Attributions\n\n- [A-SOUL_Official](https://space.bilibili.com/703007996)\n- [Moebooru](https://github.com/moebooru/moebooru)\n- [Rule 34](https://rule34.xxx) (NSFW)\n- [Gelbooru](https://gelbooru.com) (NSFW)\n- [Urushi](https://x.com/udon0531/status/1350738347681959936)\n- [Lain Iwakura](https://x.com/lililjiliijili/status/869722811236929538)\n- [GaruKura](https://www.pixiv.net/artworks/119693017)\n\n## Licence\n\nThis project is licensed with the [GNU General Public License v3.0](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuwn%2Fmayu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuwn%2Fmayu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuwn%2Fmayu/lists"}