Collections Blog Python Model code and SQLite Database.

From VSCode using SQLite3 Editor,

show your unique collection/table in database, display rows and columns in the table of the SQLite database. Screenshot 2024-04-17 at 12 17 12 AM

This is a database of all of the user information and the column that I mainly added includes the list of all designs, which is a use of a adjustable datastructure and another column that I found important was the base64 encoded version of the images, as this allows it to be passed from the frontend to the backend since it is now in text, whch is a passable data structure.

From VSCode model, show your unique code that was created to initialize table and create test data.

Lists and Dictionaries

Screenshot 2024-04-17 at 12 18 51 AM

This is a dictionary about the design information that helps with design features such as the amount of likes, the description, and also the reviews from the other users on the design, so there is active feedback on the designs. In the dictionary, we also have the dislikes to show how much people dislike the button design.

Screenshot 2024-04-17 at 12 19 21 AM

This is a dictionary about the general User information that helps with profile and this includes the User information such as the list of designs and also the admin roles for authentication or special permission to the backend.

Blog Python API code and use of List and Dictionaries.

List API Code

Screenshot 2024-04-17 at 12 24 59 AM

This is an example of the list API code as in the API folder, we have the user.py class, which deals with all of the endpoints and in this example we have the image post function, which searches through all of the users and finds which user the profile picture needs to be updated and we use the iteration and use of lists otherwise we cannot store multiple users.

Dictionary API code

Screenshot 2024-04-17 at 12 28 11 AM

In VSCode using Debugger, show a list as extracted from database as Python objects.

Screenshot 2024-04-17 at 12 25 46 AM

I access the dictionary from model class where the dictionary object is created but I manipulate it here and I acsess all of the public designs since they are the ones I want for the public search function and I don’t want to accidentally acsess any private designs. Over here, I have the debugger version of this

In VSCode use Debugger and list, show two distinct example examples of dictionaries, show Keys/Values using debugger. APIs and JSON

Screenshot 2024-04-17 at 11 12 09 AM

Screenshot 2024-04-17 at 11 20 57 AM

Here is the debugger version, which I have added breakpoints to make it stop at the variables that inlcude the dictionary and the list inside of it and it is the same dictionary as the ones shown above that contain the numerous features.

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

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.

Screenshot 2024-04-17 at 3 35 58 PM

These are the api codes that include all of the get,post, and update methods, and all of these methods are in the user.py class and this is for the login, however I have sitll created other classes for other backend functions such as the design search and also the image uploading and retrieving.

In VSCode, show algorithmic conditions used to validate data on a POST condition.

Screenshot 2024-04-17 at 3 39 42 PM

I use algorithimic conditions to validate data on a Post condition, and this is used since for uploading the image I use algorithims to search through all of the users and to check which user I am suppose to upload the porifle picture for so it matches it with that user inside the database.

In Postman, show URL request and Body requirements for GET, POST, and UPDATE methods.

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

Screenshot 2024-04-17 at 11 29 04 AM

Over here we have the get method, which doesn’t upload any body code but just recieves the data from the backend.

Screenshot 2024-04-17 at 11 29 17 AM

Screenshot 2024-04-17 at 11 29 43 AM

I use all of the numerous crud operations here and return the 200 ok status, which tells me my Postman request had properly went through.

In Postman, show the JSON response for error for 400 when missing body on a POST request. Screenshot 2024-04-17 at 11 34 57 AM

In Postman, show the JSON response for error for 404 when providing an unknown user ID to a UPDATE request. Screenshot 2024-04-17 at 11 37 01 AM

I have all the of the Postman requests here and I have used Postman throughout the develpoment of my project to independently test the backend functions without having to test with the help of my frontend, and this helped me create my backend functions much easier since creating the postman functions are easier compared to making the frontend, which might be error prone and prone to bugs, which i can’t diagnose easily being from the frontend or the backend.

Frontend

Blog JavaScript API fetch code and formatting code to display JSON. Screenshot 2024-04-17 at 11 38 49 AM

Over here this code, acsesses the image uploading and fetches the upload results by uploading the image into the database and in this function the image is also converted into base64 for string conversion and so it can actually pass through to the backend, since otherwie it would not be bale to pass through to the backend.

In Chrome inspect, show response of JSON objects from fetch of GET, POST, and UPDATE methods. Screenshot 2024-04-17 at 11 43 43 AM Screenshot 2024-04-17 at 11 44 11 AM Screenshot 2024-04-17 at 11 45 42 AM

This shows all of the responses to the login updates and also it shows responses into things such as the datatable, which lists all of the designs that are hosted on my website. It also shows the responses in the console, which shows the frontend responses for it and the json objects for each thing.

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

Screenshot 2024-04-17 at 11 52 07 AM This is the datatables of all of the deisgns that are uploaded to the database and includes every design that is public of all of the designs of each button on my werbsite. In JavaScript code, describe fetch and method that obtained the Array of JSON objects. The fetch method asks the backend function that is a get function containing all of the designs.

In JavaScript code, show code that performs iteration and formatting of data into HTML.

Screenshot 2024-04-17 at 11 54 48 AM

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. Screenshot 2024-04-17 at 7 32 50 PM Screenshot 2024-04-17 at 7 33 19 PM Screenshot 2024-04-17 at 7 33 44 PM These are the demos of the post and update showing my image uploading function failing and working since the upload first fails then it passes and works.

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

Screenshot 2024-04-17 at 3 12 54 PM

The code that handles the failure for the login logs the error in the console and the success redirects you to the homepage as seen in the link mentioned.

Optional/Extra, Algorithm Analysis In the ML projects, there is a great deal of algorithm analysis. Think about preparing data and predictions.

Show algorithms and preparation of data for analysis. This includes cleaning, encoding, and one-hot encoding. Show algorithms and preparation for predictions. Screenshot 2024-04-17 at 7 35 39 PM

This is from a project I did, which was on decrypting so over here I brute force through all combinations and use this AI model to check which one is most representative of English. Discuss concepts and understanding of Linear Regression algorithms. Some of the concepts for the understanding of liner regression is that a line is fit onto a graph of values and it matches the line closest to the points so it is most accurately represented and it is a similar concept with logistic regression as it is matching a sigma curve onto the points sio it chooses between mainly 2 values. Discuss concepts and understanding of Decision Tree analysis algorithms. Decision tree takes multiple decisions so it splits it into multiple different branches where it is sorted into the choices.