Thank you for your interest in contributing to TapIn! We're building an open-source keyless living platform, and we welcome contributions from developers, designers, testers, and documentation writers.
- Code of Conduct
- Getting Started
- Development Workflow
- Coding Standards
- Testing Guidelines
- Submitting Changes
- Reporting Issues
- Community
We are committed to providing a welcoming and inclusive environment. Please be respectful, constructive, and professional in all interactions.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/your-username/tapin.git cd tapin - Set up your development environment:
scripts\verify.bat scripts\setup-docker.bat
- Create a new branch for your feature or fix:
git checkout -b feature/your-feature-name
The backend is built with Django REST Framework and PostgreSQL.
# Run backend tests scripts\test-backend.bat # Run specific test file docker-compose exec backend pytest backend/tests/unit/test_auth.py # Access Django shell docker-compose exec backend python manage.py shell # Create migrations docker-compose exec backend python manage.py makemigrations # Apply migrations docker-compose exec backend python manage.py migrate
The frontend is built with Next.js, React, and TypeScript.
# Run frontend tests scripts\test-frontend.bat # Run frontend in development mode cd frontend npm run dev # Build for production npm run build # Run linter npm run lint
- Follow PEP 8 style guide
- Use type hints where appropriate
- Write docstrings for all public functions and classes
- Keep functions focused and under 50 lines when possible
- Use meaningful variable and function names
Example:
def create_wallet_pass(user: User, unit: Unit) -> WalletPass: """ Create a new wallet pass for a tenant. Args: user: The tenant user unit: The unit to grant access to Returns: WalletPass: The created wallet pass Raises: ValidationError: If user or unit is invalid """ # Implementation
- Use TypeScript for all new code
- Follow React best practices and hooks patterns
- Use functional components over class components
- Keep components small and focused
- Use proper TypeScript types (avoid
any) - Follow the existing file structure
Example:
interface ButtonProps { variant: 'primary' | 'secondary'; onClick: () => void; children: React.ReactNode; disabled?: boolean; } export function Button({ variant, onClick, children, disabled }: ButtonProps) { return ( <button onClick={onClick} disabled={disabled} className={`btn btn-${variant}`} > {children} </button> ); }
- Use TailwindCSS utility classes
- Follow the design system in
docs/styles.md - Support both light and dark modes
- Ensure responsive design (mobile-first)
- Use the slate color palette for consistency
- Write unit tests for all new features
- Use pytest fixtures for test data
- Test both success and error cases
- Use property-based testing (Hypothesis) for complex logic
- Aim for 80%+ code coverage
def test_create_guest_pass_success(tenant_user, unit): """Test successful guest pass creation.""" pass_data = { 'unit': unit.id, 'guest_name': 'John Doe', 'valid_from': timezone.now(), 'valid_until': timezone.now() + timedelta(days=1) } guest_pass = create_guest_pass(tenant_user, pass_data) assert guest_pass.guest_name == 'John Doe' assert guest_pass.is_active()
- Write tests for components and utilities
- Use Jest and React Testing Library
- Test user interactions and edge cases
- Mock API calls appropriately
describe('Button', () => { it('calls onClick when clicked', () => { const handleClick = jest.fn(); render(<Button onClick={handleClick}>Click me</Button>); fireEvent.click(screen.getByText('Click me')); expect(handleClick).toHaveBeenCalledTimes(1); }); });
-
Ensure all tests pass:
scripts\test-backend.bat scripts\test-frontend.bat
-
Ensure the build succeeds:
cd frontend npm run build -
Commit your changes with a clear message:
git add . git commit -m "feat: add guest pass expiration notifications"
Use conventional commit format:
feat:for new featuresfix:for bug fixesdocs:for documentation changesstyle:for formatting changesrefactor:for code refactoringtest:for adding testschore:for maintenance tasks
-
Push to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request on GitHub:
- Provide a clear title and description
- Reference any related issues
- Include screenshots for UI changes
- Ensure CI checks pass
When reporting bugs or requesting features:
- Search existing issues to avoid duplicates
- Use issue templates when available
- Provide clear reproduction steps for bugs
- Include relevant details:
- Operating system
- Browser version (for frontend issues)
- Python/Node.js version
- Error messages and stack traces
- Screenshots or videos
- Discussions: Use GitHub Discussions for questions and ideas
- Issues: Use GitHub Issues for bugs and feature requests
- Pull Requests: Submit PRs for code contributions
- Documentation: Help improve docs in the
docs/folder
- 🐛 Bug fixes and testing
- 📱 Mobile wallet integration improvements
- 🎨 UI/UX design and accessibility
- 📝 Documentation and tutorials
- 🔐 Security audits and improvements
- 🌐 Internationalization (i18n)
- 🧪 Test coverage expansion
- 🚀 Performance optimizations
If you have questions about contributing, feel free to:
- Open a discussion on GitHub
- Comment on relevant issues
- Reach out to the maintainers
Thank you for contributing to TapIn! Together, we're building a more accessible and secure future for keyless living.