# October 20, 2017

## Architecture

### Websockets w/ React Native and real-time messages

Overview:

* The general flow of socket connections should be:

Login w/Credentials || Login w/Keychain -> 

Success -> Initialize Cases -> Connect to Socket and Channel -> Go to Homepage

Failure -> Login Page

* Socket connection should be created upon login and within the AuthActions.js section of the app. If socket connection fails the login should fail.
  ** Due to the way the api requires authentication we have to first get the token from a correct login, attemt the socket connect, then fail login if login fails

  * Socket.io should have its own Actions but not have its own reducer for the moment. Messages and User reducers will contain most of the pertinent information.
  * Work out how best to stay connected to a relevant socket while also not over subscribing to the channel. Perhaps there is a way to check the current connection.
  * Are there any actions that need to be taken when the socket is closed?


Add notes from October 20 2017
Add notes from October 20 2017
