Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Sitemap for current and future development #378

Open
jmarsh24 opened this issue Nov 19, 2024 · 2 comments
Open

Create Sitemap for current and future development #378

jmarsh24 opened this issue Nov 19, 2024 · 2 comments
Assignees
Labels

Comments

@jmarsh24
Copy link
Owner

The resource routing should be reviewed. In this task we should review the current routing, propose any changes/optomizations for the current routes and then also create routing for future core features.

@jmarsh24
Copy link
Owner Author

jmarsh24 commented Nov 19, 2024

Playback

  • Player
    • GET /player - Render the player interface.
  • Playback Controls
    • POST /playback/play - Start or resume playback.
    • POST /playback/pause - Pause playback.
    • POST /playback/next - Skip to the next track.
    • POST /playback/previous - Go back to the previous track.
    • POST /playback/volume - Adjust the volume (volume_level in payload).
    • POST /playback/mute - Mute the audio.
    • POST /playback/unmute - Unmute the audio.
    • POST /playback/shuffle - Toggle shuffle mode (enabled in payload).
    • POST /playback/repeat - Set repeat mode (mode in payload: off, track, all).
    • Context-Specific Playback
      • POST /playback/context - Load a recording and modify the queue based on its context.
        • Payload:
          • recording_id - The ID of the selected recording.
          • context - The source of the recording (search, library, playlist, tanda, orchestra, etc.).
          • context_id (optional) - The ID of the resource context (e.g., playlist ID, tanda ID, orchestra ID).
          • filters (optional) - Filters to apply to the queue (e.g., familiar, discover, same_mood).

Queue Management

  • Queue
    • GET /queue - View the current playback queue.
    • POST /queue/add - Add a type and id to the queue.
    • POST /queue/select -
    • POST /queue/clear - clear the queue.
    • QueueItem Navigation
      • PATCH /queue/queue_items/:id/reorder - Reorder the queue (position in payload).
      • GET /queue/queue_items/:id - Navigate inside a specific tanda in the queue.
      • POST /queue/queue_items/:id/like - Like/save a tanda from the queue.
      • DELETE /queue/queue_items/:id/dismiss - Dismiss a tanda from the queue.
    • Queue Filters
      • GET /queue/filter/familiar - Filter the queue to show familiar tracks.
      • GET /queue/filter/discover - Filter the queue to suggest new tracks.
      • GET /queue/filter/golden_age - Filter the queue for tracks with a similar mood.
      • GET /queue/filter/orchestra - Filter the queue for tracks from the same orchestra.
      • GET /queue/filter/period - Filter the queue for tracks from the same time period.
      • GET /queue/filter/main-stream - Filter the queue for tracks from the same time period.
      • GET /queue/filter/neuvo - Filter the queue for tracks from the same time period.
      • GET /queue/filter/(moods) - Filter the queue for tracks from the same time period.

Library Management

  • User Library
    • GET /library - Fetch the user's library (playlists, recordings, tandas). (filter by type, sort, order)
    • POST /library - Add a recording, playlist, or tanda to the library (item_id and item_type in payload).
    • DELETE /library/:id - Remove an item from the library by ID.
    • PATCH /library/reorder - Reorder items in the library (from_position and to_position in payload).
    • POST /library/pin - Pin an item to the top of the library (item_id in payload).
    • DELETE /library/pin/:id - Unpin an item by ID.

Content

  • Recordings
    • GET /recordings - Browse all available recordings.
    • GET /recordings/:id - View details for a specific recording by ID.
    • GET /recordings/:id/related - Fetch recordings related to a specific recording.
    • POST /recordings/:id/like - Like a recording.
    • DELETE /recordings/:id/like - Unlike a recording.
    • POST /recordings/:id/dismiss - Dismiss a recording. (What does it mean ?)
  • Playlists
    • GET /playlists - Browse all playlists.
    • GET /playlists/:id - View details for a specific playlist by ID.
    • GET /playlists/:id/related - Fetch playlists related to a specific playlist.
    • POST /playlists/:id - Add a playlist to the user's library.
    • POST /playlists/:id/recordings - Add a recording to a playlist (recording_id in payload).
    • DELETE /playlists/:playlist_id/recordings/:recording_id - Remove a recording from a playlist.
    • DELETE /playlists/:id - Delete a specific playlist by ID.
    • Suggestions
      • GET /playlists/:id/suggestions - Fetch suggestions when adding items to a playlist.
  • Tandas
    • GET /tandas - Browse all tandas.
    • GET /tandas/:id - View details for a specific tanda by ID.
    • GET /tandas/:id/related - Fetch tandas related to a specific tanda.
    • POST /tandas/:id - Add a tanda to the user's library.
    • POST /tandas/:id/recordings - Add a recording to a tanda (recording_id in payload).
    • DELETE /tandas/:tanda_id/recordings/:recording_id - Remove a recording from a tanda.
    • DELETE /tandas/:id - Delete a specific tanda by ID.
    • Suggestions
      • GET /tandas/:id/suggestions - Fetch suggestions when adding items to a tanda.
    • POST /tandas/:id/like - Like a tanda.
    • DELETE /tandas/:id/dismiss - Dismiss a tanda.
  • Orchestras
    • GET /orchestras - Browse all orchestras.
    • GET /orchestras/:id - View details for a specific orchestra by ID.
    • GET /orchestras/:id/recordings - View details for a specific orchestra recordings with filters/sort.
    • GET /orchestras/:id/related - Fetch orchestras or recordings related to a specific orchestra.
    • POST /orchestras/:orchestra_id/recordings - Add a recording from an orchestra to the queue or library.
  • Singers
    • GET /singers - Browse all orchestras.
    • GET /singers/:id - View details for a specific orchestra by ID.
    • GET /singers/:id - View details for a specific orchestra by ID.
    • GET /singers/:id/related - Fetch orchestras or recordings related to a specific orchestra.
    • POST /singers/:orchestra_id/recordings - Add a recording from an orchestra to the queue or library.

Search

  • Search
    • GET /search - Perform a search query for recordings, playlists, tandas, or orchestras (query parameter).

Recommendations

  • Discover
    • GET /discover - Fetch personalized recommendations for the user.
    • GET /discover/for_you - Fetch recommendations tailored to the user. (Same as above ?)
    • GET /discover/new_releases - Fetch new releases.
    • GET /discover/trending - Fetch trending content (recordings, playlists, tandas).

Social Features

  • Follow
    • POST /users/:id/follow - Follow another user by ID.
    • DELETE /users/:id/follow - Unfollow another user by ID.
  • User Playlists
    • GET /users/:id/playlists - Fetch public playlists created by a user.
  • User tandas
    • GET /users/:id/tandass - Fetch public tandas created by a user.
  • Sharing
    • POST /share - Share a recording, playlist, or tanda (item_id and item_type in payload).

User Management

  • Profile
    • GET /profile - View the user's profile.
    • PATCH /profile - Update profile information (name, avatar, etc.).
  • Preferences
    • GET /preferences - Fetch user preferences.
    • PATCH /preferences - Update user preferences (e.g., playback settings, privacy settings).

Notifications

  • Notifications
    • GET /notifications - View user notifications.
    • PATCH /notifications/:id - Mark a notification as read.
    • DELETE /notifications/:id - Delete a notification.

Admin (Optional for application management)

  • Content Management
    • POST /admin/recordings - Add a new recording.
    • PATCH /admin/recordings/:id - Update recording details.
    • DELETE /admin/recordings/:id - Remove a recording.
  • User Management
    • GET /admin/users - Fetch all users.
    • PATCH /admin/users/:id - Update user details or permissions.
    • DELETE /admin/users/:id - Remove a user.

Additional Features

  • Playback History
    • GET /history - View playback history.
    • DELETE /history/:id - Remove a specific item from playback history.

@jmarsh24
Copy link
Owner Author

Rails.application.routes.draw do
  # Playback
  resource :player, only: [:show]
  namespace :playback do
    post :play
    post :pause
    post :next
    post :previous
    post :volume
    post :mute
    post :unmute
    post :shuffle
    post :repeat
    post :context
  end

  # Queue Management
  resources :queue, only: [:show, :destroy] do
    collection do
      post :recordings
      post :playlists
      post :tandas
      patch :reorder
    end
    member do
      get :tandas
      post 'tandas/:id/like', to: 'queue#like_tanda'
      delete 'tandas/:id/dismiss', to: 'queue#dismiss_tanda'
    end
    namespace :filter do
      get :familiar
      get :discover
      get :same_mood
      get :same_orchestra
      get :same_period
    end
  end

  # Library Management
  resources :library, only: [:index, :create, :destroy] do
    collection do
      patch :reorder
      post :pin
    end
    member do
      delete :pin
    end
  end

  # Content
  resources :recordings, only: [:index, :show] do
    member do
      post :like
      delete :like
      post :dismiss
      get :related
    end
  end

  resources :playlists, only: [:index, :show, :create] do
    member do
      post :recordings
      delete 'recordings/:recording_id', to: 'playlists#remove_recording'
      get :related
      get :suggestions
    end
  end

  resources :tandas, only: [:index, :show, :create] do
    member do
      post :recordings
      delete 'recordings/:recording_id', to: 'tandas#remove_recording'
      get :related
      get :suggestions
      post :like
      delete :dismiss
    end
  end

  resources :orchestras, only: [:index, :show] do
    member do
      get :related
      post :recordings
    end
  end

  # Search
  namespace :search do
    get '/', to: 'search#index'
    get :recordings
    get :playlists
    get :tandas
    get :orchestras
  end

  # Recommendations
  namespace :discover do
    get '/', to: 'discover#index'
    get :new_releases
    get :trending
    get :for_you
  end

  # Social Features
  resources :users, only: [] do
    member do
      post :follow
      delete :follow
      get :playlists
    end
  end

  post :share, to: 'share#create'

  # User Management
  resource :profile, only: [:show, :update]
  resource :preferences, only: [:show, :update]

  # Notifications
  resources :notifications, only: [:index, :update, :destroy]

  # Admin
  namespace :admin do
    resources :recordings, only: [:create, :update, :destroy]
    resources :users, only: [:index, :update, :destroy]
  end

  # Additional Features
  resources :history, only: [:index, :destroy]
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants