Implement the Actix web backend for shanty-web
#9
Notifications
Total Time Spent: 18 minutes
connor
18 minutes
No due date set.
Dependencies
No dependencies set.
Reference: Shanty/Main#9
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
shanty-webcrate is the Actix-web backend that ties all the other crates together and exposes a REST API for the Elm frontend. This is the "brain" of Shanty when used as a web application — it orchestrates indexing, tagging, downloading, and everything else through HTTP endpoints.This issue covers the backend API. The frontend (Elm) is a separate issue.
Core API endpoints:
Library / Watchlist
GET /api/artists— list all artists in the library (with filter/pagination)GET /api/artists/:id— get artist details including albums and watchlist statusPOST /api/artists— add an artist to the watchlistDELETE /api/artists/:id— remove an artist from the watchlistGET /api/albums— list all albums (with filter/pagination)GET /api/albums/:id— get album details including tracksPOST /api/albums— add an album to the watchlistGET /api/tracks— list all tracks (with filter/pagination)GET /api/tracks/:id— get track detailsSearch
GET /api/search/artist?q=<query>— search for artists onlineGET /api/search/album?q=<query>&artist=<artist>— search for albums onlineGET /api/search/track?q=<query>&artist=<artist>— search for tracks onlineGET /api/search/discography/:artist_id— get an artist's full discographyDownloads
POST /api/downloads— trigger a download (by query or URL)GET /api/downloads/queue— get the current download queuePOST /api/downloads/retry/:id— retry a failed downloadDELETE /api/downloads/:id— cancel/remove a downloadSystem
GET /api/status— system status (DB stats, queue length, currently running tasks)POST /api/index— trigger a library re-scanPOST /api/tag— trigger auto-tagging for untagged tracksGET /api/config— get current configurationPUT /api/config— update configurationBackground task system — long-running operations (indexing, tagging, bulk downloads) should run as background tasks. The API should:
GET /api/tasks/:idendpoint to check task progressConfiguration — the web app needs a configuration system:
Static file serving — serve the compiled Elm frontend from a static directory
Error handling — consistent JSON error responses with appropriate HTTP status codes
Design Considerations
actix-webas specified in the design doc.actix-rtfor spawning background tasks.Acceptance Criteria
Dependencies