{"id":20523048,"url":"https://github.com/pennlabs/penn-courses","last_synced_at":"2025-04-14T03:03:32.521Z","repository":{"id":35180306,"uuid":"178947185","full_name":"pennlabs/penn-courses","owner":"pennlabs","description":"Powering Penn Course Review, Penn Course Plan, Penn Course Alert, and Penn Degree Plan","archived":false,"fork":false,"pushed_at":"2025-04-13T17:33:07.000Z","size":151584,"stargazers_count":39,"open_issues_count":94,"forks_count":4,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-13T18:32:59.063Z","etag":null,"topics":["celery","django","django-rest-framework","react","upenn"],"latest_commit_sha":null,"homepage":"https://penncourses.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pennlabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-04-01T21:07:46.000Z","updated_at":"2025-04-13T17:26:46.000Z","dependencies_parsed_at":"2023-10-23T06:21:21.589Z","dependency_job_id":"a4447c4c-1816-4f2d-a6f1-bb4be58b200a","html_url":"https://github.com/pennlabs/penn-courses","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pennlabs%2Fpenn-courses","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pennlabs%2Fpenn-courses/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pennlabs%2Fpenn-courses/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pennlabs%2Fpenn-courses/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pennlabs","download_url":"https://codeload.github.com/pennlabs/penn-courses/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248813786,"owners_count":21165633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["celery","django","django-rest-framework","react","upenn"],"created_at":"2024-11-15T22:37:42.901Z","updated_at":"2025-04-14T03:03:32.498Z","avatar_url":"https://github.com/pennlabs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Penn Courses\n![Workflow](https://github.com/pennlabs/penn-courses/workflows/Workflow/badge.svg)\n[![Coverage Status](https://codecov.io/gh/pennlabs/penn-courses/branch/master/graph/badge.svg)](https://codecov.io/gh/pennlabs/penn-courses)\n\nThis is the unified home of all [Penn Courses](https://penncourses.org) products.\n\n## Installation \u0026 Setup\n1. [Install the backend](https://github.com/pennlabs/penn-courses/blob/master/backend/README.md)\n2. If you need to, [install the frontend](https://github.com/pennlabs/penn-courses/blob/master/frontend/README.md)\n\nNote that you need the backend to run the frontend.\n\n### Using Dev Containers\n\nThis repository has a built-in dev container that you can use to develop the project. To use it, you need to have [Docker](https://www.docker.com/products/docker-desktop) and [VSCode](https://code.visualstudio.com/) installed.\n\nPress the remote container button in the bottom left of the window and select \"Reopen in Container\". This will build the dev container and open the project in a new window.\n\nThis container is designed to work with both backend and frontend development. Some additional steps are required, like installing `pipenv` dependencies and setting up the database and running the frontend server. Please read and follow the instructions in the backend and frontend READMEs.\n\nFor more information, visit dev container [documentation](https://code.visualstudio.com/docs/remote/containers).\n\n#### Pushing Code\n\nYou can use `ssh-add` to make your SSH keys available to the dev container. This will allow you to push code to GitHub.\n\n```\nssh-add ~/.ssh/id_rsa\n```\n\n\n\n\n## API Documentation\nAPI Docs can be found at `/api/documentation` on the back-end server. Also check out the code for more explanations\nand documentation! We've tried to keep it up-to-date.\n\n## Runbook\nThis section is to collect thoughts/learnings from the codebase that have been hard-won, so we don't lose a record of it\nif and when the information proves useful again\n\n### Derived fields\nNormally, derived fields on models are represented as `@property`-decorated functions. However, there are a few in\nthe codebase that need to be accessed on the database layer without `JOIN`s. So that they can be indexed.\nSpecifically, these are the `full_code` fields on `Course` and `Section` models, which are derived from fields on related\nmodels.\n\nThese are updated every time the `save()` method is called. However, it's possible to get into a state \n(such as with db migrations) where `full_code` isn't set properly.\n\nOpen a shell in production, and run this small script:\n```python\nfrom tqdm import tqdm\nfrom courses.models import Section, Course\n\nfor c in tqdm(Course.objects.all().select_related(\"department\")):\n    c.save()\n\nfor s in tqdm(Section.objects.all().select_related(\"course\")):\n    s.save()\n```\n\n`tqdm` will give you a nice progress bar as the script completes. The `select_related` clause speeds up the query,\navoiding what would be a pretty nasty N+1 scenario.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpennlabs%2Fpenn-courses","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpennlabs%2Fpenn-courses","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpennlabs%2Fpenn-courses/lists"}