Contributing Guide
Thank you for your interest in contributing to Duit! This guide will help you get started.Table of Contents
- Getting Started
- Development Setup
- Code Style
- Making Changes
- Submitting Pull Requests
- Issue Reporting
Getting Started
Prerequisites
Before contributing, ensure you have:- Java 21 or higher
- Maven (or use the included Maven wrapper
mvnw) - PostgreSQL database (local or remote)
- Git for version control
- A code editor (IntelliJ IDEA, VS Code, Eclipse, etc.)
Fork and Clone
- Fork the repository on GitHub
- Clone your fork locally:
- Add the original repository as upstream:
Development Setup
Database Configuration
- Create a PostgreSQL database:
- Create a
.envfile in the project root:
Running the Application
Linux/Mac:http://localhost:8080
Building the Project
Code Style
General Guidelines
- Follow existing patterns - Look at similar code in the project
- Keep it simple - Prefer clarity over cleverness
- Write self-documenting code - Use meaningful names
- Add comments for complex logic - Explain the “why”, not the “what”
Java Code Style
Naming Conventions
- Classes: PascalCase (
UserController,RequestService) - Methods: camelCase (
getUserById,saveRequest) - Variables: camelCase (
userName,solicitudId) - Constants: UPPER_SNAKE_CASE (
MAX_RETRY_ATTEMPTS) - Packages: lowercase (
es.duit.app.controller)
Code Structure
Controllers:Documentation Comments
Use clear section headers in code:Thymeleaf Templates
- Use semantic HTML5 elements
- Follow existing layout patterns
- Use Thymeleaf attributes correctly:
th:text,th:href,th:if - Keep JavaScript minimal and in separate files when possible
Making Changes
Branching Strategy
- Create a feature branch from
main:
- Make your changes in small, logical commits
- Keep your branch up to date:
Commit Messages
Write clear, descriptive commit messages: Good examples:- Use imperative mood (“Add feature” not “Added feature”)
- First line: brief summary (50 chars or less)
- Blank line
- Detailed description if needed
Testing Your Changes
- Manual testing: Test your changes in the browser
- Edge cases: Test with invalid inputs and edge cases
- Different roles: Test as USER, PROFESSIONAL, and ADMIN
- Database state: Verify database changes are correct
Submitting Pull Requests
Before Submitting
- Ensure code compiles:
- Test thoroughly - Verify your changes work as expected
-
Update documentation if you:
- Add new endpoints
- Change existing behavior
- Add new configuration options
- Check for conflicts:
Creating the Pull Request
- Push your branch to your fork:
- Go to the original repository on GitHub
- Click “New Pull Request”
- Select your branch
- Fill out the PR template:
- Submit the pull request
Review Process
- Maintainers will review your PR
- Address any feedback or requested changes
- Once approved, your PR will be merged
Issue Reporting
Before Creating an Issue
- Search existing issues - Your issue may already be reported
- Verify it’s a bug - Ensure it’s not expected behavior
- Gather information - Collect relevant details
Creating a Good Issue
Include:- Title: Clear, concise description
- Description: Detailed explanation
- Steps to reproduce (for bugs):
- Step 1
- Step 2
- Step 3
- Expected behavior
- Actual behavior
- Environment:
- Java version
- Database version
- Browser (if applicable)
- Screenshots (if applicable)
Issue Template
Code Review Guidelines
For Reviewers
- Be respectful and constructive
- Explain “why” when requesting changes
- Approve PRs that improve the codebase
- Focus on:
- Code correctness
- Security implications
- Performance issues
- Code maintainability
For Contributors
- Respond to feedback promptly
- Ask questions if feedback is unclear
- Be open to suggestions
- Update your PR based on feedback
Project Structure
Understanding the project structure will help you contribute effectively:Areas to Contribute
Good First Issues
- UI improvements
- Documentation updates
- Bug fixes
- Adding validation messages
- Improving error handling
Intermediate Issues
- New features
- Refactoring existing code
- Performance improvements
- Adding unit tests
Advanced Issues
- Security enhancements
- Architecture improvements
- Database optimization
- Integration with external services
Getting Help
If you need help:- Check the documentation - Read existing docs
- Search issues - Someone may have had the same question
- Create an issue - Ask your question
- Be specific - Provide context and details
Code of Conduct
- Be respectful and inclusive
- Focus on constructive feedback
- Help create a welcoming environment
- Report inappropriate behavior
License
By contributing to Duit, you agree that your contributions will be licensed under the same license as the project.Thank you for contributing to Duit! Your help makes this project better for everyone.
