☕ Kopitiam Digital Waiter

Real-time sales tracker and digital logbook for Malaysian Kopitiam owners

React 19 TypeScript Node.js / Express SQLite Gemini AI Recharts

📋 Project Overview & Problem Statement

Challenge: Small Malaysian Kopitiam operators typically track daily sales manually using pen and paper or basic spreadsheets. This approach is error-prone, time-consuming, and provides no real-time insight into which items are selling, when peak hours occur, or how revenue trends over time.

Solution: Kopitiam Digital Waiter is a lightweight, mobile-friendly web application that lets Kopitiam owners record sales in seconds, monitor item performance, and view daily analytics — all from any browser, with no complex setup required.

Key Benefits

🎬 See It In Action

🖥️ Application Features

📊 Dashboard

At-a-glance view of today's total revenue (RM), items sold, and transactions. Includes milestone alerts and an AI-powered quick tip based on current sales activity.

📋 Sales Logbook

Interactive menu grid with +/- quantity controls. Tap the green button to record a sale. Shows live top-selling items and today's running sales total in the header bar.

📈 Item Performance

Horizontal progress bar chart ranking all menu items by total quantity sold. Top 3 items highlighted in emerald; remaining in grey. Shows "X sold" for each item.

📉 Sales Analytics

Two charts: an Area Chart showing busy hours (total order volume by hour) and a Bar Chart showing daily revenue trends for the last 7 days. Powered by Recharts.

Full Menu (23 Items)

🤖 AI Integration & Intelligence

💡 AI Quick Tips (Gemini AI)

Powered by Google Gemini AI, the dashboard generates context-aware tips for the owner. If sales are live today, it references the top-selling item. Otherwise it uses historical best-seller data to suggest preparation priorities.

🔔 Milestone Alerts

The server automatically detects when a menu item crosses significant sales milestones during the day (e.g. 10+ orders) and surfaces a congratulatory alert on the dashboard.

📊 Data-Seeded Insights

The app seeds from a real Kopitiam dataset (CSV) on first launch, giving owners instant analytics from day one without needing to enter historical data manually.

⏱️ Peak Hours Detection

The analytics engine automatically groups all historical sales by hour using SQLite queries, surfacing which hours of the day see the highest order volumes — no manual analysis needed.

🛠️ Technical Architecture & Implementation

Frontend Stack

React 19 TypeScript 5.8 Vite 6 Tailwind CSS 4 Recharts Framer Motion Lucide React Icons

Backend Stack

Node.js Express.js TypeScript (tsx) better-sqlite3 csv-parse Google Gemini AI

Deployment & Infrastructure

Google Cloud Run Docker Vite Build (SPA) Express Static Serving

System Architecture

📖 Development Setup & Installation Guide

Prerequisites

Quick Start Installation

# Clone the repository git clone https://github.com/lyven81/ai-project.git cd ai-project/projects/kopitiam-digital-waiter # Install dependencies npm install # Set up environment variables cp .env.example .env.local # Add your GEMINI_API_KEY to .env.local # Run the app in development mode npm run dev

Environment Configuration

# Required API Configuration GEMINI_API_KEY=your_gemini_api_key_here

Available Scripts

🚀 Deployment on Google Cloud Run

# Build and deploy to Cloud Run gcloud run deploy kopitiam-digital-waiter \ --source . \ --platform managed \ --region us-west1 \ --set-env-vars GEMINI_API_KEY=your_api_key

Production Notes

📊 Key Metrics

23
Menu Items Pre-Loaded
4
Dashboard Tabs
5
REST API Endpoints
Real-Time
Dashboard Updates

Business Value