Architecture Specifications - sheared-sasquatch/sparkclips GitHub Wiki

Component: Server-side web (using ASPnet core framework) Sam

  • Components responsibilities
    • Sam talks to Bob to get image files representing haircuts.
    • Sam talks to Harry to get all textual information concerning haircuts, haircut log, user preferences.
    • Sam talks to Harry to ensure users have valid credentials, or to make accounts.
    • Sam responds to requests from Cody, serving pages and responding to actions. Such actions include adding haircut photos, requests to change the page, requests for images, and upvotes (AJAX).
  • Data and functionality it will encapsulate
    1. Functions related to receiving network requests from client.
    2. Functions related to reading from Bob and Harry, and returning information to a client.
    3. Functions related to writing to Bob and Harry.
    4. User session information. Both creating and verifying them.
  • Data type
    • Client of Bob and Harry, so can receive the datatypes that they return and handle them up until giving them to Cody.
  • Inputs and outputs and their exact data types and the properties of the intended output
    • When Cody sends Sam a network GET request, Sam is able to respond by giving images acquired from Bob, and text information from Harry.
    • When Cody sends Sam a network request with user credentials, Sam is able to respond with confirmation that the user is valid.
    • When Cody sends Sam a network POST request, Sam is able to either create users or write text to Harry, or write images to Bob.

Component: Blob storage Bob

  • Components responsibilities
    • Bob allows Sam to store files
    • Bob allows Sam to retrieve files based on GUIDs that Sam has stored in Harry
  • Data and functionality it will encapsulate
    1. Blob storage Bob is an abstraction in our code base that will help us handle the storage and retrieval of images for our web app. Our external storage provider will be Azure Blob Storage.
  • Natural language the exact data type
    • The data type Bob uses it images files that will be uploaded and downloaded from Azure
  • Inputs and outputs and their exact data types and the properties of the intended output
    • Bob will have a store method, which will include as a parameter a ByteStream which represents the file contents. Another parameter will be file GUID
    • Bob will have a retrieve method, which will include as a parameter a file GUID, which Bob will use to retrieve the correct file. Bob will return a ByteStream with the file content

Component: Harry the database (SQL)

  • Components responsibilities
    • Harry will be responsible for keeping track of all of our application’s data and metadata. Such as user credentials, haircut textual information, user preferences, and haircut log entries.
  • Data and functionality it will encapsulate
    1. Harry will keep track of user accounts and passwords and associated user profile data
    2. Harry will keep track of image file metadata
      • Blob GUID
      • File name
    3. Harry will keep track of gallery items
    4. Harry will keep track of log entries for users
  • Data type
    • See previous bullet point

Component: Client side code-y Cody

  • Components responsibilities
    • Cody will be displaying the entire
    • Cody retrieves all the assets from Sam that will be displayed to users. Cody handles user interaction and event listeners, and talks to Sam or the other dudes to get changes updated in the backend. Cody needs to be properly designed so that it is aesthetically pleasing and user-friendly.
  • Data and functionality it will encapsulate
    1. Functions related to retrieving data/assets from Sam and displaying them to the front-end.
    2. Functions related to conveying upvotes/favorites to Sam so that counts get properly stored.
    3. Cody will serve as the medium for users to log in to existing accounts and/or sign up for new accounts, in which case it will communicate with the backend authentication so that proper data get stored.
  • Data type
    • Account Information (Name, Username, password)
    • Assets (Images, description text)
    • Upvotes/Favorites counts
  • Inputs and outputs and their exact data types and the properties of the intended output
    • Cody will retrieve all images, texts, description, as well as upvote and likes metrics from the server/database.
Dependency/Access Need to Know (static) Gallery Hair Cut Log
Anonymous access? Yes Yes No
Member access? Yes Yes Yes
Depends on SQL? No Yes Yes
Depends on Blob? No Yes Yes