First off, thank you for considering contributing to Todo API! It's people like you that make this project better for everyone.
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.
Before creating bug reports, please check the existing issues to avoid duplicates. When you create a bug report, include as many details as possible:
- Use a clear and descriptive title
- Describe the exact steps to reproduce the problem
- Provide specific examples to demonstrate the steps
- Describe the behavior you observed and what you expected to see
- Include screenshots if applicable
- Include your environment details (OS, Node.js version, etc.)
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, include:
- Use a clear and descriptive title
- Provide a detailed description of the suggested enhancement
- Explain why this enhancement would be useful
- List any alternative solutions you've considered
- Fork the repository and create your branch from
main - Make your changes following our coding standards
- Add tests if applicable
- Update documentation if needed
- Ensure all tests pass by running
npm test - Run the linter with
npm run lint:fix - Format your code with
npm run format - Write a clear commit message following our commit message guidelines
- Submit your pull request
-
Fork and clone the repository
git clone https://github.com/YOUR-USERNAME/ToDo-APIs.git cd ToDo-APIs -
Install dependencies
npm install
-
Create a branch for your changes
git checkout -b feature/my-new-feature
-
Set up environment variables
cp .env.example .env
-
Run the development server
npm run dev
- Use TypeScript for all new code
- Follow the existing code style
- Use meaningful variable and function names
- Add JSDoc comments for public APIs
- Keep functions small and focused
- Use async/await instead of callbacks
- Place new features in appropriate directories
- Keep related code together
- Use index files to expose public APIs
- Maintain separation of concerns
- Write tests for new features
- Maintain or improve code coverage
- Use descriptive test names
- Test edge cases and error conditions
Follow the Conventional Commits specification:
feat:New featurefix:Bug fixdocs:Documentation changesstyle:Code style changes (formatting, etc.)refactor:Code refactoringtest:Adding or updating testschore:Maintenance tasks
Examples:
feat: add pagination to todo list endpoint
fix: resolve memory leak in todo model
docs: update API documentation for new endpoint
todo-api/
├── src/
│ ├── config/ # Configuration files
│ ├── controllers/ # Request handlers
│ ├── middleware/ # Express middleware
│ ├── models/ # Data models
│ ├── routes/ # API routes
│ ├── types/ # TypeScript types
│ ├── utils/ # Utility functions
│ ├── app.ts # Express app setup
│ └── server.ts # Server entry point
├── tests/ # Test files
└── ...
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm test# Lint code
npm run lint
# Fix linting issues
npm run lint:fix
# Format code
npm run format
# Check formatting
npm run format:check# Build the project
npm run build
# Clean build
npm run build:cleanFeel free to open an issue for any questions or concerns. We're here to help!
By contributing, you agree that your contributions will be licensed under the MIT License.