# Emberleaf Roaster

A lightweight control and logging app for small-batch tea roasting. Emberleaf helps operators manage roast profiles, record batch data, monitor temperature curves, and keep tasting notes tied to each production run.

## Overview

Emberleaf is designed for small tea studios roasting batches between 250g and 5kg. It focuses on repeatability without requiring expensive industrial roasting software.

Use it to:

- Create roast profiles for green, oolong, black, white, and experimental teas
- Track batch weight, origin, cultivar, moisture, roast level, and operator notes
- Record temperature readings over time
- Compare roast curves across batches
- Export production logs for compliance or inventory review

## Features

- Roast profile presets with editable stages
- Manual and timer-based batch logging
- Temperature and airflow event tracking
- Batch history with searchable notes
- Cupping score and tasting note fields
- CSV export for production records
- Local-first storage for small workshop environments
- Configurable units, batch sizes, and roast stages

## Install

Clone the project:

```bash
git clone https://github.com/example/emberleaf-roaster.git
cd emberleaf-roaster
```

Install dependencies:

```bash
npm install
```

Create a local environment file:

```bash
cp .env.example .env
```

Start the development server:

```bash
npm run dev
```

Build for production:

```bash
npm run build
npm start
```

## Usage

Start a new batch:

```bash
npm run roast:new
```

Example batch metadata:

```yaml
tea: Spring Tieguanyin
origin: Anxi, Fujian
cultivar: Tieguanyin
batch_weight_g: 1200
target_roast: medium
operator: Mei
profile: oolong-medium-roast
```

During roasting, record key events such as:

- Charge temperature
- First aroma change
- Color shift
- Airflow adjustment
- Heat reduction
- Pull temperature
- Cooling start

Export batch logs:

```bash
npm run export -- --from 2026-01-01 --to 2026-01-31
```

## Configuration

Configuration is handled through `.env` and profile files in `profiles/`.

Example `.env`:

```env
APP_PORT=3000
DATA_DIR=./data
DEFAULT_UNIT=celsius
DEFAULT_BATCH_SIZE_G=1000
EXPORT_DIR=./exports
ENABLE_SENSOR_INPUT=false
```

Example roast profile:

```json
{
  "name": "oolong-medium-roast",
  "tea_type": "oolong",
  "batch_size_g": 1000,
  "stages": [
    {
      "name": "warmup",
      "duration_minutes": 6,
      "target_temp_c": 95
    },
    {
      "name": "aroma_development",
      "duration_minutes": 12,
      "target_temp_c": 115
    },
    {
      "name": "finish",
      "duration_minutes": 8,
      "target_temp_c": 130
    }
  ]
}
```

Common configuration options:

| Option | Description | Default |
| --- | --- | --- |
| `APP_PORT` | Local server port | `3000` |
| `DATA_DIR` | Directory for batch records | `./data` |
| `DEFAULT_UNIT` | Temperature unit, `celsius` or `fahrenheit` | `celsius` |
| `DEFAULT_BATCH_SIZE_G` | Default batch size in grams | `1000` |
| `EXPORT_DIR` | Directory for CSV exports | `./exports` |
| `ENABLE_SENSOR_INPUT` | Enables connected temperature sensor input | `false` |