{"id":40674482,"url":"https://github.com/csmberkeley/csm_web","last_synced_at":"2026-01-21T09:38:36.957Z","repository":{"id":37019141,"uuid":"153392006","full_name":"csmberkeley/csm_web","owner":"csmberkeley","description":"Web applications for CS Mentors.","archived":false,"fork":false,"pushed_at":"2025-11-18T02:56:06.000Z","size":13332,"stargazers_count":18,"open_issues_count":105,"forks_count":10,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-11-18T04:22:16.906Z","etag":null,"topics":["berkeley","computer-science-education","csm","edtech","education","educational-software","educational-technology","scheduler","uc-berkeley"],"latest_commit_sha":null,"homepage":"https://scheduler.csmentors.org/","language":"TypeScript","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/csmberkeley.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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-10-17T03:46:14.000Z","updated_at":"2025-09-03T04:09:26.000Z","dependencies_parsed_at":"2023-12-30T09:27:36.532Z","dependency_job_id":"c84e0968-57c6-4eeb-9cd3-e7a8e87abb43","html_url":"https://github.com/csmberkeley/csm_web","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/csmberkeley/csm_web","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csmberkeley%2Fcsm_web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csmberkeley%2Fcsm_web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csmberkeley%2Fcsm_web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csmberkeley%2Fcsm_web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csmberkeley","download_url":"https://codeload.github.com/csmberkeley/csm_web/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csmberkeley%2Fcsm_web/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28631415,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["berkeley","computer-science-education","csm","edtech","education","educational-software","educational-technology","scheduler","uc-berkeley"],"created_at":"2026-01-21T09:38:36.275Z","updated_at":"2026-01-21T09:38:36.948Z","avatar_url":"https://github.com/csmberkeley.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CSM Web Applications\n\nThis repository contains webapps that help support the infrastructure of CSM. Currently, it only holds Scheduler (our section signup and attendance system), but more are on the way.\n\nIf you're unfamiliar with CSM and/or its web applications, check out [this repository's releases](https://github.com/csmberkeley/csm_web/releases) for a peek at what our web applications look like and what we've been working on lately.\n\n## Installing\n\n### Requirements\n\nWe don't know what specific minimum version you would need for any of the following software, but the most recent version of any of the below should work.\n\n- Python 3.9.13\n  - It is recommended that you use a python version manager like [`pyenv`](https://github.com/pyenv/pyenv) or [`asdf`](https://asdf-vm.com) (with [`asdf-python`](https://github.com/asdf-community/asdf-python)), so that you can use a consistent python version for `csm_web`, and another python version for your other projects.\n- [`poetry`](https://python-poetry.org/docs/#installation)\n  - We use poetry to manage python dependencies; this should be installed _outside_ of a virtual environment.\n  - Although everything will be run through Docker containers, you should use Poetry to get the dependencies locally for editing.\n- `npm`\n  - It is recommended that you use a node version manager like [`nvm`](https://github.com/nvm-sh/nvm), [`n`](https://github.com/tj/n), or [`asdf`](https://asdf-vm.com) (with [`asdf-nodejs`](https://github.com/asdf-vm/asdf-nodejs)), so that you can use a consistent node/npm version for `csm_web`, and another verison for your other projects.\n  - Although everything will be run through Docker containers, you should get the dependencies locally for editing.\n- [Docker](https://www.docker.com)\n  - Your development environment will be hosted through docker containers, so that you do not need to do much local setup.\n- [PostgreSQL](https://www.postgresql.org/download/) (optional)\n  - This should not be necessary now that we have migrated to Docker, but install it if any issues arise when editing.\n- [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli#download-and-install) (optional)\n  - Create an account on [Heroku](https://id.heroku.com/login) and [login](https://devcenter.heroku.com/articles/heroku-cli#getting-started)\n  - This is not completely necessary for the application to work locally; it is only used for interactions with the production/staging environment.\n- [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) (optional)\n  - We use an S3 bucket to store course resources. See [here](https://aws.amazon.com/s3/) to get started.\n  - Log in to AWS CLI (`aws configure`) This will prompt an interactive session to enter login credentials.\n    - AWS Access Key ID: (ask tech chair)\n    - AWS Secret Access Key: (ask tech chair)\n    - Default region name: `us-east-1`\n    - Default output format: `json`\n  - This is not completely necessary for the application to work locally; it is only used for interactions with the resources page in production/staging.\n\nOther miscellaneous requirements will be installed by the commands below.\n\n### Setup\n\nTo ensure package version consistency and avoid polluting your global package installations, we highly recommend running the server with a virtual environment. Python's standard library includes [venv](https://docs.python.org/3/library/venv.html), so you do not need to install anything new here.\n\nFirstly, make sure you have the right python version (see `runtime.txt` for the expected python version to install). If you're using `pyenv` to manage python versions (this is recommended), you can install the specified python version with `pyenv install \u003cversion\u003e`.\n\nNext, make sure that your current python version is correct (i.e. as specified in the previous section); if it is different, then change to the correct python version. That is, with `pyenv`, run `pyenv local \u003cversion\u003e`; with `asdf`, run `asdf local python \u003cversion\u003e`.\n\nFinally, run `./setup.sh`. This will install additional requirements needed by the server, and set up some necessary environment variables. In particular, the setup script installs all dependencies locally and builds the Docker images.\n\nNote that generally, you should not need to run `setup.sh` after first setting up the repository.\n\n## Running\n\nTo start the Django server and other services, make sure Docker is up and run `docker compose up -d`. This will start Django, automatically compile and watch frontend files, and start a development database. (The `-d` puts the process in the background.)\n\nTo generate test data, run `docker compose exec django python3 csm_web/manage.py createtestdata`. In general, if you'd like to run any commands in the Django docker container, run `docker compose exec django \u003ccommand\u003e`. (You can make an alias in your shell if you'd like to avoid typing all of this each time.)\n\nIf all of the above has worked, visit [http://localhost:8000](http://localhost:8000) in your browser and you should see a log in screen; don't actually use this to actually log in locally. Visit [http://localhost:8000/admin/](http://localhost:8000/admin/) to log in instead.\n\nAny changes will automatically reload the server in the docker containers, but you will usually need to force refresh (`ctrl + shift + R` or `cmd + shift + R` on most browsers) for frontend changes to be reflected (this clears the browser cache for the page).\n\nDuring development, you should use the virtual environment as much as possible---while Docker makes this less necessary, your choice of editor may require the dependencies in the virtual environment. To activate the virtual environment, you can use `poetry shell` (this will start a new nested shell instance), or you can use `source .venv/bin/activate` (more generally, `source $(poetry env info --path)/bin/activate`).\n\n## Troubleshooting\n\n### `setup.sh` Errors\n\n- The following errors are likely caused by some quirks in our build system - if you set up a new virtual environment through normal commands, you may run into them. The solution for all of these should be to run `setup.sh` (you should be able to do this even after attempting to run pip/npm commands already).\n  - `django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.`\n  - When installing `psycopg2`, console output displays `ld: library not found for -lpq` or similar\n- During `./setup.sh` or `pip3 install` I'm getting a `psycopg2` install error that looks like this:\n\n```\nError: pg_config executable not found.\n\n    pg_config is required to build psycopg2 from source.  Please add the directory\n    containing pg_config to the $PATH or specify the full executable path with the\n    option:\n```\n\n- You need to install Postgres locally (see [this](https://stackoverflow.com/a/12037133) SO post)\n- During `./setup.sh`, this happens after `pip3 install` runs\n\n```\n./setup.sh:41: no such file or directory: /Users/jhshi/Documents/csm/csm_web/venv/.project_dir\n./setup.sh:44: no such file or directory: /Users/jhshi/Documents/csm/csm_web/venv/bin/activate\n./setup.sh:47: no such file or directory: /Users/jhshi/Documents/csm/csm_web/venv/bin/activate\n```\n\n- This likely happens because you moved your folder after creating your virtualenv. Removing\n  and recreating your virtualenv should fix it.\n\n### How do I access the `/admin` page?\n\n- The `./setup.sh` script will create a user with username `demo_user` and password `pass`. You can access it by signing in through the admin page.\n- If you wish to assign admin permissions to an account that uses OAuth (such as your Berkeley email), run the following commands in the Django shell (accessible by running `python3 csm_web/manage.py shell`):\n\n```py\nfrom scheduler.models import *\n# replace \"my_username\" with the prefix of your Berkeley email, as in \"my_username@berkeley.edu\"\nuser = User.objects.get(username=\"my_username\")\nuser.is_staff = True\nuser.is_superuser = True\nuser.save()\n```\n\n### Miscellaneous\n\n#### OSX: error on running `pip`\n\nTry replacing `pip` with `pip3` instead.\n\n#### OAuth errors when trying to sign in locally\n\n```\nError 401: invalid_client\nThe OAuth client was not found.\n```\n\nOAuth secrets are sourced from the heroku repository: you'll need to log in to heroku, add the\nappropriate remote, rerun `setup.sh`, and then reactivate your virtualenv.\n\n### On `runserver`, long stack trace ending with this:\n\n```\ndjango.db.utils.OperationalError: could not connect to server: Connection refused\n        Is the server running on host \"localhost\" (::1) and accepting\n        TCP/IP connections on port 5432?\ncould not connect to server: Connection refused\n        Is the server running on host \"localhost\" (127.0.0.1) and accepting\n        TCP/IP connections on port 5432?\n```\n\nYour PostgreSQL server is likely not running. On MacOS, run `brew services start postgres` before invoking `runserver` again; on Unix, run `sudo service postgresql restart` before invoking `runserver` again.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsmberkeley%2Fcsm_web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsmberkeley%2Fcsm_web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsmberkeley%2Fcsm_web/lists"}