{"id":15147641,"url":"https://github.com/berkeley-cs61b/simple-office-hours-queue","last_synced_at":"2025-10-24T03:30:54.941Z","repository":{"id":63865527,"uuid":"543478048","full_name":"Berkeley-CS61B/simple-office-hours-queue","owner":"Berkeley-CS61B","description":"Simple Office Hours Queue (SOHQ) is an open source online queue where students can request help and staff members can manage their office hours.","archived":false,"fork":false,"pushed_at":"2024-10-23T02:28:42.000Z","size":1499,"stargazers_count":13,"open_issues_count":16,"forks_count":7,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-10-29T22:36:17.114Z","etag":null,"topics":["education","nextjs","reactjs","t3-stack"],"latest_commit_sha":null,"homepage":"https://oh.datastructur.es","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Berkeley-CS61B.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-09-30T07:24:14.000Z","updated_at":"2024-10-23T02:28:46.000Z","dependencies_parsed_at":"2024-01-14T01:26:44.216Z","dependency_job_id":"55ab6de6-b1f2-4745-91c3-f4dba076b70d","html_url":"https://github.com/Berkeley-CS61B/simple-office-hours-queue","commit_stats":{"total_commits":266,"total_committers":10,"mean_commits":26.6,"dds":"0.13157894736842102","last_synced_commit":"45403fbd9dee273a0a36130a7c1430d787d97d0d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Berkeley-CS61B%2Fsimple-office-hours-queue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Berkeley-CS61B%2Fsimple-office-hours-queue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Berkeley-CS61B%2Fsimple-office-hours-queue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Berkeley-CS61B%2Fsimple-office-hours-queue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Berkeley-CS61B","download_url":"https://codeload.github.com/Berkeley-CS61B/simple-office-hours-queue/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237905696,"owners_count":19385037,"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":["education","nextjs","reactjs","t3-stack"],"created_at":"2024-09-26T13:00:21.769Z","updated_at":"2025-10-24T03:30:49.578Z","avatar_url":"https://github.com/Berkeley-CS61B.png","language":"TypeScript","readme":"# Simple Office Hours Queue\n\n## What?\n\nSOHQ is an open-source office hours queue that allows students to sign up for office hours and instructors to manage the queue.\n\nFor a brief usage guide, click [here](https://docs.google.com/presentation/d/1nPpjBQkf2LSRuIlFPolcVz9_iE3x1sNHgx0nXM867e4/edit?usp=sharing).\n\n## Installation\n\n### Prerequisites\n- Node.js \u003e= 18.17\n\nClone the reposity and `cd` into it.\n\nFor the `.env` setup, Refer to the `.env.example` file for the format of the required environment variables. The setup is as follows:\n\nRun `cp .env.example .env` to create the `.env` file.\n\n\u003cdetails\u003e\n\u003csummary\u003eAbly\u003c/summary\u003e\n\nAbly is used for real-time communication (i.e. queue updates)\n\n1. Create an account on \u003ca target=\"_blank\" href=\"https://ably.com\"\u003eAbly\u003c/a\u003e.\n\n2. Create a new app.\n\n3. Go to the \"API Keys\" tab. You should have 2 API keys, one for the server (top) and one for the client (bottom). Copy the server API key and paste it into the `ABLY_SERVER_API_KEY` variable in the `.env` file. Copy the client API key and paste it into the `NEXT_PUBLIC_ABLY_CLIENT_API_KEY` variable in the `.env` file. **Your client API key should have the `Subscribe` and `Publish` permission enabled.**\n![Ably API Keys](/readme-assets/ably-config.jpg)\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGoogle OAuth\u003c/summary\u003e\n\nGoogle OAuth is used for authentication.\n\n1. Create a new project on \u003ca target=\"_blank\" href=\"https://console.developers.google.com\"\u003eGoogle Cloud Platform\u003c/a\u003e.\n\n2. Navigate to the Credentials tab. Press the \"Create Credentials\" button and select \"OAuth client ID\". Go throuth the process of filling out the form. Select `External` if you're given the option. Press the \"Create Credentials\" button again. This time select \"Web application\" as the application type.\n\n3. Create a new OAuth client ID. Make sure to set the Authorized JavaScript origins to `http://localhost` and redirect URI to `http://localhost:3000/api/auth/callback/google`. When deployed, add new entries, replacing `localhost`/`localhost:3000` to the new URL.\n![Google Auth setup](/readme-assets/google-config.jpg)\n\n4. Copy the client ID and paste it into the `GOOGLE_CLIENT_ID` variable in the `.env` file.\n\n5. Copy the client secret and paste it into the `GOOGLE_CLIENT_SECRET` variable in the `.env` file.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eDatabase\u003c/summary\u003e\n\n#### Local Development \nFor local development we run a docker container serving a mySQL database.\n\n1. Install [Docker](https://docs.docker.com/get-docker/) on your machine.\n\n2. Start the container by running:\n```\ndocker compose up\n```\n\nNote that if you are using an M1 Mac, you may need to change the docker image in `docker-compose.yaml` to 'arm64v8/mysql'. This is because the official image for MySQl, as of writing, does not currently support the ARM architecture.\n\n\n#### Production\n\n\n\nFor the production environment, you can self-host a database or consider a hosted provider such as Planetscale, Aiven, AWS RDS, etc.\n\n1. Create a new database on your platform.\n\n2. Copy the database URL and paste it into the `DATABASE_URL` variable in the `.env` file.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eNextAuth\u003c/summary\u003e\n\nRun `openssl rand -base64 32` (you may need to download openssl) and put the result inside of `NEXTAUTH_SECRET`.\n\n\u003c/details\u003e\n\n\u003cbr /\u003e\n\n\nAfter your `.env` file is set up, run the following commands to install dependencies populate the database with the schema:\n\n```bash\nnpm install\nnpx prisma db push\n```\n\nWe need to populate the database with the default settings and first user. Go to `prisma/seed.ts` and change the `YOUR_EMAIL_ADDRESS` variable to your email. Then run:\n\n```bash\nnpx prisma db seed\n``` \n\nIf you want to run the server in development mode (to see live changes), run the following command:\n\n```bash\nnpm run dev\n```\n\nIf you want to create a production build, run the following commands:\n\n```bash\nnpm run build\nnpm run start\n```\n\nIf you'd like to view or edit your database locally at any point, you can run\n\n```bash\nnpx prisma studio\n```\n\n\n## Tech Stack\n\nThis project is built using the [T3 stack](https://github.com/t3-oss/create-t3-app), specifically these aspects:\n\n- [Next-Auth.js](https://next-auth.js.org) for authentication (Google)\n- [Prisma](https://prisma.io) for database management\n- [tRPC](https://trpc.io) for API management\n- [Chakra UI](https://chakra-ui.com) for UI components\n- [MySQL](https://mysql.com) for database\n- [Ably](https://ably.com) for real-time updates\n\n## Contributing\n\nIf you'd like to contribute, please make a pull request. If you have any questions, feel free to open an issue.\n\nTo run the Biome formatter/linter:\n\n```bash\nnpm run fmt\n```\n\n[![Powered by Vercel](https://images.ctfassets.net/e5382hct74si/78Olo8EZRdUlcDUFQvnzG7/fa4cdb6dc04c40fceac194134788a0e2/1618983297-powered-by-vercel.svg)](https://vercel.com?utm_source=cs61b\u0026utm_campaign=oss)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberkeley-cs61b%2Fsimple-office-hours-queue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fberkeley-cs61b%2Fsimple-office-hours-queue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberkeley-cs61b%2Fsimple-office-hours-queue/lists"}