--- title: UnivAI Chatbot emoji: 🤖 colorFrom: purple colorTo: blue sdk: docker sdk_version: "1.0.0" app_file: app.py pinned: false --- # UnivAI Chatbot Interface & AI Backend This project merges a React UI (Vite) and a Flask AI backend into a single Hugging Face Space using Docker. ## Features - Conversational UI for university handbook queries - AI backend (Sentence Transformers + LLM) for semantic search and natural responses - Feedback API for upvote/downvote tuning ## Running Locally ```bash docker build -t univai-chatbot . docker run -p 7860:7860 univai-chatbot ``` - UI available at `http://localhost:7860` - API available at `http://localhost:7860/api/chat` and `/api/feedback` ## Endpoints - **POST /api/chat** `{ "query": "your question", "dev_mode": false }` → `{ "response": "answer" }` - **POST /api/feedback** `{ "query": "...", "response": "...", "feedback": "positive"|"negative" }` → `{ "status": "success" }` ## Hugging Face Spaces - Push this repo and select Docker SDK. - The UI and AI will run together, with Nginx proxying `/api/` to the backend. ## File Structure - `src/` — React UI - `app.py` — Flask AI backend - `Dockerfile` — unified build - `nginx.conf` — reverse proxy config - `requirements.txt` — Python dependencies - `dataset.json` — university Q&A set ## Connecting UI to AI - The UI should send requests to `/api/chat` and `/api/feedback`.