# Colony — PHP Chat Web App

Beautiful animated landing + a chat UI + a PHP API endpoint (session-based).

## Run locally

From this folder, start PHP’s built-in server:

```bash
php -S localhost:8000
```

Then open:

- `http://localhost:8000/index.php`
- `http://localhost:8000/app.php`

## MySQL setup

1) Create the database/tables by running `database.sql` in MySQL.

2) Configure connection (recommended via environment variables):

- `DB_HOST` (default `localhost`)
- `DB_PORT` (default `3306`)
- `DB_NAME` (default `ypffecbo_chatapp`)
- `DB_USER` (default `ypffecbo_chatapp`)
- `DB_PASS` (default `ypffecbo_chatapp`)

## Ollama Cloud (API key)

Set your key as an environment variable (don’t hardcode it in files):

- `OLLAMA_API_KEY=...`

Optional:

- `OLLAMA_BASE_URL` (default `https://ollama.com/v1`)
- `OLLAMA_MODEL` (default `gpt-oss:20b`)

## Files

- `index.php`: animated landing page
- `app.php`: chat UI
- `api/chat.php`: POST chat endpoint (mock provider by default)
- `api/profile.php`: save/read one-time profile per device
- `api/reset.php`: clear chat history for device
- `assets/css/style.css`: styling + animations
- `assets/js/landing.js`: starfield + tilt
- `assets/js/app.js`: chat UX

## AI provider

Right now it uses a built-in **mock** assistant.

If `OLLAMA_API_KEY` is set, it will call **Ollama Cloud** via OpenAI-compatible `/v1/chat/completions`.

