AIMirror-Backend / CONTRIBUTING.md
Zayeemk's picture
Upload 21 files
69aa668 verified

Contributing to AI Mirror

Thank you for your interest in contributing! This document provides guidelines for contributing to the project.


🀝 How to Contribute

Reporting Bugs

If you find a bug, please create an issue with:

  • Clear description of the bug
  • Steps to reproduce
  • Expected vs actual behavior
  • Screenshots (if applicable)
  • Environment details (OS, Python version, Node version)

Suggesting Features

Feature suggestions are welcome! Please:

  • Check if the feature already exists
  • Describe the feature clearly
  • Explain the use case
  • Provide examples if possible

Code Contributions

  1. Fork the Repository

    git clone https://github.com/yourusername/ai-mirror.git
    cd ai-mirror
    
  2. Create a Branch

    git checkout -b feature/your-feature-name
    
  3. Make Changes

    • Follow existing code style
    • Add comments for complex logic
    • Update documentation if needed
  4. Test Your Changes

    • Test backend: Run all endpoints
    • Test frontend: Check all pages
    • Verify no breaking changes
  5. Commit Changes

    git add .
    git commit -m "Add: Description of your changes"
    
  6. Push and Create PR

    git push origin feature/your-feature-name
    

    Then create a Pull Request on GitHub.


πŸ“ Code Style Guidelines

Python (Backend)

  • Follow PEP 8 style guide
  • Use type hints where possible
  • Add docstrings to functions
  • Keep functions focused and small
  • Use meaningful variable names

Example:

def detect_emotion(text: str) -> Dict[str, float]:
    """
    Detect emotions from input text.
    
    Args:
        text: Input text to analyze
        
    Returns:
        Dictionary of emotion probabilities
    """
    # Implementation
    pass

JavaScript/React (Frontend)

  • Use functional components
  • Follow React best practices
  • Use meaningful component names
  • Add PropTypes or TypeScript
  • Keep components small and reusable

Example:

const EmotionCard = ({ emotion, score }) => {
  return (
    <div className="emotion-card">
      <h3>{emotion}</h3>
      <p>{score}%</p>
    </div>
  )
}

πŸ§ͺ Testing

Backend Tests

cd backend
pytest tests/

Frontend Tests

cd frontend
npm test

πŸ“š Documentation

When adding features:

  • Update README.md if needed
  • Add comments in code
  • Update API documentation
  • Create examples if applicable

πŸ” Code Review Process

All contributions go through code review:

  1. Automated checks (linting, tests)
  2. Manual review by maintainer
  3. Feedback and iteration
  4. Merge when approved

🎯 Priority Areas

Current focus areas for contributions:

  • Multi-language support
  • Additional emotion models
  • Performance optimizations
  • Mobile responsiveness
  • Accessibility improvements
  • Test coverage
  • Documentation

πŸ’¬ Communication


πŸ“œ Code of Conduct

  • Be respectful and inclusive
  • Provide constructive feedback
  • Focus on the code, not the person
  • Help others learn and grow

πŸ™ Recognition

Contributors will be:

  • Listed in CONTRIBUTORS.md
  • Mentioned in release notes
  • Credited in documentation

βš–οΈ Terms

By contributing, you agree that your contributions will be part of this open educational project.


Thank you for contributing!