Thank you for your interest in contributing to the DEAF-FIRST Platform! This document provides guidelines and instructions for contributing to this project.
- Code of Conduct
- Getting Started
- Development Workflow
- Code Standards
- Testing Guidelines
- Commit Guidelines
- Pull Request Process
- Accessibility Requirements
- Documentation
This project is committed to providing a welcoming and inclusive environment for all contributors. We expect all participants to:
- Be respectful and considerate
- Focus on accessibility and inclusive design
- Provide constructive feedback
- Accept constructive criticism gracefully
- Prioritize the needs of deaf and hard-of-hearing users
Before you begin, ensure you have the following installed:
- Node.js: >= 20.0.0
- npm: >= 10.0.0
- PostgreSQL: 14+ (for backend development)
- Redis: 7+ (for PinkSync development)
- Git: Latest version
-
Fork the repository on GitHub
-
Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/DEAF-FIRST-PLATFORM.git cd DEAF-FIRST-PLATFORM -
Add the upstream repository:
git remote add upstream https://github.com/pinkycollie/DEAF-FIRST-PLATFORM.git
npm installThis will install all dependencies for the root workspace and all service workspaces.
-
Copy the example environment file:
cp .env.example .env
-
Update
.envwith your local configuration:- Database credentials
- Redis connection
- API keys (OpenAI, etc.)
- JWT secrets
Start all services in development mode:
npm run devOr run individual services:
npm run dev:frontend # Frontend only
npm run dev:backend # Backend only
npm run dev:deafauth # DeafAUTH only
npm run dev:pinksync # PinkSync only
npm run dev:fibonrose # FibonRose only
npm run dev:a11y # Accessibility nodes onlyAlways create a new branch for your work:
git checkout -b feature/your-feature-nameBranch naming conventions:
feature/- New featuresfix/- Bug fixesdocs/- Documentation updatesrefactor/- Code refactoringtest/- Test additions or updateschore/- Maintenance tasks
- Make your changes in the appropriate workspace(s)
- Follow the Code Standards
- Write or update tests as needed
- Update documentation if required
Before committing, ensure all checks pass:
# Run linting
npm run lint
# Run type checking
npm run type-check
# Run tests
npm run test
# Format code
npm run formatWe use conventional commits for clear commit messages:
git add .
git commit -m "feat(service): add new feature description"See Commit Guidelines for more details.
- Use TypeScript for all new code
- Enable strict mode in
tsconfig.json - Define explicit types (avoid
any) - Use interfaces for object shapes
- Use enums for fixed sets of values
// Good
interface UserPreferences {
signLanguage: boolean;
highContrast: boolean;
fontSize: 'small' | 'medium' | 'large';
}
function updatePreferences(userId: string, prefs: UserPreferences): Promise<void> {
// Implementation
}
// Avoid
function updatePreferences(userId: any, prefs: any) {
// Implementation
}We use Prettier for consistent code formatting:
- Indentation: 2 spaces
- Quotes: Single quotes
- Semicolons: Yes
- Line length: 100 characters
- Trailing commas: ES5
Configuration is in .prettierrc.json.
We use ESLint for code quality:
- Follow the existing ESLint configuration
- Fix all linting errors before committing
- Address warnings when possible
workspace/
├── src/
│ ├── index.ts # Entry point
│ ├── routes/ # API routes
│ ├── controllers/ # Route controllers
│ ├── services/ # Business logic
│ ├── models/ # Data models
│ ├── types/ # TypeScript types
│ ├── utils/ # Utility functions
│ └── __tests__/ # Tests
├── package.json
└── tsconfig.json
- Files: kebab-case (e.g.,
user-service.ts) - Classes: PascalCase (e.g.,
UserService) - Functions: camelCase (e.g.,
getUserProfile) - Constants: UPPER_SNAKE_CASE (e.g.,
MAX_RETRY_COUNT) - Interfaces: PascalCase with 'I' prefix optional (e.g.,
UserDataorIUserData)
We strive for high test coverage:
- Unit Tests: Test individual functions and classes
- Integration Tests: Test service interactions
- E2E Tests: Test complete user workflows (frontend)
Use Vitest for unit and integration tests:
import { describe, it, expect } from 'vitest';
import { calculateFibonacci } from './math-utils';
describe('calculateFibonacci', () => {
it('should return correct Fibonacci number', () => {
expect(calculateFibonacci(0)).toBe(0);
expect(calculateFibonacci(1)).toBe(1);
expect(calculateFibonacci(10)).toBe(55);
});
it('should handle negative input', () => {
expect(() => calculateFibonacci(-1)).toThrow();
});
});# Run all tests
npm run test
# Run tests in watch mode
npm run test -- --watch
# Run tests for specific workspace
npm run test --workspace=backend
# Run E2E tests
npm run test:e2eWe follow the Conventional Commits specification.
<type>(<scope>): <subject>
<body>
<footer>
- feat: New feature
- fix: Bug fix
- docs: Documentation changes
- style: Code style changes (formatting, missing semicolons, etc.)
- refactor: Code refactoring
- perf: Performance improvements
- test: Adding or updating tests
- chore: Maintenance tasks
- ci: CI/CD changes
Use the workspace or service name:
frontendbackenddeafauthpinksyncfibonroseaccessibilityaidocsdeps
feat(frontend): add sign language toggle button
fix(deafauth): correct JWT expiration validation
docs(readme): update installation instructions
chore(deps): update TypeScript to 5.7.2-
Update your branch with the latest from upstream:
git fetch upstream git rebase upstream/main
-
Ensure all checks pass:
npm run lint npm run type-check npm run test npm run build -
Update documentation if needed
-
Add/update tests for your changes
-
Push your branch to your fork:
git push origin feature/your-feature-name
-
Go to the GitHub repository and create a Pull Request
-
Fill out the PR template:
- Title: Clear, descriptive title following commit conventions
- Description: Explain what and why
- Related Issues: Link any related issues
- Screenshots: For UI changes
- Testing: Describe how you tested
-
Request review from maintainers
- Maintainers will review your PR
- Address any requested changes
- Keep the PR updated with main branch
- Once approved, a maintainer will merge your PR
- Code follows style guidelines
- Self-review completed
- Comments added for complex code
- Documentation updated
- Tests added/updated
- All tests passing
- No new warnings
- Accessibility requirements met
All contributions must maintain or improve accessibility:
- Semantic HTML: Use proper HTML5 elements
- ARIA Labels: Add appropriate ARIA attributes
- Keyboard Navigation: All features accessible via keyboard
- Color Contrast: Maintain WCAG AAA contrast ratios
- Screen Reader: Test with screen readers
- Sign Language Support: Consider sign language users
- Reduced Motion: Respect
prefers-reduced-motion
# Manual testing
- Test with keyboard only (Tab, Enter, Escape)
- Test with screen reader (NVDA, JAWS, VoiceOver)
- Test with high contrast mode
- Test with browser zoom at 200%
# Automated testing
npm run test:a11y # (when implemented)- Keyboard accessible
- Screen reader friendly
- Proper heading hierarchy
- Alt text for images
- Form labels present
- Color contrast sufficient
- Focus indicators visible
- Error messages clear
- Reduced motion respected
- Add JSDoc comments for public APIs
- Document complex algorithms
- Explain non-obvious decisions
- Keep comments up-to-date
Example:
/**
* Calculates optimal resource allocation using Fibonacci-based scheduling.
*
* @param resources - Available resources to allocate
* @param tasks - Tasks requiring resource allocation
* @returns Optimized allocation map
* @throws {Error} If resources are insufficient
*/
export function optimizeAllocation(
resources: Resource[],
tasks: Task[]
): AllocationMap {
// Implementation
}Update relevant README files when:
- Adding new features
- Changing APIs
- Modifying configuration
- Adding dependencies
Update ARCHITECTURE.md when making architectural changes:
- New services
- Modified data flows
- Changed integrations
- Updated deployment strategies
- Documentation: Check the
/docsfolder - Architecture: See ARCHITECTURE.md
- Quick Start: See QUICKSTART.md
- GitHub Issues: Browse or create issues
- Discussions: Use GitHub Discussions for questions
- GitHub Issues: Bug reports and feature requests
- GitHub Discussions: Questions and general discussion
- Pull Requests: Code review and collaboration
Contributors will be:
- Listed in the project's contributors section
- Mentioned in release notes
- Recognized in the project README
Thank you for contributing to making the web more accessible!
Questions? Open an issue or start a discussion on GitHub.
Found a security issue? See SECURITY.md for reporting procedures.