7mwang / matthew-wang

MIT License
0 stars 0 forks source link

Data Structure Writeup #12

Open 7mwang opened 6 months ago

7mwang commented 6 months ago

Data Structures Blog Post

From VSCode using SQLite3 Editor, show your unique collection/table in database, display rows and columns in the table of the SQLite database.

This is our data table for our user data. 323749580-927fa2a9-b378-4b2f-af91-191c00375500 From VSCode model, show your unique code that was created to initialize table and create test data.

This is the model used to generate user test data and the admin account into an sql file. 323753262-66768bda-33be-4ca1-855a-ed57cfe80958 In VSCode using Debugger, show a list as extracted from database as Python objects.

Data is separated from body into variables. 323760334-7bc92106-2647-4030-abf0-752094851553 In VSCode use Debugger and list, show two distinct example examples of dictionaries, show Keys/Values using debugger.

Returning data in dictionary, and setting up data with dictionaries and multiple key value pairs. image 323761413-8ca7d606-c9b2-443b-9cde-a1359c55920e In VSCode, show Python API code definition for request and response using GET, POST, UPDATE methods. Discuss algorithmic condition used to direct request to appropriate Python method based on request method.

On webpage, multiple different actions lead to different outcomes. For example, updating data and submitting images uses put, while logging in uses post. 323853176-85b9a615-dd0b-4037-a9db-638b35bb1f76 In VSCode, show algorithmic conditions used to validate data on a POST condition. Data is checked to be long enough and exists so the post request can go through. 323853404-ad6dd3d9-fb31-4ac9-b552-c60777b12d1e In Postman, show URL request and Body requirements for GET, POST, and UPDATE methods.

Body needed in login/signup system 323854778-28c45771-2a61-48dd-8b25-87db476aed52

In Postman, show the JSON response data for 200 success conditions on GET, POST, and UPDATE methods.

JSON response shows success message, from 200 status 323854970-2d9cb7ab-7ebc-4c4f-bfc3-8c29a757a508

In Postman, show the JSON response for error for 400 when missing body on a POST request.

When the body is either not there, or too short, the api returns a 400 error. image

In Postman, show the JSON response for error for 404 when providing an unknown user ID to a UPDATE request.

When logging in, message user not found is returned if the user isn't in the database. 323854870-2f138211-db76-4ab6-8e02-71487555a5a0

In Chrome inspect, show response of JSON objects from fetch of GET, POST, and UPDATE methods.

After login, api returns responses and data into console. 323855159-1c49fa7d-dc5a-4aba-ae82-2f066eb44c73 In the Chrome browser, show a demo (GET) of obtaining an Array of JSON objects that are formatted into the browsers screen.

Data page shows all user data in a formatted table. image

In JavaScript code, describe fetch and method that obtained the Array of JSON objects. Code below gets all user data from backend, and formats it into a table image In JavaScript code, show code that performs iteration and formatting of data into HTML. image In the Chrome browser, show a demo (POST or UPDATE) gathering and sending input and receiving a response that show update. Repeat this demo showing both success and failure. image image In JavaScript code, show and describe code that handles success. Describe how code shows success to the user in the Chrome Browser screen. The code takes the user's data and send its to the api to confirm whether the user has access. If the user is authorized in the database, it sends a positive response back to the frontend, which is interpreted as a goahead to chance the data, sending another request to the backend to update the data. image In JavaScript code, show and describe code that handles failure. Describe how the code shows failure to the user in the Chrome Browser screen. The code takes the user's data and send its to the api to confirm whether the user has access. If the user is not authorized in the database, it sends a negative response back to the frontend, which is interpreted, and the frontend does not send a request to the backend to change the data. image

hanlunli commented 6 months ago

Overall: 1.95/2

All screenshots are very clear and it's easy to understand what is going on in each of them. The screenshots all display code/data which match the project requirements. The issue is very well organized and easy to understand. Overall, this shows mastery of all requirements needed for cpt/data structures projects.