Thank you for your interest in contributing to the Civic Issue Reporting and Resolution System! This document provides guidelines for contributing to this project.
This project adheres to a code of conduct. By participating, you are expected to uphold this code:
- Be respectful and inclusive
- Welcome newcomers and help them get started
- Focus on constructive feedback
- Be patient with questions and different skill levels
- Respect different viewpoints and experiences
Before creating an issue, please:
- Search existing issues to avoid duplicates
- Use a clear, descriptive title for the issue
- Provide detailed information including:
- Steps to reproduce the problem
- Expected vs actual behavior
- Screenshots (if applicable)
- Environment details (OS, browser, etc.)
We welcome feature suggestions! Please:
- Check if the feature already exists or is planned
- Describe the feature clearly and explain why it would be valuable
- Consider the scope - is this a minor enhancement or major feature?
- Provide examples of how the feature would work
-
Fork the repository
git clone https://github.com/your-username/Civic-lssue-Reporting-and-Resolution-System.git cd Civic-lssue-Reporting-and-Resolution-System -
Install dependencies
# Backend cd backend npm install cp .env.example .env # Configure your environment variables # Frontend cd ../frontend npm install # Mobile cd ../mobile npm install
-
Start development servers
# Backend (Terminal 1) cd backend npm run dev # Frontend (Terminal 2) cd frontend npm start # Mobile (Terminal 3) cd mobile npx expo start
-
Create a feature branch
git checkout -b feature/your-feature-name
-
Write clean, documented code
- Follow the existing code style
- Add comments for complex logic
- Include JSDoc comments for functions
- Update TypeScript types as needed
-
Write tests
- Add unit tests for new functions
- Add integration tests for new endpoints
- Ensure all tests pass
npm test -
Follow commit conventions
git commit -m "feat: add user notification preferences" git commit -m "fix: resolve issue with image upload validation" git commit -m "docs: update API documentation for new endpoint"
We use conventional commits:
feat:New featurefix:Bug fixdocs:Documentation changesstyle:Code style changes (formatting, etc.)refactor:Code refactoringtest:Adding or updating testschore:Maintenance tasks
-
Update documentation if needed
-
Add tests for new functionality
-
Ensure all tests pass
npm test npm run lint -
Create a detailed PR description:
- What changes were made?
- Why were these changes necessary?
- How were the changes tested?
- Any breaking changes?
-
Link related issues using keywords:
Closes #123 Fixes #456
- Use TypeScript for all new code
- Follow ESLint configuration
- Use meaningful variable and function names
- Prefer const over let, avoid var
- Use async/await over Promise chains
- Use functional components with hooks
- Follow component naming conventions (PascalCase)
- Use proper prop types
- Keep components small and focused
- Follow RESTful conventions
- Use proper HTTP status codes
- Include comprehensive error handling
- Document all endpoints
- Validate all inputs
- Use proper indexing for queries
- Follow naming conventions
- Add data validation
- Consider performance implications
cd backend
npm test # Run all tests
npm run test:watch # Run tests in watch mode
npm run test:coverage # Generate coverage reportcd frontend
npm test # Run all tests
npm test -- --coverage # Generate coverage report- Aim for 80%+ test coverage
- Focus on testing business logic
- Include edge cases and error scenarios
- Test API endpoints thoroughly
- Update README files for significant changes
- Add inline code comments for complex logic
- Update API documentation for new endpoints
- Include examples in documentation
-
Backend:
- Use database indexes appropriately
- Implement caching where beneficial
- Optimize API response times
- Handle rate limiting properly
-
Frontend:
- Optimize bundle size
- Use lazy loading for routes
- Implement proper error boundaries
- Optimize images and assets
-
Mobile:
- Optimize for different screen sizes
- Handle offline scenarios
- Minimize app size
- Test on different devices
- Never commit sensitive data (API keys, passwords, etc.)
- Validate all user inputs on both client and server
- Use HTTPS for all communications
- Implement proper authentication and authorization
- Follow OWASP security guidelines
- Regular security audits using npm audit
- Follow WCAG 2.1 guidelines
- Use semantic HTML elements
- Include proper ARIA labels
- Ensure keyboard navigation works
- Test with screen readers
- Maintain proper color contrast
- Desktop: Chrome 90+, Firefox 88+, Safari 14+, Edge 90+
- Mobile: iOS 13+, Android 8+
- Screen sizes: 320px to 1920px width
- Accessibility: Screen readers, keyboard navigation
If you need help:
- Check the documentation in the
/docsfolder - Search existing issues for similar problems
- Ask questions in GitHub Discussions
- Join our community Slack channel (if available)
Contributors will be recognized in:
- README.md contributors section
- Release notes for significant contributions
- Annual contributor appreciation
- Issue assignment: Comment on issues you'd like to work on
- Branch naming:
feature/issue-number-brief-description - Regular commits: Make small, focused commits
- Pull request review: All PRs require review before merging
- Continuous integration: All tests must pass before merging
- Version bumping: Follow semantic versioning
- Changelog: Maintain CHANGELOG.md
- Testing: Comprehensive testing before release
- Documentation: Update docs for new features
- Deployment: Automated deployment pipeline
Thank you for contributing to improving civic engagement and government transparency!