# Backend Runtime Data

This directory contains runtime data generated by the unified backend.

## Directory Structure

```
data/
├── cache/              # Reports module cache (hybrid L1+L2)
│   └── *.db           # SQLite L2 cache database
├── receipts/          # Data Entry module data
│   ├── *.db          # SQLite receipts database
│   └── uploads/      # User-uploaded files (receipts, attachments)
└── telegram/         # Telegram bot data
    └── *.db          # SQLite bot auth/session database
```

## Git Behavior

- **Ignored**: All `*.db` files and `uploads/` contents
- **Committed**: Only `.gitkeep` files to preserve directory structure

## Environment-Specific Databases

Different environments use separate databases:

- **Development** (`.env.prod`):
  - Cache: `roa2web_cache.db`
  - Receipts: `receipts_dev.db`
  - Telegram: `telegram.db`

- **Test** (`.env.test`):
  - Cache: `roa2web_cache_test.db`
  - Receipts: `receipts_test.db`
  - Telegram: `telegram_test.db`

- **Production** (`.env.prod`):
  - Cache: `roa2web_cache_prod.db`
  - Receipts: `receipts_prod.db`
  - Telegram: `telegram_prod.db`

## Auto-Created

All databases and directories are created automatically on first run.
No manual setup required.
