This is an NYU course forum with Albert courses data, comments and rate my professor link. It contains three subsystems: User app, Admin app, and a MongoDB database.
Admin app can add and update courses to the mongoDB to maintain the course and the correctness of the information with the help of Schedge API. They can also view course details, change the visibility of all courses, delete comments for a specific course, and refresh all courses when NYU updates its academic calender
Users app is more like a "Rate my NYU Courses" website. They can browse all courses and their detailed information, search, rate, and add their comments for a specific course.
- a admin - a program that demonstrates the courses information from API and demonstrate on screen for admin to add and delete to maintain
- a users - an interface through which web visitors can see the course information and post their comments & ratings
- a database - stores the data used by both other parts
- Make sure you have a
.env
file exists in bothusers
andadmin
directory. Within the.env
file, make sure you have the following environment variableswhereDB_CONNECTION_STRING=YOUR_DB_CONNECTION_STRING DB_NAME=YOUR_DB_NAME
DB_CONNECTION_STRING
is the connection string to your MongoDB database, andDB_NAME
is the Database name.
-
Navigate to the root folder of this project, then run:
docker compose up
-
The admin client will run at
127.0.0.1:7001
. The users client will run at127.0.0.1:6001
. -
A database container will also be created in your Docker. Make sure your
.env
file has the connection string to your database in the container. i.e.DB_CONNECTION_STRING=mongodb://db:27017/
- Navigate to
/users
, then:
pip3 install -r requirements.txt
python -m flask run --port=6001
- Navigate to
/admin
, then:
pip3 install -r requirements.txt
python -m flask run --port=6001
If the database in your .env
files are new, you need to have some initial data in your databases before you run the User app.
- Launch the Admin App
cd admin python -m flask run --port=6001
- On the main page, click "Refresh All Courses from Schedge API"
- Then, all NYU courses, schools, subjects info will be saved to your MongoDB. This is an asynchronous process, and it will take about 30 minutes to import everything. But you can still run User App while the Admin is importing data.
- In the future, if NYU updates its academic calender, you can always click the Refresh button to update existing courses.
IMPORTANT: Before you run tests, make sure both .env
files in users
and admin
are as follows (since some tests require some pre-existing data):
DB_CONNECTION_STRING=mongodb+srv://doadmin:fj70nM43lo9I15S2@db-mongodb-nyc1-17689-274bdc70.mongo.ondigitalocean.com/admin?tls=true&authSource=admin&replicaSet=db-mongodb-nyc1-17689
DB_NAME=App
Then, simply navigate to /users
or /admin
, and:
python -m pytest --cov
We have deployed both of our apps. You can try them using the links below:
Admin App
Visitor App
We have pushed our custom subsystem images to DockerHub:
Admin App
Visitor App
Admin App CI/CD workflow
Client App CI/CD workflow
*Note: Test coverages are also included in our GitHub Action workflows.
- On the top of the main Page, click "Refresh All Courses from Schedge API"
- This will take some time to refresh all schools / subjects/ courses to the database
- On the main page, click the school of the subject you want to view
- Find the subject you want to explore
- You will see a list of all displayed courses. You can click on those courses to view details
- On the same page, the switch on the top indicates whether you are viewing displayed courses or hidden courses.
- You can change the display status of each course on this page
- For example, if you are viewing displayed courses, you can change their status to
hidden
when you press "Hide All Selected Courses" button. Then, they will be removed from this list. - When you turn the switch to the other side, you will view all the
hidden
courses and you will be able to change their status back todisplayed
- For example, if you are viewing displayed courses, you can change their status to
- When you view details of a course, you can also see all its comments
- You can choose to delete a particular comment
- You can login / register when you first use this app, and your session will be kept
- You can logout on the top-right corner in the App
- By default, the school and subject on your dashboard are your major set during your registeration process
- You can change them and view all courses of your selected subject
- You can click on the title of a course to view all its sections.
- You can view the details of a specific section by pressing the "Details" button
- In the details panel of each section, you can post your comments and ratings to the course, which will affect this section's overall rating.
Schedge is an API to NYU's course catalog. Please note that this API is currently under active development and is subject to change.
User:
{
"username" : str
"password" : str,
"school" : str,
"subject" : str
}
Schools:
{
"schoolAbbr" : str,
"schoolFullname" : str,
"image": str (url)
"subjects" : [
{
"subjectAbbr" : str,
"subjectFullname" : str
}
]
}
Course:
{
"courseName" : str,
"schoolFullname" : str,
"campus" : str,
"deptCourseId" : str,
"description" : str,
"display" : boolean,
"grading" : str,
"instructionMode" : str,
"instructors" : [
str
],
"location" : str,
"notes" : str,
"overallRating" : int,
"rawCourseName" : str,
"registrationNumber" : int,
"rmpURLs" : [
str
],
"schoolAbbr" : str
"sectionName" : str
"section_code" : str,
"status" : str,
"subjectAbbr" : str,
"subjectFullname" : str,
"type" : str,
"units" : float
}
Comments:
{
"course_id" : ObjectId,
"comments" : [
{
"username" : str,
"comment" : str,
"rating" : str,
"comment_id": ObjectId
}
],
"overall_rating": float
}
├── LICENSE
├── README.md
├── admin
│ ├── Dockerfile
│ ├── README.md
│ ├── app.py
│ ├── common
│ │ └── libs
│ │ ├── Url_Manager.py
│ │ └── __init__.py
│ ├── config
│ │ └── base_setting.py
│ ├── controllers
│ │ ├── __init__.py
│ │ ├── comment.py
│ │ ├── course.py
│ │ ├── database.py
│ │ └── index.py
│ ├── crawl.py
│ ├── modules
│ │ ├── editDatabase.py
│ │ └── requestCourses.py
│ ├── requirements.txt
│ ├── rmpData.json
│ ├── static
│ │ ├── css
│ │ │ └── photo_demo.css
│ │ ├── images
│ │ │ ├── empty_star.png
│ │ │ └── filled_star.png
│ │ └── plugins
│ │ ├── bootstrap_v3
│ │ │ ├── css
│ │ │ ├── fonts
│ │ │ └── js
│ │ ├── jquery.min.js
│ │ └── layer
│ │ ├── layer.js
│ │ ├── mobile
│ │ │ ├── layer.js
│ │ │ └── need
│ │ │ └── layer.css
│ │ └── skin
│ ├── templates
│ │ ├── common
│ │ │ └── layout.html
│ │ └── courses
│ │ ├── course_details.html
│ │ ├── courses.html
│ │ ├── schools.html
│ │ └── subjects.html
│ └── tests
│ ├── test_comment.py
│ ├── test_course.py
│ ├── test_database.py
│ ├── test_editDatabase.py
│ ├── test_index.py
│ └── test_requestCourse.py
├── docker-compose.yaml
└── users
├── Dockerfile
├── app.py
├── common
│ └── libs
│ ├── Url_Manager.py
│ └── __init__.py
├── config
│ └── base_setting.py
├── controllers
│ ├── __init__.py
│ ├── course.py
│ ├── dashboard.py
│ ├── index.py
│ └── login.py
├── models
│ ├── __init__.py
│ ├── comment.py
│ ├── database.py
│ └── user.py
├── requirements.txt
├── static
│ ├── css
│ │ └── dashboard.css
│ ├── images
│ │ ├── empty_star.png
│ │ └── filled_star.png
│ └── plugins
│ ├── bootstrap_v3
│ │ ├── css
│ │ ├── fonts
│ │ └── js
│ ├── jquery.min.js
│ └── layer
│ ├── layer.js
│ ├── mobile
│ │ ├── layer.js
│ │ └── need
│ │ └── layer.css
│ └── skin
├── templates
│ ├── common
│ │ ├── layout.html
│ │ └── layout_authenticated.html
│ ├── courses
│ │ ├── course_details.html
│ │ ├── dashboard.html
│ │ ├── dashboard_search.html
│ │ ├── hello_world.html
│ │ └── index.html
│ ├── hello_world.html
│ ├── login.html
│ └── sign_up.html
└── tests
├── test_database.py
├── test_login_route.py
└── test_test.py