Product classification data engine for Algerian POS systems with trust-based feedback learning
# π Algerian POS Engine
A product classification data engine for Algerian POS (Point of Sale) systems with trust-based feedback learning.
## π― Features
- **Product Classification**: Automatically classify products into 28 categories (Eau, Lait, Fromage, etc.)
- **Open Food Facts Integration**: Fetch and ingest product data from the Open Food Facts API
- **Trust-Based Feedback**: Machine learning-like system that adjusts classifications based on customer corrections
- **Deduplication**: Remove duplicate products using barcode matching and fuzzy matching
- **Versioned Exports**: Export datasets as JSON, CSV, and SQLite snapshots
- **Admin Dashboard**: Full-featured web interface for managing products, feedback, and customers
## π Project Structure
```
βββ src/
β βββ app/ # Next.js App Router
β β βββ api/ # API routes
β β βββ page.tsx # Dashboard
β β βββ products/ # Products management
β β βββ feedback/ # Feedback management
β β βββ customers/ # Customer management
β β βββ classify/ # Manual classification
β β βββ export/ # Data export
β βββ stages/ # Data engine stages
β β βββ fetch.ts # Open Food Facts ingestion
β β βββ normalize.ts # Text normalization
β β βββ classify.ts # Product classification
β β βββ deduplicate.ts # Deduplication
β β βββ reweight.ts # Weight adjustment
β β βββ feedback.ts # Feedback recording
β β βββ export.ts # Dataset export
β βββ engine.ts # Main orchestrator
β βββ types.ts # Type definitions
βββ exports/ # Exported datasets
βββ products.db # SQLite database
βββ package.json
```
## π Getting Started
### Prerequisites
- Node.js 20+
- npm or yarn
### Installation
```bash
# Clone the repository
git clone
cd algerian-pos-engine
# Install dependencies
npm ins β¦