Contributing Guidelines - usmantahirr/infobip-notification-service GitHub Wiki

Thank you for your interest in contributing to the Infobip Notification Service! This document provides guidelines and instructions for contributing to the project.

Code of Conduct

By participating in this project, you agree to abide by our Code of Conduct. Please read it before contributing.

Getting Started

  1. Fork the repository
  2. Clone your fork:
    git clone https://github.com/your-username/infobip-notification-service.git
    cd infobip-notification-service
  3. Create a new branch:
    git checkout -b feature/your-feature-name
  4. Install dependencies:
    npm install
  5. Set up environment:
    cp .env.example .env
    # Edit .env with your credentials

Development Workflow

1. Code Style

  • Use TypeScript for all new code
  • Follow the existing code style
  • Use meaningful variable and function names
  • Add comments for complex logic
  • Keep functions small and focused

2. Testing

  • Write tests for new features
  • Update existing tests when modifying code
  • Run tests before submitting PR:
    npm test

3. Documentation

  • Update relevant documentation
  • Add JSDoc comments for new functions
  • Update API documentation if needed
  • Add examples for new features

4. Git Workflow

  1. Keep commits focused and atomic

  2. Write clear commit messages:

    type(scope): description
    
    [optional body]
    
    [optional footer]
    

    Types:

    • feat: New feature
    • fix: Bug fix
    • docs: Documentation
    • style: Code style
    • refactor: Code refactoring
    • test: Testing
    • chore: Maintenance
  3. Keep branches up to date:

    git fetch origin
    git rebase origin/main

Pull Request Process

  1. Update your branch with latest changes:

    git fetch origin
    git rebase origin/main
  2. Run tests and linting:

    npm test
    npm run lint
  3. Create a Pull Request:

    • Use the PR template
    • Provide a clear description
    • Link related issues
    • Add screenshots if applicable
  4. Address review comments:

    • Respond to all comments
    • Make requested changes
    • Push updates to your branch

Project Structure

src/
├── config/         # Configuration files
├── controllers/    # Route controllers
├── middleware/     # Express middleware
├── routes/         # API routes
├── schemas/        # Request/Response schemas
├── services/       # Business logic
├── errors/         # Error handling
└── app.ts          # Application entry point

Current Implementation

Core Features

  • Email notifications
  • SMS notifications
  • Rate limiting
  • Input validation
  • Error handling
  • Logging

Planned Features

  1. High Priority

    • Message queue integration
    • Database integration
    • Enhanced error handling
  2. Medium Priority

    • Caching layer
    • Health check endpoints
    • Metrics collection
  3. Low Priority

    • Advanced monitoring
    • A/B testing
    • Analytics dashboard

Development Guidelines

1. Error Handling

  • Use custom error classes
  • Provide meaningful error messages
  • Include error details when helpful
  • Log errors appropriately

2. Security

  • Never commit sensitive data
  • Use environment variables
  • Validate all inputs
  • Follow security best practices

3. Performance

  • Optimize database queries
  • Use caching when appropriate
  • Monitor response times
  • Profile code for bottlenecks

4. Testing

  • Write unit tests
  • Add integration tests
  • Include edge cases
  • Test error scenarios

Review Process

  1. Code Review

    • Check code style
    • Verify functionality
    • Review test coverage
    • Validate documentation
  2. Security Review

    • Check for vulnerabilities
    • Verify input validation
    • Review error handling
    • Check authentication
  3. Performance Review

    • Check response times
    • Verify resource usage
    • Review caching
    • Check scalability

Release Process

  1. Version Bumping

    • Update package.json
    • Update CHANGELOG.md
    • Tag the release
  2. Documentation

    • Update API docs
    • Update README
    • Update wiki pages
  3. Deployment

    • Run tests
    • Build package
    • Publish to npm
    • Deploy to production

Getting Help

  • Open an issue for bugs
  • Use discussions for questions
  • Join our community chat
  • Check the documentation

Recognition

Contributors will be recognized in:

  • CHANGELOG.md
  • README.md
  • Release notes
  • Contributor hall of fame

License

By contributing, you agree that your contributions will be licensed under the project's MIT License.


Last updated: March 2025

⚠️ **GitHub.com Fallback** ⚠️