Giter Club home page Giter Club logo

appdevbackend's Introduction

backend for the fun class

this is an attempt at categorizing the large Cornell class offering and allowing the user to search for keywords.

at a summary, it is a wrapper that caches the Cornell class roster and combines it with web-scraped data from CUReviews.

note: a second table was not used because we could not figure out how to best implement it with our current needs. We spent the majority of time learning how to web-scrape, because we wanted to start off with a dataset that was already compiled and public.

Public API spec:

Get details about a specific class

GET /api/courses/<course_subject>/<course_code/>

Response:

{
    "success": true, 
    "data":
    {
        "id": <database id>,
        "subject": <class subject>,
        "code": <class number>,
        "name": <class title>,
        "description": <class description>,
        "credit_count": <class credits>,
        "CU_Reviews_Overall": <CU Reviews Overall Rating>,
        "CU_Reviews_Difficulty": <CU Reviews Difficulty>,
        "CU_Reviews_Workload": <CU Reviews Workload>
    }

}

Search for tags/keywords

GET /api/courses/search/<query>/

Response:

{
    "success": true,
    "data":
    {
        [
            {
                "subject": <class subject 1>, 
                "code": <class number 1>
            }, 
            {
                "subject": <class subject 2>, 
                "code": <class number 2>
            }, 
            ...
        ]
    }
}

Private API spec:

Notes: These APIs may not function correctly because they rely on CUReviews, an external site. An update before preenroll appears to have broken the web scraping functionality. In short, CUReviews is a React website, and thus requires client-side rendering and execution of Javascript in order to produce a HTML page that's viewable. However, when automating visits and rendering the Javascript, there is a bug that was introduced last week (see the latest Github commit about a week ago, as of 12 May 2021) which breaks the rendering pipeline when non-human visitors visit the site.

Update all classes

POST /api/internal/update/

Important note: This web scrape is exhaustive; takes about three hours to execute

Expected Request:

{
    "CONFIRM": true
}

Response:

{
    "success": true,
    "data": null
}

Update specific class

GET /api/internal/update/

Response:

{
    "success": true, 
    "data":
    {
        "id": <database id>,
        "subject": <class subject>,
        "code": <class number>,
        "name": <class title>,
        "description": <class description>,
        "credit_count": <class credits>,
        "CU_Reviews_Overall": <CU Reviews Overall Rating>,
        "CU_Reviews_Difficulty": <CU Reviews Difficulty>,
        "CU_Reviews_Workload": <CU Reviews Workload>
    }

}

appdevbackend's People

Contributors

jjjxu avatar

Watchers

 avatar

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.