Inspiration

The idea for LabelLens came from trying to help a friend with severe food allergies navigate ingredient lists. We kept hitting the same wall - there was no single, reliable source that could tell us whether an additive was safe, banned, or restricted across different regions.

One website would say an ingredient was fine, another would call it dangerous, and government databases were scattered across dozens of agencies. The breaking point was discovering that Brominated Vegetable Oil (BVO) was banned in Europe and Canada but still allowed in US energy drinks. How could anyone make informed decisions with such fragmented information?

I realized that if legal professionals, doctors, and food industry experts were struggling with this same problem, there had to be a better solution.

What it does

LabelLens analyzes food ingredient lists and provides judicial-grade documentation about additives, allergens, and processing classifications. Paste any ingredient list and get instant analysis with regulatory status across US, Canadian, and European jurisdictions.

The platform covers over 150 food additives and 11 major allergens (including sesame under the FDA FASTER Act), plus implements the WHO/FAO NOVA food processing classification system. What makes it unique is real-time multi-jurisdiction tracking - it knows that Red 3 is restricted in the US but banned in Canada, and tracks pending bans and regulatory changes.

Features include product comparison, reformulation suggestions, and comprehensive reporting that generates court-ready documentation with scientific references and regulatory citations.

How we built it

We built LabelLens on Next.js 15.5.0 with TypeScript for performance and professional-grade reliability. The biggest challenge was creating a client-side classification system that didn't depend on servers - we needed real-time analysis with complete data privacy.

The additive database required manually researching and validating information from FDA databases, Health Canada lists, EFSA opinions, WHO classifications, and peer-reviewed research. Each of the 150+ entries includes chemical names, aliases, severity classifications, and regulatory status across three jurisdictions.

We implemented the complete FDA FASTER Act requirements, tracking not just major allergens but over 200 hidden sources and cross-contamination risks. The NOVA system required coding the official UN criteria for detecting ultra-processed markers.

The multi-jurisdiction compliance system was particularly complex - mapping each additive's specific regulatory status across regions, including nuanced information like "allowed but restricted" or future ban dates like California's AB 418 taking effect in 2027.

Challenges we ran into

The development process was full of technical challenges that pushed our problem-solving skills to the limit. One of the first major roadblocks was dealing with TypeScript compilation errors across different parts of the codebase. We had conflicting type definitions between our main library and a secondary label-lens directory that was causing jurisdiction classification failures.

The specific error was that our buildJurisdictionRows function was trying to access us, ca, and eu properties directly on AdditiveRule objects, but these properties didn't exist. The function was expecting jurisdiction data to be embedded in each additive record, but our architecture actually used a separate JURISDICTION_STATUS lookup table. Debugging this required understanding the entire data flow from ingredient input through classification to results display.

Another significant challenge was implementing the save functionality. Initially, the results page was missing a save button entirely, and when we added it, we ran into type mismatches between the analysis results and the SavedAnalysis interface. The SavedAnalysis type expected properties like starred, tokens, normalized, and specific jurisdiction formatting that didn't match our analysis output format. We had to build proper type conversion functions that mapped between the different data structures.

Database validation was an ongoing challenge throughout development. With over 150 additives and 11 allergens, ensuring data accuracy and consistency required constant verification against authoritative sources. We had to implement validation systems that checked for missing properties, incorrect severity classifications, and outdated regulatory information.

Accomplishments that we're proud of

Creating a comprehensive database of 150+ food additives with judicial-grade documentation was our biggest accomplishment. Each entry represents hours of research across multiple regulatory databases, scientific literature, and legal documents. The database includes complex additives like TBHQ (Tertiary Butylhydroquinone) which is allowed in the US, restricted in Canada, but completely banned in the EU - getting these regulatory nuances correct required deep understanding of international food law.

Successfully implementing the complete FDA FASTER Act allergen requirements was another major achievement. This included not just the obvious allergens like peanuts and shellfish, but also tracking the newly mandated sesame allergen and over 200 hidden sources like "natural flavors" that might contain milk derivatives or "modified food starch" that could contain wheat.

The multi-jurisdiction regulatory compliance system represents months of research into food law across three major regulatory frameworks. Understanding that California's AB 418 creates different rules than federal FDA regulations, or that EU EFSA assessments can override individual member state policies, required navigating complex legal documents and regulatory timelines.

Building a production-ready Next.js application with TypeScript strict mode, comprehensive error handling, and optimized build configuration demonstrated our ability to create professional-grade software. The application successfully builds in under 16 seconds, passes all type checking, and deploys seamlessly to Vercel with global CDN distribution.

The real-time analysis engine that can process ingredient lists instantly and provide comprehensive regulatory analysis represents a significant technical achievement. The system handles complex ingredient parsing, alias matching across multiple languages and naming conventions, and simultaneous classification across additive categories, allergen detection, and NOVA processing levels.

What we learned

This project taught us that professional software requires understanding the regulatory and legal context, not just technical implementation. Food safety involves complex political and economic considerations that vary dramatically across jurisdictions.

We learned advanced TypeScript patterns for handling complex data relationships and systematic debugging approaches. The research process taught us to distinguish between peer-reviewed literature, regulatory documents, and industry marketing materials.

Most importantly, we gained appreciation for modern food system complexity - "caramel color" can be produced through four different processes with different safety profiles, and "natural flavors" can contain over 100 different compounds.

What's next for LabelLens

The immediate roadmap includes expanding the database to cover additional regulatory jurisdictions, particularly Australia, Japan, and other major food markets. We plan to implement real-time regulatory tracking that automatically updates when agencies publish new guidance or ban decisions.

Advanced features in development include supply chain transparency tracking, personalized allergen alert systems, and integration with electronic health records for medical applications. We're also working on blockchain-based audit trails for food safety documentation.

The long-term vision includes becoming the authoritative platform for food ingredient analysis across legal, medical, and educational sectors, with expansion into related areas like cosmetics, pharmaceuticals, and industrial chemicals.

Built With

  • fda-datasets
  • next.js
  • open-food-facts
  • tailwind
  • typescript
  • usda-food-data-central
  • vercel
Share this project:

Updates