{"id":48999920,"url":"https://github.com/mtmn/corpus","last_synced_at":"2026-05-23T23:07:48.584Z","repository":{"id":352253788,"uuid":"1214450911","full_name":"mtmn/corpus","owner":"mtmn","description":"self-hosted listenbrainz and last.fm proxy","archived":false,"fork":false,"pushed_at":"2026-04-30T21:21:46.000Z","size":1129,"stargazers_count":24,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-30T23:13:21.667Z","etag":null,"topics":["duckdb","elm","lastfm","listenbrainz","purescript"],"latest_commit_sha":null,"homepage":"https://scrobbler.mtmn.name","language":"PureScript","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/mtmn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-18T15:41:42.000Z","updated_at":"2026-04-30T21:21:41.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mtmn/corpus","commit_stats":null,"previous_names":["mtmn/corpus"],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/mtmn/corpus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtmn%2Fcorpus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtmn%2Fcorpus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtmn%2Fcorpus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtmn%2Fcorpus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mtmn","download_url":"https://codeload.github.com/mtmn/corpus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtmn%2Fcorpus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32518744,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":["duckdb","elm","lastfm","listenbrainz","purescript"],"created_at":"2026-04-18T18:02:44.880Z","updated_at":"2026-05-23T23:07:48.563Z","avatar_url":"https://github.com/mtmn.png","language":"PureScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# corpus\nA self-hosted [ListenBrainz](https://listenbrainz.org) and [Last.fm](https://last.fm) frontend that stores metadata and cover images.\n\nIt stores scrobbles, enriches track metadata and provides an interactive [Elm](https://elm-lang.org) interface.\n\n[![built with garnix](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fgarnix.io%2Fapi%2Fbadges%2Fmtmn%2Fcorpus%3Fbranch%3Dmaster)](https://garnix.io/repo/mtmn/corpus)\n\n## Documentation\n\n- [Architecture](docs/architecture.md) — Deep dive into the system components, data flow, and FFI usage.\n- [DuckDB](docs/duckdb.md) — Schema details, analytical queries, and tools for data exploration.\n\n## Usage\n\nThis project uses [just](https://github.com/casey/just) and [Nix](https://nixos.org) for development and deployment.\n\n### Development\n\n```bash\n# Enter the development shell\njust shell\n\n# Build\njust nix build\n\n# Run the binary built by Nix\njust nix run\n```\n\n### Build\n\nThis project uses [pnpm](https://pnpm.io) for dependency management.\n\n```bash\n# Install dependencies\npnpm install\npnpm spago install\n\n# Build the project\npnpm run build\n\n# Run tests\npnpm test\n\n# Build an optimized release\npnpm run release\n\n# Run the application\npnpm spago run\n```\n\n### Scrobbling API\n\nCorpus provides a [ListenBrainz-compatible](https://listenbrainz.readthedocs.io/en/latest) endpoint for submitting scrobbles directly. This allows you to use any scrobbler that supports custom ListenBrainz endpoints.\n\n#### Endpoint\n\n`POST /1/submit-listens`\n\n#### Authentication\n\nThe API uses token-based authentication. A unique API token is automatically generated for each user when they first start the application. You can find your token in the server logs on startup:\n\n```text\n[INFO] User 'mtmn' token: 550e8400-e29b-41d4-a716-446655440000\n```\n\nInclude the token in the `Authorization` header of your requests:\n\n```text\nAuthorization: Token \u003cyour-token\u003e\n```\n\n#### Payload Format\n\nThe endpoint accepts standard ListenBrainz JSON payloads. See the [ListenBrainz API documentation](https://listenbrainz.readthedocs.io/en/latest/users/api/core.html#post--1-submit-listens) for details.\n\n### Environment variables\n\n| Variable | Default | Description |\n| :--- | :--- | :--- |\n| `CORPUS_USERS_FILE` | `users.json` | Path to the multi-user config file |\n| `DATABASE_PATH` | _(cwd)_ | Root directory for all user database files |\n| `PORT` | `8000` | HTTP port to listen on |\n| `LASTFM_API_KEY` | — | Last.fm API key (required when any user has `lastfmUser` set; also used for genre and cover art fallback) |\n| `DISCOGS_TOKEN` | — | Discogs token for cover art and genre fallback |\n| `S3_BUCKET` | — | S3 bucket name for cover art caching and backups |\n| `S3_REGION` | `us-east-1` | S3 region |\n| `AWS_ACCESS_KEY_ID` | — | S3 credentials |\n| `AWS_SECRET_ACCESS_KEY` | — | S3 credentials |\n| `AWS_ENDPOINT_URL` | — | S3-compatible endpoint (e.g. for MinIO) |\n| `AWS_S3_ADDRESSING_STYLE` | — | Set to `path` for path-style S3 URLs |\n| `COSINE_API_KEY` | — | [cosine.club](https://cosine.club) API key for similar tracks |\n| `METRICS_ENABLED` | `false` | Set to `true` to expose Prometheus metrics at `/metrics` |\n| `CORS_ORIGIN` | `*` | Value for the `Access-Control-Allow-Origin` header on `/proxy` responses (e.g. `https://mtmn.name`) |\n\n### Per-user configuration\n\n| Field | Default | Description |\n| :--- | :--- | :--- |\n| `slug` | — | URL slug (`\"\"` for root user, `\"filip\"` for `/u/filip`) |\n| `name` | — | Display name for the user (defaults to slug if not provided) |\n| `listenbrainzUser` | — | ListenBrainz username to sync scrobbles from |\n| `lastfmUser` | — | Last.fm username to sync scrobbles from |\n| `databaseFile` | `corpus.db` | Path to the user's DuckDB database file |\n| `coverCacheEnabled` | `true` | Enable cover art caching to S3 |\n| `backupEnabled` | `false` | Enable database backups to S3 |\n| `backupIntervalHours` | `24` | Backup frequency in hours |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtmn%2Fcorpus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmtmn%2Fcorpus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtmn%2Fcorpus/lists"}