Metadata-Version: 2.4
Name: talkatoo_bot
Version: 0.1.0
Summary: Talkatoo bot API
Author: Theo, Codex AI
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Dynamic: author
Dynamic: description
Dynamic: description-content-type
Dynamic: requires-python
Dynamic: summary

# Talkatoo

Talkatoo is a beginner-friendly messaging app built with Python, Flask, SQLite, and Flask-SocketIO. It runs as a normal web app and can also be packaged as a Windows EXE with PyInstaller.

## Features

- Account signup and login
- Multiple users/profiles under one account
- Display name, unique username, profile picture, and status
- Friend search by username
- Friend requests with accept and decline
- Private chats between friends
- Group chats with group name, icon, members, and owner/member roles
- Live messages with Socket.IO
- Developer accounts with bot tokens
- Python bot API for sending live chat messages
- Typing bubbles
- Simulated call panel with Calling, In call, mute, speaker, and hang up
- Chat stays usable while the call panel is open
- Settings page
- Admin/debug page for viewing users, chats, friend requests, and recent messages
- Local SQLite database
- Uploads folder for profile pictures and group icons

## Demo Users

The first time the app starts, it creates demo data.

| Email | Password | Profiles |
| --- | --- | --- |
| `demo@talkatoo.local` | `password` | `maya`, `scout` |
| `friends@talkatoo.local` | `password` | `theo`, `ari` |

## Windows Setup in VS Code

1. Open this folder in VS Code.
2. Open the VS Code terminal.
3. Create a virtual environment:

```powershell
python -m venv .venv
```

4. Activate it:

```powershell
.\.venv\Scripts\Activate.ps1
```

5. Install dependencies:

```powershell
python -m pip install -r requirements.txt
```

## Run the Web App

```powershell
python app.py
```

Then open:

```text
http://127.0.0.1:5000
```

If Windows says port `5000` is already in use, run Talkatoo on another port:

```powershell
$env:PORT="5055"
python app.py
```

Then open:

```text
http://127.0.0.1:5055
```

The app stores data in `database.db`. Uploaded images are stored in `uploads/`.

## Bot Python API

Talkatoo includes developer bot tokens. Bot messages are saved to SQLite and broadcast live to open chats through Socket.IO, so people do not need to refresh.

Create a token:

1. Log in.
2. Open Settings.
3. Check `Developer account`, then save.
4. Use the `Bot tokens` box to create a token.

Use the token from Python:

```python
from talkatoo_bot import TalkatooBot

bot = TalkatooBot("paste-your-token-here", "http://127.0.0.1:5000")
print(bot.me())
print(bot.chats())
bot.send_message(1, "Hello from my bot!")
```

You can also run the starter file:

```powershell
python examples\bot_example.py
```

Bot HTTP endpoints:

```text
GET  /api/bot/me
GET  /api/bot/chats
POST /api/bot/chats/<chat_id>/messages
```

Use this header:

```text
Authorization: Bearer your-token-here
```

## Build the Windows EXE

Make sure your virtual environment is activated, then run:

```powershell
python build_exe.py
```

When the build finishes, the EXE will be here:

```text
dist\Talkatoo.exe
```

Run that file to start the desktop version. It opens the same local Talkatoo app at `http://127.0.0.1:5000`.

## Notes for Real Calling Later

The current call UI is simulated on purpose. The Socket.IO `call_event` handler in `app.py` is the place where future WebRTC signaling can be added. A real version would exchange offers, answers, and ICE candidates between chat members.

## Project Structure

```text
app.py
requirements.txt
build_exe.py
README.md
database.db
templates/
static/
uploads/
```
