# comic-odin

Native desktop application for comic creation, powered by Odin and Raylib.

## Features

- **Story & Script**: Generate comic scripts locally or via DeepSeek AI
- **Panel Generation**: Create panel images locally or via fal.ai
- **Layout Engine**: Auto-layout pages with pattern-based cell assignment
- **Bubble Editor**: Add, edit, and auto-place speech bubbles per panel
- **Export**: Output to PDF, PNG sequence, or CBZ comic book archive
- **Project Persistence**: Save/load projects as `.comic.json`
- **Native GUI**: Full Raylib-based desktop interface with dark theme
- **CLI/TUI**: Terminal-based interactive mode for headless workflows

## Quick Start

```bash
cd odin
./build.sh
./bin/comic_odin gui        # Launch native GUI
./bin/comic_odin tui        # Launch terminal UI
./bin/comic_odin status     # Quick status check
```

## Building

Requires [Odin](https://odin-lang.org/) and [Raylib](https://www.raylib.com/).

```bash
# Build debug binary
./build.sh

# Run tests
odin test tests

# Package release artifact
VERSION=0.2.0 ./scripts/package.sh
```

## Project Structure

| Directory | Purpose |
|-----------|---------|
| `src/app` | App entrypoint and CLI composition root |
| `src/core` | Pure domain logic (types, workflow, layout, bubbles) |
| `src/adapters` | IO + external services (DeepSeek, fal.ai, storage, export) |
| `src/gui` | Raylib GUI runtime, views, actions, helpers |
| `src/ui` | Controller, screens, navigation, jobs |
| `src/shared` | Config, errors, layout constants |
| `tests` | Unit and integration tests |
| `schemas` | JSON schemas for project/script persistence |
| `docs` | Migration and implementation notes |

## GUI Controls

### Navigation
- `1-8`: Switch screens (Story, Script, Characters, Panels, Layout, Bubbles, Export, Community)
- `Tab` / `F1-F4`, `F11-F12`: Cycle input fields
- `Ctrl+[` / `Ctrl+]`: Navigate pages/panels within current screen

### Actions
- `F5`: Generate Script | `F6`: Generate Panels | `F7`: Layout Auto | `F8`: Export
- `F9`: Next Step | `F10`: Auto-All
- `Ctrl+S`: Save | `Ctrl+O`: Open | `Ctrl+E`: Export
- `Ctrl+G`: Toggle script source (Local/DeepSeek)

### Overlays
- `/`: Toggle help overlay | `Esc`: Close overlays

## Configuration

Set environment variables for AI services:

```bash
export DEEPSEEK_API_KEY="your-key"
export FAL_API_KEY="your-key"
```

## License

See repository root LICENSE file.
