diff --git a/SRS.md b/SRS.md new file mode 100644 index 00000000..dbdfad86 --- /dev/null +++ b/SRS.md @@ -0,0 +1,346 @@ +# Software Requirements Specification Document + +Version 2 +This serves as a template for each projects' Software Requirements Specification (SRS) document. When filling this out, you will be required to create user stories, use cases, requirements, and a glossary of terms relevant to your project. Each group member must contribute to every section, so it is crucial that your group's GitHub repository shows a commit history that reflects the work of each group member. It is highly recommended that you create separate branches for each member, but since this is one single document, you will need to manually merge the branches together. It is also advisable to have multiple working versions of this document (named separately) so that one person can compile the final SRS document from the multiple working versions. Ultimately, how you go about managing this is up to you, but consistent formatting, clear commit messages, and a thorough commit history with contributions from each group member are required. + +Fill the document out following the guidelines listed in each section. Maintain [proper Markdown syntax](https://www.markdownguide.org/basic-syntax/) and be sure that your group has a `main` branch with this document and the entire [template repository codebase](https://github.com/david-gary/onlineStoreTemplate) either forked or downloaded and copied into your group's repository. If you have arranged to use a different codebase as a template, you do not need to have the original template included, but a `main` branch is still required. + +## Group Members + + +* [Sreyas Kodukulla](mailto:skodukul.edu) +* [Akanimoh Joseph Umoren](mailto:aumoren@uncc.edu) +* [Blaise Thomas](mailto:bthom108@uncc.edu) +* [Mercere Baker](mailto:mbaker89@uncc.edu) + + +## Revisions + +When a change is made to the document, a new revision should be created. The revision should be added to the table below with all information filled out. + +| Version | Date | Description | Author | Reviewed By | +| --- | --- | --- | --- | --- | +| 1.0 | 03/22/23 | Initial draft | [David Gary](mailto:dgary9@uncc.edu) | [David Gary](mailto:dgary@uncc.edu) | + +## Table of Contents + +1. [Introduction](#introduction) +2. [Requirements](#requirements) +3. [Constraints](#constraints) +4. [Use Cases](#use-cases) +5. [User Stories](#user-stories) +6. [Glossary](#glossary) + +## Introduction + + +The idea for our project is to create a hands on jewlery store. We will build a system that has features to be able to search for jewlery based on the type and the material. The software system will allow users to perform filtered searches, create a wishlist or shopping cart for any items, and it will also display every item and give a brief description of it. Our stakeholders are the individual customers that are interested in buying products from our store. Their needs are the products we offer and we will give them the ability to browse through to find the right item to fit their needs. +the filter search is when a user can input certain things that they are looking for and not looking for (based on price, material, type) and will find items that match the conditions they have set in the search. + +## Requirements +Each group member must supply at least three functional requirements for the project. Each requirement should be written in the following format: + +* **ID:** REQ-1 + * **Description:** The customer is trying to use the filter search funtion to find the right type of chain. + * **Type:** Functional + * **Priority:** 4 + * **Rationale:** This is important because it will test a key feature of our store. + * **Testing:** We can test the requirement by seeing if the 'filter search' function returns the correct output after the user input. + +* **ID:** REQ-2 + * **Description:** The items will have a small description to help the users with their selections. + * **Type:** non-functional + * **Priority:** 3 + * **Rationale:** This is important because it makes the store easier to navigate. + * **Testing:** We will test this by seeing if the description shows once we finish the webpage. + +* **ID:** REQ-3 + * **Description:** The webiste needs to flow properly in the sense that the user should be able to follow the right path based on how they interact. Must have clear and consise UI. + * **Type:** functional + * **Priority:** 5 + * **Rationale:** This is important because if the user clicks to view chains, but rings show up instead, that means the webpage isn't up to the standards we want it to be at. + * **Testing:** We will test this by using the website after completeion and test the flow based on user input. + +* **ID:** REQ-4 + * **Description:** Website should ask the user to confirm their purchase before charging them. + * **Type:** Functional + * **Priority:** 2 + * **Rationale:** This is important so that the user does not accidentaly purchase items they do not mean to + * **Testing:** Trying to checkout the items in a cart, the user shoukld be prompted to confirm that the items are correct. + +* **ID:** REQ-5 + * **Description:** Wesite should have a navigation bar which displays the main types of items being sold + * **Type:** Functional + * **Priority:** 3 + * **Rationale:** This is important because it helps the user navigate the website easily. + * **Testing:** The webpage sould dsplay a visible navigation bar that can be used to go through the ite,s in the website easiy. + +* **ID:** REQ-6 + * **Description:** Upon payment, a confirmation of purchase should be displayed to the user + * **Type:** Functional + * **Priority:** 2 + * **Rationale:** This is important because it lets the user know that their purchase was successful. + * **Testing:** When the user pays for the items, they should be redirected to another page which displays a confirmation message and the details of their purchase like purchase id, shipping addresss, and delivery date. + +* **ID:** REQ-7 + * **Description:** Different Page per product + * **Type:** Functional + * **Priority:** 1 + * **Rationale:** You'd have a list of the different products with images, onclick it will take you to just the + the Item itself + * **Testing:** Onclick should take you to different webPages + +* **ID:** REQ-8 + * **Description:** FAQ PAGE + * **Type:** Non-Functional, gives people answers to FAQs + * **Priority:** 5 + * **Rationale:** When people have similar questions and need quick answers a FAQ page is usually what they'll seek out. + * **Testing:** Test page on click + +* **ID:** REQ-9 + * **Description:** Works on Mobile + * **Type:** Functional + * **Priority:** 3 + * **Rationale:** Makes sure the Users have the same experience across all platforms + * **Testing:** Can test by adjusting window size + +* **ID:** REQ-10 + * **Description:** Needs to have a shopping cart feature to hold their item(s) to purchase. + * **Type:** Functional + * **Priority:** 5 + * **Rationale:** An online shopping cart is one of the foundations odf commerical websites to purchase products. + * **Testing:** Trying to store items in the cart and then buying those items at checkout. + +* **ID:** REQ-11 + * **Description:** Website needs to be clear to the clients. + * **Type:** Non-functional + * **Priority:** 2 + * **Rationale:** Though good design is not necessary "functional," it is important for clients to be able to use the website intuitively and have it make sense to them. + * **Testing:** HTML elements need to work as expected and the website should be redesigned until clear. + +* **ID:** REQ-12 + * **Description:** Checkout should only be available if there is at least one item in the shopping cart. + * **Type:** Functional + * **Priority:** 4 + * **Rationale:** Customers shouldn't be prompted to enter their card information if they're not about to buy anything. + * **Testing:** When clicking on checkout, it should only proceed if there is an item in the cart. + +## Constraints + +* **Constraint 1:** We cannot include recommended items because we can't collect the user data to narrow it down. +* **Constraint 2:** Stakeholders cannot choose from a very vast collection of items, our site will be limited to only the scope of items we can include. +* **Constraint 3:** We do not display stakeholder reviews but we have admin reviews. +* **Constraint 4:** We do not control delivery prices because we deliver products using a third party delivery system. +* **Constraint 5:** No automated payments accepted, Only Debit/Credit Cards. +* **Constraint 6:** Only Available to US Region +* **Constraint 7:** This project's code is written using Python, HTML, CSS, and Javascript. +* **Constraint 8:** The project has to be finished by the end of UNCC's 2023 spring semester. + +## Use Cases + +Constraint 1: We cannot include recommended items because we can't collect the user data to narrow it down. +Constraint 2: Stakeholders cannot choose from a very vast collection of items, our site will be limited to only the scope of items we can include. +Constraint 3: We do not display stakeholder reviews but we have admin reviews. +Constraint 4: We do not control delivery prices because we deliver products using a third party delivery system. +Constraint 5: No automated payments accepted, Only Debit/Credit Cards. Only Available to US Region +Constraint 6: This project's code is written using Python, HTML, CSS, and Javascript. +Contstraint 7: The project has to be finished by the end of UNCC's 2023 spring semester. + + +* **ID:** UC-1 + * **Description:** The customer is trying to utilize the filter search funtion. + * **Actors:** The customer + * **Preconditions:** There needs to be an option for filter search that is clear and easy to find. + * **Postconditions:** The search must come up with the proper result based on the filters that the customer applies. + +* **ID:** UC-2 + * **Description:** The customer should be able to properly view and read about every item we offer. + * **Actors:** The customer + * **Preconditions:** The items must be displayed in a neat and visually pleasing manner while also having the proper descriptions. + * **Postconditions:** Once the customer navigates to their desired item, they must be able to see the exact item they searched for with an image and description. + +* **ID:** UC-3 + * **Description:** The customer clicks the checkout button + * **Actors:** The customer + * **Preconditions:** The customer has at least one item in their cart + * **Postconditions:** The items in the customer's cart are displayed and they are prompted to confirm that akll the items and their amounts are correct. + +* **ID:** UC-4 + * **Description:** The customer completes their purchase + * **Actors:** The customer + * **Preconditions:** The customer went through all the necessary purchase steps without any issues + * **Postconditions:** The customer is redirected to a page where a confirmation message of their order is displayed and other information about the details of th purchase is displayed as well. + +* **ID:** UC-5 + * **Description:** Making a singular webpage for each item with more depth of review and descriptions that also allows them to add to cart + * **Actors:** I will be building the web page, and adding the extra descriptions, Mercer will be going behind me to make sure the webpage will link to the checkout page + * **Preconditions:** Has to come from a previous page that was the items brief description, I.E Under the rings page it is the ring 3 Item, clicking that leads to the ring 3 Item webpage + * **Postconditions:** You've landed on the webpage for that specific item, complete with the photo, description, and add to cart button. + +* **ID:** UC-6 + * **Description:** Making sure that the webpages works across all devices + * **Actors:** I will be making sure that the customers can access the page from different devices, such as tablets, smartphones, and computers + * **Preconditions:** Has a device that can display webpage + * **Postconditions:** The webpage displays properly with no errors or loss in usability + +* **ID:** UC-7 + * **Description:** The customer is virtual window shopping and is navigating around the website. + * **Actors:** The customer + * **Preconditions:** The customer can connect to the website + * **Postconditions:** The customer should feel that navigation was simple and clear. The customer should not feel confused by going through our website. + +* **ID:** UC-8 + * **Description:** The customer is trying to remove items from their shopping cart. + * **Actors:** The customer + * **Preconditions:** The customer can connect to the website, the shopping cart is functional, the customer has put items in the shopping cart. + * **Postconditions:** The customer's shopping cart no longer has the item in the shopping cart. If the shopping cart only has that item, it should be empty and unable to proceed to checkout. + +## User Stories + +* **ID:** US-1 + * **Type of User:** Customer + * **Description:** The customer opens up the website, navigates to the filter search button because they are looking for a certain type of ring, they apply the filters, and they will be directed to the options we offer based on their preference. + +* **ID:** US-2 + * **Type of User:** Customer + * **Description:** The user navigates to the item they desire. Once they do that, they click on the image of the item and are shown a brief description about what the item is to aid them with their shopping experience. + +* **ID:** US-3 + * **Type of User:** Customer + * **Description:** The customer does not want to delete an item in cart that they do not want to purchase anymore. They click on the cart icon which lists the items in their cart and there is an option to remove each item from the cart. They successfully remove the item they do not need anymore. + +* **ID:** US-4 + * **Type of User:** Customer + * **Description:** The customer is currently viewing necklaces and wants to look at rings instead. They use the navigation bar to successfully got to the ring section. + +* **ID:** US-5 Web page that displays the item, a description, and an add to cart button for the user to purchase. + * **Type of User:** Customer + * **Description:** As I'm looking through the catalouge I noticed an item that I liked, I clicked on the item and it took me to a separate page that provided more detail for me to make an informed decision, I then added to cart and return to shopping. + +* **ID:** US-6 Web page that displays properly regardless of the device used to acess it. + * **Type of User:** Customer + * **Description:** As I'm looking through the catalogue I noticed an item that I liked, I clicked on the item and it took me to a separate page that provided more detail for me to make an informed decision, I then added to cart and return to shopping. Later I told my friend about the website, and he accessed it from his phone to take a look at the item I ordered. He was impressed on how easy to use on mobile it was. + +* **ID:** US-7 + * **Type of User:** Customer + * **Description:** The customer found our website and is interested in purchasing a piece of our jewelry. They browse the site, put an item in their shopping cart, click on the shopping cart icon, get taken to a checkout page, and confirm the order with an address and card information. + +* **ID:** US-8 + * **Type of User:** IT + * **Description:** The customer has a question about the website or has problems purchasing their items. They can send their issues to the provided email to have it checked out. + + + +## Use Cases + +In this section, you should list use cases for the project. Use cases are a thorough description of how the system will be used. Each group member must supply at least two use cases. Each use case should be written in the following format: + + * **ID:** UC-1 + * **Description:** The customer is trying to utilize the filter search funtion. + * **Actors:** The customer + * **Preconditions:** There needs to be an option for filter search that is clear and easy to find. + * **Postconditions:** The search must come up with the proper result based on the filters that the customer applies. + +* **ID:** UC-2 + * **Description:** The customer should be able to properly view and read about every item we offer. + * **Actors:** The customer + * **Preconditions:** The items must be displayed in a neat and visually pleasing manner while also having the proper descriptions. + * **Postconditions:** Once the customer navigates to their desired item, they must be able to see the exact item they searched for with an image and description. + +* **ID:** UC-3 + * **Description:** The customer clicks the checkout button + * **Actors:** The customer + * **Preconditions:** The customer has at least one item in their cart + * **Postconditions:** The items in the customer's cart are displayed and they are prompted to confirm that akll the items and their amounts are correct. + +* **ID:** UC-4 + * **Description:** The customer completes their purchase + * **Actors:** The customer + * **Preconditions:** The customer went through all the necessary purchase steps without any issues + * **Postconditions:** The customer is redirected to a page where a confirmation message of their order is displayed and other information about the details of th purchase is displayed as well. + +* **ID:** UC-5 + * **Description:** Making a singular webpage for each item with more depth of review and descriptions that also allows them to add to cart + * **Actors:** I will be building the web page, and adding the extra descriptions, Mercer will be going behind me to make sure the webpage will link to the checkout page + * **Preconditions:** Has to come from a previous page that was the items brief description, I.E Under the rings page it is the ring 3 Item, clicking that leads to the ring 3 Item webpage + * **Postconditions:** You've landed on the webpage for that specific item, complete with the photo, description, and add to cart button. + **ID:** UC-6 + * **Description:** Making sure that the webpages works across all devices + * **Actors:** I will be making sure that the customers can access the page from different devices, such as tablets, smartphones, and computers + * **Preconditions:** Has a device that can display webpage + * **Postconditions:** The webpage displays properly with no errors or loss in usability + +* **ID:** UC-7 + * **Description:** The customer is virtual window shopping and is navigating around the website. + * **Actors:** The customer + * **Preconditions:** The customer can connect to the website + * **Postconditions:** The customer should feel that navigation was simple and clear. The customer should not feel confused by going through our website. + +* **ID:** UC-8 + * **Description:** The customer is trying to remove items from their shopping cart. + * **Actors:** The customer + * **Preconditions:** The customer can connect to the website, the shopping cart is functional, the customer has put items in the shopping cart. + * **Postconditions:** The customer's shopping cart no longer has the item in the shopping cart. If the shopping cart only has that item, it should be empty and unable to proceed to checkout. + + +## User Stories + +In this section, you should list user stories for the project. User stories are a short description of how a user will be interacting with the system. Each group member must supply at least two user stories. Each user story should be written in the following format: + +* **ID:** US-1 + * **Type of User:** Customer + * **Description:** The customer opens up the website, navigates to the filter search button because they are looking for a certain type of ring, they apply the filters, and they will be directed to the options we offer based on their preference. + +* **ID:** US-2 + * **Type of User:** Customer + * **Description:** The user navigates to the item they desire. Once they do that, they click on the image of the item and are shown a brief description about what the item is to aid them with their shopping experience. + +* **ID:** US-3 + * **Type of User:** Customer + * **Description:** The customer does not want to delete an item in cart that they do not want to purchase anymore. They click on the cart icon which lists the items in their cart and there is an option to remove each item from the cart. They successfully remove the item they do not need anymore. + +* **ID:** US-4 + * **Type of User:** Customer + * **Description:** The customer is currently viewing necklaces and wants to look at rings instead. They use the navigation bar to successfully got to the ring section. + +* **ID:** US-5 Web page that displays the item, a description, and an add to cart button for the user to purchase. + * **Type of User:** Customer + * **Description:** As I'm looking through the catalouge I noticed an item that I liked, I clicked on the item and it took me to a separate page that provided more detail for me to make an informed decision, I then added to cart and return to shopping. +* **ID:** US-6 Web page that displays properly regardless of the device used to acess it. + * **Type of User:** Customer + * **Description:** As I'm looking through the catalogue I noticed an item that I liked, I clicked on the item and it took me to a separate page that provided more detail for me to make an informed decision, I then added to cart and return to shopping. Later I told my friend about the website, and he accessed it from his phone to take a look at the item I ordered. He was impressed on how easy to use on mobile it was. + +* **ID:** US-7 + * **Type of User:** Customer + * **Description:** The customer found our website and is interested in purchasing a piece of our jewelry. They browse the site, put an item in their shopping cart, click on the shopping cart icon, get taken to a checkout page, and confirm the order with an address and card information. + * **ID:** US-8 + * **Type of User:** IT + * **Description:** The customer has a question about the website or has problems purchasing their items. They can send their issues to the provided email to have it checked out. + + +## Glossary + +* **Term:** Filter Search + * **Definition:** the filter search is when a user can input certain things that they are looking for and not looking for (based on price, material, type) and will find items that match the conditions they have set in the search. + +* **Term:** Compatability + * **Definition:** A state in which two things are able to exist or occur together without problems or conflict. + +* **Term:** shopping cart + * **Definition:** software to allow customers to select products and buy them on the web. + +* **Term:** Navigation bar + * **Definition:** The webpage element that helps users navigate through the use of hyperlinks. + +* **Term:** Filter Search + * **Definition:** the filter search is when a user can input certain things that they are looking for and not looking for (based on price, material, type) and will find items that match the conditions they have set in the search. + +* **Term:** Compatability + * **Definition:** A state in which two things are able to exist or occur together without problems or conflict. + +* **Term:** shopping cart + * **Definition:** software to allow customers to select products and buy them on the web. + +* **Term:** Navigation bar + * **Definition:** The webpage element that helps users navigate through the use of hyperlinks. + diff --git a/app.py b/app.py index adcee448..052c645d 100644 --- a/app.py +++ b/app.py @@ -28,6 +28,9 @@ def index_page(): """ return render_template('index.html', username=username, products=products, sessions=sessions) +@app.route('/') +def index_page2(): + return render_template('indexItem.html') @app.route('/login') def login_page(): @@ -138,4 +141,4 @@ def checkout(): if __name__ == '__main__': - app.run(debug=True, host=HOST, port=PORT) + app.run(debug=True, host=HOST, port=PORT) \ No newline at end of file diff --git a/authentication/packages.png b/authentication/packages.png new file mode 100644 index 00000000..ec5b81e4 Binary files /dev/null and b/authentication/packages.png differ diff --git a/authentication/packages.puml b/authentication/packages.puml new file mode 100644 index 00000000..485d34b2 --- /dev/null +++ b/authentication/packages.puml @@ -0,0 +1,30 @@ +@startuml packages +set namespaceSeparator none +package "authentication" as authentication #aliceblue { +} +package "authentication.authTools" as authentication.authTools #aliceblue { +} +package "authentication.login" as authentication.login #aliceblue { +class "Sessions" { + username : str + db : Database + add_new_session(self, username: str, db: Database) -> None + get_session(self, username: str) -> UserSession + remove_session(self, username: str) -> None + get_all_sessions(self) -> dict +} + +class "AuthTools" { + username : str + password : str + key : str + salt : str + hash_password(password: str, salt: str = None) -> tuple + username_exists(username: str) -> bool + update_passwords(username: str, key: str, salt: str) + check_password(password: str, salt: str, key: str) -> bool + login_pipeline(username: str, password: str) -> bool + +} +} +@enduml diff --git a/authentication/packages_initial.png b/authentication/packages_initial.png new file mode 100644 index 00000000..f20677a0 Binary files /dev/null and b/authentication/packages_initial.png differ diff --git a/authentication/packages_initial.puml b/authentication/packages_initial.puml new file mode 100644 index 00000000..80d19a41 --- /dev/null +++ b/authentication/packages_initial.puml @@ -0,0 +1,7 @@ +@startuml packages +set namespaceSeparator none +package "authentication" as authentication #aliceblue { +} +package "authentication.authTools" as authentication.authTools #aliceblue { +} +@enduml diff --git a/authentication/passwords.txt b/authentication/passwords.txt index 3d93be76..672e5a3e 100644 --- a/authentication/passwords.txt +++ b/authentication/passwords.txt @@ -1,4 +1,6 @@ aturing:0d911297a1e34f4fcce78537f9aaa66a:b93727798b520dc10d145b53909c061f082ff14cd5f8cb4ab24c3b71bfa57d7e12e1296029be74c06a0d91ba32756f9fc978047fbe7232be67f94dfc1de9ced9 dritchie:e11d3b1a66b1ad362223c30b78138519:67aff785bd17ac24448d491926ff7aadd8fa75e51a2f7a9bfc31889bad0adcd2989061a27ccd9eff9e5e31f2bc14b5c193727e116dc8dc48259acb3919171cd4 llamport:89d0e5fe8d06ec113839c8f319d7033e:9171d14954eeda4e70777c23d98e349818125cdaeb884ff97ebf8cc0a9c7778f54ce394256588148132a03ebea891e44077c659e6c0132fa87a8cf77e436ae11 -bliskov:e71dda285effa69e1c29ac810fe7a986:1e4b9ae956cad1385cfa6fffd8323dd16c3fe18c54e6447e49bddef2138d042e84e1505a541c6ef19a5026e684b2559efd366145870a0a8d4d4173c0877f6cd2 \ No newline at end of file +bliskov:e71dda285effa69e1c29ac810fe7a986:1e4b9ae956cad1385cfa6fffd8323dd16c3fe18c54e6447e49bddef2138d042e84e1505a541c6ef19a5026e684b2559efd366145870a0a8d4d4173c0877f6cd2 + +Kiwi:f65a78d14f405f820a0cd4a1c250b42c:7caa8eb94a03c88251da64e1a18dd2baa1124daa80fdbd7499d246e6b68face2973ffa29570f0b9a35c85fcb6be9c9ed19bec9cbc4a6f94e466f5abc216d9ad2 \ No newline at end of file diff --git a/core/classes.png b/core/classes.png new file mode 100644 index 00000000..374121bf Binary files /dev/null and b/core/classes.png differ diff --git a/core/classes.puml b/core/classes.puml new file mode 100644 index 00000000..9c62d774 --- /dev/null +++ b/core/classes.puml @@ -0,0 +1,24 @@ +@startuml classes +set namespaceSeparator none +class "Sessions" as core.session.Sessions #aliceblue { + sessions : dict + add_new_session(username: str, db: Database) -> None + get_all_sessions() -> dict + get_session(username: str) -> UserSession + remove_session(username: str) -> None +} +class "UserSession" as core.session.UserSession #aliceblue { + cart : dict + date : datetime, NoneType + db : Database + total_cost : int + username : str + add_new_item(id: str, name: str, price: int, quantity: int, discount: float, tax_rate: float) -> None + empty_cart() -> dict + is_item_in_cart(id: str) -> bool + remove_item(id: str) -> None + submit_cart() -> None + update_item_quantity(id: str, change_to_quantity: int) -> None + update_total_cost() -> None +} +@enduml diff --git a/core/classes_initial.png b/core/classes_initial.png new file mode 100644 index 00000000..e12b8388 Binary files /dev/null and b/core/classes_initial.png differ diff --git a/core/classes_initial.puml b/core/classes_initial.puml new file mode 100644 index 00000000..9c62d774 --- /dev/null +++ b/core/classes_initial.puml @@ -0,0 +1,24 @@ +@startuml classes +set namespaceSeparator none +class "Sessions" as core.session.Sessions #aliceblue { + sessions : dict + add_new_session(username: str, db: Database) -> None + get_all_sessions() -> dict + get_session(username: str) -> UserSession + remove_session(username: str) -> None +} +class "UserSession" as core.session.UserSession #aliceblue { + cart : dict + date : datetime, NoneType + db : Database + total_cost : int + username : str + add_new_item(id: str, name: str, price: int, quantity: int, discount: float, tax_rate: float) -> None + empty_cart() -> dict + is_item_in_cart(id: str) -> bool + remove_item(id: str) -> None + submit_cart() -> None + update_item_quantity(id: str, change_to_quantity: int) -> None + update_total_cost() -> None +} +@enduml diff --git a/core/packages.png b/core/packages.png new file mode 100644 index 00000000..d68ad8e7 Binary files /dev/null and b/core/packages.png differ diff --git a/core/packages.puml b/core/packages.puml new file mode 100644 index 00000000..9ffa5cec --- /dev/null +++ b/core/packages.puml @@ -0,0 +1,10 @@ +@startuml packages +set namespaceSeparator none +package "core" as core #aliceblue { +} +package "core.session" as core.session #aliceblue { +} +package "core.utils" as core.utils #aliceblue { +} +core.session --> core.utils +@enduml diff --git a/core/packages_initial.png b/core/packages_initial.png new file mode 100644 index 00000000..d68ad8e7 Binary files /dev/null and b/core/packages_initial.png differ diff --git a/core/packages_initial.puml b/core/packages_initial.puml new file mode 100644 index 00000000..9ffa5cec --- /dev/null +++ b/core/packages_initial.puml @@ -0,0 +1,10 @@ +@startuml packages +set namespaceSeparator none +package "core" as core #aliceblue { +} +package "core.session" as core.session #aliceblue { +} +package "core.utils" as core.utils #aliceblue { +} +core.session --> core.utils +@enduml diff --git a/database/classes.png b/database/classes.png new file mode 100644 index 00000000..5484c97d Binary files /dev/null and b/database/classes.png differ diff --git a/database/classes.puml b/database/classes.puml new file mode 100644 index 00000000..70f3090c --- /dev/null +++ b/database/classes.puml @@ -0,0 +1,54 @@ +@startuml classes +set namespaceSeparator none +class "Database" as database.db.Database #aliceblue { + connection + cursor + database_path : str + get_all_item_ids() + get_all_user_information() + get_cost_by_sale_id(sale_id: int) + get_email_by_username(username: str) + get_first_name_by_username(username: str) + get_full_inventory() + get_full_sale_by_id(sale_id: int) + get_full_sales_information() + get_item_category_by_id(item_id: int) + get_item_id_by_sale_id(sale_id: int) + get_item_image_url_by_id(item_id: int) + get_item_info_by_id(item_id: int) + get_item_name_by_id(item_id: int) + get_item_price_by_id(item_id: int) + get_item_stock_by_id(item_id: int) + get_last_name_by_username(username: str) + get_password_hash_by_username(username: str) + get_quantity_by_sale_id(sale_id: int) + get_sale_date_by_sale_id(sale_id: int) + get_sales_by_cost_range(start_cost: float, end_cost: float) + get_sales_by_date_range(start_date: dt.date, end_date: dt.date) + get_sales_by_item_id(item_id: int) + get_sales_by_quantity_range(start_quantity: int, end_quantity: int) + get_sales_by_transaction_id(transaction_id: int) + get_sales_by_username(username: str) + get_transaction_id_by_sale_id(sale_id: int) + get_username_by_sale_id(sale_id: int) + insert_new_item(item_name: str, price: int, info: str) -> None + insert_new_sale(transaction_id: int, username: str, item_id: int, quantity: int, sale_date: dt.date, cost: float) + insert_user(username: str, password_hash: str, email: str, first_name: str, last_name: str) -> None + set_email(username: str, new_email: str) + set_first_name(username: str, new_first_name: str) + set_item_category(item_id: int, new_category: str) + set_item_image_url(item_id: int, new_image_url: str) + set_item_info(item_id: int, new_info: str) + set_item_name(item_id: int, new_name: str) + set_item_price(item_id: int, new_price: float) + set_item_stock(item_id: int, new_stock: int) + set_last_name(username: str, new_last_name: str) + set_password_hash(username: str, new_password_hash: str) + set_sale_cost(sale_id: int, discount: float, tax: float) + set_sale_date(sale_id: int, new_sale_date: dt.date) + set_sale_item_id(sale_id: int, new_item_id: int) + set_sale_quantity(sale_id: int, new_quantity: int) + set_sale_transaction_id(sale_id: int, new_transaction_id: int) + set_sale_username(sale_id: int, new_username: str) +} +@enduml \ No newline at end of file diff --git a/database/db.py b/database/db.py index 55fea435..454418dc 100644 --- a/database/db.py +++ b/database/db.py @@ -718,4 +718,4 @@ def set_sale_cost(self, sale_id: int, discount: float = 0, tax: float = 0.05): self.cursor.execute( "UPDATE sales SET cost = ? WHERE id = ?", (new_cost, sale_id)) - self.connection.commit() + self.connection.commit() \ No newline at end of file diff --git a/database/diagrams/PullFromDatabase.png b/database/diagrams/PullFromDatabase.png new file mode 100644 index 00000000..5d164f19 Binary files /dev/null and b/database/diagrams/PullFromDatabase.png differ diff --git a/database/diagrams/PullFromDatabase.puml b/database/diagrams/PullFromDatabase.puml new file mode 100644 index 00000000..a1633ae1 --- /dev/null +++ b/database/diagrams/PullFromDatabase.puml @@ -0,0 +1,13 @@ +@startuml +left to right direction +skinparam packageStyle rectangle +actor customer +actor Database +rectangle checkout { + customer -- (checkout) + (checkout) .> (payment) : include + (checkout) .> (Inventory -1) + (Database) .> (checkout) : extends + (checkout) -- Database +} +@enduml \ No newline at end of file diff --git a/database/diagrams/sequences/UpdatingDatabase.png b/database/diagrams/sequences/UpdatingDatabase.png new file mode 100644 index 00000000..c8d276a3 Binary files /dev/null and b/database/diagrams/sequences/UpdatingDatabase.png differ diff --git a/database/diagrams/sequences/UpdatingDatabase.puml b/database/diagrams/sequences/UpdatingDatabase.puml new file mode 100644 index 00000000..5b8e8302 --- /dev/null +++ b/database/diagrams/sequences/UpdatingDatabase.puml @@ -0,0 +1,17 @@ +@startuml +participant Participant as Sequence +actor Customer as Sequence1 +boundary CartReview as Sequence2 +control Payment as Sequence3 +entity InventoryReduction as Sequence4 +database DatabaseInventoryUpdate as Sequence5 +collections NewInventory as Sequence6 +queue ConfirmationRestart as Sequence7 +Sequence -> Sequence1 : to actor +Sequence -> Sequence2 : To boundary +Sequence -> Sequence3 : To control +Sequence -> Sequence4 : To entity +Sequence -> Sequence5 : To database +Sequence -> Sequence6 : To collections +Sequence -> Sequence7 : To queue +@enduml \ No newline at end of file diff --git a/database/packages.png b/database/packages.png new file mode 100644 index 00000000..eeb575dd Binary files /dev/null and b/database/packages.png differ diff --git a/database/packages.puml b/database/packages.puml new file mode 100644 index 00000000..720e7168 --- /dev/null +++ b/database/packages.puml @@ -0,0 +1,7 @@ +@startuml packages +set namespaceSeparator none +package "store.database" as database #aliceblue { +} +package "store.database.db" as database.db #aliceblue { +} +@enduml \ No newline at end of file diff --git a/database/schema.sql b/database/schema.sql index 0f874ee8..0bfe8be7 100644 --- a/database/schema.sql +++ b/database/schema.sql @@ -26,5 +26,4 @@ CREATE TABLE sales ( cost DECIMAL(10,2) NOT NULL, FOREIGN KEY (username) REFERENCES users(username), FOREIGN KEY (item_id) REFERENCES inventory(id) -); - +); \ No newline at end of file diff --git a/database/startingData.sql b/database/startingData.sql index 19da65d3..13361b9e 100644 --- a/database/startingData.sql +++ b/database/startingData.sql @@ -11,13 +11,13 @@ INSERT into `users` (`username`, `password_hash`, `email`, `first_name`, `last_n VALUES ('bliskov', '1e4b9ae956cad1385cfa6fffd8323dd16c3fe18c54e6447e49bddef2138d042e84e1505a541c6ef19a5026e684b2559efd366145870a0a8d4d4173c0877f6cd2', 'barbara@thor.com', 'Barbara', 'Liskov'); INSERT into `inventory` (`item_name`, `info`, `price`, `stock`, `image_url`, `category`) -VALUES ('Apples', 'An edible cultivation of the Malus genus.', 2.00, 100, 'static/images/apple.jpeg', 'Fruit'); +VALUES ('Diamond Ring', 'A luxurious ring with a sparkling diamond as the centerpiece.', 5000.00, 50, 'static/images/diamond_ring.jpeg', 'Jewelry'); INSERT into `inventory` (`item_name`, `info`, `price`, `stock`, `image_url`, `category`) -VALUES ('Bananas', 'A long curved fruit which grows in clusters and has soft pulpy flesh and yellow skin when ripe.', 1.00, 100, 'static/images/banana.jpeg', 'Fruit'); +VALUES ('Cuban Link Chain', 'A stylish chain with tightly interlocking links, made of high-quality materials.', 12000.00, 100, 'static/images/cuban_chain.jpeg', 'Jewelry'); INSERT into `inventory` (`item_name`, `info`, `price`, `stock`, `image_url`, `category`) -VALUES ('Mangos', 'The best fruit on the planet.', 4.00, 100, 'static/images/mango.jpeg', 'Fruit'); +VALUES ('Diamond Earring', 'Elegant earrings featuring dazzling diamonds that catch the light beautifully.', 3000.00, 100, 'static/images/diamond_earring.jpeg', 'Jewelry'); INSERT into `sales` (`transaction_id`, `username`, `item_id`, `quantity`, `sale_date`, `cost`) VALUES ('1', 'aturing', '1', 10, '2022-12-21 7:30:30', 5.50); @@ -26,4 +26,4 @@ INSERT into `sales` (`transaction_id`, `username`, `item_id`, `quantity`, `sale_ VALUES ('2', 'dritchie', '2', 10, '2022-12-21 7:30:30', 5.50); INSERT into `sales` (`transaction_id`, `username`, `item_id`, `quantity`, `sale_date`, `cost`) -VALUES ('3', 'llamport', '3', 10, '2022-12-21 7:30:30', 5.50); +VALUES ('3', 'llamport', '3', 10, '2022-12-21 7:30:30', 5.50); \ No newline at end of file diff --git a/diagrams.md b/diagrams.md new file mode 100644 index 00000000..b80b6144 --- /dev/null +++ b/diagrams.md @@ -0,0 +1,138 @@ +# Project 2: Design + +## Introduction + +In this phase, you will be mapping out your project and creating easily understandable diagrams that will help you and your team know your codebase inside and out. This also makes it much easier to communicate the flow of your application to less technical audiences or anyone who is new to your project. We will be using `pyreverse` and `plantuml` to help us create, update, and visualize our diagrams. + +This activity will require you to generate Class, Package, Use Case, and Sequence diagrams for your project. If you are unfamiliar with these diagrams, you can find an in-depth explanation of each diagram type [here](https://www.uml-diagrams.org/) or reference [this article](https://nulab.com/learn/software-development/uml-diagrams-guide/). + +## Task 1: Installations + +- Use `pip` to install the following packages: + - `pylint==2.17.1` + - `plantuml==0.3.0` +- Add both of these packages to your `requirements.txt` file, including the version numbers. Follow the format of the `flask` package in the file. +- Install `Graphviz` on your machine. You can find download instructions for your operating system [here](https://graphviz.org/download/). + +## Task 2: Initial Structure Diagrams + +- Each group member will create diagrams for at least one of the following subdirectories/files of your project: + - `authentication`: requires a package diagram + - `core`: requires both a package diagram and a class diagram + - `database`: requires both a package diagram and a class diagram + - `testing`: requires a package diagram + +All of the above diagrams must be generated, so split this work evenly and push and pull code often. To generate a class diagram for a subdirectory or file, you must first generate the `plantuml` files using `pyreverse`. Then, you must use `plantuml` to generate the diagram from the `plantuml` file. Here's an example of how to do this for the package diagram in the `testing` subdirectory. + +```bash +pyreverse --output puml --colorized -A --output-directory testing testing # generates testing/package.puml +python3.10 -m plantuml testing/package.puml # generates testing/package.png +``` + +Since `testing` has no classes, we do not need a class diagram, but if we did, we would change the `testing/package.puml` to `testing/classes.puml` in the last command. + +- Delete the `.puml` files that do not have a corresponding `.png` file. For example, since `testing` has no classes, we would delete `testing/classes.puml`. +- For each subdirectory, create copies of the `.puml` and `.png` files with naming schemes that include `_initial` in the name. + - For example, `testing/package.puml` would have a copy called `testing/package_initial.puml` and `testing/package.png` would have a copy called `testing/package_initial.png`. + +## Task 3: Update Structure Diagrams + +- Begin planning the implentations necessary to fulfill requirements listed in your `SRS.md` file. +- Go to the corresponding subdirectory, and update the `.puml` file to reflect the changes you have planned. + - For example, by implementing a method called `delete_cart` in the `UserSession` class from `core`, my `core/classes.puml` file would look like the one shown below because I added a line to the `UserSession` class that says `delete_cart(id: str) -> None`. + - [PlantUML class diagram documentation](https://plantuml.com/class-diagram) +- Be sure to regenerate the `.png` file for each subdirectory after you update the corresponding `.puml` file. + +```plantuml +@startuml classes +set namespaceSeparator none +class "Sessions" as store.core.session.Sessions #aliceblue { + sessions : dict + add_new_session(username: str, db: Database) -> None + get_all_sessions() -> dict + get_session(username: str) -> UserSession + remove_session(username: str) -> None +} +class "UserSession" as store.core.session.UserSession #aliceblue { + cart : dict + date : datetime, NoneType + db + total_cost : int + username : str + add_new_item(id: str, name: str, price: int, quantity: int, discount: float, tax_rate: float) -> None + empty_cart() -> dict + is_item_in_cart(id: str) -> bool + remove_item(id: str) -> None + delete_cart(id: str) -> None + submit_cart() -> None + update_item_quantity(id: str, change_to_quantity: int) -> None + update_total_cost() -> None +} +@enduml +``` + +## Task 4: Use Case Diagrams + +- Create a `diagrams` subdirectory from the project root directory, and navigate to it. +- Create a `cases` subdirectory from the `diagrams` subdirectory and navigate to it. +- For each user type (actor) mentioned in your `SRS.md` file, create an appropriately named `.puml` file showcasing the use cases for that actor. + - For example, if I had an actor called `Customer`, I might create a file called `customer.puml` that looks like the template below. + - [PlantUML use case diagram documentation](https://plantuml.com/use-case-diagram) +- Generate a `.png` file from the `.puml` file. + - Remember, this will look something like: `python3.10 -m plantuml customer.puml` + +```plantuml +@startuml customer +left to right direction +actor Customer +rectangle "System" as system { + (Login) + (Register) + (View Cart) + (View Items) + (View Orders) + (View Profile) + (Logout) +} +Customer --> (Login) +Customer --> (Register) +Customer --> (View Cart) +Customer --> (View Items) +Customer --> (View Orders) +Customer --> (View Profile) +Customer --> (Logout) +@enduml +``` + +## Task 5: Sequence Diagrams + +- Create a `sequences` subdirectory from the `diagrams` subdirectory and navigate to it. +- For each of the use cases shown in your use case diagrams, create an appropriately named `.puml` file showcasing the sequence of events for that use case and generate its corresponding `.png` file. + - For example, if I had a use case called `Login`, I might create a file called `login.puml` that looks like the template below. + - [PlantUML sequence diagram documentation](https://plantuml.com/sequence-diagram) + +```plantuml +@startuml login +actor Customer +boundary "System" as system +control "Sessions" as sessions +control "Authentication" as auth +Customer -> system: Login +activate system +system -> auth: login_pipeline(username, password) +activate auth +auth --> system: True +deactivate auth +system -> sessions: add_new_session(username, db) +activate sessions +sessions --> system: None +deactivate sessions +system -> system: redirect to home page +deactivate system +@enduml +``` + +## Submission Details + +- On Canvas, submit the following: + - the URL to your group's repository diff --git a/diagrams/cases/customer.png b/diagrams/cases/customer.png new file mode 100644 index 00000000..79235c11 Binary files /dev/null and b/diagrams/cases/customer.png differ diff --git a/diagrams/cases/customer.puml b/diagrams/cases/customer.puml new file mode 100644 index 00000000..9f4ccca6 --- /dev/null +++ b/diagrams/cases/customer.puml @@ -0,0 +1,12 @@ +@startuml customer +left to right direction +actor Customer +rectangle "System" as system { + (Login) + (View Cart) + (View Items) +} +Customer --> (Login) +Customer --> (View Cart) +Customer --> (View Items) +@enduml diff --git a/diagrams/cases/customerExperience.png b/diagrams/cases/customerExperience.png new file mode 100644 index 00000000..4bf7a239 Binary files /dev/null and b/diagrams/cases/customerExperience.png differ diff --git a/diagrams/cases/customerExperience.puml b/diagrams/cases/customerExperience.puml new file mode 100644 index 00000000..1a9cbc83 --- /dev/null +++ b/diagrams/cases/customerExperience.puml @@ -0,0 +1,16 @@ +@startuml customer +left to right direction +actor Customer +rectangle "System" as system { + (Login) + (View Cart) + (View Items) + (View Orders) + (Logout) +} +Customer --> (Login) +Customer --> (View Cart) +Customer --> (View Items) +Customer --> (View Orders) +Customer --> (Logout) +@enduml \ No newline at end of file diff --git a/diagrams/sequences/login.png b/diagrams/sequences/login.png new file mode 100644 index 00000000..bd1a464c Binary files /dev/null and b/diagrams/sequences/login.png differ diff --git a/diagrams/sequences/login.puml b/diagrams/sequences/login.puml new file mode 100644 index 00000000..94cbe9ce --- /dev/null +++ b/diagrams/sequences/login.puml @@ -0,0 +1,24 @@ +@startuml login +actor Customer +boundary "System" as system +control "Sessions" as sessions +control "Authentication" as auth +Customer -> system: Login +activate system +system -> auth: login_pipeline(username, password) +activate auth +auth --> system: True +deactivate auth +system -> sessions: add_new_session(username, db) +activate sessions +sessions --> system: None +deactivate sessions +system -> system: redirect to home page +Customer -> system: View Cart +activate system +system -> auth: viewCart +activate auth +auth -> system: True +deactivate auth +deactivate system +@enduml diff --git a/diagrams/sequences/loginAttempt.png b/diagrams/sequences/loginAttempt.png new file mode 100644 index 00000000..2e8275e7 Binary files /dev/null and b/diagrams/sequences/loginAttempt.png differ diff --git a/diagrams/sequences/loginAttempt.puml b/diagrams/sequences/loginAttempt.puml new file mode 100644 index 00000000..f83696bb --- /dev/null +++ b/diagrams/sequences/loginAttempt.puml @@ -0,0 +1,24 @@ +@startuml login +actor Customer +boundary "System" as system +control "Sessions" as sessions +control "Authentication" as auth +Customer -> system: Login +activate system +system -> auth: login_pipeline(username, password) +activate auth +auth --> system: True +deactivate auth +system -> sessions: add_new_session(username, db) +activate sessions +sessions --> system: None +deactivate sessions +system -> system: redirect to home page +Customer -> system: Login +activate system +system -> auth: username_exists(username) +activate auth +auth --> system: True +deactivate auth +deactivate system +@enduml \ No newline at end of file diff --git a/group.md b/group.md new file mode 100644 index 00000000..153817ca --- /dev/null +++ b/group.md @@ -0,0 +1,24 @@ +# Group Members + +## Blaise Thomas + +- **Github Username:** BlaiseThomas20 +- **Niner Net ID:** bthom108 + +## Sreyas Kodukulla + +- **Github Username:** sreyaskodukulla +- **Niner Net ID:** skodukul + + +## Mercere Baker + +- **Github Username:** MercereBaker +- **Niner Net ID:** mbaker89 + +## Akaninoh Joseph Aumoren + +- **Github Username:** oneofthejosephs +- **Niner Net ID:** aumoren + + diff --git a/implementation.md b/implementation.md new file mode 100644 index 00000000..2e615a8e --- /dev/null +++ b/implementation.md @@ -0,0 +1,23 @@ +# Project 3: Implementation + +## Introduction + +The exciting part of the project has finally come. It is now time to implement the features you planned in the previous phase. In all likelihood, this will require a massive amount of work. That's why it is important to begin by planning the smaller changes you can make, divide these among your group, and work together to implement them. This process is repetitive, taking on larger and larger tasks as you go. The tasks listed below are not necessarily meant to be performed in sequence. They are, instead, a list of what we will be looking for when evaluating your implementation. Beyond just functionality, your project's code should be readable and well documented. + +## Task 1: Code Style Guides + +- Python files should be written in `lower_snake_case.py` format. +- Global variables and constants should be written in `UPPER_SNAKE_CASE`. +- Class names should be written in `UpperCamelCase`. +- Method and local variable names should be written in `lower_snake_case`. + +## Task 2: Documentation Guides + +- All classes, methods, and functions should be documented using the docstring format shown throughout the template codebase. +- After implementing a feature, be sure to update the relevant `plantuml` and `png` files in all respective subdirectories. +- Commit messages should be written to be descriptive of the changes made and the feature implemented. When writing code for a specific requirement from the `SRS.md`, you should use the requirement's ID in your commit message. + +## Submission Details + +- On Canvas, submit the following: + - the URL to your group's repository diff --git a/requirements.txt b/requirements.txt index c39f059d..63c9afdb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,3 @@ -flask==2.2.2 \ No newline at end of file +flask==2.2.2 +pylint==2.17.1 +plantuml==0.3.0 \ No newline at end of file diff --git a/static/css/style.css b/static/css/style.css index c5aeb0ea..2648be0c 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -1,3 +1,72 @@ +.navigation_bar +{ + background-color:rgb(253, 254, 255); +} + +#nav_links +{ + overflow: hidden; + font-size:x-large; + padding: 0; + margin: 0; + list-style-type: none; +} + +#nav_links li +{ + float: left; + color:#0e0f0f; + display: block; + margin-top: 10px; + margin-left: 10px; + margin-right: 10px; + transition-duration: 0.5s; + +} + +#nav_links a +{ + text-decoration: none; +} + + +#nav_links li:hover +{ + cursor: pointer; +} + +#nav_links li ul +{ + visibility: hidden; + display: none; + opacity: 0; +} + +#nav_links li ul li +{ + clear:both; +} + + +#nav_links li:hover > ul, #nav_links li ul:hover +{ + visibility: visible; + opacity: 1; + display:block; +} + +#logout_button{ + background-color: #ef0c0c; + border-color: #ccc; + color: rgb(236, 236, 236); + width: 100px; + font-weight: bold; + margin-top: 10px; + margin-top: 1rem; + margin-bottom: 2rem; + margin-left: 37rem; +} + #index_buttons { padding-top: 15px; margin: 0 auto; @@ -40,16 +109,18 @@ /*
*/ #product_card { + position: relative; margin: 0 auto; margin-top: 10px; margin-bottom: 10px; width: 302px; background-color: #cac2c2; border: 1px solid rgb(178, 178, 178); - height: 500px; + height: 302px; } .product_card-img { + display: block; width: 300px; height: 300px; } @@ -65,12 +136,35 @@ .product_card-text { /* Centered */ + color: white; + display: block; + position: absolute; text-align: center; - font-size: 15px; - margin-top: 10px; - margin-bottom: 10px; - font-style: italic; + font-style: oblique; + font-size: large; height: 60px; + top: 50%; + left: 50%; + -webkit-transform: translate(-50%, -50%); + -ms-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); +} + +.overlay { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + height: 100%; + width: 100%; + opacity: 0; + transition: .5s ease; + background-color: #09b6f0; + } + +.product_card:hover .overlay { + opacity: 1; } .product_card-price { @@ -118,9 +212,18 @@ color: rgb(32, 30, 30); width: 220px; font-weight: bold; - margin-top: 10px; - margin-bottom: 10px; + margin-top: 5rem; /* centered on the page */ text-align: center; + margin-left: 1rem; -} \ No newline at end of file +} + +.row { + margin-top: 2rem; + margin-bottom: 2rem; +} + +.quantity { + margin-left: 4rem; +} diff --git a/static/images/cuban_chain.jpeg b/static/images/cuban_chain.jpeg new file mode 100644 index 00000000..0764212f Binary files /dev/null and b/static/images/cuban_chain.jpeg differ diff --git a/static/images/diamond_earring.jpeg b/static/images/diamond_earring.jpeg new file mode 100644 index 00000000..3b95f751 Binary files /dev/null and b/static/images/diamond_earring.jpeg differ diff --git a/static/images/diamond_ring.jpeg b/static/images/diamond_ring.jpeg new file mode 100644 index 00000000..aa6ea82b Binary files /dev/null and b/static/images/diamond_ring.jpeg differ diff --git a/static/images/logo.png b/static/images/logo.png new file mode 100644 index 00000000..5c55688b Binary files /dev/null and b/static/images/logo.png differ diff --git a/templates/checkout.html b/templates/checkout.html index 2096fb98..a75e7f97 100644 --- a/templates/checkout.html +++ b/templates/checkout.html @@ -5,9 +5,10 @@

Your Order

+

${{ total_cost }}


-

{{ total_cost }}

+ Home Page
diff --git a/templates/home.html b/templates/home.html index cc35f50a..dac83a31 100644 --- a/templates/home.html +++ b/templates/home.html @@ -2,12 +2,13 @@ {% block content %} +Logout

Products


-
+
{% for product in products %} @@ -16,10 +17,12 @@

Products

...
{{ product.item_name }}
-

{{ product.info }}

+
+

{{ product.info }}

+

${{ product.price }}

+ placeholder="0" min="0">
@@ -28,13 +31,33 @@
{{ product.item_name }}
- -
+ +
+ {% endblock %} \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index e65edc97..469ff94b 100644 --- a/templates/index.html +++ b/templates/index.html @@ -18,14 +18,14 @@

Products

{% for product in products %}
-
-
- ... -
-
{{ product.item_name }}
+
+ ... +
+
{{ product.item_name }}
+

{{ product.info }}

-

${{ product.price }}

+

${{ product.price }}

diff --git a/templates/indexItem.html b/templates/indexItem.html new file mode 100644 index 00000000..469ff94b --- /dev/null +++ b/templates/indexItem.html @@ -0,0 +1,38 @@ +{% extends "layout.html" %} + +{% block content %} +
+
+ Login + Register +
+
+ +
+
+

Products

+
+
+
+
+
+ {% for product in products %} +
+
+ ... +
+
{{ product.item_name }}
+
+

{{ product.info }}

+
+

${{ product.price }}

+
+
+
+ {% endfor %} +
+
+
+
+
+ {% endblock %} \ No newline at end of file diff --git a/templates/layout.html b/templates/layout.html index f38efaec..9519020b 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -3,17 +3,29 @@ - Private Online Store + The Jewel Box +
+ +
-

Private Online Store

+

The Jewel Box


diff --git a/templates/login.html b/templates/login.html index 38c4cca9..5c6d294d 100644 --- a/templates/login.html +++ b/templates/login.html @@ -2,7 +2,7 @@ {% block content %}
-

Welcome back!

+

Log in!

diff --git a/testing.md b/testing.md new file mode 100644 index 00000000..a6553a49 --- /dev/null +++ b/testing.md @@ -0,0 +1,14 @@ +# Project 4: Testing + +## Introduction/Description + +Now it is time to test the code you have added. Since there will be a variety of codebase structures across the entire class, the specific requirements for this stage are minimal. But you must, as a group, write tests for each of the implemented functions/features that you added in the previous phase. These tests should be integrated into the existing test suite from the template codebase. You should document these in either the `testing/README.md` file or with comments in the test files themselves. After this, another group member should review your tests and make sure they are correct and complete. Create a subdirectory called `reviews` inside the `testing` directory and document the review process there. Each group member should create their own file in this directory with their name as the filename. In this file, document which tests you reviewed, when you reviewed them, and any comments or concerns you have about them. + +## Continue Developing + +Everything in your codebase should be tested by the end of this project, but it is likely that the implementations you had hoped to finish by now still need some work. Test the features you can, and keep coding! This iterative, complicated process is a part of software development. Reach out to the TAs if you're struggling with implementations. + +## Submission Details + +- On Canvas, submit the following: + - the URL to your group's repository diff --git a/testing/packages.png b/testing/packages.png new file mode 100644 index 00000000..c9b758c1 Binary files /dev/null and b/testing/packages.png differ diff --git a/testing/packages.puml b/testing/packages.puml new file mode 100644 index 00000000..b6a6422b --- /dev/null +++ b/testing/packages.puml @@ -0,0 +1,51 @@ +@startuml packages +set namespaceSeparator none +package "testing" as testing #aliceblue { +} +package "testing.filterSearch" as testing.filterSearch #aliceblue { +class "Website" { + filterByMaterial(material: str) : void + filterByPrice(price: int) : void + filterByType(type: str) : void +} +class "Filter" { + material : str + price : int + type : str + setMaterial(material: str) : void + setPrice(price: int) : void + setType(type: str) : void + getMaterial() : str + getPrice() : int + getType() : str +} +class "SearchResult" { + material : str + price : int + type : str + display() : void +} +"Website" --> "Filter" +"Filter" --> "SearchResult" +} +package "testing.shoppingCart" as testing.shoppingCart #aliceblue { +class "CartItem" { + -itemId : String + -quantity : Integer + -price : Float + +getTotalPrice() : Float +} +class "Cart" { + -items : List + +addItem(item: CartItem) : void + +removeItem(itemId: String) : void + +getItems() : List + +getTotalPrice() : Float + +checkout() : void +} +"Cart" --> "CartItem" +} +@enduml + + + \ No newline at end of file diff --git a/testing/packages_initial.png b/testing/packages_initial.png new file mode 100644 index 00000000..fa59ed07 Binary files /dev/null and b/testing/packages_initial.png differ diff --git a/testing/packages_initial.puml b/testing/packages_initial.puml new file mode 100644 index 00000000..6e3f7ce9 --- /dev/null +++ b/testing/packages_initial.puml @@ -0,0 +1,11 @@ +@startuml packages +set namespaceSeparator none +package "testing" as testing #aliceblue { +} +package "testing.authTests" as testing.authTests #aliceblue { +} +package "testing.coreTests" as testing.coreTests #aliceblue { +} +package "testing.dbTests" as testing.dbTests #aliceblue { +} +@enduml diff --git a/testing/reviews/Mercere.txt b/testing/reviews/Mercere.txt new file mode 100644 index 00000000..e69de29b