Thank you for your interest in contributing to RetroLoop! This document provides guidelines and workflows for contributing to this project.
- Getting Started
- Development Workflow
- Branch Naming Conventions
- Commit Message Conventions
- Code Style Guidelines
- Pull Request Process
- Testing
- Review Expectations
- Node.js 24+
- Yarn 4.x (packageManager is set in package.json)
- PostgreSQL 16+
- Git
-
Fork the repository on GitHub
-
Clone your fork:
git clone https://github.com/runtimebug/retroloop.git cd retroloop -
Install dependencies:
yarn install
-
Configure environment:
cp .env.example .env # Edit .env with your database credentials, JWT_SECRET, etc. -
Set up the database:
# Start PostgreSQL (via Docker) docker-compose up -d -
Run migrations and build shared types:
yarn workspace @retro/shared-types build-lib yarn workspace back db:migrate
-
Start development servers:
# Terminal 1: Backend yarn dev:back # Terminal 2: Frontend yarn dev:front
Always create a new branch from main for your work:
git checkout main
git pull origin main
git checkout -b type/short-description- Write code following our style guidelines
- Add or update tests as needed
- Update documentation if applicable
Before committing, ensure all checks pass:
# Lint and format
yarn lint
yarn format:check
# Type check
yarn workspace back build
yarn workspace front build
# Run tests
yarn workspace back testFollow our commit message conventions.
git push -u origin type/short-descriptionThen open a Pull Request on GitHub.
Use the following prefixes for branch names:
| Prefix | Purpose | Example |
|---|---|---|
feat/ |
New features or enhancements | feat/dark-mode |
fix/ |
Bug fixes | fix/login-redirect |
hotfix/ |
Urgent production fixes | hotfix/security-patch |
docs/ |
Documentation changes | docs/api-examples |
refactor/ |
Code refactoring | refactor/auth-service |
test/ |
Adding or updating tests | test/auth-unit-tests |
chore/ |
Maintenance tasks | chore/update-deps |
We follow Angular commit conventions Angular Conventional Commits:
| Type | Description |
|---|---|
feat |
A new feature |
fix |
A bug fix |
docs |
Documentation only changes |
style |
Code style changes (formatting, missing semi colons, etc) |
refactor |
Code change that neither fixes a bug nor adds a feature |
perf |
Performance improvements |
test |
Adding or correcting tests |
chore |
Changes to build process or auxiliary tools |
feat(front): add dark mode toggle
fix(back): resolve WebSocket reconnection issue
docs(back): update API endpoint documentation
refactor(front): extract card service from gateway
test(back): add unit tests for auth service
- Use present tense ("add feature" not "added feature")
- Use imperative mood ("move cursor to..." not "moves cursor to...")
- Limit the first line to 72 characters or less
- Reference issues and PRs in the footer when applicable
- Strict mode enabled - All strict compiler options are on
- Use explicit return types for public functions
- Prefer
interfaceovertypefor object shapes - Use
unknowninstead ofanywhere possible
We use ESLint and Prettier for automated formatting. Run yarn lint:fix before committing.
// NestJS imports first
import { Injectable } from '@nestjs/common';
// Third-party imports
import { eq } from 'drizzle-orm';
// Shared types (workspace dependency)
import type { User } from '@retro/shared-types';
// Internal imports
import { usersTable } from '../database/schema';// React/Next imports first
import { memo, useCallback } from 'react';
// Third-party imports
import { motion } from 'framer-motion';
import { toast } from 'sonner';
// Direct icon imports (bundle size optimization)
import X from 'lucide-react/dist/esm/icons/x';
import Plus from 'lucide-react/dist/esm/icons/plus';
// Internal imports
import { apiClient } from '../lib/api-client';'use client';
import { memo, useCallback } from 'react';
import { motion } from 'framer-motion';
// Memoize components for performance
export const MyComponent = memo(function MyComponent({
data,
onAction,
}: MyComponentProps) {
// Use functional setState
const handleClick = useCallback(() => {
onAction(data);
}, [data, onAction]);
return (
<motion.div whileHover={{ scale: 1.02 }}>
<button onClick={handleClick}>Action</button>
</motion.div>
);
});- Use kebab-case for files:
my-component.tsx - Use PascalCase for React components:
MyComponent - Use camelCase for utilities and hooks:
useLocalStorage.ts
-
Update your branch with the latest
main:git fetch origin git merge origin/main
-
Run all checks:
yarn lint yarn format:check yarn workspace back test yarn workspace front test
-
Fill out the PR template completely
- PR title should follow commit message conventions
- Include a clear description of what changed and why
- Link any related issues (e.g., "Fixes #123")
- Add screenshots for UI changes
- Ensure all CI checks pass
- Small PRs (< 200 lines): Quick review, preferred
- Medium PRs (200-500 lines): Acceptable with good description
- Large PRs (> 500 lines): Consider breaking into smaller PRs
# Run unit tests
yarn workspace back test
# Run with coverage
yarn workspace back test --coverage
# Run E2E tests
yarn workspace back test:e2e# Run unit tests
yarn workspace front test
# Run with coverage
yarn workspace front test:coverage- New features should include unit tests
- Bug fixes should include a test that reproduces the bug
- Aim for meaningful coverage, not just high percentages
describe('AuthService', () => {
let service: AuthService;
let mockUserRepository: jest.Mocked<UserRepository>;
beforeEach(() => {
mockUserRepository = createMock<UserRepository>();
service = new AuthService(mockUserRepository);
});
describe('login', () => {
it('should return token for valid credentials', async () => {
// Arrange
mockUserRepository.findByEmail.mockResolvedValue(mockUser);
// Act
const result = await service.login('test@example.com', 'password');
// Assert
expect(result.token).toBeDefined();
});
});
});- Respond to review comments within 48 hours
- Resolve conversations after addressing feedback
- Request re-review when ready
- Be open to feedback and suggestions
- Review PRs within 2 business days
- Focus on:
- Correctness: Does it work as intended?
- Security: Any potential vulnerabilities?
- Performance: Any obvious bottlenecks?
- Maintainability: Is the code readable and well-structured?
- Tests: Are there adequate tests?
- Use "Request changes" for blocking issues
- Use "Comment" for suggestions
- Use "Approve" when satisfied
- Code follows style guidelines
- Tests are included and pass
- No hardcoded secrets or credentials
- Error handling is appropriate
- Documentation is updated (if needed)
- No console.log statements left in production code
If you have questions or need help:
- Check existing issues and discussions
- Open a new issue with the
questionlabel - Ask in your PR if it's specific to your changes
Thank you for contributing to RetroLoop!