diff --git a/.DS_Store b/.DS_Store index 3a209cc..267d18e 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.env.local b/.env.local new file mode 100644 index 0000000..89cbb04 --- /dev/null +++ b/.env.local @@ -0,0 +1 @@ +BUMP_TOKEN=vvg5DaxfdWUVR9A8vUMnTGrgd5taQBNN \ No newline at end of file diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml deleted file mode 100644 index b887b33..0000000 --- a/.github/workflows/bump.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Check & deploy API documentation -permissions: - contents: read - pull-requests: write -on: - push: - branches: - - main - - master - pull_request: - branches: - - main - - master -jobs: - deploy-doc: - if: ${{ github.event_name == 'push' }} - name: Deploy API documentation on Bump.sh - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Deploy API documentation - uses: bump-sh/github-action@v1 - with: - doc: classify - token: dS6y9Ec8CnxDsK5UaCTE5tahq6vLfRUp - file: doc/api-documentation.yml - api-diff: - if: ${{ github.event_name == 'pull_request' }} - name: Check API diff on Bump.sh - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Comment pull request with API diff - uses: bump-sh/github-action@v1 - with: - doc: classify - token: dS6y9Ec8CnxDsK5UaCTE5tahq6vLfRUp - file: doc/api-documentation.yml - command: diff - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - - diff --git a/api-documentation.yml b/api-documentation.yml new file mode 100644 index 0000000..77e3254 --- /dev/null +++ b/api-documentation.yml @@ -0,0 +1,225 @@ +openapi: 3.0.3 +info: + title: UIUC Course API + description: A comprehensive API to retrieve and manage course-related data at the University of Illinois Urbana-Champaign. + version: 1.0.0 +servers: + - url: https://uiuc-course-api-production.up.railway.app + description: Local development server +paths: + /prof-search: + get: + summary: Search professors by name, semester, and year + parameters: + - name: query + in: query + required: true + description: Search query with format `last_name semester year` + schema: + type: string + responses: + '200': + description: List of courses taught by the professor + content: + application/json: + schema: + type: array + items: + type: object + + /gpa-search: + get: + summary: Search GPA information for a course + parameters: + - name: query + in: query + required: true + description: Search query with format `subject course_number` + schema: + type: string + responses: + '200': + description: GPA data for the specified course + content: + application/json: + schema: + type: object + + /master-search: + get: + summary: Retrieve subjects for a given semester and year + parameters: + - name: query + in: query + required: true + description: Search query with format `semester year` + schema: + type: string + responses: + '200': + description: List of subjects + content: + application/json: + schema: + type: array + items: + type: string + + /interest-search: + get: + summary: Retrieve areas of interest + parameters: + - name: query + in: query + required: true + description: Search query for areas of interest + schema: + type: string + responses: + '200': + description: Matching interest data + content: + application/json: + schema: + type: array + items: + type: string + + /search: + get: + summary: Search courses by subject and semester/year or specific course + parameters: + - name: query + in: query + required: true + description: Flexible query format to search by subject, course, semester, and year + schema: + type: string + responses: + '200': + description: Course data + content: + application/json: + schema: + type: object + + /subject-info: + get: + summary: Retrieve subject information as JSON + parameters: + - name: subject + in: query + required: true + description: Subject code (e.g., `CS`) + schema: + type: string + responses: + '200': + description: Subject information in JSON + content: + application/json: + schema: + type: object + '400': + description: Missing subject parameter + '500': + description: Error fetching or parsing data + + /class-info: + get: + summary: Retrieve class information + parameters: + - name: class + in: query + required: true + description: Class query with format `subject class_number` + schema: + type: string + responses: + '200': + description: Class details + content: + application/json: + schema: + type: object + '400': + description: Missing query parameter + '500': + description: Error fetching or parsing data + + /gpa-distribution: + get: + summary: Retrieve GPA distribution for a class + parameters: + - name: class + in: query + required: true + description: Class name with format `subject course_number` + schema: + type: string + responses: + '200': + description: GPA distribution data + content: + application/json: + schema: + type: object + + /class-average-gpas: + get: + summary: Retrieve average GPAs for a class + parameters: + - name: subject + in: query + required: true + description: Subject code + schema: + type: string + - name: course_number + in: query + required: true + description: Course number + schema: + type: string + responses: + '200': + description: Average GPA data + content: + application/json: + schema: + type: array + items: + type: object + properties: + class: + type: string + average_gpa: + type: number + + /professor-stats: + get: + summary: Retrieve professor statistics + parameters: + - name: class + in: query + required: true + description: Class name + schema: + type: string + responses: + '200': + description: Professor statistics + content: + application/json: + schema: + type: array + items: + type: object + properties: + professor: + type: string + average_gpa: + type: number + total_students: + type: integer + diff --git a/deploy_bump.sh b/deploy_bump.sh new file mode 100755 index 0000000..29acbae --- /dev/null +++ b/deploy_bump.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# Load environment variables from .env.local +if [ -f .env.local ]; then + export $(cat .env.local | xargs) +fi + +bump deploy \ + --doc "classify-api" \ + --token "$BUMP_TOKEN" \ + api-documentation.yml \ No newline at end of file diff --git a/doc/api-documentation.yml b/doc/api-documentation.yml deleted file mode 100644 index 59212b2..0000000 --- a/doc/api-documentation.yml +++ /dev/null @@ -1,27 +0,0 @@ -openapi: 3.0.3 -info: - title: Sample API - description: This is a sample API for demonstration purposes. - version: 1.0.0 -servers: - - url: https://api.example.com/v1 - description: Production server -paths: - /users: - get: - summary: Get a list of users - description: Retrieve a list of all users in the system. - responses: - '200': - description: A JSON array of users - content: - application/json: - schema: - type: array - items: - type: object - properties: - id: - type: integer - example: 1 -