From c6cc37bbf0016d6c28e06dee7534b5b20692ea47 Mon Sep 17 00:00:00 2001 From: Daniel Miretsky Date: Sat, 27 Jun 2026 15:00:17 -0400 Subject: [PATCH 1/7] Revise README with setup and development details Updated the README to include setup instructions, prerequisites, and development guidelines. Signed-off-by: Daniel Miretsky --- README.md | 98 ++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 76 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index bfb78b9b..556646d3 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,84 @@ -

- WIT-calendar Icon -

+## Getting Started -

- WIT-Calendar -

+This guide will walk you through setting up the application for development. -

- website · install · status page -
- (middle-click or ctrl/cmd+click to open in a new tab) -

+### Prerequisites -## Description -WIT-Calendar is a Chrome extension that makes adding your classes to your calendar easy & quick! -It supports all major calendars, including Google Calendar, Microsoft Outlook, and Apple Calendar. -In the future, you will also be able to find "best times" to meet with fellow students, easily register for classes, and more! +Make sure you have the following installed on your system: -## How does it work? -The Chrome extension gets your schedule, processes it, and then provides you with a calendar link. You can also optionally connect your Google account for automatic updates to your Google Calendar. +* **Ruby:** Version `4.0.1` (as specified in the `Dockerfile`). We recommend using a version manager like [`rbenv`](https://github.com/rbenv/rbenv) or [`rvm`](https://rvm.io/). Project owner, @jsp, uses and recommends [`mise`](https://mise.jdx.dev/). +* **Bundler:** `gem install bundler` +* **PostgreSQL:** Version 15 is recommended. +* **Redis:** A running Redis server. -You can also manage event alerts, colors, and titles from within the extension. +**Alternative: Use GitHub Codespaces** (Recommended for quick setup) -## Development -- See instructions for developing the extension [here](https://github.com/WITCodingClub/calendar-extension/blob/main/client/README.md). +1. Create a new branch OR fork this repository + + **If you create a new branch, make sure it is named properly.** -- See instructions for developing the backend **(this repo)** [here](https://github.com/WITCodingClub/calendar-backend/blob/main/README.md). +2. Click the green "Code" button towards the right of the screen -- See instructions for developing our landing/marketing page [here](https://github.com/WITCodingClub/calendar-website/blob/main/README.md) +3. Click the "Codespaces" tab at the top of the pop-up + +4. Click "Create codespace on `your-branch-name`" + +Then follow the instructions below, starting from Step 2. + +### Setup + +1. **Clone the repository:** + + ```bash + git clone https://github.com/WITCodingClub/calendar-backend.git + cd calendar-backend + ``` + +2. **Install dependencies:** + + ```bash + bundle install + ``` + +3. **Set up environment variables:** + + This project uses a `.env.example` file to define required environment variables. Copy it to `.env` and fill in the values for your local setup. + + ```bash + cp .env.example .env + ``` + + Then, edit the `.env` file with your local configuration. + +4. **Set up Rails credentials:** + + This project uses Rails encrypted credentials for storing sensitive configuration like Google OAuth credentials and Active Record encryption keys. + + * Uses `config/credentials/development.yml.enc` + * Request `config/credentials/development.key` from @jsp + + The credentials file should include: + - Google OAuth client ID and secret (for admin authentication) + - Active Record encryption keys (for encrypting OAuth tokens) + - Rate My Professor API credentials + - Any other third-party service credentials + + Ask @jsp for the master key file to decrypt the credentials. + +5. **Create and seed the database:** + + ```bash + rails db:create + rails db:migrate + rails db:seed + ``` + +6. **Run the application:** + + ```bash + bin/dev + ``` + + This will start the web server, the background job worker, and the CSS watcher. You can access the application at `http://127.0.0.1:3000`. + + **Note:** Make sure you have the credentials master key file at `config/credentials/development.key` to access encrypted credentials for Google OAuth and other services. From bf6200454776ecb47fde76cacb215544fba67536 Mon Sep 17 00:00:00 2001 From: Daniel Miretsky Date: Wed, 1 Jul 2026 22:15:13 -0400 Subject: [PATCH 2/7] clean up outdated info Signed-off-by: Daniel Miretsky --- README.md | 53 +++++++++++------------------------------------------ 1 file changed, 11 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 556646d3..24324d85 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,8 @@ -## Getting Started +# Getting Started This guide will walk you through setting up the application for development. -### Prerequisites - -Make sure you have the following installed on your system: - -* **Ruby:** Version `4.0.1` (as specified in the `Dockerfile`). We recommend using a version manager like [`rbenv`](https://github.com/rbenv/rbenv) or [`rvm`](https://rvm.io/). Project owner, @jsp, uses and recommends [`mise`](https://mise.jdx.dev/). -* **Bundler:** `gem install bundler` -* **PostgreSQL:** Version 15 is recommended. -* **Redis:** A running Redis server. - -**Alternative: Use GitHub Codespaces** (Recommended for quick setup) +## Use GitHub Codespaces 1. Create a new branch OR fork this repository @@ -23,39 +14,19 @@ Make sure you have the following installed on your system: 4. Click "Create codespace on `your-branch-name`" -Then follow the instructions below, starting from Step 2. - -### Setup - -1. **Clone the repository:** - - ```bash - git clone https://github.com/WITCodingClub/calendar-backend.git - cd calendar-backend - ``` - -2. **Install dependencies:** +5. **Install dependencies:** ```bash bundle install ``` -3. **Set up environment variables:** - - This project uses a `.env.example` file to define required environment variables. Copy it to `.env` and fill in the values for your local setup. - - ```bash - cp .env.example .env - ``` - - Then, edit the `.env` file with your local configuration. - -4. **Set up Rails credentials:** +6. **Set up Rails credentials:** This project uses Rails encrypted credentials for storing sensitive configuration like Google OAuth credentials and Active Record encryption keys. * Uses `config/credentials/development.yml.enc` - * Request `config/credentials/development.key` from @jsp + * Email @jasper [mayonej@wit.edu] for the development key to decrypt the credentials. + * Paste the key into `config/credentials/development.key` The credentials file should include: - Google OAuth client ID and secret (for admin authentication) @@ -63,17 +34,15 @@ Then follow the instructions below, starting from Step 2. - Rate My Professor API credentials - Any other third-party service credentials - Ask @jsp for the master key file to decrypt the credentials. - -5. **Create and seed the database:** +7. **Create and seed the database:** ```bash - rails db:create - rails db:migrate - rails db:seed + bin/rails db:create + bin/rails db:migrate + bin/rails db:seed ``` -6. **Run the application:** +8. **Run the application:** ```bash bin/dev From 6adfbbe6c56694b8d66316ee5d59a99264e16728 Mon Sep 17 00:00:00 2001 From: Daniel Miretsky Date: Thu, 2 Jul 2026 20:58:51 -0400 Subject: [PATCH 3/7] wip Signed-off-by: Daniel Miretsky --- README.md | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 24324d85..e955bd8d 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,28 @@ This guide will walk you through setting up the application for development. 5. **Install dependencies:** + Run in a new terminal window: ```bash bundle install ``` -6. **Set up Rails credentials:** +6. **Set up environment variables:** + + This project uses a `.env.example` file to define required environment variables. Copy it to `.env` and fill in the values for your local setup. + + ```bash + cp .env.example .env + ``` + +7. **Set up Postgres server:** + + Run the following command in the terminal: + + ```bash + docker run -d --name calendar-postgres -p 5432:5432 postgres:16 + ``` + +7. **Set up Rails credentials:** This project uses Rails encrypted credentials for storing sensitive configuration like Google OAuth credentials and Active Record encryption keys. @@ -34,7 +51,7 @@ This guide will walk you through setting up the application for development. - Rate My Professor API credentials - Any other third-party service credentials -7. **Create and seed the database:** +8. **Create and seed the database:** ```bash bin/rails db:create @@ -42,7 +59,7 @@ This guide will walk you through setting up the application for development. bin/rails db:seed ``` -8. **Run the application:** +9. **Run the application:** ```bash bin/dev @@ -51,3 +68,17 @@ This guide will walk you through setting up the application for development. This will start the web server, the background job worker, and the CSS watcher. You can access the application at `http://127.0.0.1:3000`. **Note:** Make sure you have the credentials master key file at `config/credentials/development.key` to access encrypted credentials for Google OAuth and other services. + +10. **Set up Google OAuth:** + + You will need to provide @jasper [mayonej@wit.edu] your Codespace URL to be added to the development project on Google Cloud. + + a. In the bottom panel of your Codespace, click the Ports tab as shown below: + image + + b. Right click port 3000 and set the port visibility to "Public" as shown below: + image + + c. Right click the "Forwarded Address" for port 3000 and click "Copy Local Address" as shown below: + image + From d343da5557a08a52dddbabfa47fc321b1e6d08c4 Mon Sep 17 00:00:00 2001 From: Daniel Miretsky Date: Sat, 4 Jul 2026 00:36:08 -0400 Subject: [PATCH 4/7] added codespace setup script and misc changes Signed-off-by: Daniel Miretsky --- README.md | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index e955bd8d..fa5c838e 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Getting Started -This guide will walk you through setting up the application for development. +This guide will walk you through setting up the application for development using GitHub Codespaces. -## Use GitHub Codespaces +## Setup 1. Create a new branch OR fork this repository @@ -21,20 +21,12 @@ This guide will walk you through setting up the application for development. bundle install ``` -6. **Set up environment variables:** - - This project uses a `.env.example` file to define required environment variables. Copy it to `.env` and fill in the values for your local setup. - - ```bash - cp .env.example .env - ``` - -7. **Set up Postgres server:** +6. **Set up Codespace:** Run the following command in the terminal: ```bash - docker run -d --name calendar-postgres -p 5432:5432 postgres:16 + ./bin/codespace-setup ``` 7. **Set up Rails credentials:** @@ -45,11 +37,7 @@ This guide will walk you through setting up the application for development. * Email @jasper [mayonej@wit.edu] for the development key to decrypt the credentials. * Paste the key into `config/credentials/development.key` - The credentials file should include: - - Google OAuth client ID and secret (for admin authentication) - - Active Record encryption keys (for encrypting OAuth tokens) - - Rate My Professor API credentials - - Any other third-party service credentials + **Note: You'll need to create the `development.key` file. Ensure it is created in the correct directory (`config/credentials`).** 8. **Create and seed the database:** @@ -65,9 +53,9 @@ This guide will walk you through setting up the application for development. bin/dev ``` - This will start the web server, the background job worker, and the CSS watcher. You can access the application at `http://127.0.0.1:3000`. + This will start the web server, the background job worker, and the CSS watcher. You can access the application at `http://127.0.0.1:3000/users/sign_in`. - **Note:** Make sure you have the credentials master key file at `config/credentials/development.key` to access encrypted credentials for Google OAuth and other services. + **Note:** Make sure you have the credentials master key file at `config/credentials/development.key` to access encrypted credentials for Google OAuth and other services (see step 7). 10. **Set up Google OAuth:** @@ -82,3 +70,7 @@ This guide will walk you through setting up the application for development. c. Right click the "Forwarded Address" for port 3000 and click "Copy Local Address" as shown below: image +## Troubleshooting + +If you run into any errors in the terminal you don't recogize, feel free to run them by @jasper [mayonej@wit.edu]. + From e4646f6339aed29b644d552f872127e2c77dbae1 Mon Sep 17 00:00:00 2001 From: Daniel Miretsky Date: Sat, 4 Jul 2026 01:11:57 -0400 Subject: [PATCH 5/7] Update command to use 'bash' for setup script Signed-off-by: Daniel Miretsky --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fa5c838e..e81ece8e 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ This guide will walk you through setting up the application for development usin Run the following command in the terminal: ```bash - ./bin/codespace-setup + bash bin/codespace-setup ``` 7. **Set up Rails credentials:** From b48def4063b76e0e951da714538791f5b622d2d5 Mon Sep 17 00:00:00 2001 From: Daniel Miretsky Date: Sat, 4 Jul 2026 13:08:29 -0400 Subject: [PATCH 6/7] Reorganize setup instructions in README Reordered the steps for setting up Google OAuth and running the application in the README. Added a note about accessing the application URL. Signed-off-by: Daniel Miretsky --- README.md | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index e81ece8e..3fdea989 100644 --- a/README.md +++ b/README.md @@ -47,17 +47,7 @@ This guide will walk you through setting up the application for development usin bin/rails db:seed ``` -9. **Run the application:** - - ```bash - bin/dev - ``` - - This will start the web server, the background job worker, and the CSS watcher. You can access the application at `http://127.0.0.1:3000/users/sign_in`. - - **Note:** Make sure you have the credentials master key file at `config/credentials/development.key` to access encrypted credentials for Google OAuth and other services (see step 7). - -10. **Set up Google OAuth:** +9. **Set up Google OAuth:** You will need to provide @jasper [mayonej@wit.edu] your Codespace URL to be added to the development project on Google Cloud. @@ -70,6 +60,17 @@ This guide will walk you through setting up the application for development usin c. Right click the "Forwarded Address" for port 3000 and click "Copy Local Address" as shown below: image + +10. **Run the application:** + + ```bash + bin/dev + ``` + + This will start the web server, the background job worker, and the CSS watcher. You can access the application at `http://127.0.0.1:3000/users/sign_in` or `your-codespace-URL/users/sign_in` (see the previous step for instructions for getting your Codespace URL). + + **Note:** If you click the "Open in Browser" on the notification that comes up within the Codespace after starting the server, you will be redirected to the root page of the server, which doesn't exist. You must manually append `/users/sign_in` to the end of the URL. + ## Troubleshooting If you run into any errors in the terminal you don't recogize, feel free to run them by @jasper [mayonej@wit.edu]. From 7a636deb5829312a0003c85fad116c190e6d2a4b Mon Sep 17 00:00:00 2001 From: Daniel Miretsky Date: Sat, 4 Jul 2026 13:18:19 -0400 Subject: [PATCH 7/7] Update README to change database setup instructions Signed-off-by: Daniel Miretsky --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3fdea989..ad98f664 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ This guide will walk you through setting up the application for development usin **Note: You'll need to create the `development.key` file. Ensure it is created in the correct directory (`config/credentials`).** -8. **Create and seed the database:** +8. **Set up the database:** ```bash bin/rails db:create