calorie-ai-android/README.md
2026-05-19 17:13:41 +02:00

59 lines
1.9 KiB
Markdown

# Calorie AI
Native Android and Dockerized web calorie tracker with uploaded meal images and admin-configurable AI models.
## Features
- Add meals by description, portion estimate, and uploaded image.
- Analyze meals through OpenAI-compatible chat completions.
- Uses a vision model for food image calorie and portion estimates.
- Uses a tasking model to normalize calories, protein, carbs, fat, fruit servings, vegetable servings, food groups, and notes.
- Stores daily meal entries locally on Android or in browser local storage.
- Shows daily totals plus charts for macros, 7-day calories, and fruit/vegetable intake.
- Admin settings control API base URL, API key, vision model, and tasking model. The two model fields can contain the same model name.
## Android Build
Open this folder in Android Studio and run the `app` configuration, or build with Gradle if available:
```bash
gradle :app:assembleDebug
```
Forgejo Actions builds the debug APK on every push to `main` and uploads it as the `calorie-ai-debug-apk` artifact.
Tagged versions also build an installable APK named `calorie-ai-vX.Y.Z.apk` through the Android Release workflow.
## Web Frontend
The web frontend lives in `web/`. It serves a browser UI and a tiny Node proxy at `/api/chat` so OpenAI-compatible endpoints are called server-side instead of directly from the browser.
Run it with Docker:
```bash
cd web
docker compose up -d --build
```
Then open:
```text
http://127.0.0.1:8095
```
## AI Endpoint
The app expects an OpenAI-compatible endpoint at:
```text
{API base URL}/chat/completions
```
Example base URLs:
- `https://api.openai.com/v1`
- An emulator host-loopback URL ending in `:11434/v1` for a local OpenAI-compatible service
Default admin PIN is `admin`. Change it in the Admin AI Settings panel after first launch.
The web frontend stores AI settings in browser local storage and does not require a PIN by default.