|
| 1 | +# Contributing to Eryxon Flow |
| 2 | + |
| 3 | +Thank you for your interest in contributing to Eryxon Flow! This document provides guidelines for contributing to this manufacturing execution system. |
| 4 | + |
| 5 | +## License Agreement |
| 6 | + |
| 7 | +By contributing to Eryxon Flow, you agree that your contributions will be licensed under the same [Business Source License 1.1](LICENSE) that covers the project. After the change date, contributions will be available under Apache 2.0. |
| 8 | + |
| 9 | +## Getting Started |
| 10 | + |
| 11 | +### Prerequisites |
| 12 | + |
| 13 | +- Node.js 20+ |
| 14 | +- npm or pnpm |
| 15 | +- Git |
| 16 | +- A [Supabase](https://supabase.com) account (free tier works) |
| 17 | + |
| 18 | +### Development Setup |
| 19 | + |
| 20 | +```bash |
| 21 | +# Clone the repository |
| 22 | +git clone https://github.com/SheetMetalConnect/eryxon-flow.git |
| 23 | +cd eryxon-flow |
| 24 | + |
| 25 | +# Install dependencies |
| 26 | +npm install |
| 27 | + |
| 28 | +# Copy environment template |
| 29 | +cp .env.example .env |
| 30 | +# Edit .env with your Supabase credentials |
| 31 | + |
| 32 | +# Start development server |
| 33 | +npm run dev |
| 34 | +``` |
| 35 | + |
| 36 | +### Running Tests |
| 37 | + |
| 38 | +```bash |
| 39 | +# Run all tests |
| 40 | +npm test |
| 41 | + |
| 42 | +# Type checking |
| 43 | +npm run typecheck |
| 44 | + |
| 45 | +# Linting |
| 46 | +npm run lint |
| 47 | +``` |
| 48 | + |
| 49 | +## How to Contribute |
| 50 | + |
| 51 | +### Reporting Bugs |
| 52 | + |
| 53 | +1. Check existing [GitHub Issues](https://github.com/SheetMetalConnect/eryxon-flow/issues) to avoid duplicates |
| 54 | +2. Use the bug report template |
| 55 | +3. Include: |
| 56 | + - Steps to reproduce |
| 57 | + - Expected vs actual behavior |
| 58 | + - Browser/environment details |
| 59 | + - Screenshots if applicable |
| 60 | + |
| 61 | +### Suggesting Features |
| 62 | + |
| 63 | +1. Open a [GitHub Discussion](https://github.com/SheetMetalConnect/eryxon-flow/discussions) first |
| 64 | +2. Describe the use case and manufacturing context |
| 65 | +3. Explain why existing features don't solve the problem |
| 66 | + |
| 67 | +### Submitting Pull Requests |
| 68 | + |
| 69 | +1. **Fork** the repository |
| 70 | +2. **Create a branch** from `main`: |
| 71 | + ```bash |
| 72 | + git checkout -b feature/your-feature-name |
| 73 | + ``` |
| 74 | +3. **Make your changes** following our code style |
| 75 | +4. **Test** your changes thoroughly |
| 76 | +5. **Commit** with clear messages (see below) |
| 77 | +6. **Push** and open a Pull Request |
| 78 | + |
| 79 | +## Code Style |
| 80 | + |
| 81 | +### General Guidelines |
| 82 | + |
| 83 | +- Follow existing code patterns in the codebase |
| 84 | +- Use TypeScript with strict typing (no `any`) |
| 85 | +- Keep components small and focused |
| 86 | +- Write self-documenting code |
| 87 | + |
| 88 | +### Localization |
| 89 | + |
| 90 | +**All user-facing text must be localized.** Never hardcode strings. |
| 91 | + |
| 92 | +```tsx |
| 93 | +// Correct |
| 94 | +const { t } = useTranslation(); |
| 95 | +<Button>{t('common.save')}</Button> |
| 96 | + |
| 97 | +// Incorrect - never do this |
| 98 | +<Button>Save</Button> |
| 99 | +``` |
| 100 | + |
| 101 | +Add translations to all three language files: |
| 102 | +- `src/i18n/locales/en/` - English |
| 103 | +- `src/i18n/locales/nl/` - Dutch |
| 104 | +- `src/i18n/locales/de/` - German |
| 105 | + |
| 106 | +### Design System |
| 107 | + |
| 108 | +Use existing design tokens and classes. See `docs/DESIGN_SYSTEM.md`: |
| 109 | + |
| 110 | +```tsx |
| 111 | +// Correct - use design system classes |
| 112 | +<div className="glass-card"> |
| 113 | + <h1 className="hero-title">{title}</h1> |
| 114 | +</div> |
| 115 | + |
| 116 | +// Incorrect - never inline custom styles |
| 117 | +<div style={{ background: '#1a1a2e' }}> |
| 118 | +``` |
| 119 | + |
| 120 | +### Data Fetching |
| 121 | + |
| 122 | +Always use real data from Supabase. Never create mock data: |
| 123 | + |
| 124 | +```tsx |
| 125 | +// Correct |
| 126 | +const { data } = useQuery({ |
| 127 | + queryKey: ['jobs'], |
| 128 | + queryFn: () => supabase.from('jobs').select('*') |
| 129 | +}); |
| 130 | + |
| 131 | +// Incorrect - never mock data |
| 132 | +const mockJobs = [{ id: 1, name: 'Test' }]; |
| 133 | +``` |
| 134 | + |
| 135 | +## Commit Messages |
| 136 | + |
| 137 | +Use conventional commits format: |
| 138 | + |
| 139 | +``` |
| 140 | +type(scope): description |
| 141 | + |
| 142 | +[optional body] |
| 143 | +``` |
| 144 | + |
| 145 | +**Types:** |
| 146 | +- `feat` - New feature |
| 147 | +- `fix` - Bug fix |
| 148 | +- `docs` - Documentation only |
| 149 | +- `style` - Code style (formatting, etc.) |
| 150 | +- `refactor` - Code refactoring |
| 151 | +- `test` - Adding tests |
| 152 | +- `chore` - Maintenance tasks |
| 153 | + |
| 154 | +**Examples:** |
| 155 | +``` |
| 156 | +feat(jobs): add bulk delete functionality |
| 157 | +fix(operator): correct time calculation for paused operations |
| 158 | +docs(api): update webhook documentation |
| 159 | +``` |
| 160 | + |
| 161 | +## Pull Request Guidelines |
| 162 | + |
| 163 | +### Before Submitting |
| 164 | + |
| 165 | +- [ ] Code follows the style guide |
| 166 | +- [ ] All tests pass |
| 167 | +- [ ] TypeScript has no errors (`npm run typecheck`) |
| 168 | +- [ ] New features have translations in all 3 languages |
| 169 | +- [ ] Documentation updated if needed |
| 170 | + |
| 171 | +### PR Description |
| 172 | + |
| 173 | +Include: |
| 174 | +- What the PR does |
| 175 | +- Why the change is needed |
| 176 | +- How to test the changes |
| 177 | +- Screenshots for UI changes |
| 178 | + |
| 179 | +### Review Process |
| 180 | + |
| 181 | +1. Maintainers will review within 1-2 weeks |
| 182 | +2. Address feedback promptly |
| 183 | +3. Keep PRs focused - split large changes |
| 184 | + |
| 185 | +## Development Resources |
| 186 | + |
| 187 | +- [CLAUDE.md](CLAUDE.md) - Detailed development guidelines |
| 188 | +- [docs/DESIGN_SYSTEM.md](docs/DESIGN_SYSTEM.md) - UI design system |
| 189 | +- [docs/CODING_PATTERNS.md](docs/CODING_PATTERNS.md) - Code patterns |
| 190 | +- [docs/DATABASE.md](docs/DATABASE.md) - Database schema |
| 191 | + |
| 192 | +## Questions? |
| 193 | + |
| 194 | +- Open a [GitHub Discussion](https://github.com/SheetMetalConnect/eryxon-flow/discussions) |
| 195 | +- Check existing documentation in `/docs` |
| 196 | + |
| 197 | +## Code of Conduct |
| 198 | + |
| 199 | +Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md). |
| 200 | + |
| 201 | +--- |
| 202 | + |
| 203 | +Thank you for contributing to manufacturing innovation! |
0 commit comments