From 066876a4e2827f9b799ed4285be666dd7d9ee482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ai-chan-0411=20=28=E8=97=8D=29?= Date: Sun, 12 Apr 2026 08:07:53 +0900 Subject: [PATCH] docs: create CONTRIBUTING.md with setup and guidelines (closes #29) --- CONTRIBUTING.md | 155 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..7c454ed --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,155 @@ +# Contributing to DevImpact + +Thank you for your interest in contributing to DevImpact! This guide will help you get started. + +## Table of Contents + +- [Getting Started](#getting-started) +- [Development Setup](#development-setup) +- [Project Structure](#project-structure) +- [Making Changes](#making-changes) +- [Pull Request Guidelines](#pull-request-guidelines) +- [Issue Guidelines](#issue-guidelines) +- [Coding Standards](#coding-standards) +- [Need Help?](#need-help) + +## Getting Started + +1. **Fork** the repository on GitHub +2. **Clone** your fork locally: + ```bash + git clone https://github.com/your-username/DevImpact.git + cd DevImpact + ``` +3. **Add the upstream remote**: + ```bash + git remote add upstream https://github.com/O2sa/DevImpact.git + ``` + +## Development Setup + +### Prerequisites + +- [Node.js](https://nodejs.org/) (v18 or higher) +- [pnpm](https://pnpm.io/) package manager +- A [GitHub Personal Access Token](https://github.com/settings/tokens) with `read:user` and `repo` scopes + +### Installation + +1. Install dependencies: + ```bash + pnpm install + ``` + +2. Create a `.env` file in the project root (see `.env.example`): + ``` + GITHUB_TOKEN=your_github_token_here + ``` + +3. Start the development server: + ```bash + pnpm dev + ``` + +4. Open [http://localhost:3000](http://localhost:3000) in your browser. + +## Project Structure + +``` +DevImpact/ +├── app/ # Next.js App Router pages and API routes +├── components/ # Reusable React components +├── lib/ # Utility functions, GitHub API client, scoring logic +├── types/ # TypeScript type definitions +├── .github/ # Issue templates, PR template, workflows +├── tailwind.config.ts +├── next.config.js +└── tsconfig.json +``` + +### Tech Stack + +- **Framework**: Next.js 16+ (App Router) +- **Language**: TypeScript +- **Styling**: Tailwind CSS +- **UI Components**: Radix UI, Lucide React icons +- **Charts**: Recharts +- **API**: GitHub GraphQL API via Octokit + +## Making Changes + +1. **Sync your fork** with the latest upstream changes: + ```bash + git fetch upstream + git checkout main + git merge upstream/main + ``` + +2. **Create a feature branch** from `main`: + ```bash + git checkout -b feat/your-feature-name + ``` + +3. **Make your changes** and test them locally. + +4. **Run the linter** before committing: + ```bash + pnpm lint + ``` + +5. **Commit your changes** with a clear message: + ```bash + git commit -m "feat: add your feature description" + ``` + +6. **Push** to your fork and open a Pull Request. + +### Commit Message Format + +Use descriptive commit messages with a prefix: + +- `feat:` for new features +- `fix:` for bug fixes +- `docs:` for documentation changes +- `refactor:` for code refactoring +- `style:` for formatting changes (no logic change) +- `test:` for adding or updating tests + +## Pull Request Guidelines + +- Reference the related issue using `Fixes #` in the PR description +- Keep PRs focused on a single change +- Make sure the linter passes (`pnpm lint`) +- Test your changes locally before submitting +- Fill out the PR template provided +- Be responsive to review feedback + +## Issue Guidelines + +We use several issue templates: + +- **Bug Report** - for reporting bugs +- **Feature Request** - for suggesting new features +- **Feature Change Request** - for modifying existing features +- **Documentation** - for documentation improvements +- **Refactoring** - for code quality improvements + +When opening an issue, please use the appropriate template and provide as much detail as possible. + +## Coding Standards + +- **TypeScript**: Use proper types. Avoid `any` where possible. +- **Components**: Keep components small and focused. Use the `components/` directory for reusable UI elements. +- **Styling**: Use Tailwind CSS utility classes. Follow the existing patterns in the codebase. +- **API calls**: Use the existing GitHub API client in `lib/` rather than creating new API integrations. +- **File naming**: Use kebab-case for files (e.g., `compare-form.tsx`). + +## Need Help? + +- Check the [open issues](https://github.com/O2sa/DevImpact/issues) for tasks you can work on +- Look for issues labeled `good first issue` for beginner-friendly tasks +- Open a new issue if you have questions or suggestions + +## License + +By contributing to DevImpact, you agree that your contributions will be licensed under the [MIT License](LICENSE).