jacksonx9 / JobToGo

LinkedIn with Tinder's UI for fun, interactive and effortless job search on the go
6 stars 3 forks source link

BE Sockets #142

Closed wchang22 closed 5 years ago

wchang22 commented 5 years ago

This adds socketio to the backend.

On socket connection, the client will send a userId message, which we then use to create two mappings in Redis: 1) socket.id -> userId, which allows us to efficiently determine which user is sending messages 2) userId -> socket.id, which allows us to efficiently determine which user to send messages to

On friend updates, we retrieve userId and/or friendId from redis to update the frontend. This is also done for job sharing.

Note: Due to the dependency on Redis, backend tests now must be run in docker, unless you manually start redis.