![]() |
About | Games | Sprint 1 | Sprint 2 | Sprint 3 | Verify w/JS | N@tM |
Take a Byte
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 for my feature

issue on video with self grade
My feature: posting
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.



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.

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

backend API code

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

python file for my specific posting feature

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
API request and respone through frontend

sucessful input in 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.

successful get, shows all posts data

unsuccessful delete, shows error types (this case is 500 internal error)
Input/Output requests
API request and response through frontend

Successful input in 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.

Successful GET, shows all posts data

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

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

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

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.

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.

Example of static data using lists
Call to Algorithm request
Discuss the call/request to the method with Algorithm (fetch to endpoint).(how frontend sends data to backend API with fetch)

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



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