API routes
REST endpoints are defined in api/src/routes/ and mounted under /api. On Vercel, the frontend calls same-origin paths; locally, Nuxt devProxy forwards to the Express server.
Conventions
- JSON request/response bodies
- Auth via
Authorization: Bearer <jwt> - Errors return JSON with appropriate HTTP status codes
- Producer-only routes require
PRODUCERrole - Static media at
/storage/*and/audio/*(not under/api)
Health
| Method | Path | Description | Auth |
|---|---|---|---|
| GET | /healthAPI liveness check | API liveness check | Public |
| GET | /health/ffmpegffmpeg/ffprobe availability for audio processing | ffmpeg/ffprobe availability for audio processing | Public |
Auth
| Method | Path | Description | Auth |
|---|---|---|---|
| POST | /api/auth/registerRegister with email and password | Register with email and password | Public |
| POST | /api/auth/loginLogin with email and password | Login with email and password | Public |
| GET | /api/auth/meCurrent authenticated user | Current authenticated user | User |
| PUT | /api/auth/profileUpdate profile fields | Update profile fields | User |
| POST | /api/auth/forgot-passwordRequest password reset email | Request password reset email | Public |
| POST | /api/auth/reset-passwordReset password with token | Reset password with token | Public |
| GET | /api/auth/googleStart Google OAuth flow | Start Google OAuth flow | Public |
| GET | /api/auth/google/callbackGoogle OAuth callback | Google OAuth callback | Public |
Beats
| Method | Path | Description | Auth |
|---|---|---|---|
| GET | /api/beatsList beats with filters, search, pagination | List beats with filters, search, pagination | Public |
| GET | /api/beats/statsAggregate marketplace stats | Aggregate marketplace stats | Public |
| GET | /api/beats/:slugOrIdBeat detail by slug or ID | Beat detail by slug or ID | Public |
| POST | /api/beatsCreate beat draft | Create beat draft | Producer |
| POST | /api/beats/uploadUpload beat files (audio + cover) | Upload beat files (audio + cover) | Producer |
| PUT | /api/beats/:idUpdate beat metadata | Update beat metadata | User |
| POST | /api/beats/:id/publishPublish beat | Publish beat | Producer |
| POST | /api/beats/:id/likeLike beat | Like beat | User |
| POST | /api/beats/:id/favoriteToggle favorite | Toggle favorite | User |
| GET | /api/beats/:id/downloadDownload purchased or free beat | Download purchased or free beat | Public |
| DELETE | /api/beats/:idDelete beat | Delete beat | User |
Users & producers
| Method | Path | Description | Auth |
|---|---|---|---|
| GET | /api/users/producersList producers | List producers | Public |
| GET | /api/users/:identifierPublic producer profile | Public producer profile | Public |
| GET | /api/users/:identifier/beatsBeats by producer | Beats by producer | Public |
| PUT | /api/users/meUpdate account (avatar upload) | Update account (avatar upload) | User |
| GET | /api/users/me/beatsCurrent user beats | Current user beats | User |
| GET | /api/users/me/favoritesCurrent user favorites | Current user favorites | User |
| GET | /api/users/me/analyticsProducer analytics | Producer analytics | User |
| POST | /api/users/:identifier/followFollow producer | Follow producer | User |
Purchases
| Method | Path | Description | Auth |
|---|---|---|---|
| GET | /api/purchases/:purchaseId/downloadDownload purchased beat files | Download purchased beat files | User |
| GET | /api/users/me/purchasesCurrent user purchase history | Current user purchase history | User |
Messages
| Method | Path | Description | Auth |
|---|---|---|---|
| GET | /api/messages/conversationsList conversations | List conversations | User |
| GET | /api/messages/conversations/:userIdMessages with a user | Messages with a user | User |
| POST | /api/messages/sendSend message | Send message | User |
| PUT | /api/messages/:messageId/readMark message read | Mark message read | User |
| GET | /api/messages/notificationsNotification feed | Notification feed | User |
Admin
| Method | Path | Description | Auth |
|---|---|---|---|
| GET | /api/admin/statsPlatform statistics | Platform statistics | Admin |
| GET | /api/admin/usersList users | List users | Admin |
| GET | /api/admin/beatsList beats (moderation) | List beats (moderation) | Admin |
| GET | /api/admin/settingsPlatform settings | Platform settings | Admin |
| PUT | /api/admin/settingsUpdate platform settings | Update platform settings | Admin |
Comments
/api/comments/beats/:beatIdComments on a beat
/api/comments/beats/:beatIdPost comment
/api/comments/:idDelete comment