DeltaO3 / UWAttend---3200_27

Repository for CITS3200 group 27
1 stars 1 forks source link

UWAttend - Group 27 (CITS3200)

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.

Manual

For more information on how to use UWAttend, visit the following: MANUAL.pdf

Prerequisites

To run UWAttend on your own machine, you must have the following dependencies installed on your system:

Installation

Clone the Repository

To get started, clone the repository:

git clone https://github.com/DeltaO3/UWAttend---3200_27.git UWAttend
cd UWAttend

Setting Up the Environment

  1. Create the Python Virtual Environment and activate it:
python3 -m venv venv
source /venv/vin/activate
  1. Install the required dependencies:
pip3 install -r requirements.txt
  1. Setting up .env Secret Keys UWAttend utilises secret keys located in .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

Database Setup

  1. Initialise the Database Schema:
flask db upgrade
  1. Populate the Database (Will not work without setting up Amazon SES credentials):
python3 -m app.testdb
  1. Add any additional admins to the database (OPTIONAL)
python3 -m app.createadmin.py

Running UWAttend

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

Database Schema

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.


1. alembic_version Table


2. session Table


3. Units_Coordinators_Table


4. Units_Facilitators_Table


5. attendance Table


6. student Table


7. unit Table


8. user Table

Project File Summary

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.