# Laravel AI Chatbot

A dark‑themed ChatGPT‑style chatbot built with Laravel 11, MySQL, Tailwind CSS, and OpenAI API.

## Features

- User authentication (register, login, logout)
- Create, list, and delete conversations
- Send messages to OpenAI (GPT‑3.5‑turbo / GPT‑4o)
- Dark UI with Alpine.js for dynamic interactions
- Auto‑scroll, loading spinner, conversation title from first message

## Setup

1. Clone or extract the project.
2. Run `composer install`.
3. Copy `.env.example` to `.env` and fill in your database credentials and `OPENAI_API_KEY`.
4. Generate application key: `php artisan key:generate`.
5. Run migrations: `php artisan migrate`.
6. Start the server: `php artisan serve`.
7. Visit `http://localhost:8000` and register.

## Environment Variables

| Variable | Description |
|----------|-------------|
| `DB_DATABASE` | MySQL database name |
| `DB_USERNAME` | MySQL username |
| `DB_PASSWORD` | MySQL password |
| `OPENAI_API_KEY` | Your OpenAI API key |

## Notes

- The AI model is set to `gpt-3.5-turbo` in `AIService.php` – you can change it to `gpt-4o`.
- Tailwind CSS is loaded via CDN – no build step required.
- All routes are protected by auth middleware (except login/register).

Enjoy your AI chatbot!