CS467SynchronousCommunicationPlatform / frontend

https://frontend-self-tau.vercel.app
0 stars 0 forks source link

Websocket Functionality #14

Closed arbiosu closed 6 days ago

arbiosu commented 1 week ago

General channel websocket functionality:

  1. Decided to go with the socket.io-client library, comes with everything we need and react-use-websocket is not tested on the latest version of socket.io
  2. Slightly changed some of the components
    • redefined MessageProps to match with our messages table on the backend
    • renamed the original Chat.tsx to PreviousMessages.tsx, removed the dummy data - this now works with any realtime message and should work with messages we pull from Supabase
    • Updated ChatInput to accept ChatInputProps - these contain function handlers for onSubmit and onChange, as well as the default value for the input box. TODO: add 'placeholder' field so the input placeholder can be dynamic
    • Renamed the navigation bar components to match with other components
    • Renamed socket.tsx to Chat.tsx
  3. Will need to add a .env variable NEXT_PUBLIC_SOCKET_URL for this to build
vercel[bot] commented 1 week ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 8, 2024 1:27am