Disclaimer: You are not supposed to reuse the code in this repo for your current CS 4501 Internet Scale Application class project. Learning the how to do the project yourself is an essential point of learning in this class
This project attempts to integrate and improve on the current functionality of Lou's list and the Course Forum by adding improved data visualization of grade distribution data (retrieved through FOIA) in order to provide students and faculty an improved perspective that will aid in the course selection process.
You may contribute your thoughts on this project to our Trello page. The models API is documented on Swagger.
All CS 4501 (Internet Scale Application) course related files can be found in the misc/
directory. Please see cs4501.md for details.
For initial setup, please refer to Project1 @CS4501. The next parts assume you have Django/Docker correctly installed, and a mysql container (with credentials given in the project) up and running.
- First
clone
orpull
the current project from Github:
$ cd ~/cs4501/app/
$ git clone https://github.com/Charleo85/SIS-Rebuild
- Locate and run the docker-compose file:
$ cd SIS-Rebuild/
$ docker-compose up -d
- Verify that the website is working (you should see html codes for the homepage):
$ curl 127.0.0.1
- Depending on situations, you might want to reset the MySQL database to its initial state:
$ docker start mysql
$ chmod 755 misc/scripts/cleardb.sh && ./misc/scripts/cleardb.sh
**Note: every model begins with a line describing its "required" fields; all other fields can be left blank.
-
Grade
- required:
num_a
,num_b
,num_c
,num_d
,num_f
; average_gpa
:DecimalField
w/ 3 decimal places;num_a_plus
,num_a
,num_a_minus
, etc. (down tonum_f
):PositiveSmallIntegerField
;num_withdraw
,num_drop
:PositiveSmallIntegerField
.
- required:
-
Course
- required:
name
,mnemonic
,number
,grade
; name
,mnemonic
,number
:CharField
;description
:TextField
;grade
: one-to-one relationship withGrade
model.
- required:
-
Section
- required:
semester
,section_id
,sis_id
,units
,section_type
,course
,instructor
; semester
,section_id
,sis_id
:CharField
;units
:PositiveSmallIntegerField
;section_type
:CharField
with choices (lectures, labs, etc.), seemodels.py
;title
,meeting_time
,location
:CharField
;website
:URLField
;capacity
:PositiveSmallIntegerField
;description
,other_info
:TextField
.course
: many-to-one relationship withCourse
model;instructor
: many-to-one relationship withInstructor
model;grade
: one-to-one relationship withGrade
model.
- required:
-
User
- required:
username
,password
,name
; username
,password
,name
:CharField
,password
field stores hashes;email
:EmailField
;interested_course
: many-to-many relationship withSection
.
- required:
-
Instructor
- required:
name
,computing_id
; name
,computing_id
:CharField
;website
:URLField
;email
:EmailField
;address
,cell_phone
:CharField
;other_info
:TextField
;user
: one-to-one relationship withUser
model (see if the instructor is a registered user).
- required:
-
Authenticator
backend usage only- required:
user_id
,authenticator
,date_created
; user_id
,authenticator
:CharField
;date_created
:DateField
that automatically record dates when anAuthenticator
is created.
- required:
Important: The views are written in an object-oriented way, using Django's class-based views. There's a BaseView
class that defines the basic behaviors of a view (i.e. when it receives a GET, POST, or DELETE request). Every view class extends from this base class, and should define the methods to create/update/lookup a specific model.
-
For model
Course
: base_url =/apiv2/course
-
GET
- use keyword arguments as queries after the base_url.
- returns an array of objects that matches the given query.
- example: to retrieve all courses with mnemonic CS and number 2150, use
/apiv2/course?mnemonic=CS&number=2150
.
-
POST (create)
- nothing should be present after the base_url.
- use key-value pairs as post data (also accepts JSON).
- returns the id of the newly created object, if successful.
-
POST (update)
- use keyword arguments as queries (same as GET) to filter the single object to update.
- use key-value pairs as post data (also accepts JSON).
- each valid key-value pair would correspond to one updated column for the object.
- returns the id of the updated object, if successful.
-
DELETE
- use keyword arguments as queries (same as GET) to filter the object(s) to delete.
- no body content should be present for this request.
- to force deletion of multiple objects, specify
?force=true
in the url query.
-
-
December 13th, 2016
- Finished all CS 4501 course projects. Details on Wiki.
-
January 3rd, 2017
- Open-source procedures completed; Trello page created.
- Document structure update.
-
January 14th
- Finished base codes for apiv2 (mostly
models.py
andviews.py
). - Tested the new api for model
Course
to make sure it's working.
- Finished base codes for apiv2 (mostly
- Charlie Wu (jw7jb@virginia.edu)
- Tong Qiu (tq7bw@virginia.edu)
- Zakey Faieq (zaf2xk@virginia.edu)