The saga continues with an epic garden of epic-ness!
Create a new database called garden
and run the SQL in the database.sql
file.
- Run
npm install
- Start postgres if not running already
- Run
npm run server
to start the server - Run
npm run client
to start the client - Navigate to
localhost:5173
src/
contains the React applicationpublic/
contains static assets for the client-sideserver/
contains the Express App
Currently, the app is rendering and adding stuff to the DOM, but this is 100% client-side code. Your job is going to be to convert this app into a full stack app that uses React, Redux, and Redux-Saga. Here are the steps to do this:
- Add the
redux-logger
middleware to the project. - Add
redux-saga
to the project. TheGET /api/plants
route is already written to send an array of plant objects as its response. Obtain and render that array in thePlantList
component when it loads. (You'll need to make a Saga function instore.js
whose job is to get the data from the server, thenput
it into theplantList
reducer.) - Add all of the plant fields to the
PlantForm
to allow adding a new plant to the database. The server-side code for this already exists in thePOST /api/plants
route. - Add a delete button for each plant to allow it to be removed from the database. The
DELETE /api/plants/:id
route is already written for this.
- Implement
react-router
so that when a user navigates tohttp://localhost:5173/#/plants/1
it displays the details for a given plant. (The plant with anid
of 1, in this case.) TheGET /api/plants/:id
route is already written to respond with all of the details for a single plant.- You'll need to research URL Parameters for React Router
- Add
Material UI
to the project to give the site an earthy color palette.