API

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 PRODUCER role
  • Static media at /storage/* and /audio/* (not under /api)

Health

MethodPathAuth
GET/health

API liveness check

Public
GET/health/ffmpeg

ffmpeg/ffprobe availability for audio processing

Public

Auth

MethodPathAuth
POST/api/auth/register

Register with email and password

Public
POST/api/auth/login

Login with email and password

Public
GET/api/auth/me

Current authenticated user

User
PUT/api/auth/profile

Update profile fields

User
POST/api/auth/forgot-password

Request password reset email

Public
POST/api/auth/reset-password

Reset password with token

Public
GET/api/auth/google

Start Google OAuth flow

Public
GET/api/auth/google/callback

Google OAuth callback

Public

Beats

MethodPathAuth
GET/api/beats

List beats with filters, search, pagination

Public
GET/api/beats/stats

Aggregate marketplace stats

Public
GET/api/beats/:slugOrId

Beat detail by slug or ID

Public
POST/api/beats

Create beat draft

Producer
POST/api/beats/upload

Upload beat files (audio + cover)

Producer
PUT/api/beats/:id

Update beat metadata

User
POST/api/beats/:id/publish

Publish beat

Producer
POST/api/beats/:id/like

Like beat

User
POST/api/beats/:id/favorite

Toggle favorite

User
GET/api/beats/:id/download

Download purchased or free beat

Public
DELETE/api/beats/:id

Delete beat

User

Users & producers

MethodPathAuth
GET/api/users/producers

List producers

Public
GET/api/users/:identifier

Public producer profile

Public
GET/api/users/:identifier/beats

Beats by producer

Public
PUT/api/users/me

Update account (avatar upload)

User
GET/api/users/me/beats

Current user beats

User
GET/api/users/me/favorites

Current user favorites

User
GET/api/users/me/analytics

Producer analytics

User
POST/api/users/:identifier/follow

Follow producer

User

Purchases

MethodPathAuth
GET/api/purchases/:purchaseId/download

Download purchased beat files

User
GET/api/users/me/purchases

Current user purchase history

User

Messages

MethodPathAuth
GET/api/messages/conversations

List conversations

User
GET/api/messages/conversations/:userId

Messages with a user

User
POST/api/messages/send

Send message

User
PUT/api/messages/:messageId/read

Mark message read

User
GET/api/messages/notifications

Notification feed

User

Comments

MethodPathAuth
GET/api/comments/beats/:beatId

Comments on a beat

Public
POST/api/comments/beats/:beatId

Post comment

User
DELETE/api/comments/:id

Delete comment

User

Admin

MethodPathAuth
GET/api/admin/stats

Platform statistics

Admin
GET/api/admin/users

List users

Admin
GET/api/admin/beats

List beats (moderation)

Admin
GET/api/admin/settings

Platform settings

Admin
PUT/api/admin/settings

Update platform settings

Admin