diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..6f2d754 --- /dev/null +++ b/.env.example @@ -0,0 +1,4 @@ +# .env.example +ALGOLIA_APP_ID= +ALGOLIA_API_KEY= +ALGOLIA_INDEX_NAME= diff --git a/.gitignore b/.gitignore index b2d6de3..b083ed4 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ # Misc .DS_Store +.env .env.local .env.development.local .env.test.local diff --git a/README.md b/README.md index 0c6c2c2..aead283 100644 --- a/README.md +++ b/README.md @@ -1,41 +1,71 @@ -# Website +# CCSS Handbook -This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator. +The Carleton Computer Science Society internal handbook for volunteers and developers. -### Installation +## Installation +```bash +npm install ``` -$ yarn + +## Local Development + +1. **Create ``.env`` file at the project root** + +```bash +echo > .env ``` -### Local Development +2. **Add environment variables to the ``.env`` file** + +Open the ``.env`` file and define the variables from ``.env.example``. Reach out to Matthew for the values: +```text +ALGOLIA_APP_ID= +ALGOLIA_API_KEY= +ALGOLIA_INDEX_NAME= ``` -$ yarn start + +3. **Run Start Command** + +```bash +npm run start ``` This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. -### Build +### Formatting + +To format the codebase to match the style defined by Prettier: +```bash +npm run format ``` -$ yarn build + +### Build + +```bash +npm run build ``` -This command generates static content into the `build` directory and can be served using any static contents hosting service. +This creates an optimized static `build` in the build directory. -### Deployment +## Deployment -Using SSH: +**Using SSH:** -``` -$ USE_SSH=true yarn deploy +```bash +USE_SSH=true npm run deploy ``` -Not using SSH: +**Not using SSH:** +```bash +GIT_USER= npm run deploy ``` -$ GIT_USER= yarn deploy -``` -If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. +This will build the site and push it to the ``gh-pages`` branch. + +## Contributing + +We welcome new developers! Make sure you are properly [onboarded](https://handbook.carletoncomputersciencesociety.ca/docs/guides/onboarding/development-volunteers) to be able to contribute to this project. diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 4fb3da4..65daffc 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -1,6 +1,7 @@ import {themes as prismThemes} from 'prism-react-renderer'; import type {Config} from '@docusaurus/types'; import type * as Preset from '@docusaurus/preset-classic'; +import 'dotenv/config'; // This runs in Node.js - Don't use client-side code here (browser APIs, JSX...) diff --git a/package-lock.json b/package-lock.json index 56e682d..ab97608 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,8 @@ "@docusaurus/module-type-aliases": "3.7.0", "@docusaurus/tsconfig": "3.7.0", "@docusaurus/types": "3.7.0", + "@types/dotenv": "^6.1.1", + "dotenv": "^16.5.0", "gh-pages": "^6.3.0", "typescript": "~5.6.2" }, @@ -4845,6 +4847,16 @@ "@types/ms": "*" } }, + "node_modules/@types/dotenv": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/@types/dotenv/-/dotenv-6.1.1.tgz", + "integrity": "sha512-ftQl3DtBvqHl9L16tpqqzA4YzCSXZfi7g8cQceTz5rOlYtk/IZbFjAv3mLOQlNIgOaylCQWQoBdDQHPgEBJPHg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/eslint": { "version": "9.6.1", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", @@ -7621,6 +7633,19 @@ "node": ">=8" } }, + "node_modules/dotenv": { + "version": "16.5.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.5.0.tgz", + "integrity": "sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, "node_modules/dunder-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", diff --git a/package.json b/package.json index 9c9b1aa..f1de72e 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,8 @@ "@docusaurus/module-type-aliases": "3.7.0", "@docusaurus/tsconfig": "3.7.0", "@docusaurus/types": "3.7.0", + "@types/dotenv": "^6.1.1", + "dotenv": "^16.5.0", "gh-pages": "^6.3.0", "typescript": "~5.6.2" },