Thank you for your interest in contributing to CRUDkit! This document provides guidelines and instructions for contributing to the project.
- Code of Conduct
- Getting Started
- Development Workflow
- Coding Standards
- Testing
- Submitting Changes
- Reporting Issues
By participating in this project, you agree to abide by our code of conduct:
- Be respectful and inclusive
- Welcome newcomers and help them get started
- Focus on constructive criticism
- Accept feedback gracefully
- Prioritize the project's best interests
- Docker and Docker Compose (MANDATORY)
- Git
- Node.js 18+ (only needed on host for git hooks)
-
Fork the Repository
# Fork on GitHub, then clone your fork git clone https://github.com/YOUR_USERNAME/CRUDkit.git cd CRUDkit
-
Setup Docker Environment
# Create .env file with your user ID echo "UID=$(id -u)" > .env echo "GID=$(id -g)" >> .env # Start Docker development environment (MANDATORY) docker compose up
NOTE: This project REQUIRES Docker. Local pnpm/npm is NOT supported.
-
Create a Branch
git checkout -b feature/your-feature-name # or git checkout -b fix/your-bug-fix
# Start development environment
docker compose up
# Run commands in container
docker compose exec scripthammer pnpm dev # Dev server
docker compose exec scripthammer pnpm test # Run tests
docker compose exec scripthammer pnpm lint # Run linting
docker compose exec scripthammer pnpm format # Format code
docker compose exec scripthammer pnpm storybook # Storybook
docker compose exec scripthammer pnpm type-check # TypeScript| Script | Description |
|---|---|
docker compose exec scripthammer pnpm dev |
Start Next.js development server |
docker compose exec scripthammer pnpm build |
Build for production |
docker compose exec scripthammer pnpm test |
Run Vitest tests |
docker compose exec scripthammer pnpm test:coverage |
Generate coverage report |
docker compose exec scripthammer pnpm lint |
Run ESLint |
docker compose exec scripthammer pnpm format |
Format code with Prettier |
docker compose exec scripthammer pnpm format:check |
Check formatting without changes |
docker compose exec scripthammer pnpm type-check |
Run TypeScript type checking |
docker compose exec scripthammer pnpm storybook |
Start Storybook development |
- We use TypeScript with strict mode enabled
- All new code must be properly typed (no
anyunless absolutely necessary) - Use interfaces for object shapes, types for unions/primitives
- Export types/interfaces that might be used elsewhere
- Code is automatically formatted with Prettier on commit
- Follow the existing patterns in the codebase
- Use meaningful variable and function names
- Keep functions small and focused
- Add JSDoc comments for public APIs
We follow Atomic Design principles:
src/components/
├── subatomic/ # Basic elements (Text, Button, Input)
├── atomic/ # Simple components (Card, Modal)
├── molecular/ # Composite components
└── organisms/ # Complex sections
- Components should be in their own folders with:
ComponentName.tsx- Component fileComponentName.test.tsx- Test fileComponentName.stories.tsx- Storybook storiesindex.ts- Export file
We use conventional commits:
type(scope): description
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Test additions or fixeschore: Build process or auxiliary tool changesperf: Performance improvements
Examples:
feat(auth): add OAuth2 integration
fix(ui): resolve theme switcher flickering
docs: update installation instructions- Write tests for all new features and bug fixes
- Place tests next to the code they test (
Component.test.tsx) - Use descriptive test names that explain the behavior
- Follow the AAA pattern: Arrange, Act, Assert
# Run all tests (inside Docker)
docker compose exec scripthammer pnpm test
# Run tests in watch mode
docker compose exec scripthammer pnpm test:watch
# Generate coverage report
docker compose exec scripthammer pnpm test:coverageCurrent minimum coverage thresholds:
- Statements: 0.5%
- Branches: 0.5%
- Functions: 0.5%
- Lines: 0.5%
These will increase as the project matures.
Our pre-commit hooks automatically:
- Format code with Prettier
- Lint with ESLint
- Run related tests
- Check TypeScript types
-
Update Documentation
- Update README.md if needed
- Add/update tests
- Update Storybook stories for UI changes
-
Ensure Quality
- All tests pass
- No linting errors
- Code is formatted
- TypeScript has no errors
-
Create Pull Request
- Use a clear, descriptive title
- Reference any related issues
- Provide a detailed description of changes
- Include screenshots for UI changes
-
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 - [ ] Updated existing tests ## Checklist - [ ] Code follows project style - [ ] Self-reviewed code - [ ] Updated documentation - [ ] No console errors/warnings
- PRs require at least one review
- Address all feedback constructively
- Keep PRs focused and reasonably sized
- Be patient - reviewers are volunteers
- Check existing issues (including closed ones)
- Verify you're using the latest version
- Try to reproduce in a clean environment
Include:
- Clear, descriptive title
- Steps to reproduce
- Expected behavior
- Actual behavior
- Screenshots/error messages
- Environment details (OS, browser, Node version)
We provide templates for:
- Bug reports
- Feature requests
- Documentation improvements
- Performance issues
CRUDkit/
├── .github/ # GitHub Actions and templates
├── .husky/ # Git hooks
├── .storybook/ # Storybook configuration
├── public/ # Static assets
├── src/
│ ├── app/ # Next.js app router pages
│ ├── components/ # React components
│ ├── contexts/ # React contexts
│ ├── utils/ # Utility functions
│ └── test/ # Test utilities
├── docs/ # Documentation
└── docker-compose.yml # Docker configuration
- Check the documentation
- Review existing issues
- Ask in discussions
- Read the README
Contributors are recognized in:
- The project README
- Release notes
- GitHub contributors page
Thank you for contributing to CRUDkit! 🎉