Thank you for your interest in contributing to our backend project! This document provides guidelines and steps for setting up the development environment and contributing.
- Getting Started
- Development Setup
- Development Workflow
- Pull Request Process
- API Documentation
- Code Style
- Community Guidelines
- Check our issues page
- Look for
good first issue
labels - Comment on the issue to get assigned
- Check existing issues first
- Use our issue templates
- Provide detailed reproduction steps for bugs
- For features, explain the use case
- Node.js (v18 or higher)
- npm (v8 or higher)
- Git
- PostgreSQL (v14 or higher)
- Fork and clone the repository
git clone https://github.com/your-username/backend-project.git
cd backend-project
- Install dependencies
npm install
- Copy the example environment file
cp .env.example .env
- Set up environment variables (details below)
- Install PostgreSQL if you haven't already
- Create a new database
CREATE DATABASE your_database_name;
- Update DATABASE_URL in .env
DATABASE_URL="postgresql://username:password@localhost:5432/your_database_name"
- Run Prisma db push
npx prisma db push
- Go to GitHub Settings > Developer settings > OAuth Apps > New OAuth App
- Set Homepage URL to your frontend URL
- Set Authorization callback URL to
{FRONTEND_URL}/redirect
- Add to .env:
GITHUB_CLIENT_ID=your_client_id
GITHUB_CLIENT_SECRET=your_client_secret
- Go to GitHub Settings > Developer settings > Personal access tokens
- Generate a new token with required permissions
- Add to .env:
GITHUB_TOKEN=your_token
- Create a SendGrid account
- Go to Settings > API Keys > Create API Key
- Add to .env:
SENDGRID_API_KEY=your_sendgrid_key
MAILER_MAIL=your_verified_sender@example.com
MAILER_NAME=Your Name
Generate a secure random string:
node -e "console.log(require('crypto').randomBytes(64).toString('hex'))"
Add to .env:
JWT_SECRET=generated_secret
Generate another secure random string for webhook verification:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
Add to .env:
WEBHOOK_SECRET=generated_secret
FRONTEND_URL=http://localhost:5173
PORT=3000
- Create a new branch
git checkout -b feature/your-feature-name
- Start the development server
npm run dev
- Make your changes
- Run tests
npm test
- Update API documentation if needed
- Update Prisma schema and run push if needed
npx prisma db push
- Push your changes and create a PR
- Keep PRs focused and reasonably sized
- Link related issues
- We use ESLint
- Follow existing patterns in the codebase
- Use meaningful variable and function names
- Use meaningful model names
- Follow Prisma best practices
- Create indexes for frequently queried fields
- Be respectful and inclusive
- Help others in the community
- Follow our Code of Conduct
- Ask in issues or pull requests
- Join our Discord
By contributing, you agree that your contributions will be licensed under the project's license.