GithubHelp home page GithubHelp logo

jburns20 / q Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 17.0 388 KB

The office hours queue for Carnegie Mellon's 15-122 course.

Home Page: http://q.15122.tk

JavaScript 70.60% CSS 3.70% EJS 25.71%
office-hours-queue education queue node-js carnegie-mellon-university

q's Introduction

15-122 Office Hours Queue

Gather Necessary Information

In order to install the Queue application, you'll need to create a MySQL database and user, and obtain Google OAuth credentials. After installing MySQL (directions for Ubuntu can be found here. Other platforms: Google it), you can run the following sequence of commands to create a database and a user that has permission to access it:

  1. $ mysql -u root -p (and enter the MySQL root password which you created during installation)
  2. mysql> CREATE DATABASE queue;
  3. mysql> CREATE USER 'your_username'@'localhost' IDENTIFIED BY 'your_password'; (make sure to choose a strong password)
  4. mysql> GRANT ALL PRIVILEGES ON queue.* TO 'your_username'@'localhost';

To get Google OAuth credentials, you can follow the instructions at https://developers.google.com/adwords/api/docs/guides/authentication#webapp. Leave the "Authorized JavaScript origins" field blank, and use https://<YOUR_DOMAIN>/oauth2/callback for the Authorized Redirect URI. (if you're not using HTTPS, replace https with http).

If you have a Slack team set up for your course, you can set up a Slack Incoming Webhook here. Otherwise, you may leave the slack_webhook field empty in the config file.

Install

  1. Install Node.js

  2. Clone this repository

  3. In the root directory, create the file config.json with the following structure:

    {
        "title": "15-122 Office Hours Queue",
        "protocol": "http",
        "domain": "q.15122.tk",
        "timezone": "America/New_York",
        "server_port": 80,
    
        "mysql_db": "<Your MySQL database>",
        "mysql_user": "<MySQL user that has access to the database>",
        "mysql_pass": "<Password for the MySQL user>",
    
        "google_id": "<Google Client ID from https://console.developers.google.com>",
        "google_secret": "<Google Client Secret from https://console.developers.google.com>",
    
        "owner_email": "<Google/Andrew account email address for this site's Owner (super-user)>"
    }
    
  4. Run this command in your terminal:

    npm install
    

Set up and run

This part is up to you. If port 80 is already being used (for another web server, for example), you can set up Nginx as a reverse proxy and use a different port in config.json. Once you have properly configured your environment, use the following command to run the server:

node index.js

You can also use pm2 to manage the server process to ensure that it's always running.

Add your information

In a web browser, go to the domain you specified in the configuration. If everything was set up correctly, you should see a splash page that says the installation was successful.

Log into the account with the email address you specified as the owner_email in the configuration to finish the setup. You'll be taken to the admin page, where you should set the current semester and add admins, TAs and topics. If you're planning to help students, you must add yourself to the list as an admin (being the owner is not enough).

q's People

Contributors

alex-stanescu avatar anbenson avatar angelaz1 avatar austin-leung avatar baozix avatar dependabot[bot] avatar gyf304 avatar jburns20 avatar pranavaddepalli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

q's Issues

Students/Hour is really small

Graphs are honestly a pain to implement, but is there any way to change the timeframe for the metrics graph? Currently, the number of students per hour graph is really, really small.

screen shot 2019-02-11 at 12 35 30 am

Show more data

Show more data than just the "mean" time. Ideally we could see a histogram of all times, but if not that then at least the median time :)

Issue with mysql table setup

setup according to README, getting this

'Unhandled rejection SequelizeDatabaseError: ER_NO_SUCH_TABLE: Table 'queue.options' doesn't exist
at Query.formatError (/Users/harryxu/Desktop/Harrys_Stuff/School/Carnegie_Mellon_Undergrad/q/node_modules/sequelize/lib/dialects/mysql/query.js:175:14)
at Query._callback (/Users/harryxu/Desktop/Harrys_Stuff/School/Carnegie_Mellon_Undergrad/q/node_modules/sequelize/lib/dialects/mysql/query.js:49:21)
at Query.Sequence.end (/Users/harryxu/Desktop/Harrys_Stuff/School/Carnegie_Mellon_Undergrad/q/node_modules/mysql/lib/protocol/sequences/Sequence.js:88:24)
at Query.ErrorPacket (/Users/harryxu/Desktop/Harrys_Stuff/School/Carnegie_Mellon_Undergrad/q/node_modules/mysql/lib/protocol/sequences/Query.js:90:8)
at Protocol._parsePacket (/Users/harryxu/Desktop/Harrys_Stuff/School/Carnegie_Mellon_Undergrad/q/node_modules/mysql/lib/protocol/Protocol.js:279:23)
at Parser.write (/Users/harryxu/Desktop/Harrys_Stuff/School/Carnegie_Mellon_Undergrad/q/node_modules/mysql/lib/protocol/Parser.js:76:12)
at Protocol.write (/Users/harryxu/Desktop/Harrys_Stuff/School/Carnegie_Mellon_Undergrad/q/node_modules/mysql/lib/protocol/Protocol.js:39:16)
at Socket. (/Users/harryxu/Desktop/Harrys_Stuff/School/Carnegie_Mellon_Undergrad/q/node_modules/mysql/lib/Connection.js:103:28)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at TCP.onread (net.js:607:20)'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.