Giter Club home page Giter Club logo

final-project-team-6's Introduction

Admin Status Client Status

Overview

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.

Subsystems

  • 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

Running the Project

  1. Make sure you have a .env file exists in both users and admin directory. Within the .env file, make sure you have the following environment variables
    DB_CONNECTION_STRING=YOUR_DB_CONNECTION_STRING
    DB_NAME=YOUR_DB_NAME
    
    where DB_CONNECTION_STRING is the connection string to your MongoDB database, and DB_NAME is the Database name.

Running with Docker

  1. Navigate to the root folder of this project, then run:

    docker compose up
    
  2. The admin client will run at 127.0.0.1:7001. The users client will run at 127.0.0.1:6001.

  3. 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/

Running without Docker

User

  1. Navigate to /users, then:
pip3 install -r requirements.txt

python -m flask run --port=6001

Admin

  1. Navigate to /admin, then:
pip3 install -r requirements.txt

python -m flask run --port=6001

Running the Project for the First Time

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.

  1. Launch the Admin App
    cd admin
    python -m flask run --port=6001
    
  2. On the main page, click "Refresh All Courses from Schedge API"
  3. 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.
  4. In the future, if NYU updates its academic calender, you can always click the Refresh button to update existing courses.

Running Tests

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

Deployed Apps

We have deployed both of our apps. You can try them using the links below:
Admin App
Visitor App

Docker Images

We have pushed our custom subsystem images to DockerHub:
Admin App
Visitor App


CI/CD

Admin App CI/CD workflow
Client App CI/CD workflow
*Note: Test coverages are also included in our GitHub Action workflows.

Admin Functionalities

Refresh All Schools/Subjects/Courses

  1. On the top of the main Page, click "Refresh All Courses from Schedge API"
  2. This will take some time to refresh all schools / subjects/ courses to the database

View All Courses of a particular subject

  1. On the main page, click the school of the subject you want to view
  2. Find the subject you want to explore
  3. You will see a list of all displayed courses. You can click on those courses to view details

Hide/Show Courses

  1. On the same page, the switch on the top indicates whether you are viewing displayed courses or hidden courses.
  2. You can change the display status of each course on this page
    1. 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.
    2. 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 to displayed

Delete Comments

  1. When you view details of a course, you can also see all its comments
  2. You can choose to delete a particular comment

Client Functionalities

Login / Register / Logout

  1. You can login / register when you first use this app, and your session will be kept
  2. You can logout on the top-right corner in the App

Browse Courses / Dashboard

  1. By default, the school and subject on your dashboard are your major set during your registeration process
  2. You can change them and view all courses of your selected subject
  3. You can click on the title of a course to view all its sections.
  4. You can view the details of a specific section by pressing the "Details" button

Post Comments

  1. 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.

API Used

Schedge

Schedge is an API to NYU's course catalog. Please note that this API is currently under active development and is subject to change.

Collections

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
}

File Structure

├── 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

Contributors

Tim Chen

James Liu

Wenni Fan

Yanchong Xu

Iris Qian

Jiawei Zhang

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.