UWAttend is a web-based application written in Flask that is designed to simplify and streamline the process of student sign-ins and sign-outs for university classes. This app helps class facilitators track student participation and manage grading and aims to replace hand-written attendance tracking.
For more information on how to use UWAttend, visit the following: MANUAL.pdf
To run UWAttend on your own machine, you must have the following dependencies installed on your system:
To get started, clone the repository:
git clone https://github.com/DeltaO3/UWAttend---3200_27.git UWAttend
cd UWAttend
python3 -m venv venv
source /venv/vin/activate
pip3 install -r requirements.txt
.env
for security purposes. Create a file called .env
in the project root directory and set the following:SECRET_KEY="insert_key_here"
DATABASE_PASSWORD="insert_key_here"
# UWAttend uses boto3 to send emails using Amazon SES.
# You must set up SES inorder for the email functionality to work.
# If you don't have SES, you will need to set up Admin account variables below in order to start using the app.
AWS_ACCESS_KEY="insert_key_key"
AWS_SECRET_ACCESS_KEY="insert_key_here"
# Optional Admin Account Variables if you want to add an extra admin user
EMAIL="sampleemail@gmail.com"
FIRSTNAME="John"
LASTNAME="Smith"
PASSWORD="password"
USERTYPE="admin"
Note: replace "insert_key_here"
with your desired values
SECRET_KEY
- The key to initialise SQLalchemyDATABASE_PASSWORD
- The password that will be used to encrypt app.db
flask db upgrade
python3 -m app.testdb
python3 -m app.createadmin.py
Now that all the dependencies are set up, you can now run the flask app.
To start the web-app, run the following:
flask run
This will host the application at http://127.0.0.1:5000
This database schema is designed to manage the different entities and relationships within the UWAttend system, such as users, sessions, units, attendance, and student information. Below is an explanation of the purpose of each table and its respective columns.
version_num
: A unique version identifier for the current schema state.sessionID
: The unique identifier for each session.unitID
: A foreign key linking to the unit table, indicating which unit the session belongs to.sessionName
: The name of the session (e.g., Lab, Lecture).sessionTime
: The time when the session takes place (e.g., Morning, Afternoon).sessionDate
: The date of the session.userID
: A foreign key referencing the user table, representing the coordinator.unitID
: A foreign key referencing the unit table, indicating which unit the coordinator is responsible for.userID
: A foreign key referencing the user table, representing the facilitator.unitID
: A foreign key referencing the unit table, indicating which unit the facilitator is assigned to.attendanceID
: The unique identifier for each attendance record.sessionID
: A foreign key referencing the session table, linking the attendance to a specific session.studentID
: A foreign key referencing the student table, identifying the student attending the session.signInTime
: The time the student signed in for the session.signOutTime
: The time the student signed out (optional).facilitatorID
: A foreign key referencing the user table (as a facilitator), indicating who facilitated the session.marks
: Any grades or marks awarded during the session (optional).comments
: Comments or feedback about the student's participation in the session (optional).consent_given
: Indicates whether the student has given consent for their participation to be recorded.studentID
: The unique identifier for each student.studentNumber
: The student’s university-assigned number.firstName
: The student's first name.lastName
: The student's last name.title
: The student’s title (e.g., Mr., Ms., Dr.).preferredName
: The name the student prefers to be called.unitID
: A foreign key referencing the unit table, linking the student to a specific unit.consent
: Indicates whether the student has provided consent for their participation to be recorded.unitID
: The unique identifier for each unit.unitCode
: The unique code for the course (e.g., CITS3000).unitName
: The name of the course (e.g., Computing 101).studyPeriod
: The academic period or semester in which the unit runs.startDate
: The date when the unit begins.endDate
: The date when the unit ends.sessionNames
: Names of the sessions associated with the unit (e.g., Lecture, Lab).sessionTimes
: Times when the sessions for the unit occur (e.g., Morning, Afternoon).comments
: A boolean value indicating whether comments are enabled for this unit.marks
: A boolean value indicating whether marks are assigned for this unit.consent
: A boolean value indicating whether consent is required for this unit.commentSuggestions
: Suggested comments that can be used by facilitators for feedback.userID
: The unique identifier for each user.userType
: The type of user (e.g., admin, coordinator, facilitator).firstName
: The first name of the user.lastName
: The last name of the user.passwordHash
: The hashed password used for login authentication.email
: The email address of the user (unique).token
: Optional field for storing a session or authentication token.createadmin.py
This script is responsible for creating an admin user in the system, initialising the required administrator account for the application.
database.py
Handles the configuration and connection to the database, including initialising the database models and performing database-related tasks.
forms.py
Contains the form definitions used throughout the application, typically with Flask-WTF, for handling form validation and user inputs on the frontend.
helpers.py
Includes utility functions or helper methods that perform common tasks needed across the application, such as formatting or shared logic.
__init__.py
Initialises the Flask app and sets up configurations, routing, and extensions. This is the entry point for the app's core setup.
models.py
Defines the data models (tables) for the application using an ORM (like SQLAlchemy). This file contains the structure for the database tables and relationships.
routes.py
Defines the routes or endpoints for the web application. It maps URLs to their corresponding view functions, handling requests and responses.
static
Contains static files such as JavaScript, CSS, and other resources (e.g., CSV templates). These files are used to enhance the frontend of the application.
templates
Houses all the HTML files used in the application, following the Jinja2 templating system. These templates define the structure and layout of the web pages rendered by the Flask app.
testdb.py
A script for initialising or populating the database with test data.
utilities.py
Contains utility functions specific to various parts of the application, such as data processing, reading files, or performing operations that don't fit directly into the models or routes.