Thank you for your interest in contributing! This document provides guidelines and instructions for contributing to the project.
- Be respectful and inclusive
- Provide constructive feedback
- Focus on the code, not the person
- Help others learn and grow
git clone https://github.com/yourusername/ajt-ecommerce.git
cd AJT_E-commercegit checkout -b feature/your-feature-namemvn clean install
# Configure .env with your local settings- Follow Java naming conventions (camelCase for variables/methods, PascalCase for classes)
- Use meaningful variable and method names
- Keep methods focused and under 50 lines when possible
- Add comments for complex logic
Use clear, descriptive commit messages:
feat: Add product search functionality
fix: Resolve cart total calculation bug
docs: Update README with API endpoints
refactor: Simplify database connection logic
-
Update your branch with the latest main:
git fetch origin git rebase origin/main
-
Test your changes:
mvn clean test mvn clean install -
Push to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request with:
- Clear title and description
- Reference to related issues
- Screenshots (if UI changes)
- Testing instructions
-
Address review feedback and update your PR
- Create an issue first describing the bug
- Reference the issue in your PR
- Include steps to reproduce
- Add test cases if applicable
- Discuss in an issue before starting work
- Follow the existing code structure
- Add documentation
- Update README if needed
- Fix typos and unclear sections
- Add examples and use cases
- Improve API documentation
- Add architecture diagrams
- Benchmark before and after
- Document the improvement
- Ensure no functionality is lost
mvn test- Create test classes in
src/test/java - Use JUnit for unit tests
- Name tests descriptively:
testFeatureName() - Aim for >80% code coverage
- Deploy to local Tomcat
- Test all affected features
- Verify in different browsers
- Check database operations
Add comments for:
- Complex algorithms
- Non-obvious business logic
- Important configuration
- Workarounds or hacks
Example:
// Calculate discount based on order total and customer tier
// Premium customers get 15%, regular get 10%
double discount = isPremium ? total * 0.15 : total * 0.10;Update README.md if you:
- Add new features
- Change installation steps
- Modify configuration
- Add new dependencies
Include:
- Clear title and description
- Steps to reproduce
- Expected vs actual behavior
- Screenshots/logs if applicable
- Environment details (Java version, OS, etc.)
Include:
- Clear description of the feature
- Use case and benefits
- Potential implementation approach
- Any related issues or discussions
When adding new code:
- Beans - Data models in
com.shashi.beans - Services - Business logic in
com.shashi.service - Servlets - Controllers in
com.shashi.srv - Utilities - Helper classes in
com.shashi.utility - JSP - Views in
WebContent/
- Add to
pom.xmlwith appropriate version - Document why it's needed
- Check for conflicts with existing dependencies
- Update
.env.exampleif configuration needed
- Ensure no code uses it
- Update documentation
- Verify build succeeds
- Use connection pooling for database
- Cache frequently accessed data
- Optimize database queries
- Minimize JSP processing
- Use CDN for static assets
- Never commit credentials or secrets
- Use parameterized queries to prevent SQL injection
- Validate all user inputs
- Use HTTPS in production
- Keep dependencies updated
Maintainers will:
- Review and merge PRs
- Update version in
pom.xml - Update CHANGELOG
- Create release tag
- Deploy to production
- Check existing issues and discussions
- Review documentation
- Ask in pull request comments
- Email maintainers
Thank you for contributing to Ellison Electronics! 🎉