Skip to content

tamu-edu-students/Faculty-Teaching-Assignment

Repository files navigation

README

Team Name: AggieAssign

Summary

The main customer need is to have an application that creates an efficient classroom schedule which for each course section, assigns a time, a room, and an instructor, while satisfying a range of constraints. These constraints include room capacity, instructor availability, teaching style requirements, and course conflicts. The system also needs to consider instructor preferences, such as desired teaching times and course preferences, in order to maximize their satisfaction. The application provides a solution by providing an easy to understand interface which allows the user to upload data, preferences and constraints as csv files. It then automatically generates a schedule that meets both hard constraints and soft preferences, while minimizing wasted classroom space and balancing instructor workloads. The application will have additional features such as the ability to manually override schedules and see detailed schedule views, as well as export the generated schedules for easy sharing.

The key stakeholder for this application is the Associate Department Head, who is responsible for creating the teaching schedule before every semester. The secondary stakeholders are the Instructors and Students, who benefit indirectly from having flexible course schedules. The application integrates all scheduling requirements into one platform, allowing for streamlined data input, constraint satisfaction, and schedule optimization, while being scalable for future adjustments.

Prerequisites

-Ruby (version >= 2.7.0)

-Some C compiler (gcc, clang, etc.)

Build Instructions

Clone repository:

git clone git@github.com:tamu-edu-students/Faculty-Teaching-Assignment.git

Download gems and other dependencies:

cd Faculty-Teaching-Assignment
bundle install
rake glpk:install

The schedule builder relies on GLPK, an open-source linear program solver. This is downloaded, configured, and installed by the glpk:install Rake task. By default, it is installed to the top-level app directory, as to prevent the user from having to add the required binaries to their path. See lib/tasks/glpk.rake for details.

Links

Getting Started with Setup and Deployment

Prerequisites

  1. Heroku Account: Sign up for a Heroku account.
  2. Heroku CLI: Download and install the Heroku CLI.
  3. GitHub Repository: Ensure your Rails application is committed and pushed to a GitHub repository.
  4. Rails and Ruby: Check that you have Ruby and Rails installed locally to set up the app.
  5. OAuth Configuration: Ensure you have Google OAuth API keys

1. Clone the GitHub Repository (If Needed)

If you're setting up the project locally, clone the repository:

git clone https://github.com/tamu-edu-students/Faculty-Teaching-Assignment.git
cd Faculty-Teaching-Assignment

2. Install Dependencies and setup Rails Master Key

Run bundle install to install all required dependencies.

bundle install

Setup your Google OAuth Rails Credentials using Google Developer Console. For a more detailed explantion, see Setup Google OAuth on Google's End and Add OAuth ID and Secret to Rails Credentials.

If steps are followed correctly you would have your RAILS_MASTER_KEY in config/master.key. NEVER EVER COMMIT THIS TO GIT.


3. Set Up Database (Locally)

Run database migrations and set up the database:

rails db:create
rails db:migrate
rails db:seed # If there are any seed files
rails server # To run locally

4. Prepare Application for Heroku

  1. Add a Procfile: Create a file named Procfile in the root directory with the following line:

    web: bundle exec puma -C config/puma.rb
    
  2. Add the Heroku Postgres Add-on: Heroku uses PostgreSQL as the default database for Rails apps. Check your Gemfile for the pg gem.

  3. Environment Variables: Use dotenv for local testing and set variables on Heroku using the CLI.


5. Deploy to Heroku

  1. Login to Heroku:

    heroku login
  2. Create a New Heroku App:

    heroku create <YOUR_APP_NAME> # Optionally specify an app name
  3. Add Heroku as a Git Remote:

    git remote add heroku https://git.heroku.com/<YOUR_APP_NAME>.git
  4. Push to Heroku:

    git push heroku main
  5. Run Database Migrations on Heroku:

    heroku run rails db:migrate

6. Configure Environment Variables on Heroku and add redirect URI

Add the Heroku domain as an authorized redirect URI to your Google OAuth. Example:

https://<YOUR_APP_NAME>.herokuapp.com/auth/<PROVIDER>/callback

Set environment variables on Heroku for any API keys, secrets, or configuration variables, you will have to setup your Google Authentication key :

If you have used RAILS_MASTER_KEY to encrypt

heroku config:set RAILS_MASTER_KEY=<YOUR_MASTER_KEY>

If the above steps do not work, see Deploy to Heroku for OmniAuth documentation.