Veganify checks the barcode (EAN or UPC) of a food- or non-food-product and tells you if it is vegan or not. It is an useful tool for vegans and vegetarians - Developed with usability and simplicity in mind, so without distracting irrelevant facts or advertising.
The [Veganify Ingredients API](https://github.com/frontendnetwork/Veganify-API) checks the products ingredients against a list of thousands of non-vegan items.
> We're using [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) for commit messages. Please follow this convention when making changes.
> We're aware not everything in this repo follows those standards. This is because of how the project was started and evolved. We're working on improving this.
#### Component Structure
- Break down components into smaller, reusable pieces
- Each significant component should have its own directory with the following structure:
-`hooks/` for component-specific hooks
-`utils/` for component-specific utilities
-`models/` for component-specific types
- Small, simple components can be single files
#### Testing
- All utility functions must have 100% test coverage
- Tests are written using Jest for unit testing
- Components currently don't require test coverage
- Playwright is used for end-to-end testing but currently only coversa few basics use cases. More tests are needed.
#### TypeScript
- TypeScript is mandatory
- The `any` type is not acceptable unless absolutely necessary
- Always define proper interfaces and types in the appropriate `models` folder
- Use type inference when possible
#### Internationalization
- Use `next-intl` for translations
- Add new translations to all language files in `/locales`
- Follow the existing translation key structure
#### Code Style
- Follow Node.js, React, and Next.js best practices
- Use the App Router pattern for routing
- Keep components pure and functional when possible
- Use hooks for state management and side effects
- Follow the DRY (Don't Repeat Yourself) principle
- Use meaningful variable and function names
- Write comments for complex logic
- Keep functions small and focused
#### Styling
- Place all styles in the `styles` folder
- Keep styles modular and scoped to components when possible
- Be sure to use SCSS for styling
- Use CSS variables for theming and repeated values
When making a contribution, please follow these guidelines to ensure consistency and maintainability.
Remember that every contribution, no matter how small, is valuable to the project. Thank you for helping make Veganify better!
## Support
Please refer to our issue trackers to see where you could help:
<ahref="https://fink.inlang.com/github.com/frontendnetwork/veganify?ref=badge"><imgsrc="https://badge.inlang.com/?url=github.com/frontendnetwork/veganify"alt="Veganify on Inlang"style="border-radius: 5%;"></a>