├── .gitignore ├── gifs ├── connect1.gif ├── connect2.gif ├── addChannels.gif ├── publishMessages.gif ├── redisTerminalDemo.gif ├── subscribeAndClone.gif └── addPubAndSubClients.gif ├── static ├── RPS_View_logo.png ├── RPS_View_favicon.png └── RPSView_light_logo_transparent.png ├── client ├── index.js ├── actions │ ├── errorActions.js │ ├── channelActions.js │ ├── clientActions.js │ └── middleware.js ├── components │ ├── OneChannel.jsx │ ├── SubscribedChannelsDisplay.jsx │ ├── MessageLogDisplay.jsx │ ├── ChannelsDisplay.jsx │ ├── ClientCard.jsx │ └── MessageBox.jsx ├── store.js ├── reducers │ ├── index.js │ ├── errorReducer.js │ ├── channelsReducer.js │ └── clientReducer.js ├── constants │ └── actionTypes.js ├── containers │ ├── ChannelContainer.jsx │ ├── ErrorBox.jsx │ ├── App.jsx │ ├── ClientMenu.jsx │ ├── PublisherActions.jsx │ ├── ClientWindow.jsx │ ├── SubscriberActions.jsx │ └── NavBar.jsx └── styles │ ├── _variables.scss │ └── styles.scss ├── main.js ├── index.html ├── server ├── routes │ ├── clientRouter.js │ └── menuRouter.js ├── server.js └── controllers │ ├── clientController.js │ └── menuController.js ├── CONTRIBUTING.md ├── LICENSE ├── __tests__ ├── supertest.js ├── errorReducerTest.js └── clientReducerTest.js ├── webpack.config.js ├── package.json └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | build 3 | dump.rdb 4 | package-lock.json 5 | ./__tests__/dump.rdb -------------------------------------------------------------------------------- /gifs/connect1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oslabs-beta/RPS-View/HEAD/gifs/connect1.gif -------------------------------------------------------------------------------- /gifs/connect2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oslabs-beta/RPS-View/HEAD/gifs/connect2.gif -------------------------------------------------------------------------------- /gifs/addChannels.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oslabs-beta/RPS-View/HEAD/gifs/addChannels.gif -------------------------------------------------------------------------------- /gifs/publishMessages.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oslabs-beta/RPS-View/HEAD/gifs/publishMessages.gif -------------------------------------------------------------------------------- /gifs/redisTerminalDemo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oslabs-beta/RPS-View/HEAD/gifs/redisTerminalDemo.gif -------------------------------------------------------------------------------- /gifs/subscribeAndClone.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oslabs-beta/RPS-View/HEAD/gifs/subscribeAndClone.gif -------------------------------------------------------------------------------- /static/RPS_View_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oslabs-beta/RPS-View/HEAD/static/RPS_View_logo.png -------------------------------------------------------------------------------- /gifs/addPubAndSubClients.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oslabs-beta/RPS-View/HEAD/gifs/addPubAndSubClients.gif -------------------------------------------------------------------------------- /static/RPS_View_favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oslabs-beta/RPS-View/HEAD/static/RPS_View_favicon.png -------------------------------------------------------------------------------- /static/RPSView_light_logo_transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oslabs-beta/RPS-View/HEAD/static/RPSView_light_logo_transparent.png -------------------------------------------------------------------------------- /client/index.js: -------------------------------------------------------------------------------- 1 | /**Entry point for application, app should be rendered from here */ 2 | 3 | import React from 'react'; 4 | import { render } from 'react-dom'; 5 | import { Provider } from "react-redux"; 6 | import App from './containers/App.jsx'; 7 | import store from "./store"; 8 | 9 | render( 10 | 11 | 12 | 13 | , 14 | document.getElementById('root') 15 | ); 16 | -------------------------------------------------------------------------------- /main.js: -------------------------------------------------------------------------------- 1 | const { BrowserWindow, app } = require('electron') 2 | // const express = require('./server/server.js') 3 | 4 | let mainWindow = null 5 | 6 | function main() { 7 | 8 | // express 9 | mainWindow = new BrowserWindow({ width: 1200, height: 800 }) 10 | mainWindow.loadURL(`http://localhost:3000/`) 11 | mainWindow.on('close', event => { 12 | mainWindow = null 13 | }) 14 | } 15 | 16 | app.on('ready', main) -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | RPS View 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /client/actions/errorActions.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ************************************ 3 | * 4 | * @module errorActions.js 5 | * @author 6 | * @date 7 | * @description actions related to errorReducers 8 | * 9 | * ************************************ 10 | */ 11 | 12 | import * as types from '../constants/actionTypes.js'; 13 | 14 | //globalError 15 | export const errorHandler = (string) => ({ 16 | type: types.ERROR_HANDLER, 17 | payload: string, 18 | }); 19 | 20 | //clear global error 21 | export const clearError = () => ({ 22 | type: types.CLEAR_ERROR, 23 | }) -------------------------------------------------------------------------------- /client/components/OneChannel.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * ************************************ 3 | * 4 | * @module One Channel 5 | * @author Joe and Mark 6 | * @date 11/16 7 | * @description presentation component that renders a single box for each Channel 8 | * 9 | * ************************************ 10 | */ 11 | 12 | import React from "react"; 13 | 14 | const OneChannel = (props)=>{ 15 | return( 16 |
17 | 18 | 19 |
20 | ) 21 | } 22 | 23 | export default OneChannel; -------------------------------------------------------------------------------- /client/store.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ************************************ 3 | * 4 | * @module store.js 5 | * @author 6 | * @date 7 | * @description Redux 'single source of truth' 8 | * 9 | * ************************************ 10 | */ 11 | 12 | import { createStore, applyMiddleware } from 'redux'; 13 | import { composeWithDevTools } from 'redux-devtools-extension'; 14 | import reducers from './reducers/index.js'; 15 | import ReduxThunk from 'redux-thunk'; 16 | 17 | const composedEnhancer = composeWithDevTools(applyMiddleware(ReduxThunk)) 18 | 19 | const store = createStore( 20 | reducers, composedEnhancer 21 | ); 22 | 23 | export default store; 24 | -------------------------------------------------------------------------------- /client/reducers/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ************************************ 3 | * 4 | * @module index.js 5 | * @author 6 | * @date 7 | * @description simply a place to combine reducers 8 | * 9 | * ************************************ 10 | */ 11 | 12 | import {combineReducers} from 'redux'; 13 | 14 | import clientReducer from './clientReducer.js'; 15 | import channelsReducer from './channelsReducer'; 16 | import errorReducer from './errorReducer'; 17 | 18 | const reducers = combineReducers({ 19 | client: clientReducer, 20 | //add channels reducer here 21 | channels: channelsReducer, 22 | //adding error reducer 23 | error: errorReducer, 24 | }) 25 | 26 | 27 | // make the combined reducers available for import 28 | export default reducers; 29 | 30 | -------------------------------------------------------------------------------- /server/routes/clientRouter.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ************************************ 3 | * 4 | * @module clientRouter 5 | * @author Mark, Joe 6 | * @date 11/18 7 | * @description router for client menu 8 | * 9 | * ************************************ 10 | */ 11 | const express =require('express') 12 | const router = express.Router(); 13 | const clientController = require('../controllers/clientController') 14 | 15 | //router for client unsub 16 | router.post('/unsubscribe', clientController.unsubscribe) 17 | 18 | //router for client sub 19 | router.post('/subscribe', clientController.subscribe) 20 | 21 | //router for client publish 22 | router.post('/publish', clientController.publish) 23 | 24 | router.post('/subscribeMany', clientController.subscribeMany) 25 | 26 | 27 | module.exports = router; 28 | -------------------------------------------------------------------------------- /client/actions/channelActions.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ************************************ 3 | * 4 | * @module channelActions.js 5 | * @author Lara, Elise 6 | * @date 11/20 7 | * @description channel-related actions 8 | * 9 | * ************************************ 10 | */ 11 | import * as types from '../constants/actionTypes.js'; 12 | 13 | 14 | export const selectChannel = (channelName) => ({ 15 | type : types.SELECT_CHANNEL, 16 | payload: channelName 17 | }) 18 | 19 | export const addChannel = (channelName) => ({ 20 | type: types.ADD_CHANNEL, 21 | payload: channelName, 22 | }); 23 | 24 | export const deleteChannel = (channelName) => ({ 25 | type: types.DELETE_CHANNEL, 26 | payload: channelName, 27 | }); 28 | 29 | //portConnected 30 | export const portConnected = (data) => ({ 31 | type: types.PORT_CONNECTED, 32 | payload: data, 33 | }); -------------------------------------------------------------------------------- /client/components/SubscribedChannelsDisplay.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * ************************************ 3 | * 4 | * @module SubscribedChannelsDisplay.jsx 5 | * @author Lara, Elise 6 | * @date 7 | * @description subscribed channels display gets a prop channels, displays each channel in a list 8 | * 9 | * ************************************ 10 | */ 11 | 12 | import React from 'react'; 13 | 14 | const SubscribedChannelsDisplay = (props) => { 15 | 16 | //props will be an array of strings, each of which is a channel 17 | //for each string (i.e. element of array), add a
  • to a