Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion authentication/passwords.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
aturing:0d911297a1e34f4fcce78537f9aaa66a:b93727798b520dc10d145b53909c061f082ff14cd5f8cb4ab24c3b71bfa57d7e12e1296029be74c06a0d91ba32756f9fc978047fbe7232be67f94dfc1de9ced9
dritchie:e11d3b1a66b1ad362223c30b78138519:67aff785bd17ac24448d491926ff7aadd8fa75e51a2f7a9bfc31889bad0adcd2989061a27ccd9eff9e5e31f2bc14b5c193727e116dc8dc48259acb3919171cd4
llamport:89d0e5fe8d06ec113839c8f319d7033e:9171d14954eeda4e70777c23d98e349818125cdaeb884ff97ebf8cc0a9c7778f54ce394256588148132a03ebea891e44077c659e6c0132fa87a8cf77e436ae11
bliskov:e71dda285effa69e1c29ac810fe7a986:1e4b9ae956cad1385cfa6fffd8323dd16c3fe18c54e6447e49bddef2138d042e84e1505a541c6ef19a5026e684b2559efd366145870a0a8d4d4173c0877f6cd2
bliskov:e71dda285effa69e1c29ac810fe7a986:1e4b9ae956cad1385cfa6fffd8323dd16c3fe18c54e6447e49bddef2138d042e84e1505a541c6ef19a5026e684b2559efd366145870a0a8d4d4173c0877f6cd2
asteene:95dbb2bc2b4e761c53c9c71e64c94a59:dba160be834504fe81be71efc8fb9f385538c04f0e08847eb8d2ec69984272303f1e960f4d6c59a09e2e0425c507547074b44641f1b04af86e7e96340c02dcb6
mansmohaali:3f3afcc3eef86052d7136609f9abe828:376d73187de23a68e281d25e69c87a1b0071ed66613f8a487d713178812a905927fc74e38a36376621a7e1540ab8b92d34e8728286fae557ee6a05652113f6e7
user:9be32a9c75f5fa6307194f34b36d5b03:7c294cf6c011c99460302290e34f3ff9bbd3ddb95339b803a5decd180238d1a56c246c7ce3d2a2344e40026576f8d6964cb4779dfe9182538bceac61beb5d807
24 changes: 24 additions & 0 deletions core/classes.puml
Original file line number Diff line number Diff line change
@@ -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
Binary file added core/packages.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions core/packages.puml
Original file line number Diff line number Diff line change
@@ -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
138 changes: 138 additions & 0 deletions diagrams.md
Original file line number Diff line number Diff line change
@@ -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 testin # 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
21 changes: 21 additions & 0 deletions group.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Group Members

## Nicholas Matherly

- **Github Username:** nymbee
- **Niner Net ID:** nmatherl

## Jack Douglass

- **Github Username:** JackDougl
- **Niner Net ID:** jdougl39

## Mansoor Mohamed Ali

- **Github Username:** mmoham18
- **Niner Net ID:** mansmohaali

## Alec Steene

- **Github Username:** asteene
- **Niner Net ID:** asteene
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
flask==2.2.2
flask==2.2.2
pylint==2.17.1
plantuml==0.3.0
Loading