Migration to Actix for the Party Manager #1

Closed
opened 2023-06-23 06:52:49 -05:00 by Snoupix · 0 comments
Snoupix commented 2023-06-23 06:52:49 -05:00 (Migrated from github.com)

Websockets in Remix

The problem

The only way I could add a Websocket endpoint to my app, was to add an Express route to handle it. But since my whole app, thus my Party manager, is in Remix, I couldn't use WS with express to communicate with my Party manager and my clients.

The solution

Aside of this project, I was creating my own REST API in Rust with Actix. So I will add a GraphQL (Juniper) endpoint for my Party manager to it.
And, since they have a Websocket feature, I think I'm gonna migrate all the back-end of my Remix app to Actix and keep the Express server for SSR and probably Cookie management.

Progress

  • Move the whole Party manager class to Rust
  • Create a GraphQL endpoint
  • Create a GraphQL schema
  • Create a GraphQL resolver for each Party method
  • Create a Websocket enpoint to send Party/Spotify data
  • Change Polling to native browser Websocket client-side
  • Configure the websocket as excepted server side
  • Use the websocket as excepeted client side
# Websockets in Remix ## The problem The only way I could add a Websocket endpoint to my app, was to add an Express route to handle it. But since my whole app, thus my Party manager, is in Remix, I couldn't use WS with express to communicate with my Party manager and my clients. ## The solution Aside of this project, I was creating my own REST API in Rust with [Actix](https://actix.rs). So I will add a [GraphQL (Juniper)](https://github.com/graphql-rust/juniper) endpoint for my Party manager to it. And, since they have a [Websocket](https://actix.rs/docs/websockets/) feature, I think I'm gonna migrate all the back-end of my Remix app to Actix and keep the Express server for SSR and probably Cookie management. ## Progress - [x] Move the whole Party manager class to Rust - [x] Create a GraphQL endpoint - [x] Create a GraphQL schema - [x] Create a GraphQL resolver for each Party method - [x] Create a Websocket enpoint to send Party/Spotify data - [x] Change Polling to [native browser Websocket](https://www.npmjs.com/package/websocket) client-side - [x] Configure the websocket as excepted server side - [x] Use the websocket as excepeted client side
Sign in to join this conversation.
No description provided.