Skip to content

Latest commit

ย 

History

History
512 lines (360 loc) ยท 11.7 KB

File metadata and controls

512 lines (360 loc) ยท 11.7 KB

Contributing to CIITM Backend ๐Ÿค

Thank you for your interest in contributing to the CIITM Backend project! We welcome contributions from the community while maintaining the integrity and vision of this educational technology platform.

๐Ÿ“‹ Table of Contents

๐Ÿค Code of Conduct

By participating in this project, you agree to abide by our community standards:

  • Be Respectful: Treat all contributors with respect and kindness
  • Be Collaborative: Work together towards common goals
  • Be Constructive: Provide helpful feedback and suggestions
  • Follow License Terms: Respect the project's licensing and usage terms

๐ŸŽฏ Project Vision

This project is the intellectual property of abhishek-nexgen-dev and represents a vision for modernizing educational technology in India.

โš ๏ธ Important Guidelines:

  • โœ… Personal Use: You can use this project for learning and add it to your resume
  • โœ… Open Source Contributions: Contribute features, bug fixes, and improvements
  • โŒ No Commercial Hosting: Don't host this as a commercial service
  • โŒ No Business Use: Don't use this for profit without permission
  • โŒ No Idea Copying: Don't copy the core concept for commercial purposes

๐Ÿš€ How to Contribute

1. Fork and Clone

# Fork the repository on GitHub
# Clone your fork
git clone https://github.com/YOUR_USERNAME/Ciitm-Backend.git
cd Ciitm-Backend

2. Set Up Development Environment

# Install dependencies
pnpm install

# Set up environment variables
cp .env.example .env
# Edit .env with your configuration

# Start development server
pnpm run start:dev

3. Create a Branch

# Create a feature branch
git checkout -b feature/your-feature-name
# or
git checkout -b bugfix/issue-description

๐Ÿ› ๏ธ Development Guidelines

Code Style

  • ESLint: Follow the configured ESLint rules
  • Prettier: Use Prettier for code formatting
  • ES6 Modules: Use modern JavaScript/ES6+ features
  • Comments: Write clear, concise comments for complex logic

Naming Conventions

  • Files: Use kebab-case for files (user-controller.mjs)
  • Functions: Use camelCase (getUserData)
  • Constants: Use UPPER_SNAKE_CASE (API_VERSION)
  • Classes: Use PascalCase (UserService)

Testing

# Run tests
pnpm test

# Run tests in watch mode
pnpm run test:watch

# Run linting
pnpm run lint

๐Ÿ“ Contribution Types

๐Ÿ› Bug Fixes

  • Fix existing bugs and issues
  • Improve error handling
  • Optimize performance

โœจ New Features

  • Add new educational features
  • Improve user experience
  • Enhance security measures

๐Ÿ“š Documentation

  • Improve README and guides
  • Add code comments
  • Create API documentation

๐ŸŽจ UI/UX Improvements

  • Enhance frontend integration
  • Improve responsive design
  • Add accessibility features

๐Ÿ”ง Infrastructure

  • Improve build processes
  • Add CI/CD improvements
  • Database optimizations

๐Ÿ”„ Pull Request Process

Before Submitting

  1. Test Thoroughly: Ensure your changes work correctly
  2. Run Tests: All tests should pass
  3. Code Quality: Follow linting rules
  4. Documentation: Update relevant documentation

PR Template

## Description

Brief description of changes

## Type of Change

- [ ] Bug fix
- [ ] New feature
- [ ] Documentation update
- [ ] Performance improvement

## Testing

- [ ] Tests pass locally
- [ ] New tests added (if applicable)
- [ ] Manual testing completed

## Checklist

- [ ] Code follows project guidelines
- [ ] Self-review completed
- [ ] Documentation updated
- [ ] No breaking changes (or properly documented)

Review Process

  1. Automated Checks: Must pass all CI/CD checks
  2. Code Review: Maintainer will review your code
  3. Feedback: Address any requested changes
  4. Approval: Maintainer approval required for merge

๐Ÿ“œ License and Terms

By contributing to this project, you agree that:

  1. Your contributions will be licensed under the same terms as the project
  2. You respect the intellectual property of the project maintainer
  3. You understand the non-commercial nature of this project
  4. You cooperate with the maintainer's vision and guidelines

Resume/Portfolio Use

โœ… You are encouraged to:

  • Add this project to your resume
  • Showcase your contributions in your portfolio
  • Mention your open-source contributions
  • Use this as a learning experience

โŒ You must not:

  • Claim ownership of the project idea
  • Use it for commercial purposes without permission
  • Host it as a commercial service
  • Copy the business model

๐ŸŽ“ Learning Opportunities

Contributing to this project provides valuable learning in:

  • Modern Node.js/Express.js development
  • MongoDB database design
  • Real-time communication with Socket.io
  • Payment gateway integration
  • Cloud services (Cloudinary, Email services)
  • Authentication and security
  • API design and documentation

๐Ÿšซ What We Don't Accept

  • Contributions that violate the license terms
  • Code that compromises security
  • Features that don't align with educational purposes
  • Contributions without proper testing
  • Code that breaks existing functionality

๐Ÿ” Issue Guidelines

Before Creating an Issue

  1. Search existing issues to avoid duplicates
  2. Check the documentation and README first
  3. Provide clear reproduction steps for bugs
  4. Include system information (OS, Node.js version, etc.)

Issue Templates

Bug Report

**Bug Description**
A clear description of the bug

**Steps to Reproduce**

1. Step one
2. Step two
3. Step three

**Expected Behavior**
What should happen

**Actual Behavior**
What actually happens

**Environment**

- OS: [e.g., Windows 11, Ubuntu 22.04]
- Node.js version: [e.g., 18.17.0]
- Browser: [if applicable]

**Additional Context**
Screenshots, logs, or additional information

Feature Request

**Feature Description**
Clear description of the proposed feature

**Problem Statement**
What problem does this solve?

**Proposed Solution**
How should this be implemented?

**Educational Value**
How does this benefit the educational platform?

**Additional Context**
Mockups, examples, or references

๐Ÿ›ก๏ธ Security

Reporting Security Issues

  • DO NOT create public issues for security vulnerabilities
  • Email directly: abhishek.nexgen.dev@gmail.com
  • Subject: "Security Issue - CIITM Backend"
  • Include: Detailed description and reproduction steps

Security Best Practices

  • Keep dependencies updated
  • Follow OWASP guidelines
  • Use secure coding practices
  • Validate all inputs
  • Implement proper authentication

๐Ÿ”ง Environment Setup Details

Required Software

# Node.js (v18+ recommended)
node --version

# MongoDB (v6+ recommended)
mongod --version

# pnpm (recommended package manager)
pnpm --version

IDE Setup (VS Code Recommended)

Install these extensions:

  • ESLint
  • Prettier
  • MongoDB for VS Code
  • REST Client (for API testing)

Environment Variables

Create .env file with these variables:

# Required
MONGO_URL=mongodb://localhost:27017/ciitm_dev
JWT_SECRET=your_development_secret
PORT=8000

# Optional for development
GMAIL_User=your_test_email@gmail.com
GMAIL_Password=your_app_password
Cloudinary_Cloud_Name=your_cloud_name
Cloudinary_API_Key=your_api_key
Cloudinary_API_Secret=your_api_secret

๐Ÿ“š Documentation Standards

Code Documentation

  • Functions: Document parameters and return values
  • Classes: Document purpose and usage
  • Complex Logic: Add inline comments
  • API Endpoints: Document request/response format

Documentation Example

/**
 * Creates a new student admission record
 * @param {Object} admissionData - Student admission information
 * @param {string} admissionData.name - Student's full name
 * @param {string} admissionData.email - Student's email address
 * @param {File} admissionData.avatar - Student's profile picture
 * @returns {Promise<Object>} Created admission record
 * @throws {ValidationError} When required fields are missing
 */
async function createAdmission(admissionData) {
  // Implementation
}

๐Ÿงช Testing Guidelines

Test Structure

src/
โ”œโ”€โ”€ __tests__/              # Test files
โ”‚   โ”œโ”€โ”€ unit/              # Unit tests
โ”‚   โ”œโ”€โ”€ integration/       # Integration tests
โ”‚   โ””โ”€โ”€ fixtures/          # Test data

Writing Tests

import { jest, describe, it, expect } from '@jest/globals';
import { createAdmission } from '../api/v1/Admission/Admission.controller.mjs';

describe('Admission Controller', () => {
  it('should create a new admission', async () => {
    // Test implementation
  });
});

Test Coverage

  • Aim for 80%+ code coverage
  • Test both success and error cases
  • Include edge cases
  • Mock external dependencies

๐Ÿš€ Release Process

Version Numbering

We follow Semantic Versioning:

  • MAJOR: Breaking changes
  • MINOR: New features (backward compatible)
  • PATCH: Bug fixes (backward compatible)

Release Checklist

  • All tests pass
  • Documentation updated
  • CHANGELOG.md updated
  • Version bumped in package.json
  • Security audit completed
  • Performance testing done

๐ŸŒŸ Best Practices

Git Workflow

# Always start from main
git checkout main
git pull origin main

# Create feature branch
git checkout -b feature/new-feature

# Make changes and commit
git add .
git commit -m "feat: add new feature description"

# Push and create PR
git push origin feature/new-feature

Commit Message Format

type(scope): subject

body (optional)

footer (optional)

Types:

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation changes
  • style: Code style changes
  • refactor: Code refactoring
  • test: Adding tests
  • chore: Maintenance tasks

Code Review Checklist

  • Code follows project conventions
  • Tests are included and pass
  • Documentation is updated
  • No sensitive data exposed
  • Performance impact considered
  • Backward compatibility maintained

๐Ÿ† Contributor Hall of Fame

We maintain a list of our top contributors:

๐Ÿฅ‡ Core Contributors

๐Ÿฅˆ Major Contributors

Coming soon - your name could be here!

๐Ÿฅ‰ Contributors

All contributors are listed in CONTRIBUTORS.md

๐Ÿ“Š Contribution Statistics

We track and celebrate:

  • Lines of code contributed
  • Issues resolved
  • Features implemented
  • Documentation improvements
  • Community engagement

๐ŸŽฏ Monthly Focus Areas

We rotate focus areas monthly:

  • January: Security & Performance
  • February: Testing & Documentation
  • March: New Features
  • April: UI/UX Improvements
  • May: Mobile & API Enhancements
  • June: Accessibility & Internationalization
  • July: DevOps & Infrastructure
  • August: Bug Fixes & Optimization
  • September: Community Features
  • October: Analytics & Monitoring
  • November: Integration & Plugins
  • December: Year-end Cleanup & Planning

Thank you for contributing to the future of education technology in India! ๐Ÿ‡ฎ๐Ÿ‡ณ

This project is maintained with โค๏ธ by abhishek-nexgen-dev