Skip to content

Architecture

William Edwards edited this page Oct 19, 2024 · 46 revisions

General Architecture Information

We will develop an Android app written in Kotlin on Android Studio. We will be using Android Views XML files to create our app’s layouts and the android.graphics library for custom graphics like charts and graphs. We will use Gradle as our package manager. Google Firebase Realtime Database will act as our database and Google Firebase Authentication will authenticate our users.

For testing during development, we will be using the built-in Android emulator in Android Studio.

For distributing to testers during development, we will...

Model Classes and Databases

Database Schema

Firebase Realtime Databases store everything in one JSON tree. The following tree represents the schema of that tree, but avoids exact JSON syntax for conciseness. [Type] represents a list of that type. Non-JSON-supported types, such as UUIDs, Dates, Datetimes, are strings. "Lists of objects with:" means that there will be a variable number of properties named with the UUID of the object they contain. Each object will contain contain all the properties the next level down after "with:". Doing this instead of using an actual JSON list allows us to get a single object based on UUID instead of having to download all objects of that type and filtering them on device.

Root of Firebase real-time database tree:

  • users: list of objects with:
    • id: UUID
    • classes: [UUID]
    • classInvitations: [UUID]
    • globalSettings: bool
    • blockedUsers: [UUID]
  • settings: list of objects with:
    • user: UUID
    • class: UUID
    • unpreparedOption: bool
    • selectionAnimation: bool
    • selectionAlgorithmIParam: int
    • skippedStudentNotRespottedOnThatDay: bool
    • raiseAbsentSpotProb: bool
    • raiseSkipSpotProb: bool
    • currentRatingSystemMax: int
  • classes: list of objects with:
    • id: UUID
    • students: [UUID]
    • layout: UUID
    • name: string
    • owner: UUID
    • acceptedUsers: [UUID]
    • invitedUsers: [UUID]
  • students: list of objects with:
    • id: UUID
    • class: UUID
    • firstname: string
    • lastname: string
    • nonAbsentSpottings: int
    • lastNonAbsentSpotting: Date
    • absences: int
    • unprepareds: int
    • lastAbsence: Date
    • lastUnprepared: Date
    • totalOfRatings: double
    • numberOfRatings: int
    • seat: string
    • profilePicture: Cloud Storage for Firebase URI string
    • year: string
  • spottings: list of objects with:
    • id: UUID
    • student: UUID
    • class: UUID
    • unprepared: bool
    • rating: double
    • skipped: bool
    • absent: bool
    • datetime: DateTime
    • maxOfRatingSystem: int
  • gridLayouts: list of objects with:
    • id: UUID
    • class: UUID
    • rows: int
    • columns: int
    • seatNumberingSystem: string
  • bowlLayouts: list of objects with:
    • id: UUID
    • class: UUID
    • rows: int
    • columnsPerRow: [int]
    • seatNumberingSystem: string
  • customLayouts: list of objects with:
    • id: UUID
    • class: UUID
    • seatNumberingSystem: string
    • seats: list of objects with:
      • x: double
      • y: double
      • rotation: double
      • name: string

Views

LOGIN SCREEN

  • tvLogInPrompt (TextView): A TextView prompting the user to log in.
  • etUsername (EditText): An EditText for the user to enter their username.
  • etPassword (EditText): An EditText for the user to enter their password.
  • chkRememberMe (CheckBox): A CheckBox for the user to select in order to avoid logging in every time they use the app.
  • btnForgotPass (Button): A Button which brings the user to the “Password Recovery” screen in case they have forgotten their password.
  • btnLogIn (Button): A Button which submits the user’s username and password when pressed and brings them to the “Home” screen if their username and password correspond to an existing account.
  • btnSignUp (Button): A button which brings the user to the “Sign Up” screen if they need to create an account.

SIGNUP SCREEN

  • imgBtnBack(ImageButton): An ImageButton in the upper left to bring the user back to the “Login” screen.
  • tvSignUpPrompt (TextView): A TextView prompting the user to enter their information in order to create a new account.
  • etEmail (EditText): An EditText for the user to enter their email.
  • etUsername (EditText): An EditText for the user to enter their username.
  • etPassword (EditText): An EditText for the user to enter their password.
  • etPasswordRepeat (EditText): An EditText for the user to enter their password again in order to confirm their password choice.
  • btnSubmit (Button): A Button which submits the user’s info to create a new account and brings them to the “Home” screen.

ACCOUNT RECOVERY SCREEN

  • imgBtnBack(ImageButton): An ImageButton in the upper left to bring the user back to the “Login” screen.
  • tvRecoveryPrompt (TextView): A TextView prompting the user to enter the email connected to their account.
  • etEmail (EditText): An EditText for the user to enter their email.
  • btnSendEmail (Button): A Button for the user to submit their email address so that they can receive an email to reset their password and recover their account (or an email notifying them that there is no account corresponding to the given email).

HOME SCREEN

  • imgBtnHamburgerMenu (ImageButton): An ImageButton to open up a NavigationDrawer from the left side which contains a list of the user’s classes.
  • imgBtnSettings (ImageButton): An ImageButton which brings the user to the “Settings” screen when pressed.
  • tvClassTitle (TextView): A TextView displaying the name of the currently open class.
  • btnStudent1, btnStudent2, … (Buttons): A grid of Buttons representing seats based on the classroom layout. If the seat the button represents is occupied, the initials of the student occupying it will be presented. If a button representing an occupied seat is pressed, the app will switch to the “View Student Information” screen for the student sitting in the selected seat.
  • btnSpot (Button): A Button which selects a random student from the class roster and displays their name and information along with the performance rating interface in a popup screen.
  • imgBtnRoster (ImageButton): an ImageButton in the bottom left which opens up the “Class Roster” screen when pressed, allowing the user to view information about the students in their class.
  • imgBtnStats (ImageButton): An ImageButton to the right of imgBtnRoster which opens up the “Statistics” Screen when pressed, allowing the user to view the class’s statistics.
  • imgBtnEditClass (ImageButton): An ImageButton in the bottom right which opens up the “Class Edit” screen when pressed, allowing the user to edit the class title, roster, and seat layout.

SPOT SCREEN

  • tvStudentName (TextView): A TextView containing the student’s name that was selected from the class roster.
  • tvNumPriorCalls (TextView): A TextView containing the number of times the selected student has been called that day.
  • tvAvgRating (TextView): A TextView containing the overall average rating of that student’s performance.
  • tvRatingPrompt (TextView): A TextView containing the text “Performance Rating”, prompting the user to rate the student’s performance from 1 to 5 stars.
  • imgBtnStar1, imgBtnStar2, … (ImageButtons): A series of five ImageButtons allowing the user to rank the performance of the student.
  • btnAbsent (Button): A button allowing the user to indicate the selected student is absent from class.
  • btnUnprepared (Button): A button allowing the user to indicate the selected student was unprepared for the question. This simply provides an extra flag for class statistics.
  • imgBtnDone (ImageButton): An ImageButton in the bottom left allowing the user to submit their rating of the student and return to the “Home” screen.
  • imgBtnNext (ImageButton): An ImageButton in the bottom right allowing the user to submit their rating of the student and randomly select another student.
  • btnSkip (Button): A Button allowing the user to skip the selected student and not save any rating data for the selected student.
  • Note: This entire layout will be placed in a Dialog object to achieve the popup effect.

SETTINGS SCREEN

  • imgBtnBack(ImageButton): An ImageButton in the upper left to bring the user back to the “Home” screen.
  • tvSettings (TextView): A TextView containing “Settings”.
  • tvUnpreparedOpt (TextView): A TextView labeling the Switch which turns on and off the option for a user to mark a student as “unprepared”.
  • swtUnpreparedOpt (Switch): A Switch allowing the user to turn on and off the option for a user to mark a student as “unprepared”.
  • imgBtnUnpreparedOptInfo (ImageButton): An ImageButton to the left of tvUnpreparedOpt which will provide more information about the specific setting when pressed by the user.
  • tvAnimationOpt (TextView): A TextView labeling the Switch which turns on and off the option for a user to mark a student as “unprepared”.
  • swtAnimationOpt (Switch): A Switch allowing the user to turn on and off the animation that plays when btnSpot is pressed.
  • imgBtnAnimationOptInfo (ImageButton): An ImageButton to the left of tvAnimationOpt which will provide more information about the specific setting when pressed by the user.
  • tvRatingOpt (TextView): A TextView labeling the Spinner which allows the user to select which rating system they want to use (5 stars, 1-10, letter grading system, etc.)
  • spnRatingOpt (Spinner): A Switch allowing the user to turn on and off the option for a user to mark a student as “unprepared”.
  • imgBtnRatingOptInfo (ImageButton): An ImageButton to the left of tvRatingOpt which will provide more information about the specific setting when pressed by the user.
  • btnLogOut (Button): A Button allowing the user to log out of their account and return to the “Login” screen.
  • Note: There will be other settings added to this screen as we develop the app. Each will have the same setup: a TextView labeling the setting, the proper widget for choosing the setting, and a Button to provide more information about the setting.

STATISTICS SCREEN

  • imgBtnBack(ImageButton): An ImageButton in the upper left to bring the user back to the “Home” screen.
  • tvStatistics (TextView): A TextView containing “Class Statistics”
  • tvUpdate (TextView): A TextView containing a generated update about the class based on its current performance trends.
  • tvClassData (TextView): A TextView containing various statistics about the class such as total students, average rating, best performing student, worst performing student, etc.
  • Note: There will be multiple graphs on this screen. For example, there may be a pie chart representing the distribution of performance ratings, and there may be a line chart representing the progression of ratings over time. These graphs will be drawn in Canvases using the android.graphics library.

CLASS LIST SCREEN

  • nvClassList (NavigationView): A NavigationView containing the Buttons used to swap between classes. This will slide in/out from the left when the hamburger button is pressed.
  • imgBtnHamburgerMenu (ImageButton): An ImageButton to close the NavigationDrawer from the left side which contains a list of the user’s classes.
  • btnClass1, btnClass2, … (Buttons): A series of Buttons used to switch to other classes that the user has created. When a user creates a new class, a new Button is added to this list containing the name of the created class.
  • btnAddClass (Button): A Button which brings the user to the “Create Class” screen when pressed so that the user can create new classes.

Clone this wiki locally