You and your partner should include links or images of the following resources in this section:
Create an app that allows users to log their favorite snacks. Add functionality that allows users to see whether or not their snack is healthy based on a simple algorithm.
For this project there are 40 features or functionality to build. To pass this project a minimum of 28 features must be built. The project will be graded according to the rubric on Canvas.
- Using a mono-repo template repository, create a full-stack web application
- Use express to build a full CRUD back-end application that adheres to RESTful routes
- Use create-react-app to build a full CRUD front-end application that interacts with the back-end
- Use unit tests to guide the building process
- Deploy the applications online, so anyone can see them online
- Each partner should commit and push their work at least once per day (for days we have class)
- You should edit the Helpful Links section of this readme to include links for your relevant project planning resources
Only one person on your team needs to fork this repo. They should add the other team member(s) as collaborators.
You and your partner should both submit a link to your team's fork of this repo immediately -- do not wait for the due date. That way, your instructors can use your README to access your trello board and other planning resources to check-in on your team's progress.
- Basic root route that returns a string
- Snacks resource
- Get one (with correct id)
- Get one (non-matching id, sends 404)
- Delete (with valid id)
- Delete (handles invalid id)
- Get all snacks
- Create a snack with all fields completed
- Create a snack and set a default image, if no image is provided
- Correctly capitalize snack name - for snack names with 2 or more letters
- Correctly capitalize snack name with multiple words
- Correctly fix capitalization, regardless if input is lowercase or uppercase
- Snack Health Check logic
- Checks if snack has enough fiber
- Checks if snack has enough protein
- Checks if snack has enough fiber and protein
- Checks if snack has enough fiber but too much sugar
- Checks if snack has enough protein but too much sugar
- Checks if snack has enough fiber and protein, but too much sugar
- Checks if snack has not enough protein, nor fiber and has too much sugar
- Checks if snack has invalid or missing information
Total: 21 tests
- Index page
- Can load index page and has navigation to the New page
- Has a list of snack cards that are coming from the back-end seed data
- Has a link to each snack's show page
- Has a solid heart, if the snack is healthy
- Has a heart outline, if the snack is unhealthy
- Has the CSS that is detailed in the tests
- Show page
- Shows header text
- Can navigate to New page
- Snack has correct information displayed
- Contains action/navigation buttons
- New page
- Shows the header text
- Has a form with the correct labels and fields
- Can create a snack and then redirects back to the index page
- Edit page
- Has a form with the correct labels and fields
- Data is pre-filled into the form
- Can update a snack and then redirects back to the index page
- Delete button
- Can delete a snack using the app
Total: 17 tests
Additional features:
Back-end hosted and accessible online: 1 feature
Front-end hosted and accessible online: 1 feature
Grand total: 40 features
- Fork and clone this repository.
It is recommended that you open a new terminal tab that will be dedicated to running and developing your back-end
cd back-end
touch .env
.env
PORT=3333
PG_HOST=localhost
PG_PORT=5432
PG_DATABASE=snack_a_log
npm install
- install npm packages listed inpackage.json
npm run db:init
- initialize a new database and create tablesnpm run db:seed
- seed the table(s) with some datanodemon
- confirm that this is running on port 3333- Visit http://localhost:3333/snacks/ and make sure you see some snack data in the form of an array of objects
npm run test
- to run the back-end tests
It is recommended that you open a new terminal tab that will be dedicated to running and developing your front-end
cd front-end
touch .env
.env
REACT_APP_API_URL=http://localhost:3333
npm install
- install npm packages listed inpackage.json
npm start
- make sure your React app can start
Keep the React app running, open a new tab and run
npm test
- to open Cypress and run front-end tests
This project uses this template - you can follow the readme to set up deployment.