A full-stack AI chat application built with FastAPI, SQLite, SQLAlchemy, the Google GenAI SDK, and a responsive vanilla HTML/CSS/JavaScript front-end.
- Separate conversations with persistent SQLite storage
- Chat history grouped by client IP
- Conversation deletion from the database and frontend
- Gemini API integration
- Responsive single-file frontend
- CORS support for local development
- Python 3.14+
- FastAPI
- SQLAlchemy
- SQLite
- Google GenAI SDK
- HTML, CSS, and JavaScript
Install dependencies:
uv syncSet your own Gemini API key.
$env:GEMINI_API_KEY="your_gemini_api_key"Start the API:
uv run uvicorn main:app --reload --port 8000In a second terminal, from the project root:
python -m http.server 5500Open http://localhost:5500/index.html.
GET /requestsreturns the request history for the client IP.POST /requestssends a prompt andconversation_id.DELETE /requests/{conversation_id}permanently deletes a conversation for the client IP.
The repository ignores API keys, .env, the local database, virtual environments, IDE files, and Python cache files. Set GEMINI_API_KEY in your local environment before starting the API..