|
2 | 2 |
|
3 | 3 | Thanks for helping improve FairShare. This guide covers setup, workflow, and contribution standards. |
4 | 4 |
|
| 5 | +## Getting Started (for Beginners) |
| 6 | + |
| 7 | +This section explains how to start contributing if you're new to the project or open source in general. |
| 8 | + |
| 9 | +### 1. Fork the Repository |
| 10 | + |
| 11 | +Click the **Fork** button at the top-right of the repository page to create your own copy of the codebase. |
| 12 | + |
| 13 | +### 2. Clone Your Fork |
| 14 | + |
| 15 | +Clone your forked repository to your local machine: |
| 16 | + |
| 17 | +```bash |
| 18 | +git clone https://github.com/YOUR_USERNAME/FairShare.git |
| 19 | +cd FairShare |
| 20 | +``` |
| 21 | + |
| 22 | +*Replace `YOUR_USERNAME` with your GitHub username.* |
| 23 | + |
| 24 | +### 3. Set Up Upstream |
| 25 | + |
| 26 | +Keep your fork in sync with the main project: |
| 27 | + |
| 28 | +```bash |
| 29 | +git remote add upstream https://github.com/Arun-kushwaha007/FairShare.git |
| 30 | +``` |
| 31 | + |
| 32 | +### 4. Create a Branch |
| 33 | + |
| 34 | +Always create a new branch for your work. Use the following naming standard: |
| 35 | + |
| 36 | +- `feat/your-feature-name` (for new features) |
| 37 | +- `fix/bug-description` (for bug fixes) |
| 38 | +- `docs/what-changed` (for documentation updates) |
| 39 | + |
| 40 | +```bash |
| 41 | +git checkout -b feat/add-new-feature |
| 42 | +``` |
| 43 | + |
| 44 | +### 5. Make Changes & Commit |
| 45 | + |
| 46 | +After making your changes, stage and commit them. Follow the conventional commit style (see below). |
| 47 | + |
| 48 | +```bash |
| 49 | +git add . |
| 50 | +git commit -m "feat(scope): add helpful description" |
| 51 | +``` |
| 52 | + |
| 53 | +### 6. Push & Pull Request |
| 54 | + |
| 55 | +Push your changes to your fork and open a Pull Request (PR) on the main repository. |
| 56 | + |
| 57 | +```bash |
| 58 | +git push origin feat/add-new-feature |
| 59 | +``` |
| 60 | + |
| 61 | +Go to the original repository on GitHub, and you'll see a "Compare & pull request" button. |
| 62 | + |
| 63 | +--- |
| 64 | + |
5 | 65 | ## Setup |
| 66 | + |
6 | 67 | 1. Install dependencies: |
7 | | -``` |
| 68 | + |
| 69 | +```bash |
8 | 70 | pnpm install |
9 | 71 | ``` |
10 | | -2. Create environment files: |
11 | | -``` |
| 72 | + |
| 73 | +1. Create environment files: |
| 74 | + |
| 75 | +```bash |
12 | 76 | cp .env.example .env |
13 | 77 | cp apps/mobile/.env.example apps/mobile/.env |
14 | 78 | ``` |
15 | | -3. Start local services: |
16 | | -``` |
| 79 | + |
| 80 | +1. Start local services: |
| 81 | + |
| 82 | +```bash |
17 | 83 | docker-compose up -d |
18 | 84 | ``` |
19 | | -4. Run apps: |
20 | | -``` |
| 85 | + |
| 86 | +1. Run apps: |
| 87 | + |
| 88 | +```bash |
21 | 89 | pnpm dev |
22 | 90 | ``` |
23 | 91 |
|
24 | | -## Project Structure |
| 92 | +## Projects Structure |
| 93 | + |
25 | 94 | - `apps/backend`: NestJS API |
26 | 95 | - `apps/web`: Next.js dashboard |
27 | 96 | - `apps/mobile`: Expo app |
28 | 97 | - `packages/shared-types`: shared types across apps |
29 | 98 |
|
30 | 99 | ## Branching and Commits |
| 100 | + |
31 | 101 | - Create a feature branch from `main`. |
32 | 102 | - Keep commits focused and readable. |
33 | 103 | - Use conventional commit style when possible: |
| 104 | + |
34 | 105 | - `feat(scope): message` |
35 | 106 | - `fix(scope): message` |
36 | 107 | - `chore(scope): message` |
37 | 108 |
|
38 | 109 | ## Code Style |
| 110 | + |
39 | 111 | - TypeScript everywhere |
40 | 112 | - Keep UI changes consistent with existing design tokens |
41 | 113 | - Avoid introducing new dependencies unless necessary |
42 | 114 | - Prefer shared types in `packages/shared-types` |
43 | 115 |
|
44 | 116 | ## Testing |
| 117 | + |
45 | 118 | Run what applies to your change: |
46 | | -``` |
| 119 | + |
| 120 | +```bash |
47 | 121 | pnpm lint |
48 | 122 | pnpm test |
49 | 123 | pnpm --filter web build |
50 | 124 | ``` |
51 | 125 |
|
52 | 126 | ## Pull Request Checklist |
| 127 | + |
53 | 128 | - Changes compile and relevant tests pass |
54 | 129 | - Screenshots for UI changes (web/mobile) |
55 | 130 | - No secrets or credentials committed |
56 | 131 | - Updated README/docs if behavior changed |
57 | 132 |
|
58 | 133 | ## Security Checklist |
| 134 | + |
59 | 135 | - Never commit `.env` or real credentials |
60 | 136 | - Use placeholders or local-only values for compose/dev configs |
61 | 137 | - Avoid logging tokens or sensitive payloads |
62 | 138 | - Rotate keys immediately if a secret is exposed |
63 | 139 | - Keep dependencies updated and audited |
64 | 140 |
|
65 | 141 | ## Reporting Issues |
| 142 | + |
66 | 143 | When filing a bug, include: |
| 144 | + |
67 | 145 | - Reproduction steps |
68 | 146 | - Expected vs actual behavior |
69 | 147 | - Logs or screenshots |
|
0 commit comments