Skip to the content.

Sprint 5

shark About Games Sprint 1 Sprint 2 Sprint 3 Verify w/JS N@tM
Take a Byte




Take a Byte

Sprint 4/5 project

Introduction: Take A Byte is a website to find new recipies of many cuisines. Users can spin a wheel to help design or ask the AI chatbot. They can also post their own recipies that aren't on the website to further expand options.

My specific feature I worked on the posting feature. It is accessable through the main page and users can enter data to describe the recipe they are posting

Challenges: Had difficulty figuring out the data tables. Had a lot of errors when running db.init database generating file. I fixed these by asking my groupmates for help and comparing our code in speciic files to make sure everything was up to date and working.

Collaboration: throughout the entire project, I worked closedly with my groupmates to run the webstie. We tired our best to make sure everyone had their features working, and keep each other in check and on track.

Khanman board: Link here

Individual issue (also on the Khanman board):

checklist

Checklist for my feature

pic of frontend

issue on video with self grade




My feature: posting

Going over my specific feature

Posting feature frontend: User can enter name, dish, cuisine, link, comments then post it. It requires all fields to be filled out before being able to post. After posting, a button appears which the user can click which redirects them to a new page with all posts (including the one the user just posted). On this new page, the user can also delete a post or go back home.

pic of frontend pic of frontend pic of frontend

Posting feature backend: 2 users, martha and wayne, have their data stored in backend so far. Currently it is static but working on dynamic data. Their data is acessed through the buttons on the posting page, which displays their data. In backend an API sources the static data and displays it in frontend. They are also integrated into the table created from db.init.

pic of backend

I have more screenshots of it working below, but I can live demo the API working too!

pic of backend

backend API code

pic of backend

data table with martha and wayne (ignore all the extras please, I was testing a lot and forgot to delete them)

pic of backend

python file for my specific posting feature

pic of backend

data for martha and wayne in data table

Future plans with my feature: Dynamic data where the data inputed by users in the home page goes to backend and is stored there instead of locally. I also want to make it so users can only delte their own posts and not others.




Input/Output requests

Demo ways to Input to full stack feature

API request and respone through frontend

pic of frontend

sucessful input in frontend

pic of frontend

posted underneath all previous posts, shown in frontend. 200 in backend and appears in table

Using postman to show raw API request and RESTful response: Using the requests (get, post, put, and delete) to check if each feature of crud works.

pic of postman

successful get, shows all posts data

pic of postman

unsuccessful delete, shows error types (this case is 500 internal error)




Input/Output requests

Demo ways to Input to full stack feature

API request and response through frontend

pic of frontend

Successful input in frontend

pic of frontend

Posted underneath all previous posts, shown in frontend. 200 in backend and appears in table

Using Postman to show raw API request and RESTful response: Using the requests (get, post, put, and delete) to check if each feature of CRUD works.

pic of postman

Successful GET, shows all posts data

pic of postman

Unsuccessful DELETE, shows error types (this case is 500 internal error)




List requests

Use of list, dictionaries and database. Code descriptions of area where you work with list (rows) and dictionaries (columns) of the database.
pic

In model, data is retrieved in lists/rows. Each object under posting (like name, dish, cuisine, etc.) is converted into a dictionary so it can store the user's input data

Discuss formatting response data (JSON) from API into DOM

pic of frontend

Read method formats the objects into a JSON-compatible dictionary.

pic of frontend

Line 182, fetch API data for create method to add to table. Line 190, updates the DOM

Discuss queries from database where you extract a Python List (rows). Mention how these queries are provided by a 3rd-party library.

pic of postman

Line 109 and 112 are SQLAlchemy methods to retrieve rows from the table. This is an example from read, which filters by name first and if no name, it retrieves all the posts. Then it iterates the posts with the read format in JSON format.

pic of postman

Example of static data using lists




Call to Algorithm request

Show the definition of code block to make a request.

Discuss the call/request to the method with Algorithm (fetch to endpoint).(how frontend sends data to backend API with fetch)

pic

fetchstaticposting function recieves the data.Using dynamic data from postername, endpoint is made with that data. The data is fetched from backend with GET requesst, then converted into js.

Discuss the return/response from the method with Algorithm (fetch) and how you handle data: after url called, poster_name looked up in dictionary and if exists get 200. If doesn't exist, 404 error shown.

Show how changing data or method triggers a different response, specifically normal conditions and error conditions.

Trigger is the button. Example is getting data with button. After user clicks, it fetches data of who they clicked and appears underneath

pic of postman pic of postman pic of postman

error to fetch when backend isn't running. When it is and the button is clicked, data appears.