From 181fbc02483cc5c645461ff073e115c69de811a0 Mon Sep 17 00:00:00 2001 From: Sean Nguyen Date: Mon, 24 Nov 2025 20:40:25 +0000 Subject: [PATCH 1/2] feat: adds contributing markdown Adds the CONTRIBUTING.md file to the repo. Includes a Quick Start guide on how to set up the repo, install dependencies, and go through the rest of the setup. Includes Development Guidelines with a link to the STYLE_GUIDE.md --- CONTRIBUTING.md | 108 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..5cf01a1 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,108 @@ +# Contributing + +Here are all of the steps you should follow whenever contributing to this repo! + +--- + +## Quick Start + +### 1. Setting Up the Repo + +1. Go to the project [repo](https://github.com/hack4impact/operations-api). +2. Click the green "Code" button in the top right. Switch to the "HTTPS" tab. +3. Click the "Copy URL to clipboard" button to the right of the URL. +4. Go into your IDE/terminal and enter `git clone ` + +### 2. Install Dependencies + +```bash +npm install +``` + +### 3. Environment Setup + +Create a `.env` file in the root directory and copy fields from `.env.example`: + +```env +# Database Configuration +DATABASE_URL=your_database_url_here +DIRECT_URL=your_direct_url_here + +# Server Configuration +PORT=3000 +REST_PORT=3001 +GRAPHQL_PORT=3002 +``` + +### 4. Database Setup + +```bash +npx prisma db pull # Sync schema with database +npx prisma generate # Generate Prisma client +``` + +### 5. Start Development Server + +```bash +# Start integrated server (both REST & GraphQL) +npm run dev + +# Or start servers separately +npm run dev:rest # REST API only +npm run dev:graphql # GraphQL API only +npm run dev:both # Both servers concurrently +``` + +The servers will be available at: + +- **Integrated**: +- **REST API**: +- **GraphQL API**: + +--- + +## Development Guidelines + +_See Style Guide: [STYLE_GUIDE.md](https://github.com/hack4impact/operations-api/blob/main/STYLE_GUIDE.md)_ + +### Branch Naming Convention + +Follow the pattern: `feature/issue-number-description` + +- Example: `feature/1-add-volunteer-endpoints` +- This automatically links branches to GitHub issues + +### Making Changes + +1. Before you start making changes, always make sure you're on the main branch, then `git pull` and `npm i` to make sure your code is up to date +2. Create a branch `git checkout -b ` +3. Make changes to the code +4. Run ESLint to ensure code standards (see in [style guide](https://github.com/hack4impact/operations-api/blob/main/STYLE_GUIDE.md#eslint)). + +### Committing Changes + +When interacting with Git/GitHub, feel free to use the command line, VSCode extension, or Github desktop. These steps assume you have already made a branch using `git checkout -b ` and you have made all neccessary code changes for the provided task. + +1. View diffs of each file you changed using the VSCode Github extension (3rd icon on far left bar of VSCode) or GitHub Desktop +2. `git add .` (to stage all files) or `git add ` (to stage specific file) +3. `git commit -m "[optional scope]: "` or `git commit -m "[optional scope]: " -m "[optional body]"` or `git commit` to get a message prompt +4. `git push -u origin ` + +### Making Pull Requests + +1. Go to the Pull Requests tab on [github.com](https://github.com/) +2. Find your PR, fill out the PR template +3. (If applicable, provide a screenshot of your work in the comment area) +4. Link your PR to the corresponding Issue +5. Request a reviewer to check your code +6. Once approved, your code is ready to be merged in 🎉 + +### Testing + +```bash +npm run test # Run all tests (Unit & Integration) +npm run test:coverage # Generate coverage report for Unit tests only +npm run test:integration # Integration tests only +npm run test:unit # Unit tests only +npm run test:watch # Watch mode for unit tests +``` From 462ee550f09bc036d56f1a5ba4444ab19467886f Mon Sep 17 00:00:00 2001 From: Sophia Chang <103406603+soramicha@users.noreply.github.com> Date: Mon, 24 Nov 2025 12:54:15 -0800 Subject: [PATCH 2/2] Revise contributing guidelines for clarity Updated instructions for cloning the repo and branch naming conventions. Signed-off-by: Sophia Chang <103406603+soramicha@users.noreply.github.com> --- CONTRIBUTING.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5cf01a1..0acbdc5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,7 @@ Here are all of the steps you should follow whenever contributing to this repo! 1. Go to the project [repo](https://github.com/hack4impact/operations-api). 2. Click the green "Code" button in the top right. Switch to the "HTTPS" tab. -3. Click the "Copy URL to clipboard" button to the right of the URL. +3. If you are using Github Desktop, click "Open with Github Desktop", otherwise click the "Copy URL to clipboard" button to the right of the URL. 4. Go into your IDE/terminal and enter `git clone ` ### 2. Install Dependencies @@ -34,6 +34,8 @@ REST_PORT=3001 GRAPHQL_PORT=3002 ``` +Access the important fields from Vaultwarden from this: https://vault.hack4impact.org/#/login + ### 4. Database Setup ```bash @@ -67,14 +69,15 @@ _See Style Guide: [STYLE_GUIDE.md](https://github.com/hack4impact/operations-api ### Branch Naming Convention -Follow the pattern: `feature/issue-number-description` +Follow the pattern listed in your issue: `feature/issue-number-description` - Example: `feature/1-add-volunteer-endpoints` - This automatically links branches to GitHub issues +- Create your branch off of the "develop" branch, not the main. ### Making Changes -1. Before you start making changes, always make sure you're on the main branch, then `git pull` and `npm i` to make sure your code is up to date +1. Before you start making changes, always make sure you're on the develop branch, then `git pull` and `npm i` to make sure your code is up to date 2. Create a branch `git checkout -b ` 3. Make changes to the code 4. Run ESLint to ensure code standards (see in [style guide](https://github.com/hack4impact/operations-api/blob/main/STYLE_GUIDE.md#eslint)).