Toddy is a Redux application I made for my students so they can practice refactoring an existing React app to use Redux.
Branch | Summary |
---|---|
Main |
The main todo app |
Redux |
The Redux refactoring documented step by step |
Advanced Router |
The Advanced React-Router refactoring step by step |
React was used for the front end.
Bootstrap was used for the UI
Redux was used for state management.
Router was used for navigational components.
Mock server was used for the backend to simulate connecting to an API.
-
Add new todos.
-
View existing todos
-
Delete any todo from the list.
-
When adding a todo if a todo has no title it will be untitled.
-
Each todo get an id, timestamp and random activity from the backend.
-
Each todo can be viewed in details through its own url containing its ID.
-
Invalid todos are handeled correctly and the user is redirected to a 404 page.
-
Each component in the redux branch has all the refactoring steps to switch from state to Redux.
-
Each component in the advanced router branch has all the refactoring steps to implement router params and 404 routing.
Main Branch
+---public
| index.html
| manifest.json
| robots.txt
|
\---src
| index.css
| index.js
|
+---components
| AddTodo.js
| App.js
| NavBar.js
| Todo.js
| Todos.js
|
\---utils
api.js
Redux
+---public
| index.html
| manifest.json
| robots.txt
|
\---src
| index.css
| index.js
|
+---actions
| todos.js
|
+---components
| AddTodo.js
| App.js
| NavBar.js
| Todo.js
| Todos.js
|
+---middleware
| index.js
| logger.js
|
+---reducers
| todos.js
|
\---utils
api.js
Advanced Router
+---public
| 404.gif
| index.html
| manifest.json
| robots.txt
|
\---src
| index.css
| index.js
|
+---actions
| todos.js
|
+---components
| AddTodo.js
| App.js
| NavBar.js
| NotFound.js
| Todo.js
| TodoDetails.js
| Todos.js
|
+---middleware
| index.js
| logger.js
|
+---reducers
| todos.js
|
\---utils
api.js
You can get the project up and running in 2 simple steps.
- Use the following command to install the required packages
npm install
- Use the following command to run the project
npm start