E6 Checkpoint Assignment 3

07 Dec 2021

1. Show what each page will look like. The pages do not have to be “functional” but the design should clear.

Nearly all of my pages are generated on the server and so I plan on having a navigation bar which should be accessible from them; they will be separated by brands so Lamy, Sailor, TWSBI, will each have a separate page. This nav bar will also have the shopping cart icon, and there will be a button at the bottom of each page that replaces the checkout button with “Add to Cart”.

2. Describe your design for your site’s shopping cart. That is, will it be a separate page that the user can view and edit, or will it be integrated into the product pages? If so, describe in detail how this will work on your site. Provide several examples of using the cart.

The shopping cart can be accessed by each user by clicking on a button in the navigation bar. When the user clicks on it, it will lead them to the invoice page (which will still have the navigation bar, so you can still access the different brands from there), with an option to finalize their purchase or checkout. On each brand page, once they select the quantities they want and press buy, the data will be stored in the cart and they will have the choice to stay there to buy more products or continue on to the invoice page. On the invoice page, it will generate the total/tax, etc., based on what they currently have in their shopping cart because the data is stored in the server. It will also provide an option to log in if they have not done so already.

3. Explain specifically how you will use sessions to manage your shopping cart. In particular, what shopping cart data will be stored in the session, what data format will be used (NOT what data type, but the format like with the data format used for your registration data). Use code examples showing what data structures (such as arrays and their objects) you will use to manage the shopping cart data and how they will be used in a session.

Sessions will be utilized to keep track of all the users on the website (keep them separate). Each session ID is specific to the user. Each session will also contain the data for the products that the user has decided to add to their cart. As soon as the checkout button is pressed, the session data will request to write the invoice.

4. How will you avoid access to your application when the user has not logged in or registered? What are the particular security concerns you must address?

Each user will be given a cookie from the browser after logging in and should be transient between the pages. I can request their cookie from them through the server to ensure that each user has separate data (depending on their shopping cart). An unregistered or a guest who hasn’t logged in cannot access anyone else’s cookie from the browser–I will redirect them to the login page instead. To add addtional security, I need to also add an expiration time to the cookie as well as encrypt through a unique key.

5. Upon a successful login, how do you provide personalization in your UI? Explain how you did or will do this (paste code if necessary)

A personalization I will be doing something similar to Assignment 2. Once the user logs in successfully, I can display a message like, “Thank you (user). You have successfully logged in” and “(user), you are currently logged in” at the top of the store, near the nav bar. Of course, I will also put a thank you message on the invoice page as well: “Thank you (user) for your purchase. Is this all you want?” The username will be stored in the request.body in a variable. Once they’re registered, I can also get their email address through the user_data json file. I can then send their invoice with the email and also a personalized message along with it.

6. If you are working with partners, how will you split up the work in your team so that you are working in parallel as effectively as possible? That is, who is doing what and when

I do not have partners.

7. How are you approaching Assignment 3 differently than Assignment 2?

This assignment will definitely test my ability to think through what exactly I want to request/respond with. To do this, I have to think more about what I can replace with sessions and to simplify my code so that the data on the server is still transient for each page. I am thinking of creating an outline or a mindmap so that I can visualize which elements I am missing or can clean up. At this point, I am worried about cluttering my UI or making it ugly as I am adding more products to each brand, and so I have to be conscious of each design as well. Once again, I am a visual person and so I will try to draw what each page looks like and note what the function of the elements/post and get requests are.