Local‑first Discogs collection viewer written in PHP 8.4. Imports your collection into SQLite, caches cover images to disk, and serves a fast Twig UI with powerful full‑text search and optional release enrichment. All browsing is from your local DB + images — no live API calls while you use the app.
• Personal use. If you self‑host publicly, respect Discogs ToU: refresh ≤6h and show attribution (“Data provided by Discogs.” + link/trademark).
- Local‑first: SQLite database + cached images (no API calls during normal browsing)
- Discogs‑aware HTTP client: header‑driven rate limiting + robust retries
- Initial sync and incremental refresh of your Collection and Wantlist
- Optional enrichment with full release details (tracklist, credits, companies, identifiers, notes, videos) and personal metadata (ratings, conditions, notes)
- Sync personal data: push your ratings, conditions, and notes back to Discogs or keep them locally
- Image cache with 1 req/sec throttle and 1000/day cap (persisted)
- Search anything (SQLite FTS5) with field prefixes and year ranges
- Sorting: Added date (default), Year, Artist, Title, Rating
- Clean, responsive UI with a lightbox gallery and sticky header
- Smart Collections: save your searches as sidebar shortcuts
- Statistics: visualization of your collection by artist, genre, decade, and format
- Randomizer: "Surprise Me" button to pick a random release from your collection
- Live Discogs Search: find and add releases directly to your collection or wantlist from the web UI
- AI-Powered Recommendations: get personalized recommendations for artists and releases based on what's in your collection (powered by Anthropic Claude)
- Static Site Generator: export your collection as a standalone, portable web app
- Apple Music Integration: listen to releases directly in the app (requires barcodes and an Apple Music Developer Token)
- PHP 8.4 (Herd recommended)
- Composer
- A Discogs account with a personal access token.
- To get a token: Go to Discogs Developer Settings, click "Generate new token", and copy the result.
- Copy
.env.exampleto.envand fill values (including your Discogs credentials):
USER_AGENT="MyDiscogsApp/0.1 (+contact: you@example.com)"
DB_PATH=var/app.db
IMG_DIR=public/images
APP_ENV=dev
APP_DEBUG=1
# Discogs Credentials
DISCOGS_USERNAME=your_username
DISCOGS_TOKEN=your_personal_access_token
# AI Recommendations (Optional)
ANTHROPIC_API_KEY=your_anthropic_api_key
- Install dependencies
composer install
- Run the web app
php -S 127.0.0.1:8000 -t public
- Initial sync (creates DB and imports your collection and wantlist)
Option A: Web Interface (Recommended)
- Navigate to http://127.0.0.1:8000/tools
- Click "Run initial sync" and watch the progress in real-time
Option B: Command Line
php bin/console sync:initial
Important: If the database already contains data, sync:initial refuses to run unless you pass --force. For ongoing usage, prefer:
php bin/console sync:refresh
This preserves any enriched details and updates basic fields for both collection and wantlist incrementally.
- Optional: enrich releases with full details
php bin/console sync:enrich --limit=100
# or a specific release
php bin/console sync:enrich --id=123456
- Optional: download missing cover images (respects 1 rps, 1000/day)
php bin/console images:backfill --limit=200
- Optional: incremental refresh (new/changed since last run)
php bin/console sync:refresh --pages=5
# override the since cursor
php bin/console sync:refresh --since=2024-01-01T00:00:00Z
- Optional: rebuild search index (maintenance)
php bin/console search:rebuild
All console commands can be run from a web-based interface with real-time progress indicators:
-
Access: Navigate to
/toolsor click "Tools" in the navigation menu -
Features:
- Execute all console commands from your browser
- Real-time output streaming as commands run
- Progress indicators showing status and line counts
- Two-column responsive layout for easy access
- No need to use the terminal
-
Available Tools:
- Initial Sync - Import your entire collection
- Refresh - Incremental sync of new/changed items
- Enrich - Fetch full release details
- Backfill Images - Download cover images
- Rebuild Search Index - Maintain search functionality
- Push Changes - Sync local edits to Discogs
- Export Static Site - Generate standalone HTML
For detailed documentation, see docs/web-console-commands.md
The application features a powerful search engine powered by SQLite FTS5 for local browsing and direct integration with the Discogs API for live searches.
Simply type your search terms into the search bar. This performs a full-text search across multiple fields including Artist, Title, Labels, Formats, Tracklist, Credits, and Notes.
miles davis kind of blue"duran duran"(use double quotes for exact phrases)
You can target specific fields using prefixes. These work for both local and live Discogs searches.
| Prefix | Description | Example |
|---|---|---|
artist: |
Primary artist name | artist:devo |
title: |
Release or Master title | title:"freedom of choice" |
year: |
Release year or range | year:1980 or year:1980..1985 |
genre: |
Genre (e.g., Jazz, Rock) | genre:electronic |
style: |
Style (e.g., Techno, New Wave) | style:"synth-pop" |
label: |
Label name or Catalog Number | label:mute |
format: |
Media format | format:vinyl |
country: |
Country of release | country:japan |
barcode: |
Barcode or other identifier | barcode:0602527 |
master: |
Discogs Master Release ID | master:48969 |
type: |
Result type (Discogs only) | type:master or type:release |
notes: |
Search in release and personal notes | notes:"first press" |
discogs: |
Flag for Live Discogs Search | discogs: artist:devo |
Specify a range of years using the .. syntax:
year:1977..1980— Matches any release from 1977 through 1980.
To search the live Discogs database instead of your local collection, start your query with discogs:.
discogs: artist:devo type:master— Finds Master releases by Devo on Discogs.- Once you find a release you want, you can add it to your Collection or Wantlist directly from the search results.
If you don't want to remember the prefixes, click the "Advanced" toggle next to the search bar. This opens a visual builder where you can:
- Select a field from the dropdown.
- Enter the value (or year range).
- Click (+) to add it to your query.
Any search query can be saved as a Smart Collection.
- Perform your search (e.g.,
genre:jazz year:1950..1960 format:vinyl). - Click the "Save Search" button in the sidebar.
- Your search will now appear as a permanent shortcut in the sidebar, updating automatically as you add new releases to your collection.
The application uses Anthropic's Claude AI to provide personalized recommendations.
- Setup: Add your
ANTHROPIC_API_KEYto the.envfile. - Personalized Context: Claude looks at your top 5 artists and top 5 genres to understand your taste.
- Discovery: On any release page, click the "Recommendations" tab.
- Results: The AI suggests 5 similar artists or releases. Each recommendation includes a "Live Search" link to help you find it on Discogs immediately.
- Caching: Recommendations are cached locally for 30 days to save on API usage.
The application can embed an Apple Music player on release pages by matching the release's barcode (UPC).
- Setup: Add your
APPLE_MUSIC_DEVELOPER_TOKENto the.envfile.- This must be a valid JSON Web Token (JWT) signed with your Apple Music private key.
- Enrichment: Ensure your releases are enriched. The integration relies on barcodes, which are fetched during the enrichment process.
- Run
php bin/console sync:enrich --limit=100to fetch details for your releases.
- Run
- Usage: Open any release page and click the "Tracks" tab. If a matching album is found on Apple Music, the player will appear automatically below the tracklist.
- Caching: Matches are stored in your local database to ensure the player loads instantly on subsequent visits.
- Default: Added (newest first)
- Also: Year (newest/oldest), Artist (A→Z/Z→A), Title (A→Z/Z→A), Rating (high→low/low→high)
- Full synchronization: You can edit a release's rating, media/sleeve condition, and personal notes directly in the web app.
- Pushing to Discogs: Changes are enqueued and can be synced back to your Discogs account by running
php bin/console sync:push. - Local storage: All your personal metadata is stored in your local SQLite database and is fully searchable.
- Refreshing: You can pull the latest values from Discogs at any time using
php bin/console sync:refresh.
All commands below can be run from the command line or from the Web Console Interface at /tools:
php bin/console sync:initial— initial import of collection and wantlistphp bin/console sync:refresh [--pages=N | --since=ISO8601]— incremental refreshphp bin/console sync:enrich [--limit=N | --id=RELEASE_ID]— full detailsphp bin/console images:backfill [--limit=N]— download covers to local cachephp bin/console search:rebuild— rebuild FTS indexphp bin/console sync:push— push queued rating/note/collection changes to Discogsphp bin/console export:static [--out=dist] [--base-url=/] [--copy-images] [--chunk-size=N]— generate a static site of your collection
For detailed command documentation:
- CLI usage and safety notes: docs/console-commands.md
- Web interface usage: docs/web-console-commands.md
- Where are images stored?
- public/images/<release_id>/.jpg. The UI prefers local files and falls back to Discogs URLs.
- Where do my personal notes show up on Discogs?
- Once you run
sync:push, your personal notes, ratings, and conditions are updated on your Discogs Collection/Wantlist. They will appear in your private notes field on the Discogs website.
- Once you run
- Empty home page after setup? Ensure both CLI and web use the same DB path (
var/app.db) and that you have configured your Discogs credentials in.env, then runsync:initial. - Images not local? Run
images:backfilland refresh the page. - Missing notes/credits? Run
sync:enrich; it targets releases that have not yet been enriched. - Search feels off? Run
search:rebuildto repopulate the FTS index.
Data provided by Discogs. Discogs® is a trademark of Zink Media, LLC. If you deploy publicly, refresh data at most every 6 hours and include visible attribution.
MIT