Blog Python Model code and SQLite Database. This is a table of registered user and their ids and passwords in the login system currently. It can be updated using the sign up function

Show your unique collection/table in database, display rows and columns in the table of the SQLite database from VSCode using SQLite3 Editor. Screenshot 2024-04-22 133914

Show your unique code that was created to initialize table and create test data from VSCode model.

Just the sample users from the template. Nothing special Screenshot 2024-04-22 134807

Show a list as extracted from database as Python objects in VSCode using Debugger.

image

Show two distinct examples of dictionaries, show Keys/Values using debugger in VSCode.

image

Blog Python API code and use of Postman to request and respond with JSON.

Everytime postman reaches out with a condition, with the correct JSON code, such putting down the name of the user you would to see, you could pull user information, check if their login works, and so on.

Show Python API code definition for request and response using GET, POST, UPDATE methods in VSCode. Discuss algorithmic condition used to direct request to appropriate Python method based on request method.

image

When the API receives the postman request, depending on the type of HTTP format that is found (JSON?), it will redirect the request into the correct method that is found, for example for creating a new account, it will go to the post method under CRUD and execute the code.

Show algorithmic conditions used to validate data on a POST condition in VSCode.

Under the self method, this checks the user id, name, and password when the user enters it into the field. This prevents any other garbage credentials from getting in as it refers back to the database with the read method and presents the data as JSON. image

Show URL request and Body requirements for GET, POST, and UPDATE methods in Postman.

image

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

  • Get image

Pulls the data about the user from the SQlite table.

  • Post image

Validates user information (log in successful)

There is no UPDATE method because I don’t want people to mess with people’s credentials without proper authentication, which I don’t have currently.

Show the JSON response for error for 400 when missing body on a POST request in Postman.

image

Show the JSON response for error for 404 when providing an unknown user ID to a UPDATE request in Postman.

image

Blog JavaScript API fetch code and formatting code to display JSON.

As the GET method is triggered, you can see the numerous process such as the images or users passed through.

Show response of JSON objects from fetch of GET, POST, and UPDATE methods in Chrome inspect.

!image.png image-2.png

When the user successfuly logs in, it sends out a response with a successful confirmation message, showing that the log in has worked out.

Show a demo (GET) of obtaining an Array of JSON objects that are formatted into the browsers screen in the Chrome browser.

image The other image above also has the initializations

Describe fetch and method that obtained the Array of JSON objects in JavaScript code.

When triggered, the get method triggers the login_api here, which creates a JSON string with the user entered data and sends a post request to verify if it matches with the SQlite table.

Show code that performs iteration and formatting of data into HTML in JavaScript code.

image

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 in the Chrome browser.

https://drive.google.com/drive/u/0/folders/1WWPDneDeNavfMNFq3vf1J1MTC3PBiyk5?safe=active

Show and describe code that handles success. Describe how code shows success to the user in the Chrome Browser screen in JavaScript code.

image

When the login is successful, a popup appears confirming that the sign up is successful, which the user can click to go to the next page.

Show and describe code that handles failure. Describe how the code shows failure to the user in the Chrome Browser screen in JavaScript code.

image

If the login fails to due bad connection or incorrect information when checking with the SQLite database, it will notify the user on the bottom of the page that the login has failed in red lettering.