Thank you for your interest in contributing to the Dynamic App Builder! This document provides guidelines and information for contributors.
- Code of Conduct
- Getting Started
- Development Setup
- Contributing Guidelines
- Code Style
- Testing
- Security
- Submitting Changes
By participating in this project, you agree to abide by our Code of Conduct:
- Use welcoming and inclusive language
- Be respectful of differing viewpoints and experiences
- Gracefully accept constructive criticism
- Focus on what is best for the community
- Show empathy towards other community members
- Node.js 14.0.0 or higher
- npm or yarn
- Git
- An Anthropic API key for testing
-
Fork and clone the repository
git clone https://github.com/yourusername/dynamic-app-builder.git cd dynamic-app-builder -
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env # Edit .env with your configuration -
Run type checking
npm run type-check
-
Run tests
npm test -
Start development
npm run dev
We welcome several types of contributions:
- Bug fixes - Fix issues in the codebase
- Features - Add new functionality
- Documentation - Improve or add documentation
- Tests - Add or improve test coverage
- Performance - Optimize existing code
- Security - Address security vulnerabilities
- Check existing issues - Look for existing issues or feature requests
- Create an issue - If none exists, create one describing your contribution
- Discuss approach - Comment on the issue to discuss your approach
- Wait for approval - Wait for maintainer feedback before starting work
-
Create a branch
git checkout -b feature/your-feature-name # or git checkout -b fix/issue-number -
Make your changes
- Follow our code style guidelines
- Add tests for new functionality
- Update documentation as needed
-
Test your changes
npm test npm run type-check npm run lint -
Commit your changes
git add . git commit -m "feat: add new feature description"
-
Push and create PR
git push origin your-branch-name # Create PR through GitHub interface
- Use ES6+ features
- Use
constandlet, avoidvar - Use async/await over Promises when possible
- Use meaningful variable and function names
- Add JSDoc comments for public APIs
Example:
/**
* Validates user input for code generation
* @param {string} prompt - The user's prompt
* @param {Object} options - Validation options
* @returns {Object} Validation result
*/
async function validatePrompt(prompt, options = {}) {
if (!prompt || typeof prompt !== 'string') {
throw new Error('Prompt must be a non-empty string');
}
return {
valid: true,
sanitized: prompt.trim()
};
}- Place utility functions in
src/utils/ - Add tests in
tests/directory - Use descriptive file names
- Group related functionality together
- Always handle errors gracefully
- Use try-catch blocks for async operations
- Log errors with context information
- Provide meaningful error messages to users
try {
const result = await apiCall();
return result;
} catch (error) {
logger.error('API call failed', error, {
operation: 'generateCode',
correlationId: request.id
});
throw new Error('Code generation temporarily unavailable');
}- Never log sensitive information
- Validate all user inputs
- Use parameterized queries for database operations
- Follow the principle of least privilege
- Use secure storage for sensitive data
tests/
├── unit/ # Unit tests
├── integration/ # Integration tests
├── fixtures/ # Test data
└── setup.js # Test configuration
- Write tests for all new functionality
- Use descriptive test names
- Test both success and failure cases
- Mock external dependencies
- Aim for >80% code coverage
Example:
describe('CacheManager', () => {
beforeEach(() => {
cacheManager.clear();
});
test('should store and retrieve cached results', () => {
const key = 'test-prompt';
const value = { code: 'console.log("test")' };
cacheManager.set(key, value);
const result = cacheManager.get(key);
expect(result).toEqual(value);
});
});# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run test:coverage
# Run specific test file
npm test -- tests/utils/cacheManager.test.jsDO NOT create public issues for security vulnerabilities. Instead:
- Email security details to: security@yourcompany.com
- Include a detailed description of the vulnerability
- Provide steps to reproduce if possible
- Suggest a fix if you have one
- Never commit API keys or secrets
- Use environment variables for configuration
- Validate and sanitize all inputs
- Use secure storage for sensitive data
- Keep dependencies up to date
- Update documentation - Update README, API docs, etc.
- Add/update tests - Ensure good test coverage
- Run the test suite - All tests must pass
- Check types - Run TypeScript type checking
- Update changelog - Add entry to CHANGELOG.md
- Create PR - Use the PR template
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] Tests pass locally
- [ ] Added new tests
- [ ] Manual testing completed
## Checklist
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Documentation updated
- [ ] No sensitive information committed- Automated checks - CI/CD pipeline runs
- Maintainer review - Code review by maintainers
- Address feedback - Make requested changes
- Final approval - Maintainer approves and merges
- Use
console.logsparingly, prefer the logger - Use debugger statements for complex issues
- Check the application logs in
logs/directory - Use Chrome DevTools for renderer debugging
- Profile code changes for performance impact
- Use the built-in performance monitoring
- Avoid blocking the main thread
- Use worker threads for heavy operations
- Follow the existing patterns
- Keep functions small and focused
- Use dependency injection where appropriate
- Maintain separation of concerns
- Issues - Create GitHub issues for bugs/features
- Discussions - Use GitHub Discussions for questions
- Email - Contact maintainers directly if needed
- Documentation - Check existing docs first
Contributors will be recognized in:
- README.md contributors section
- Release notes for significant contributions
- GitHub contributor graphs
- Special recognition for security discoveries
By contributing, you agree that your contributions will be licensed under the same MIT License that covers the project.
Thank you for contributing to Dynamic App Builder! 🚀