Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thinkswan/redux-voting-app
A React app that allows users to vote for things and uses Redux.
https://github.com/thinkswan/redux-voting-app
javascript react redux socket-io tutorial
Last synced: about 2 months ago
JSON representation
A React app that allows users to vote for things and uses Redux.
- Host: GitHub
- URL: https://github.com/thinkswan/redux-voting-app
- Owner: thinkswan
- License: mit
- Created: 2019-06-28T17:42:55.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-09T15:26:35.000Z (almost 4 years ago)
- Last Synced: 2023-03-11T18:28:18.682Z (almost 2 years ago)
- Topics: javascript, react, redux, socket-io, tutorial
- Language: JavaScript
- Homepage:
- Size: 85 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# redux-voting-app
A React app that allows users to vote for things and uses Redux.
Based on the tutorial found at
http://teropa.info/blog/2015/09/10/full-stack-redux-tutorial.html.## How to use
```
npm install
cd client/ && npm install cd ../ # Run `npm install` in `client/` to install client dependencies
npm test
npm run dev
```This will start a server at http://localhost:8080/.
To view the results of a vote, visit http://localhost:8080/#/results.
## How it works
The app is implemented using React components with state being managed by a
Redux store. Action creators are used to connect each component to the store
and reducers are used to transform the state when the user interacts with the
app and when the server emits updated data.A custom piece of middleware called `RemoteActionMiddleware` emits actions to
the server when necessary.The client and server talk to each other using web sockets implemented by
Socket.io.The server is implemented using Socket.io so multiple clients can easily
participate in each vote. The server emits a `state` event whenever data changes
and listens to `action` events to store votes from the clients.## License
MIT