From 6bdf4eeea29fe175e55a6bd01d6fcb9882eea590 Mon Sep 17 00:00:00 2001 From: Mona Date: Wed, 14 Oct 2026 21:34:19 -0400 Subject: [PATCH 1/3] Update windows scripts for start, test, and seed --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a74d424d..697a73ba 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,13 @@ "private": true, "scripts": { "start": "DEBUG=hackboard:* NODE_ENV=development nodemon --ignore gcp_creds.json ./bin/www.js", - "start-windows": "set DEBUG=hackboard:* && set NODE_ENV=test && nodemon --ignore gcp_creds.json ./bin/www.js", + "start-windows": "set \"DEBUG=hackboard:*\" && set \"NODE_ENV=development\" && nodemon --ignore gcp_creds.json ./bin/www.js", "deploy": "NODE_ENV=deployment node ./bin/www.js", "debug": "DEBUG=hackboard:* NODE_ENV=development nodemon --ignore gcp_creds.json ./bin/www.js", "test": "DEBUG=hackboard:* NODE_ENV=development mocha -r dotenv/config --reporter spec tests/**.js --exit", - "test-windows": "DEBUG=hackboard:* SET NODE_ENV=development & mocha -r dotenv/config --reporter spec tests/**.js --exit", + "test-windows": "DEBUG=hackboard:* SET NODE_ENV=test & mocha -r dotenv/config --reporter spec tests/**.js --exit", "seed": "NODE_ENV=development node ./seed/index.js", + "seed-windows": "set \"NODE_ENV=test\" && node ./seed/index.js", "docs": "apidoc -i ./routes -o ./docs/api/", "format": "prettier --write '**/*.js'", "lint": "eslint --fix '**/*.js'" From b8139788be1083df7a263917e96f15754d8ceaba Mon Sep 17 00:00:00 2001 From: Mona Date: Wed, 14 Oct 2026 21:34:48 -0400 Subject: [PATCH 2/3] Add placeholder keys for google sheets checkin form in .env.example --- .env.example | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 3767c1f4..03f2554f 100644 --- a/.env.example +++ b/.env.example @@ -32,7 +32,7 @@ JWT_INVITE_SECRET= #Reset password secret JWT_RESET_PWD_SECRET= -#Secret key fo account confirmation token +#Secret key for account confirmation token JWT_CONFIRM_ACC_SECRET= #mail information @@ -53,3 +53,7 @@ AUTH_URI= TOKEN_URI= AUTH_PROVIDER_X509_CERT_URL= CLIENT_X509_CERT_URL= + +# Google Sheets checkin form +SPREADSHEET_ID= +CHECKIN_SHEET_NAME= From 7beae471f1f9a51de33fd9a641c38e8e757f51be Mon Sep 17 00:00:00 2001 From: Mona Date: Wed, 14 Oct 2026 21:35:16 -0400 Subject: [PATCH 3/3] Update setup steps in docs --- docs/getting-started.md | 42 ++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index 7f0ceef1..4f909cb1 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -4,31 +4,39 @@ * A google cloud provider account: * Google storage bucket. -* Sendgrid account and the sendgrid_api_key +* Sendgrid account: + * Sendgrid API key. You may need to log in to the Sendgrid account and create a new key. ## Setting up this repo 1. Clone the repository: `git clone https://github.com/hackmcgill/hackerAPI.git` -2. Make sure you have the following tools: - 1. `git`: - 2. `mongodb`: - 1. Make sure you also have the `/data/db` directory. - 2. To test the installation, run `mongod`. - 3. `node`: - 4. `npm`: . - 5. `Postman`: . We use this for testing the API locally. -3. Make sure you have the following (only if you are going to be publishing this as a kubernetes cluster on google cloud): - 1. `kubectl`: - 2. `gcloud`: -4. Create a `.env` file in the root directory, and populate the fields as per `.env.example`. -5. run `npm install` +2. Make sure you have [node **v20.10.0**](https://nodejs.org/en/download/) installed. You can check using `node -v`. + * It is recommended to install and use [node version manager (nvm)](https://www.nvmnode.com/guide/download.html) as other McHacks repos may not use the same version of node. + * If you have another standalone version of node installed, uninstall it or make sure that your shell calls the node from nvm and _not_ the standalone one. + * Run `nvm install 20.10.0` + * If you want your default node version to be a different version, you can install that version and follow instructions [here](https://www.nvmnode.com/guide/usage.html#setting-a-default-node-js-version) + * The .nvmrc file should automatically have nvm use 20.10.0 when you execute node commands in this folder +2. Make sure you have [MongoDB Community edition](https://www.mongodb.com/try/download/community) installed. + * Follow the setup instructions for your operating system at . Keeping all the default values provided by the installer should be fine. + * Start the mongodb service if it was not started during installation. + * You can check if it installed properly by running `mongod --version` as well as `mongosh`. +3. Create a `.env` file in the root directory, and populate the fields as per `.env.example`. + * Most values can be found in the 1Password, including the dev and deploy database information, JWT and cookie secrets, and Google Cloud service account information. + * The test database should be a local database. + * See previous section for `SENDGRID_API_KEY`. + * `NO_REPLY_EMAIL` should be the McHacks noreply email. + * `SPREADSHEET_ID` and `CHECKIN_SHEET_NAME` shoud have the corresponding information for the Google Sheets spreadsheet that is connected to the team check-in form. +4. Run `npm install` to install all the dependencies. +5. Set up the database using instructions in the next section. +6. Run `npm run start` or `npm run start-windows` to serve locally! + ## Setting up the database 1. Determine which environment the database you want to seed belongs to (`deployment`, `development`, or `test`). -2. Navigate to `package.json`, and confirm that at the `seed` script, `NODE_ENV` is set to the proper environment. -3. Run `npm run seed`. +2. Navigate to `package.json`, and confirm that at the `seed` and/or `seed-windows` script, `NODE_ENV` is set to the proper environment. +3. Run `npm run seed` or `npm run seed-windows`. ## Testing the API -In order to test that you have set up the API properly, run `npm run test`. \ No newline at end of file +In order to test that you have set up the API properly, run `npm run test`.