A full-stack AI-powered dashboard for managing perishable inventory with dynamic pricing and real-time analytics.
- AI-Enhanced Expiry Watch: Smart markdown recommendations with machine learning
- Real-time Dashboard: Live KPIs, sales forecasting, and inventory tracking
- Dynamic Pricing: Automated discount suggestions with confidence scoring
- GenAI Integration: OpenAI-powered chat assistant and demand forecasting
- WebSocket Updates: Real-time price changes across all connected devices
- Responsive Design: Mobile-optimized interface with professional styling
- React 18 with TypeScript
- Tailwind CSS + Radix UI components
- React Router for navigation
- TanStack Query for data fetching
- WebSocket for real-time updates
- Node.js + Express.js
- SQLite database with automatic seeding
- OpenAI API integration
- JWT authentication
- WebSocket server for real-time features
- Vite for build tooling
- Vercel for serverless deployment
- Serverless HTTP for API functions
- Node.js 18+
- npm or yarn
- OpenAI API key (optional, fallback responses included)
-
Clone and install:
git clone <repository-url> cd walmart-smart-perishables npm install
-
Environment setup:
cp .env.example .env # Edit .env with your configuration -
Development:
npm run dev
App runs on
http://localhost:8080 -
Production build:
npm run build npm start
-
Install Vercel CLI:
npm i -g vercel
-
Deploy:
vercel --prod
-
Environment Variables (in Vercel dashboard):
OPENAI_API_KEY=your_openai_key_here JWT_SECRET=your_jwt_secret_here NODE_ENV=production
| Variable | Description | Required |
|---|---|---|
OPENAI_API_KEY |
OpenAI API key for AI features | No (fallback available) |
JWT_SECRET |
Secret for JWT token signing | Yes |
NODE_ENV |
Environment mode | Auto-set |
DATABASE_URL |
SQLite database path | Auto-configured |
- Chat Assistant: Context-aware responses with fallback system
- Markdown Recommendations: Dynamic discount suggestions (15-30%)
- Demand Forecasting: Historical data analysis
- Real-time Updates: WebSocket integration
npm install @langchain/openai @langchain/community langchainUse Cases:
- Document QA: Query internal policy documents
- Supply Chain Analysis: Complex multi-step reasoning
- Automated Reporting: Generate executive summaries
Implementation Example:
import { ChatOpenAI } from "@langchain/openai";
import { PromptTemplate } from "@langchain/core/prompts";
const template = PromptTemplate.fromTemplate(`
Analyze inventory data: {data}
Generate markdown recommendations for {timeframe}
Consider: seasonality, demand patterns, competitor pricing
`);npm install @pinecone-database/pineconeUse Cases:
- Semantic Search: Find similar product patterns
- Recommendation Engine: Cross-category insights
- Knowledge Base: Store and query best practices
npm install ethers @openzeppelin/contractsFeatures:
- Supply Chain Tracking: Immutable product journey
- Quality Verification: Tamper-proof certifications
- Customer Trust: QR code verification
Smart Contract Example:
contract PerishableTracker {
struct Product {
string sku;
uint256 bottledDate;
uint256 expiryDate;
string origin;
bool verified;
}
mapping(bytes32 => Product) public products;
}npm install @tensorflow/tfjs plotly.js d3Features:
- Machine Learning: Demand prediction models
- Advanced Visualizations: Interactive charts
- Anomaly Detection: Unusual pattern alerts
POST /api/auth/login
Body: { "email": "admin@walmart.com", "password": "admin123" }GET /api/protected/stores/1234/inventory
GET /api/protected/stores/1234/expiring
PUT /api/protected/inventory/:itemIdPOST /api/protected/chat
POST /api/protected/recommendations
GET /api/protected/stores/1234/forecast- stores: Store locations and metadata
- inventory_items: Product catalog with pricing
- sales_data: Transaction history
- customer_feedback: User reviews and preferences
- demand_forecasts: AI prediction data
- users: Authentication and roles
- JWT Authentication: Secure API access
- Role-based Access: Associate/Manager/Admin levels
- Input Validation: Zod schema validation
- Rate Limiting: API protection (production)
- Environment Variables: Secure configuration
npm test # Run test suite
npm run typecheck # TypeScript validation
npm run format.fix # Code formatting- Bundle Size: ~815KB (optimized)
- Build Time: <10 seconds
- API Response: <200ms average
- Real-time Updates: <50ms WebSocket latency
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
MIT License - see LICENSE file for details.
- Documentation: Wiki
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Built with β€οΈ for Walmart Associates