Thanks for taking the time to contribute. NutriLens is an accountability tool for Indian consumers — the more people who contribute data, rules, and platform support, the more useful it becomes.
- Fork the repo and clone your fork
- Follow the Quick Start to get a local backend running
- Pick an issue tagged
good first issueorhelp wanted - Open a PR — we review within a few days
For larger changes (new platform, new scoring dimension), open an issue first to discuss the approach.
Open an issue with the product URL, what you expected, and what NutriLens returned. Screenshots of the popup help.
BigBasket and Flipkart are the next priority. See Adding a Platform below.
The scoring benchmarks (BENCHMARKS dict in backend/engines/ranker.py) need per-category data. If you have FSSAI compliance data or published nutritional benchmarks for Indian products, open a PR.
The OCR parser and scoring engine have no automated tests. The test harness in ocr-service/test_extraction.py is a good starting point.
amazon.js has a NOISE_PATTERNS array that filters UI text from marketing claims. If you find bullets that should be filtered (or shouldn't be), a one-line PR is welcome.
The popup is English-only. Hindi and Tamil translations would significantly increase the user base.
cp .env.example .env
docker compose upAfter changing any Python file in backend/ or ocr-service/:
docker compose restart api worker # or: ocrCheck logs:
docker compose logs api --tail=50
docker compose logs worker --tail=50Database access (psql):
docker compose exec db psql -U nutrilens -d nutrilenscd extension
npm install
npm run dev # Vite dev mode — rebuilds on saveAfter npm run build, reload the extension at chrome://extensions.
The first run downloads PaddleOCR models (~200MB). They are cached in a Docker volume so subsequent starts are fast. Test OCR extraction directly:
docker compose exec ocr python test_extraction.py path/to/label.jpg- Follow PEP 8
- Type hints on all function signatures
- Docstring on every module (single paragraph, present tense)
- No
print()— uselogging
- ESLint default config (from
package.json) - No default exports except React components
- Content script functions must be pure — no module state that survives page navigation
type(scope): short description
Types: feat, fix, refactor, test, docs, chore
Scope: extension, backend, ocr, docker, ci
Examples:
feat(extension): add BigBasket content script
fix(backend): correct per-100g double-multiplication in normalizer
docs: update OCR architecture diagram
- Branch from
main:git checkout -b feat/your-feature - Write or update tests if touching scoring or parsing logic
- Run the backend and manually test the end-to-end flow on at least one Amazon.in product
- Check the
/admindashboard to confirm your changes produce correct DB rows - Open a PR against
main— fill in the template
PRs that only touch one concern (one platform, one bug, one feature) are much easier to review and merge quickly.
- Create
extension/content_scripts/{platform}.js— model it onamazon.js - Export the same shape:
{ platform, platform_id, product_name, brand, price_inr, quantity_g, claims[], nutrition_facts{}, serving_size_g } - Register the content script in
manifest.jsonundercontent_scriptswith the platform's URL match pattern - Test on at least 10 product pages across different categories
- Note any structural differences from Amazon (e.g. BigBasket shows nutrition per serving only) in a comment at the top of the file
The backend is platform-agnostic — as long as the payload matches ProductSubmitRequest in backend/models/schemas.py, no backend changes are needed.
Open a discussion in the GitHub Discussions tab. For security issues, see SECURITY.md.