Thank you for your interest in contributing to ID PASS DataCollect! This document provides guidelines and instructions for contributing to the project.
- Code of Conduct
- Getting Started
- Development Setup
- How to Contribute
- Pull Request Process
- Coding Standards
- Testing
- Documentation
This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior by opening an issue on GitHub.
- Fork the repository on GitHub
- Clone your fork locally
- Create a new branch for your contribution
- Make your changes
- Push to your fork and submit a pull request
- Node.js 22.x
- PostgreSQL 15+ (for backend development)
- pnpm
- Clone the repository:
git clone https://github.com/idpass/idpass-data-collect.git
cd idpass-data-collect- Install dependencies for all modules:
# Install all dependencies (pnpm workspaces)
pnpm install
# Build datacollect library first (required by backend)
pnpm --filter @idpass/data-collect-core build- Set up environment variables:
# Copy example environment file
cp .env.example .env
# Edit .env with your local configuration- Set up the database:
# Create PostgreSQL database
createdb datacollect_dev
createdb datacollect_test- Run the development servers:
# Terminal 1 - Backend
pnpm --filter @idpass/data-collect-backend dev
# Terminal 2 - Admin
pnpm --filter @idpass/data-collect-admin dev
# Terminal 3 - Mobile (optional)
pnpm --filter @idpass/data-collect-mobile dev- Use the GitHub Issues page to report bugs
- Check if the issue already exists before creating a new one
- Include detailed steps to reproduce the issue
- Provide system information (OS, Node.js version, etc.)
- Open a GitHub Issue with the "enhancement" label
- Clearly describe the feature and its use case
- Be open to discussion and feedback
- Find an Issue: Look for issues labeled "good first issue" or "help wanted"
- Discuss: Comment on the issue to discuss your approach
- Implement: Follow the coding standards and include tests
- Document: Update documentation as needed
- Test: Ensure all tests pass locally
- Submit: Create a pull request
-
Branch Naming: Use descriptive branch names:
feature/add-user-exportfix/sync-timeout-issuedocs/update-api-reference
-
Commit Messages: Follow conventional commits:
feat: add user export functionality fix: resolve sync timeout issue docs: update API reference for v2 -
PR Description: Include:
- What changes were made
- Why these changes were made
- Any breaking changes
- Related issue numbers
-
Code Review:
- Address reviewer feedback promptly
- Keep discussions professional and constructive
-
Merging: PRs will be merged after:
- All CI checks pass
- Code review approval
- No merge conflicts
- Use TypeScript for all new code
- Enable strict mode
- Avoid
anytypes unless absolutely necessary - Use interfaces over type aliases when possible
- Run
pnpm formatbefore committing - Follow ESLint rules (run
pnpm lint) - Use meaningful variable and function names
- Keep functions small and focused
// Good
import { external } from "external-package";
import { internal } from "@/internal-module";
import { local } from "./local-file";
// Bad
import { local } from "./local-file";
import { external } from "external-package";
import { internal } from "@/internal-module";# Run all tests
pnpm test
# Run tests for specific module
pnpm --filter @idpass/data-collect-core test
pnpm --filter @idpass/data-collect-backend test
pnpm --filter @idpass/data-collect-admin test:unit
# Run specific test file
pnpm test -- EntityDataManager.test.ts
# Run tests in watch mode
pnpm test -- --watch- Write tests for all new functionality
- Aim for high code coverage
- Use descriptive test names
- Follow AAA pattern (Arrange, Act, Assert)
Example:
describe("EntityDataManager", () => {
describe("submitForm", () => {
it("should create a new group entity when valid form is submitted", async () => {
// Arrange
const manager = new EntityDataManager(/* ... */);
const formData = createMockGroupForm();
// Act
const result = await manager.submitForm(formData);
// Assert
expect(result.type).toBe("group");
expect(result.data.name).toBe(formData.data.name);
});
});
});- Add JSDoc comments to all public APIs
- Include examples in documentation
- Document complex algorithms
- Update README.md when adding new features
- Keep examples up to date
- Add new dependencies to setup instructions
- Document all REST endpoints
- Include request/response examples
- Note any breaking changes
If you have questions about contributing, please:
- Check existing documentation
- Search closed issues
- Ask in an open issue
- Contact the maintainers
Thank you for contributing to ID PASS DataCollect!