Skip to content

AI-powered food freshness visibility platform with real-time FreshScore and smart supply chain insights. Donation decisions across farms, distributors, and retailers.

Notifications You must be signed in to change notification settings

suryanewa/freshi

Repository files navigation

Freshi Logo
Freshi - Freshness Tracking & Supply Chain Management
Built with Next.js 15 App Router

Overview

Freshi is a comprehensive freshness tracking and supply chain management platform designed for food and ingredient distributors. The platform provides real-time monitoring of shipment freshness, temperature tracking, partner management, and IoT sensor integration.

Built with the following modern stack:

Features

Core Functionality

  • Real-time Freshness Tracking: Monitor FreshScore metrics across all shipments with predictive analytics
  • Shipment Management: Track in-transit loads with temperature, humidity, and location monitoring
  • Inventory Management: Manage food and ingredient inventory with quantity and unit tracking
  • Partner Management: Manage relationships with retailers and food banks, including FreshScore thresholds and delivery history
  • IoT Sensor Integration: Monitor and manage temperature, humidity, and location sensors with support for Emerson, Samsara, and Tive integrations
  • Route Visualization: Interactive Mapbox maps showing shipment routes and real-time tracking
  • Data Sharing Controls: Granular permissions for sharing freshness data with partners

Pages

Page Description
Dashboard (Overview) Real-time freshness KPIs, FreshScore over time charts, shipment volume by freshness tier, spoilage source breakdown, and active shipment tracking
Inventory Manage food and ingredient inventory with search, filtering, and categorization. Track quantity and units for bulk items
Shipments Monitor all in-transit shipments with temperature/humidity charts, route maps, driver status, and predictive shelf life. Includes reroute suggestions for at-risk shipments
Partners Manage retailer and food bank relationships, view FreshScore thresholds, delivery history, acceptance rates, and shared freshness ledger
Sensors & Devices Manage IoT sensors and tracking devices. Monitor battery levels, signal strength, calibration status, and integration health
Settings Configure team roles (Operations, Driver, Quality Assurance) and data sharing permissions with partners
Billing Manage subscription plans, payment methods, and view billing history
Notifications Customize notification preferences by category (shipment alerts, freshness warnings, temperature breaches, etc.)
Profile User profile management via Clerk authentication

Feature based organization

src/
├── app/ # Next.js App Router directory
│ ├── (auth)/ # Auth route group
│ │ ├── (signin)/
│ ├── (dashboard)/ # Dashboard route group
│ │ ├── layout.tsx
│ │ ├── loading.tsx
│ │ └── page.tsx
│ └── api/ # API routes
│
├── components/ # Shared components
│ ├── ui/ # UI components (buttons, inputs, etc.)
│ └── layout/ # Layout components (header, sidebar, etc.)
│
├── features/ # Feature-based modules
│ ├── feature/
│ │ ├── components/ # Feature-specific components
│ │ ├── actions/ # Server actions
│ │ ├── schemas/ # Form validation schemas
│ │ └── utils/ # Feature-specific utilities
│ │
├── lib/ # Core utilities and configurations
│ ├── auth/ # Auth configuration
│ ├── db/ # Database utilities
│ └── utils/ # Shared utilities
│
├── hooks/ # Custom hooks
│ └── use-debounce.ts
│
├── stores/ # Zustand stores
│ └── dashboard-store.ts
│
└── types/ # TypeScript types
└── index.ts

Getting Started

Note

This project uses Next.js 15 with React 19. Follow these steps to get started:

Prerequisites

  • Node.js 18+ and pnpm installed
  • Clerk account for authentication
  • Mapbox account (for map visualizations)
  • Sentry account (optional, for error tracking)

Installation

  1. Clone the repository:
git clone <repository-url>
cd freshi
  1. Install dependencies:
pnpm install
  1. Set up environment variables:
cp env.example.txt .env.local
  1. Configure your .env.local file with the following required variables:

    • NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY - Clerk publishable key
    • CLERK_SECRET_KEY - Clerk secret key
    • NEXT_PUBLIC_MAPBOX_PUBLIC_TOKEN - Mapbox public token for map visualizations
    • NEXT_PUBLIC_SENTRY_DSN - Sentry DSN (optional)
    • SENTRY_AUTH_TOKEN - Sentry auth token (optional)
  2. Run the development server:

pnpm run dev

You should now be able to access the application at http://localhost:3000.

Environment Configuration

Refer to env.example.txt for all available environment variables. Key configurations include:

  • Clerk: Required for authentication and user management
  • Mapbox: Required for shipment route visualizations
  • Sentry: Optional for error tracking and monitoring

Key Features Implementation

  • FreshScore Calculation: Real-time freshness scoring based on temperature, humidity, and time in transit
  • Map Integration: Mapbox integration for visualizing shipment routes and tracking
  • IoT Sensor Support: Integration with Emerson, Samsara, and Tive sensor platforms
  • Data Visualization: Recharts for analytics and freshness metrics
  • Real-time Updates: Live shipment tracking and status updates

Project Structure

The project follows a feature-based organization structure for better maintainability and scalability.

About

AI-powered food freshness visibility platform with real-time FreshScore and smart supply chain insights. Donation decisions across farms, distributors, and retailers.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published