Thank you for your interest in contributing to CodePark! We welcome contributions from everyone. This document provides guidelines and instructions for contributing to the project.
We are committed to providing a welcoming and inspiring community for all. Please be respectful in all communications and maintain a professional attitude.
- Use welcoming and inclusive language
- Be respectful of differing opinions, viewpoints, and experiences
- Gracefully accept constructive criticism
- Focus on what is best for the community
- Show empathy towards other community members
- Harassment or discrimination of any kind
- Offensive comments related to gender, sexual orientation, disability, mental illness, neuro(a)typicality, physical appearance, body size, race, or religion
- Trolling, insulting/derogatory comments, and personal or political attacks
- Publishing others' private information without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting
- Node.js 22.0.0 or higher
- npm 10.0.0 or higher
- Git
- Familiarity with Git and GitHub workflow
- Understanding of experimental npm packages
-
Fork the repository
# Visit https://github.com/skanda890/CodePark and click "Fork" -
Clone your fork
git clone https://github.com/YOUR-USERNAME/CodePark.git cd CodePark -
Add upstream remote
git remote add upstream https://github.com/skanda890/CodePark.git
-
Install dependencies
npm install
-
Create a development branch
git checkout -b feature/your-feature-name
-
Set up pre-commit hooks (optional but recommended)
npm run setup-husky
-
Create a feature branch from
maingit checkout -b feature/amazing-feature
-
Make your changes
- Follow the coding standards (see below)
- Write tests for new functionality
- Update documentation as needed
-
Run tests and linting
npm run lint npm run format npm test -
Commit your changes
git commit -m "feat: Add amazing feature" -
Push to your fork
git push origin feature/amazing-feature
-
Create a Pull Request
- Go to https://github.com/skanda890/CodePark/pulls
- Click "New Pull Request"
- Select your branch and fill in the PR template
-
Create a bug fix branch
git checkout -b fix/bug-description
-
Reference the issue in commits
git commit -m "fix: Resolve issue #123 - description" -
Follow the same PR process as above
- ES6+ syntax: Use modern JavaScript features
- Async/await: Prefer async/await over callbacks and promises
- const/let: Never use
var - Arrow functions: Use arrow functions for callbacks
- Template literals: Use backticks for strings with variables
-
Linting: Code must pass ESLint checks
npm run lint
-
Formatting: Code must be formatted with Prettier
npm run format
-
No console.log: Use the logging library (pino) instead
logger.info("Message"); logger.error("Error");
src/
├── api/ # API routes and controllers
├── services/ # Business logic
├── models/ # Data models and schemas
├── middleware/ # Express middleware
├── utils/ # Utility functions
└── config/ # Configuration files
- Files: kebab-case for files (
my-module.js) - Directories: kebab-case for directories (
my-module/) - Functions: camelCase for function names
- Classes: PascalCase for class names
- Constants: UPPER_SNAKE_CASE for constants
-
JSDoc comments: Document all functions and classes
/** * Processes user data and returns formatted result * @param {Object} user - User object * @param {string} user.name - User's name * @param {string} user.email - User's email * @returns {Promise<Object>} Formatted user object */ async function processUser(user) { // implementation }
-
README: Keep README.md updated with new features
-
Comments: Write clear comments for complex logic
- Minimum coverage: 80% line coverage required
- Unit tests: Test individual functions and modules
- Integration tests: Test API endpoints and workflows
- E2E tests: Test complete user scenarios
# Run all tests
npm test
# Run with coverage
npm test -- --coverage
# Watch mode
npm run test:watch
# AI-specific tests
npm run test:ai- Use Jest as the testing framework
- Place tests in
tests/directory - Name test files
*.test.js - Follow the Arrange-Act-Assert pattern
describe("UserService", () => {
describe("createUser", () => {
it("should create a new user with valid data", async () => {
// Arrange
const userData = { name: "John", email: "john@example.com" };
// Act
const result = await createUser(userData);
// Assert
expect(result.id).toBeDefined();
expect(result.name).toBe("John");
});
});
});- Run
npm auditto check for vulnerabilities - Run
npm run security-checkfor comprehensive scanning - Never commit secrets, API keys, or credentials
- Don't use
localStorageorsessionStorage(use variables) - Validate and sanitize all user inputs
- Use parameterized queries (Prisma handles this)
If you discover a security vulnerability, please email security@example.com instead of using the issue tracker.
type(scope): subject
body
footer
- feat: A new feature
- fix: A bug fix
- docs: Documentation changes
- style: Code style changes (formatting, missing semicolons, etc.)
- refactor: Code refactoring without feature changes
- perf: Performance improvements
- test: Adding or updating tests
- chore: Build process, dependencies, or tooling changes
- ci: CI/CD configuration changes
# Feature
git commit -m "feat(ai): Add code suggestion ML model"
# Bug fix
git commit -m "fix(auth): Fix JWT token expiration issue"
# Documentation
git commit -m "docs(api): Update GraphQL schema examples"
# Performance
git commit -m "perf(db): Add connection pooling"- Fork the repository
- Create a descriptive branch name
- Make your changes
- Update tests and documentation
- Run
npm run lintandnpm run format - Run
npm testto ensure tests pass - Run
npm run security-checkfor security validation - Rebase on the latest
mainbranch
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] Unit tests added
- [ ] Integration tests added
- [ ] Tested locally
## Checklist
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Comments added for complex logic
- [ ] Documentation updated
- [ ] No new warnings generated
- [ ] Tests pass locally
- [ ] Security checks pass
## Related Issues
Fixes #(issue number)
## Screenshots (if applicable)
Add screenshots for UI changes- Code quality and adherence to standards
- Test coverage and quality
- Documentation accuracy
- Security implications
- Performance impact
- Backwards compatibility
- Respond to all feedback
- Push additional commits if changes are requested
- Use the "Resolve conversation" button after addressing feedback
- Request re-review when ready
- PRs require at least 1 approval from a maintainer
- All conversations must be resolved
- All checks must pass
- Squash and merge for clean history
- Search existing issues to avoid duplicates
- Check the documentation and FAQ
- Test with the latest version
## Description
Clear description of the issue
## Steps to Reproduce
1. Step one
2. Step two
3. Step three
## Expected Behavior
What should happen
## Actual Behavior
What actually happens
## Environment
- Node.js version:
- npm version:
- OS: Windows / macOS / Linux
- Browser (if applicable):
## Error Messages
Include relevant error messages or logs
## Additional Context
Any other relevant informationWe welcome documentation improvements!
- Use clear, simple language
- Include code examples where appropriate
- Keep examples up-to-date
- Add table of contents for long documents
- Use proper markdown formatting
- Proofread for typos and grammar
- Main docs:
/docs/directory - API docs:
docs/API.md - Architecture:
docs/ARCHITECTURE.md - Auto-update guide:
Coding/Scripts/auto-update/README.md - Contributing guide:
CONTRIBUTING.md(this file) - Changelog:
CHANGELOG.md
- Discussions: GitHub Discussions
- Issues: GitHub Issues
- Wiki: GitHub Wiki
- Watch the repository for updates
- Follow the Changelog
- Subscribe to release notifications
- Join community discussions
Contributors will be recognized in:
- Pull request acknowledgments
- Release notes
- Contributors list (coming soon)
- Project documentation
- Node.js Documentation
- Express.js Guide
- Git Guide
- GitHub Guides
- CodePark Architecture
- CodePark API Documentation
Feel free to:
- Open a GitHub Discussion
- Create an issue with the
questionlabel - Check existing documentation
- Review past issues and PRs
By contributing to CodePark, you agree that your contributions will be licensed under the MIT License.
Thank you for making CodePark better! 🎉