First off, thank you for considering contributing to ChittChat! We're thrilled you're here. This project thrives on community contributions, and we believe that every line of code, documentation update, or bug report helps make ChittChat better for everyone.
This guide is designed to be a comprehensive resource, walking you through the entire contribution process from finding an issue to getting your pull request merged.
- Our Contribution Philosophy
- Your Contribution Journey
- 🚀 Setting Up Your Local Environment
- 💻 The Art of Making Changes
- ✅ Submitting Your Pull Request
- ❓ Where to Get Help
We believe in a welcoming and inclusive community. Our goal is to create a space where people of all skill levels can learn, grow, and contribute. We expect all contributors to be respectful, open-minded, and collaborative. Please be kind in all your interactions.
Ready to get started? Here's the path you'll take from an idea to a merged contribution.
The best place to start is our Issues Tab.
- Look for issues labeled
good first issueorhelp wanted. These are specifically prepared for new contributors. - If you have your own idea, please open a new issue to propose your change. This allows us to discuss the feature and make sure it aligns with the project's goals before you spend time on it.
- Once you've chosen an issue, comment on it to let us know you'd like to work on it. We'll assign it to you.
First, you'll need your own copy of the project.
- Fork the main ChittChat repository to your GitHub account.
- Clone your fork to your local machine, replacing
<YOUR_USERNAME>:git clone [https://github.com/](https://github.com/)<YOUR_USERNAME>/ChittChat.git cd ChittChat
To avoid conflicts, it's important to keep your fork's main branch updated with the original repository.
- Add the original repository as an "upstream" remote:
git remote add upstream [https://github.com/shambhaveesrivastava12/ChittChat.git](https://github.com/shambhaveesrivastava12/ChittChat.git)
- Before creating a new branch, always pull the latest changes from the upstream main branch:
git checkout main git pull upstream main
Create a new branch for every issue you work on. This isolates your changes and makes the review process much cleaner.
💡 Branch Naming Convention: We use the format
<type>/<short-description>.
- Features:
feat/add-dark-mode- Bug Fixes:
fix/login-button-bug- Documentation:
docs/update-contributing-guide
git checkout -b feat/your-cool-new-featureThis section contains the detailed, step-by-step instructions to get ChittChat running on your machine.
- Node.js: v12 or higher.
- MongoDB: Make sure the database service is actively running.
- npm / yarn: Comes with Node.js.
- Install Backend Dependencies (from the project's root directory):
npm install
- Install Frontend Dependencies:
npm install --prefix frontend
⚠️ Important: The.envfile must be created in the ROOT directory of the project, not inside thebackendfolder.
-
Create a file named
.envin the project's root. -
Copy the following configuration into it:
PORT=5000 MONGO_DB_URI=mongodb://localhost:27017/ChittChat JWT_SECRET=this_is_a_super_secret_for_local_dev_12345 NODE_ENV=development
You'll need two separate terminals.
- Terminal 1 (Backend Server): In the root
ChittChatdirectory, run:npm start
- Terminal 2 (Frontend Client): In the
frontenddirectory, run:cd frontend npm run dev
Your browser should open to the Vite development server (e.g., http://localhost:5173).
- Error:
mongosh: command not found- Fix: This means MongoDB's command-line tools are not in your system's PATH. You need to find your MongoDB
bindirectory and add it to your system's environment variables.
- Fix: This means MongoDB's command-line tools are not in your system's PATH. You need to find your MongoDB
- Error:
The 'uri' parameter... must be a string, got "undefined"- Fix: This is almost always an issue with your
.envfile. Double-check that:- The file is named exactly
.env(not.env.txt). - It is located in the ROOT project folder.
- The variable is spelled exactly
MONGO_DB_URI.
- The file is named exactly
- Fix: This is almost always an issue with your
- Problem: The frontend shows a blank white page.
- Fix: Open your browser's developer console (Right-click > Inspect > Console). This will show you the exact JavaScript error that is preventing React from rendering.
- Consistency is Key: Please try to match the style and patterns you see in the existing codebase.
- React: We use functional components with Hooks.
- JavaScript: Prefer modern ES6+ syntax (e.g.,
const/let, arrow functions, destructuring). - Tailwind CSS: Use theme values where possible and add new styles in a way that is consistent with the existing UI.
We use the Conventional Commits standard. This helps us maintain a clear and searchable git history.
Format: <type>(<scope>): <subject>
<scope>is optional.
Examples:
feat: Add emoji picker to chat inputfix(auth): Correct password validation errordocs: Update local setup instructions in CONTRIBUTING.mdstyle(sidebar): Reformat component with Prettierrefactor: Simplify message sending logicchore: Upgrade emoji-picker-react to latest version
- Commit your changes with clear, conventional messages.
- Push your branch to your fork on GitHub:
git push origin feat/your-cool-new-feature - Go to the main ChittChat repository and you will see a prompt to open a Pull Request from your new branch.
Please fill out the Pull Request template provided. It helps us understand your changes at a glance.
💡 Pro-Tip: A great PR description includes a "before" and "after" screenshot or a short screen recording (Loom is great for this).
A project maintainer will review your PR.
- We may ask questions or request changes. This is a normal and healthy part of the contribution process!
- Once your PR is approved and all checks have passed, a maintainer will merge it into the main branch.
- 🎉 Congratulations, and thank you for your contribution!
If you get stuck at any point, don't hesitate to ask for help! The best place is by commenting on your issue or pull request on GitHub.
Thank you again for being a part of the ChittChat community. We look forward to your contributions! ❤️