Skip to content

Enhance Spotofy project documentation, user authentication, and room management - #17

Merged
Nil2000 merged 20 commits into
developfrom
feat/improvements
Jun 14, 2026
Merged

Nil2000 merged 20 commits into
developfrom
feat/improvements

Conversation

@Nil2000

@Nil2000 Nil2000 commented Jun 14, 2026

Copy link
Copy Markdown
Owner

No description provided.

Nil2000 added 20 commits May 30, 2026 19:31
…tecture

- Expanded AGENTS.md to provide detailed guidance on the Spotofy app, including project structure, tech stack, and environment variables.
- Revised README.md to introduce Spotofy, explain its functionality, and outline the architecture, including components and their interactions.
- Added prerequisites and local setup instructions for running the application.
- Updated the import path for route types in next-env.d.ts.
- Added a Sign Out button in the LandingPage component to allow user logout.
- Modified SpotifyPlaybackState to include previous_tracks for better playback tracking.
- Refactored SpotifyWebPlayer to streamline state management and improve track end detection logic.
- Consolidated useEffect hooks for better performance and clarity.
- Renamed CLIENT_TO_SERVER_MESSAGE_TYPES and SERVER_TO_CLIENT_MESSAGE_TYPES to ClientEvents and ServerEvents for improved clarity and consistency.
- Updated all references to the new message type constants across the room-server and web components.
- Enhanced message structure to follow a more descriptive naming convention, aligning with event-driven architecture.
- Introduced `admitUserToRoom` function to streamline user admission process, including sending relevant updates to the user and broadcasting room status.
- Added `notifyPendingUsersOnAdminJoin` function to automatically admit users if auto-approval is enabled, or notify them when the admin joins.
- Updated `Room` class to include a method for retrieving pending user requests.
- Enhanced join status messages in the web component to provide clearer feedback to users regarding their entry status.
- Adjusted WebSocket handling to update join states based on admin presence.
- Updated `requestSong` method in the Room class to check for duplicate song requests and return an appropriate error message.
- Modified the Song model to include a new `songId` field for better identification of songs.
- Adjusted the request song section in the web component to accommodate the new `songId` field.
- Added a new WebSocket event documentation to clarify the flow of song requests and responses.
- Implemented database migration to backfill existing songs with their corresponding Spotify track IDs.
- Introduced new server events for user and upvote limits: ROOM_USER_LIMIT_REACHED, ROOM_UPVOTE_LIMIT_REACHED, and USER_UPVOTES_USAGE.
- Enhanced the Room class with methods to check user capacity and track upvote usage.
- Updated admission logic to handle cases when user or upvote limits are reached, sending appropriate messages to clients.
- Modified web components to display upvote usage and room capacity status, providing clearer feedback to users.
- Adjusted WebSocket handling to manage new event types and update state accordingly.
- Added a new event `SONG_REQUEST_SUBMITTED` to the ServerEvents for better tracking of song requests.
- Updated the `requestSong` method in the Room class to include the requesting user's ID.
- Modified the `rejectSong` method to return detailed information about rejected songs, including the requester.
- Enhanced WebSocket handling to notify users when their song requests are submitted and provide feedback on approval or rejection.
- Updated message schemas to accommodate new event types and payload structures.
- Removed the queue property from the payload in user admission and join messages for simplification.
- Enhanced the user rejection message to include the room ID and a descriptive message for better user feedback.
- Updated message schemas to reflect the changes in payload structure for user admission and rejection events.
- Replaced `playCurrentSong` method with `getCurrentSong` in the Room class for clearer intent and improved functionality.
- Introduced `sendPendingListToAdmin` function to synchronize pending user requests with the admin.
- Updated WebSocket handling to ensure the current song is broadcasted correctly and playback starts when necessary.
- Enhanced client components to support new player readiness events and improved state management for song requests.
- Introduced a new event `PENDING_SONG_REQUESTS` to notify clients of songs awaiting admin approval.
- Enhanced the `handleJoinRoom` function to send a backlog of pending song requests to users upon joining.
- Updated message schemas to include the new `PendingSongRequestsMessage` type for better structure and validation.
- Improved error handling for users attempting actions before joining a room, providing clearer feedback.
- Adjusted WebSocket handling to manage new event types and ensure seamless communication regarding song requests.
- Introduced repeat mode handling in the SpotifyWebPlayer component, allowing users to toggle between repeat states (off, track, context).
- Updated state management to track the current repeat mode and reflect changes in the UI.
- Improved error handling for repeat mode updates and adjusted button styles based on repeat state.
- Refactored related functions to streamline repeat mode logic and enhance overall player experience.
…r component

- Removed the sign-out button from the LandingPage component.
- Integrated sign-out functionality into the Navbar component, utilizing the useSession hook to conditionally render the button based on user session state.
- Enhanced sign-out process to redirect users to the homepage upon successful sign-out.
- Introduced queue locking mechanism to prevent race conditions during song requests and promotions.
- Updated `requestSong` method to utilize transactions for better integrity and to prevent duplicate song requests.
- Enhanced `promoteNextIfIdle` method to manage song promotion more effectively, ensuring the next song is played when the current one is idle.
- Adjusted WebSocket event handling to reflect changes in song promotion and playback status.
- Updated metadata in the web app to better describe the application functionality.
- Updated user permission checks to validate admin status based on user ID instead of a boolean flag.
- Enhanced error handling in user rejection and approval functions to provide clearer feedback when the room is not found or the user is not an admin.
- Improved session handling in the proxy function to include callback URLs for login redirection.
- Added WS_SECRET to .env.example for WebSocket authentication.
- Introduced token-based authentication for WebSocket connections, enhancing security.
- Updated connection handling to verify user authorization before allowing access to rooms.
- Refactored join room logic to ensure proper user validation and error handling.
- Enhanced user payload resolution to include user details and admin status.
- Improved WebSocket event handling to manage user connections and disconnections more effectively.
- Replaced direct session retrieval with a centralized `requireSession` function across multiple API routes to streamline authentication.
- Improved error handling for unauthorized access by returning consistent response structures.
- Updated related API routes to ensure proper session validation before processing requests.
@Nil2000
Nil2000 merged commit 624fcf2 into develop Jun 14, 2026
12 checks passed
@Nil2000
Nil2000 deleted the feat/improvements branch November 3, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant