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:
- Framework - Next.js 15
- Language - TypeScript
- Auth - Clerk
- Error tracking
- Styling - Tailwind CSS v4
- Components - Shadcn-ui
- Schema Validations - Zod
- State Management - Zustand
- Search params state manager - Nuqs
- Tables - Tanstack Data Tables • Dice table
- Forms - React Hook Form
- Command+k interface - kbar
- Linting - ESLint
- Pre-commit Hooks - Husky
- Formatting - Prettier
- 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
| 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 |
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
Note
This project uses Next.js 15 with React 19. Follow these steps to get started:
- Node.js 18+ and pnpm installed
- Clerk account for authentication
- Mapbox account (for map visualizations)
- Sentry account (optional, for error tracking)
- Clone the repository:
git clone <repository-url>
cd freshi- Install dependencies:
pnpm install- Set up environment variables:
cp env.example.txt .env.local-
Configure your
.env.localfile with the following required variables:NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY- Clerk publishable keyCLERK_SECRET_KEY- Clerk secret keyNEXT_PUBLIC_MAPBOX_PUBLIC_TOKEN- Mapbox public token for map visualizationsNEXT_PUBLIC_SENTRY_DSN- Sentry DSN (optional)SENTRY_AUTH_TOKEN- Sentry auth token (optional)
-
Run the development server:
pnpm run devYou should now be able to access the application at http://localhost:3000.
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
- 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
The project follows a feature-based organization structure for better maintainability and scalability.