Skip to content

Add support for syllabi#202

Draft
ap-1 wants to merge 13 commits intomainfrom
syllabi
Draft

Add support for syllabi#202
ap-1 wants to merge 13 commits intomainfrom
syllabi

Conversation

@ap-1
Copy link
Copy Markdown
Contributor

@ap-1 ap-1 commented Jan 28, 2025

Created a SideNav entry for syllabi, a section for it in CourseCard, and added it to the prisma schema.

I also attempted to created a syllabus controller and create routes for it in the backend, but I need someone to verify I'm doing it correctly. I also need help writing app/api/syllabi.ts and consuming the API properly in CourseCard.

The syllabus page and search functionality for it are also not yet implemented, and I will probably need help with the latter

Closes #201
Closes #121

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

@ap-1 ap-1 added the enhancement New feature or request label Jan 28, 2025
@ap-1 ap-1 self-assigned this Jan 28, 2025
@railway-app
Copy link
Copy Markdown

railway-app Bot commented Jan 28, 2025

This PR was not deployed automatically as @ap-1 does not have access to the Railway project.

In order to get automatic PR deploys, please add @ap-1 to your team on Railway.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
cmucourses-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 12, 2025 7:52pm

@ap-1 ap-1 marked this pull request as draft January 28, 2025 18:37
@ap-1 ap-1 requested a review from xavilien January 28, 2025 18:37
@ap-1 ap-1 linked an issue Jan 28, 2025 that may be closed by this pull request
@ap-1 ap-1 added the help wanted Extra attention is needed label Mar 6, 2025
@ilong4rennes
Copy link
Copy Markdown
Contributor

@ap-1 Hi Anish,

I've implemented syllabi functionality:

  • Added app/api/syllabi.ts API module
  • Added Course Syllabus Card to CourseDetails.tsx
  • Added view for /syllabi route with basic SyllabiSearchList.tsx for debugging

Issue found: While the database contains 19,556 syllabi records, all field values are NULL (see screenshots). Since you're familiar with the course scraper, could you help diagnose why the data wasn't properly populated?

Screenshot 2025-03-13 at 7 36 43 PM
Screenshot 2025-03-13 at 7 36 14 PM
Screenshot 2025-03-13 at 8 14 12 PM

@ap-1
Copy link
Copy Markdown
Contributor Author

ap-1 commented Mar 14, 2025

woah this is great

i'm actually working on a rewrite of course-api in a separate repo, and I moved the syllabus scraper there along w a bunch of other updates---i'll upload the csv to mongo for now

do note that I removed a bunch of redundant data, including titles, in exchange for having more reliable course number/section parsing

@ap-1
Copy link
Copy Markdown
Contributor Author

ap-1 commented Mar 14, 2025

I think I pushed the wrong commit the first time but it should be fixed now w/ your changes and the updated schema in schema.prisma. I also ran MONGODB_URI="....." bun run db-migrate

$ prisma db push
Prisma schema loaded from schema.prisma
Datasource "db": MongoDB database "course-api" at "monorail.proxy.rlwy.net:39417"
Applying the following changes:

[-] Index `year_1_number_1_section_1_season_1`
[-] Index `text`
[+] Fulltext index `text` on ({"name":"text","department":"text","desc":"text","prereqString":"text"})
[+] Index `syllabi_year_number_section_season_idx` on ({"year":1,"number":1,"section":1,"season":1})


🚀  Your database indexes are now in sync with your Prisma schema. Done in 2.59s

✔ Generated Prisma Client (v5.22.0) to ./../../node_modules/@prisma/client in 51ms

@ilong4rennes
Copy link
Copy Markdown
Contributor

Added the MVP of the frontend. The link to the syllabi is now clickable from the course details, and the syllabi list view is now available, but the display does not look beautiful. I will finish this up hopefully by tomorrow or Saturday.

@ilong4rennes ilong4rennes self-assigned this Mar 14, 2025
@ap-1
Copy link
Copy Markdown
Contributor Author

ap-1 commented Mar 14, 2025

nice! one thing I would note is that users would probably want the option whether to automatically open the download link or view the PDF/docx/whatever in canvas. This can be done by modifying the URL as such:

(dowload link)
https://canvas.cmu.edu/files/5177329/download?download_frd=1&verifier=5dM1dEf8IwZFQcqC1MIou46HO1kVtEzX2Ru1IYvD

(canvas link)
https://canvas.cmu.edu/files/5177329/?verifier=5dM1dEf8IwZFQcqC1MIou46HO1kVtEzX2Ru1IYvD

@ap-1
Copy link
Copy Markdown
Contributor Author

ap-1 commented Mar 15, 2025

I like what you did with the Course Syllabus card (the one w the placeholder "No syllabi available for this course"), I think it makes it cleaner when a course has multiple syllabi to display. Then the "Syllabi" section in in CourseCard could simply link to the Course Syllabus card on the /syllabi route, instead of providing a download link to a single syllabus (it isn't clear which one it is providing the syllabus to before it's actually clicked on)

There's a discord bot that does something similar to what I'm thinking for this card:

image

We can do something like this w/ an actual UI and get the instructor information from looking up the course+section+season+year in the DB.

@ilong4rennes
Copy link
Copy Markdown
Contributor

I like what you did with the Course Syllabus card (the one w the placeholder "No syllabi available for this course"), I think it makes it cleaner when a course has multiple syllabi to display. Then the "Syllabi" section in in CourseCard could simply link to the Course Syllabus card on the /syllabi route, instead of providing a download link to a single syllabus (it isn't clear which one it is providing the syllabus to before it's actually clicked on)

There's a discord bot that does something similar to what I'm thinking for this card:

image We can do something like this w/ an actual UI and get the instructor information from looking up the course+section+season+year in the DB.

This is a good idea! Ill work on this!

@ap-1
Copy link
Copy Markdown
Contributor Author

ap-1 commented Apr 7, 2025

this is great work! i really appreciate all the effort you've put into this. i just have a few small nitpicks (and i apologize in advance if some of these sound a little pedantic)

  1. in the course card, we have an established style for links that is used in the prereqs/coreqs/crosslisted sections. it would be great if the syllabus section used the same style.
image
  1. Rather than the heading being "Syllabus" and the link being "View All Syllabi," I think it would look slightly cleaner if the heading was "Syllabi" and the link was "View All"

  2. In the course cards, the headings aren't styled like links, and they have no hover effects aside from cursor-pointer. it would be great if the syllabus cards followed the same format. Also, the course cards have a little bit of padding (margin?) under the heading, and i think the syllabus cards should have that too, just so that the table isn't right up against it

image image
  1. Because the dedicated course pages don't have a heading or a "View All Courses" button, I don't think the dedicated syllabus pages should have a "Syllabi for XX-XXX" heading or a "View All Syllabi" button either. The page should ideally start with the table (which contains the heading), like what the course pages do
image image
  1. I think these sections would also benefit from using the same link style as the prereqs/coreqs/crosslisted sections on course cards. Also, I think if you change the column labels to "View on Canvas" and "Download PDF," it also makes sense to get rid of the "(Canvas Link)" and "(Download Link)" on each entry--I think it looks a bit cramped to have it everywhere.
image
  1. some stuff (might) be getting duplicated? if this is how it's in the database, that's fine for now, but probably double check to make sure things aren't being duplicated just to be safe
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Incorporate syllabi [Feature] Add links to course syllabi

2 participants