aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-05-14 15:15:28 -0700
committerGitHub <[email protected]>2024-05-14 15:15:28 -0700
commitd686a39bd5a0474f4a6c122e1ec54300cf0b4f7f (patch)
tree44e28d801c691aa7c5b5893ef411773e2917bed2 /README.md
parentb6f4669007c371321b59da8ef56ecc243b56e13c (diff)
downloadmayu-d686a39bd5a0474f4a6c122e1ec54300cf0b4f7f.tar.xz
mayu-d686a39bd5a0474f4a6c122e1ec54300cf0b4f7f.zip
docs(readme): usage and database information
Diffstat (limited to 'README.md')
-rw-r--r--README.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/README.md b/README.md
index 95cd841..6de6c07 100644
--- a/README.md
+++ b/README.md
@@ -15,6 +15,18 @@ Mayu is written in [Gleam](https://gleam.run) and uses [SQLite](https://sqlite.o
## Usage
+Mayu currently has seven available themes selectable using the `theme` query parameter of any `get` operation.
+
+E.g., [counter.due.moe/get/@demo?theme=urushi](https://counter.due.moe/get/@demo?theme=urushi)
+
+- `asoul`
+- `gelbooru-h` (NSFW)
+- `gelbooru`
+- `moebooru-h` (NSFW)
+- `moebooru`
+- `rule34` (NSFW)
+- `urushi`.
+
### Local
```bash
@@ -29,10 +41,22 @@ $ gleam run
docker run --volume 'mayu:/mayu/data/' -p '80:3000' --rm fuwn/mayu:latest
```
+This Docker command uses a named volume, `mayu`, which allows the Mayu's database to persist between container restarts.
+
### Database
Mayu will use SQLite by default and will place the database file, `count.db`, within the `data/` directory of the project's root directory.
+Mayu 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.
+
+Mayu 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.
+
+### Routes
+
+- `/heart-beat`: `alive`
+- `/get/@name`: An `image/xml+svg` counter, defaulting to theme `asoul`, modifiable using the `theme` query parameter
+- `/record/@name`: JSON object containing the database's `name`, `num`, `created_at`, and `updated_at` fields for counter `name`
+
## Resource Attributions
- [A-SOUL_Official](https://space.bilibili.com/703007996)