Code of Conduct
By participating in this project, you agree to maintain a respectful and inclusive environment. Be kind, professional, and constructive in all interactions.Ways to Contribute
There are many ways to contribute to SnailyCAD:- Bug fixes - Fix issues and improve stability
- New features - Add requested functionality
- Documentation - Improve guides and API docs
- Translations - Add or update language files
- Code review - Review pull requests from others
- Testing - Test new features and report bugs
- Design - Improve UI/UX
Getting Started
Before you start contributing:- Check existing issues - See if someone is already working on it
- Discuss major changes - Open an issue to discuss large features before implementing
- Follow the setup guide - Complete the Getting Started guide
- Read the architecture docs - Understand the Architecture
Contributing Code
1. Fork the Repository
Create your own fork of the repository:- Visit github.com/SnailyCAD/snaily-cadv4
- Click “Fork” in the top right
- Clone your fork locally:
2. Create a Feature Branch
Create a new branch for your work:feature/- New features (e.g.,feature/vehicle-search)fix/- Bug fixes (e.g.,fix/login-error)docs/- Documentation updates (e.g.,docs/api-reference)refactor/- Code refactoring (e.g.,refactor/auth-service)chore/- Maintenance tasks (e.g.,chore/update-dependencies)
3. Make Your Changes
Follow these guidelines while coding:Code Style
- Use TypeScript for all new code
- Follow the existing code style
- Run
pnpm formatbefore committing - Run
pnpm lint:fixto fix linting issues - Ensure
pnpm typecheckpasses without errors
Writing Quality Code
Do:- Write clear, self-documenting code
- Add comments for complex logic
- Use meaningful variable and function names
- Keep functions small and focused
- Follow SOLID principles
- Add proper error handling
- Leave commented-out code
- Use
anytype unless absolutely necessary - Ignore TypeScript errors
- Skip validation on user inputs
- Hardcode sensitive data or configuration
Testing
While SnailyCAD doesn’t have comprehensive test coverage yet, consider:- Testing your changes manually
- Verifying edge cases
- Checking both success and error scenarios
- Testing on different browsers (for UI changes)
4. Commit Your Changes
Write clear, descriptive commit messages:- Use present tense (“Add feature” not “Added feature”)
- Be specific and descriptive
- Reference issue numbers when applicable
- Keep the first line under 72 characters
5. Push to Your Fork
Push your changes to your fork:6. Open a Pull Request
- Go to the SnailyCAD repository
- Click “Pull requests” → “New pull request”
- Click “compare across forks”
- Select your fork and branch
- Fill out the pull request template
- Click “Create pull request”
Pull Request Guidelines
Title:- Be clear and descriptive
- Use the same format as commit messages
- Explain what changes were made and why
- Reference related issues (e.g., “Fixes #123”)
- Include screenshots for UI changes
- List any breaking changes
- Mention if documentation needs updating
7. Code Review Process
After submitting your PR:- Automated checks - GitHub Actions will run linting and type checking
- Review - Maintainers will review your code
- Feedback - Address any requested changes
- Approval - Once approved, your PR will be merged
- Be open to suggestions
- Ask questions if you don’t understand
- Make requested changes promptly
- Push new commits to the same branch
Contributing Translations
Translations help make SnailyCAD accessible to users worldwide.Adding a New Language
- Fork and create a branch:
- Copy the English locale folder:
- Translate the JSON files in the new folder
- Validate translations:
- Commit and push:
- Open a pull request
Updating Existing Translations
- Navigate to
apps/client/locales/[language]/ - Update the relevant JSON files
- Validate and submit a PR as above
- Maintain the same JSON structure as English
- Use appropriate formality for the language
- Keep technical terms consistent
- Test translations in the UI when possible
Reporting Bugs
Found a bug? Help us fix it:- Check existing issues - It may already be reported
- Create a new issue - Use the bug report template
- Provide details:
- Steps to reproduce
- Expected behavior
- Actual behavior
- Screenshots or error messages
- Environment (browser, OS, SnailyCAD version)
Requesting Features
Have an idea for a new feature?- Check existing issues - It may already be requested
- Create a feature request - Use the feature request template
- Provide details:
- Clear description of the feature
- Use cases and benefits
- Potential implementation approach (optional)
- Mockups or examples (optional)
Development Best Practices
Working with the Monorepo
Running commands in specific workspaces:Database Changes
When modifying the database schema:-
Edit the Prisma schema:
- Located at
apps/api/prisma/schema.prisma - Follow existing patterns
- Located at
- Create a migration:
-
Verify the migration:
- Check the generated SQL in
apps/api/prisma/migrations/ - Test both up and down migrations
- Check the generated SQL in
-
Update related code:
- Controllers
- Services
- Client components
- Validation schemas
API Changes
When adding or modifying API endpoints:- Create/update controller - In
apps/api/src/controllers/ - Add validation schema - In
packages/schemas/ - Update types if needed - Prisma schema or custom types
- Document the endpoint - Use Ts.ED decorators for Swagger docs
- Test the endpoint - Use the Swagger UI or Postman
UI Changes
When modifying the user interface:- Follow existing patterns - Check similar components
- Use TailwindCSS - Prefer utility classes over custom CSS
- Ensure responsiveness - Test on mobile, tablet, and desktop
- Check accessibility - Use semantic HTML and ARIA labels
- Update translations - Add new translation keys if needed
- Test dark mode - SnailyCAD supports dark mode
Getting Help
Need help with your contribution?- Discord - Join the community Discord
- GitHub Discussions - Ask questions in discussions
- Issues - Comment on related issues
- Documentation - Check the official docs
Recognition
All contributors are valued and recognized:- Contributors are listed in GitHub’s contributors page
- Significant contributors may be added to the README
- Join the sponsors list by sponsoring the project
License
By contributing to SnailyCAD, you agree that your contributions will be licensed under the MIT License.Questions?
If you have any questions about contributing, feel free to:- Open an issue for discussion
- Ask in the Discord community
- Tag maintainers in your PR comments