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”.
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.
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.
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.
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.
I do not have partners.
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.