diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..c794e24 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,272 @@ +# Contributing to codebrew.tech + +Thank you for your interest in contributing to codebrew.tech! We welcome contributions from the community and appreciate your help in making this project better. + +## Table of Contents + +- [Getting Started](#getting-started) +- [Development Workflow](#development-workflow) +- [Code Standards](#code-standards) +- [Commit Guidelines](#commit-guidelines) +- [Pull Request Process](#pull-request-process) +- [Project Structure](#project-structure) +- [Testing](#testing) +- [Need Help?](#need-help) + +## Getting Started + +### Prerequisites + +- Node.js (version 20 or higher recommended) +- npm, yarn, pnpm, or bun package manager +- Git + +### Setting Up Your Development Environment + +1. **Fork the repository** + + Click the "Fork" button at the top right of the repository page. + +2. **Clone your fork** + + ```bash + git clone https://github.com/YOUR_USERNAME/codebrew.tech.git + cd codebrew.tech + ``` + +3. **Add the upstream remote** + + ```bash + git remote add upstream https://github.com/crafter-station/codebrew.tech.git + ``` + +4. **Install dependencies** + + ```bash + npm install + # or + yarn install + # or + pnpm install + # or + bun install + ``` + +5. **Start the development server** + + ```bash + npm run dev + # or + yarn dev + # or + pnpm dev + # or + bun dev + ``` + + Open [http://localhost:3000](http://localhost:3000) to view the application. + +## Development Workflow + +1. **Create a new branch** + + Always create a new branch for your work: + + ```bash + git checkout -b feature/your-feature-name + # or + git checkout -b fix/your-bug-fix + ``` + +2. **Make your changes** + + - Write clean, readable code + - Follow the existing code style + - Keep changes focused and atomic + +3. **Test your changes** + + - Run the development server and verify your changes work as expected + - Run the linter: `npm run lint` + - Run the build: `npm run build` + - Ensure there are no errors or warnings + +4. **Keep your branch up to date** + + ```bash + git fetch upstream + git rebase upstream/main + ``` + +## Code Standards + +### TypeScript + +- This project uses **TypeScript** with strict mode enabled +- Ensure all code is properly typed +- Avoid using `any` type unless absolutely necessary +- Use interfaces for object types and type aliases for unions/primitives + +### Code Style + +- **Linting**: We use ESLint with Next.js configuration + - Run `npm run lint` before committing + - Fix any linting errors or warnings +- **Formatting**: Follow the existing code formatting in the project +- **Naming Conventions**: + - Components: PascalCase (e.g., `MyComponent.tsx`) + - Files: kebab-case for non-component files (e.g., `my-utility.ts`) + - Variables and functions: camelCase + - Constants: UPPER_SNAKE_CASE for true constants + +### Next.js Best Practices + +- Use App Router conventions (we're using Next.js 16) +- Place components in the `components/` directory +- Place pages in the `app/` directory +- Use Server Components by default, Client Components (`'use client'`) only when needed +- Leverage Next.js built-in optimizations (Image, Font, etc.) + +### React Best Practices + +- Use functional components with hooks +- Keep components small and focused +- Extract reusable logic into custom hooks +- Use proper dependency arrays in useEffect + +## Commit Guidelines + +We follow the [Conventional Commits](https://www.conventionalcommits.org/) specification: + +### Commit Message Format + +``` +(): + + + +