Skip to content

Commit 828069b

Browse files
authored
Merge pull request #84 from sunithvs/feat(DOCS)/contribution-guid
Feat(docs)/contribution guid
2 parents e61f63e + da732e7 commit 828069b

File tree

1 file changed

+187
-13
lines changed

1 file changed

+187
-13
lines changed

CONTRIBUTING.md

Lines changed: 187 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,179 @@
11
# CONTRIBUTING.md
22

3-
## How to Contribute
4-
We welcome contributions from the community! Follow these guidelines to ensure your contributions are well-received.
3+
Thank you for your interest in contributing to devb.io! This guide will help you understand how to contribute to both the frontend and backend components of our project.
4+
5+
## 🌟 Project Overview
6+
7+
devb.io is a platform that automatically generates professional developer portfolios from GitHub profiles, using AI to enhance professional representations. The project consists of:
8+
9+
- **Frontend**: NextJS application (in the `/www` directory)
10+
- **Backend**: FastAPI application (in the `/api` directory)
11+
- **Caching**: Redis for performance optimization
12+
13+
## 🚀 Getting Started
14+
15+
### Prerequisites
16+
17+
- Python 3.9+
18+
- Node.js 18+ and npm/pnpm
19+
- Redis (for local development)
20+
- Git
21+
22+
### Setting Up the Development Environment
23+
24+
1. **Fork the Repository:**
25+
Click the Fork button on GitHub to create your own copy.
526

6-
### 🛠 Getting Started
7-
1. **Fork the Repository:** Click the Fork button on GitHub to create your own copy.
827
2. **Clone Your Fork:**
928
```bash
1029
git clone https://github.com/your-username/devb.io.git
30+
cd devb.io
1131
```
32+
1233
3. **Create a New Branch:**
1334
```bash
1435
git checkout -b feature/your-feature-name
1536
```
1637

17-
### 💾 Making Changes
18-
- Keep your code clean and follow the existing code style.
19-
- Write clear and concise commit messages.
38+
## 🔧 Backend Setup (FastAPI)
39+
40+
1. **Install Python Dependencies:**
41+
```bash
42+
pip install -r requirements.txt
43+
```
44+
45+
2. **Environment Variables:**
46+
- Copy the example environment file and modify as needed
47+
- Required variables include API keys and configuration settings
48+
49+
3. **Run the Backend Server:**
50+
```bash
51+
uvicorn api.main:app --reload --port 8000
52+
```
53+
54+
4. **Access the API Documentation:**
55+
- Swagger UI: http://localhost:8000/docs
56+
- ReDoc: http://localhost:8000/redoc
57+
58+
### Backend Development Guidelines
59+
60+
1. **Code Structure:**
61+
- Place new API endpoints in the appropriate modules
62+
- Follow the existing pattern for route definitions
63+
- Use dependency injection for shared resources
64+
65+
2. **Error Handling:**
66+
- Use FastAPI's HTTPException for API errors
67+
- Include descriptive error messages
68+
- Implement proper status codes
69+
70+
3. **Testing:**
71+
- Write tests using pytest
72+
- Run tests with `pytest` command
73+
- Ensure test coverage for new features
74+
75+
4. **Performance Considerations:**
76+
- Use caching where appropriate
77+
- Implement async functions for I/O bound operations
78+
- Consider rate limiting for external API calls
79+
80+
## 💻 Frontend Setup (NextJS)
81+
82+
1. **Install Node Dependencies:**
83+
```bash
84+
cd www
85+
pnpm install
86+
```
87+
88+
2. **Environment Variables:**
89+
- Copy `www/example.env` to `www/.env.local`
90+
- Update the API endpoint and other required variables
91+
92+
3. **Run the Development Server:**
93+
```bash
94+
pnpm dev
95+
```
96+
97+
4. **Access the Frontend:**
98+
- Open http://localhost:3000 in your browser
99+
100+
### Frontend Development Guidelines
101+
102+
1. **Code Structure:**
103+
- Follow the Next.js app router structure
104+
- Place components in the appropriate directories
105+
- Use client and server components appropriately
106+
107+
2. **Styling:**
108+
- Use Tailwind CSS for styling
109+
- Follow the existing design system
110+
- Ensure responsive design
111+
112+
3. **State Management:**
113+
- Use Zustand for client state management (Only if necessary)
114+
- Follow existing patterns for data fetching
115+
116+
4. **Error Handling:**
117+
- Implement proper error boundaries
118+
- Use the retry mechanism for API calls (especially for LinkedIn data)
119+
- Display user-friendly error messages
120+
121+
5. **Performance:**
122+
- Optimize images and assets
123+
- Use proper loading states and skeletons
124+
- Implement proper caching strategies
125+
126+
## 🧪 Testing
127+
128+
### Backend Testing
129+
130+
```bash
131+
# Run all tests
132+
pytest
133+
134+
# Run with coverage report
135+
pytest --cov=api
136+
```
137+
138+
### Frontend Testing
139+
140+
```bash
141+
# Run linting
142+
cd www
143+
pnpm lint
144+
```
145+
146+
## 📝 Making Changes
147+
148+
- Keep your code clean and follow the existing code style
149+
- Write clear and concise commit messages
150+
- Follow the conventional commit format: `type(scope): message`
151+
- Types include: feat, fix, docs, style, refactor, test, chore
152+
153+
## 🔄 Pull Request Process
154+
155+
1. **Update Documentation:**
156+
- Update the README.md if needed
157+
- Add comments to your code
158+
- Update API documentation if applicable
159+
160+
2. **Test Your Changes:**
161+
- Ensure all tests pass
162+
- Add new tests for new features
163+
- Verify your changes work as expected
164+
165+
3. **Create a Pull Request:**
166+
- Use the PR template provided
167+
- Link to any related issues
168+
- Provide a clear description of your changes
169+
170+
4. **Code Review:**
171+
- Address reviewer comments
172+
- Make requested changes
173+
- Respond to feedback constructively
20174

21175
### ✅ Pull Request Template
176+
22177
When submitting a Pull Request, please follow this template:
23178

24179
```markdown
@@ -46,15 +201,34 @@ When submitting a Pull Request, please follow this template:
46201

47202
## Checklist
48203
<!--- Ensure the following points are checked -->
49-
- [ ] My code follows the projects code style.
204+
- [ ] My code follows the project's code style.
50205
- [ ] I have updated the documentation as needed.
206+
- [ ] I have added tests to cover my changes.
207+
- [ ] All new and existing tests passed.
208+
- [ ] My changes generate no new warnings.
51209
```
52210

53-
### 🤝 Code of Conduct
54-
- Be respectful and inclusive.
55-
- Provide constructive feedback.
211+
## 🤝 Code of Conduct
212+
213+
- Be respectful and inclusive
214+
- Provide constructive feedback
215+
- Follow the golden rule: treat others as you would like to be treated
216+
217+
## 🔍 Code Review Guidelines
218+
219+
When reviewing code, please:
220+
221+
1. Be respectful and constructive
222+
2. Focus on the code, not the person
223+
3. Explain your reasoning
224+
4. Suggest improvements, not just point out issues
225+
5. Approve PRs that meet the requirements
226+
227+
## 💡 Need Help?
56228

57-
### 💡 Need Help?
58-
If you have any questions, feel free to open an issue or reach out via [[email protected]](mailto:[email protected]).
229+
If you have any questions, feel free to:
230+
- Open an issue on GitHub
231+
- Join our [Discord community](https://discord.gg/W364NEY6)
232+
- Reach out via [[email protected]](mailto:[email protected])
59233

60234
Happy contributing! 🎉

0 commit comments

Comments
 (0)