This is a React and Redux app where a user can play the 'Would you rather game'. It was built as part of my coursework for Udacity's React Developer NanoDegree course.
This project has been bootstrapped with Create React App.
This app uses a data file to represent a fake database, and this data file has methods to allow access to the data.
Users of the app can answer 'would you rather' questions, pose their own questions, toggle between polls they have and haven't answered, compare their answers to other users, and see how they are ranked on the leaderboard of users who have asked/answered the most polls. There is also a very basic login type functionality where the user just needs to select their name from a dropdown upon logging in.
I've added some simple styling to the app using SASS. I also use a few images/icons, from the Noun Project, PlaceKitten, PlaceBear and FillMurray.
git clone https://github.com/chrisonside/would-you-rather.gitcd would-you-rathernpm installnpm start
The React Loader Spinner is used as a visual cue to the user that data will soon be loaded into the view.
React Router DOM is used as the DOM bindings for React Router - React Router is a commonly used routing library for React and makes sure that my app's UI is in sync with the current URL.
I am using Redux Form (which works well with the React-Redux bindings) to manage my form state in Redux.
Redux Thunk middleware is used to release Redux from its synchronous confines, allowing my app to dispatch actions once it has heard back from an API.
I followed this guide to using SASS in CRA, and this recommends to use the node-sass library to natively compile .scss files to CSS.
If adding/updating styles to this app in the future, to watch the SASS files and update the index.css file that the index.js points to, simply run npm run sass.
Finally, to avoid having to remember to transpile CSS before running a new build, a sass:build task has been added to the npm run build script, which will run a one-time build of the styles automatically.