We're excited that you're interested in contributing to ContribHub! This document will guide you through the process of setting up the project locally and making contributions.
- Prerequisites
- Setting Up the Development Environment
- Configuring Supabase
- Running the Project
- Making Changes
- Submitting a Pull Request
- Code Style Guidelines
- Community Guidelines
Before you begin, ensure you have the following installed:
- Node.js (v14 or later)
- pnpm (v7 or later)
- Git
- Docker (for local Supabase setup)
-
Fork the ContribHub repository on GitHub.
-
Clone your forked repository locally:
git clone https://github.com/your-username/contribhub.git cd contribhub
-
Install project dependencies:
pnpm install
-
Set up Supabase locally:
- Install Supabase CLI (Guides)
- Start Supabase:
supabase start
- This will spin up a local Supabase instance using Docker
- Keep the terminal window open and running the Supabase local dev setup, we need the anon key and the service role key later
-
Copy the .env.example file to .env.local
-
Replace the values in the .env.local file with your own values, here is a guide to what each value is for:
GITHUB_APP_TOKEN
: Your GitHub personal access token GitHub GuideNEXT_PUBLIC_SUPABASE_ANON_KEY
: The anon key from the values you got when you started the supabase local dev setupSUPABASE_SERVICE_KEY
: The service role key from the values you got when you started the supabase local dev setupNEXT_PUBLIC_SUPABASE_URL
: The URL of your Supabase project, which is the API URL value from the supabase local dev setupNEXT_PUBLIC_CONTRIBHUB_ORIGIN_DOMAIN
: The domain where your ContribHub instance is running (e.g., http://localhost:3000 for local development)NODE_ENV
: The environment (development, production, etc.)
Note: Make sure to keep your .env.local file secure and never commit it to version control.
-
Register an OAuth application on GitHub Supabase Guide
-
Go the folder that supabase generated (supabase)
-
In the config.yaml file, add this :
[auth.external.github]
enabled = true
client_id = "env(GITHUB_CLIENT_ID)"
secret = "env(GITHUB_SECRET)"
redirect_uri = "" # Overrides the default auth redirectUrl.
- In the .env.local of the folder inside supabase, add this :
GITHUB_CLIENT_ID=<your-client-id>
GITHUB_SECRET=<your-client-secret>
-
Start the development server:
pnpm run dev
-
Open your browser and navigate to
http://localhost:3000
to see the application running.
-
Create a new branch for your feature or bug fix:
git checkout -b feature/your-feature-name
-
Make your changes in the relevant files.
-
Test your changes thoroughly.
-
Commit your changes with a descriptive commit message:
git commit -m "Add feature: your feature description"
-
Push your changes to your forked repository:
git push origin feature/your-feature-name
-
Go to the original ContribHub repository on GitHub and create a new pull request.
-
Provide a clear title and description for your pull request, explaining the changes you've made.
-
Wait for the maintainers to review your pull request. They may ask for changes or clarifications.
- Follow the existing code style in the project.
- Use TypeScript for all new files.
- Use meaningful variable and function names.
- Write clear comments for complex logic.
- Ensure your code is properly formatted (you can use
npm run lint
to check for linting issues).
- Be respectful and inclusive in your interactions with other contributors.
- If you find a bug or have a feature request, please open an issue on GitHub before starting work on it.
- For major changes, please open an issue first to discuss the proposed changes with the maintainers.
Thank you for contributing to ContribHub! Your efforts help make open-source contribution more accessible to everyone.