Skip to content

Commit 4c35188

Browse files
feat: adds contributing markdown (#75)
Closes #68 ### Overview 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 ### Testing _No testing_ ### Screenshots / Screencasts Preview of the markdown file (it's 3 pictures, sorry for the formatting): <img width="832" height="753" alt="contributing_1" src="https://github.com/user-attachments/assets/748a16ae-2a29-46f5-941d-f0724128cc05" /> <img width="826" height="814" alt="contributing_2" src="https://github.com/user-attachments/assets/1d951a42-739a-48a6-96b2-f613fecb8991" /> <img width="831" height="820" alt="contributing_3" src="https://github.com/user-attachments/assets/e6526c74-ffe8-4ba1-882f-37a46c04898f" /> ### Checklist - [x] Code is neat, readable, and works - [x] Code is commented where appropriate and well-documented - [x] Commit messages follow our [guidelines](https://www.conventionalcommits.com) - [x] Issue number is linked - [x] Branch is linked - [ ] Reviewers are assigned (one of your tech leads) Tip: You can make the issue and then check them after the fact or replace `[ ]` with `[x]` to check it! ### Notes Not sure if the STYLE_GUIDE.md is supposed to be incorporated into the CONTRIBUTING.md file or if just linking it is sufficient. Also, much of the content was taken from this repo's README.md and Cal Poly's H4I repo, so let me know if something doesn't make sense or conform to Operation's standards. --------- Signed-off-by: Sophia Chang <[email protected]> Co-authored-by: Sophia Chang <[email protected]>
1 parent 59a0cdb commit 4c35188

File tree

1 file changed

+111
-0
lines changed

1 file changed

+111
-0
lines changed

CONTRIBUTING.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Contributing
2+
3+
Here are all of the steps you should follow whenever contributing to this repo!
4+
5+
---
6+
7+
## Quick Start
8+
9+
### 1. Setting Up the Repo
10+
11+
1. Go to the project [repo](https://github.com/hack4impact/operations-api).
12+
2. Click the green "Code" button in the top right. Switch to the "HTTPS" tab.
13+
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.
14+
4. Go into your IDE/terminal and enter `git clone <paste-URL-here>`
15+
16+
### 2. Install Dependencies
17+
18+
```bash
19+
npm install
20+
```
21+
22+
### 3. Environment Setup
23+
24+
Create a `.env` file in the root directory and copy fields from `.env.example`:
25+
26+
```env
27+
# Database Configuration
28+
DATABASE_URL=your_database_url_here
29+
DIRECT_URL=your_direct_url_here
30+
31+
# Server Configuration
32+
PORT=3000
33+
REST_PORT=3001
34+
GRAPHQL_PORT=3002
35+
```
36+
37+
Access the important fields from Vaultwarden from this: https://vault.hack4impact.org/#/login
38+
39+
### 4. Database Setup
40+
41+
```bash
42+
npx prisma db pull # Sync schema with database
43+
npx prisma generate # Generate Prisma client
44+
```
45+
46+
### 5. Start Development Server
47+
48+
```bash
49+
# Start integrated server (both REST & GraphQL)
50+
npm run dev
51+
52+
# Or start servers separately
53+
npm run dev:rest # REST API only
54+
npm run dev:graphql # GraphQL API only
55+
npm run dev:both # Both servers concurrently
56+
```
57+
58+
The servers will be available at:
59+
60+
- **Integrated**: <http://localhost:3001>
61+
- **REST API**: <http://localhost:3002>
62+
- **GraphQL API**: <http://localhost:3003>
63+
64+
---
65+
66+
## Development Guidelines
67+
68+
_See Style Guide: [STYLE_GUIDE.md](https://github.com/hack4impact/operations-api/blob/main/STYLE_GUIDE.md)_
69+
70+
### Branch Naming Convention
71+
72+
Follow the pattern listed in your issue: `feature/issue-number-description`
73+
74+
- Example: `feature/1-add-volunteer-endpoints`
75+
- This automatically links branches to GitHub issues
76+
- Create your branch off of the "develop" branch, not the main.
77+
78+
### Making Changes
79+
80+
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
81+
2. Create a branch `git checkout -b <name-of-branch>`
82+
3. Make changes to the code
83+
4. Run ESLint to ensure code standards (see in [style guide](https://github.com/hack4impact/operations-api/blob/main/STYLE_GUIDE.md#eslint)).
84+
85+
### Committing Changes
86+
87+
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 <branch-name>` and you have made all neccessary code changes for the provided task.
88+
89+
1. View diffs of each file you changed using the VSCode Github extension (3rd icon on far left bar of VSCode) or GitHub Desktop
90+
2. `git add .` (to stage all files) or `git add <file-name>` (to stage specific file)
91+
3. `git commit -m "<type>[optional scope]: <description>"` or `git commit -m "<type>[optional scope]: <description>" -m "[optional body]"` or `git commit` to get a message prompt
92+
4. `git push -u origin <name-of-branch>`
93+
94+
### Making Pull Requests
95+
96+
1. Go to the Pull Requests tab on [github.com](https://github.com/)
97+
2. Find your PR, fill out the PR template
98+
3. (If applicable, provide a screenshot of your work in the comment area)
99+
4. Link your PR to the corresponding Issue
100+
5. Request a reviewer to check your code
101+
6. Once approved, your code is ready to be merged in 🎉
102+
103+
### Testing
104+
105+
```bash
106+
npm run test # Run all tests (Unit & Integration)
107+
npm run test:coverage # Generate coverage report for Unit tests only
108+
npm run test:integration # Integration tests only
109+
npm run test:unit # Unit tests only
110+
npm run test:watch # Watch mode for unit tests
111+
```

0 commit comments

Comments
 (0)