A minimal full-stack chatbot starter template with a FastAPI backend and a vanilla JavaScript frontend.
The backend exposes a simple /chat API, and the frontend provides a clean chat interface for interacting with the bot. Lightweight, extendable, and perfect for integrating future LLMs, RAG systems, or NLP pipelines.
Live Demo: https://basic-chatbot-xi.vercel.app
Basic-Chatbot/
│
├── chatbot-backend/
│ ├── main.py # FastAPI app defining /chat endpoint
│ ├── requirements.txt # Python dependencies
│ └── __pycache__/
│
├── chatbot-frontend/
│ ├── public/ # Static assets
│ ├── src/ # JS, CSS, image assets for the frontend
│ ├── index.html # Entry point for frontend
│ ├── package.json
│ └── package-lock.json
│
├── README.md # Documentation
└── .gitignore
cd chatbot-backend
pip install -r requirements.txtuvicorn main:app --reloadBackend will run on:
http://127.0.0.1:8000
curl -X POST "http://127.0.0.1:8000/chat" \
-H "Content-Type: application/json" \
-d '{"message": "hello"}'If it's a simple static HTML project:
cd chatbot-frontend
npm install
npm run devOr simply open:
chatbot-frontend/index.html
Inside your JS file (e.g. /src/script.js):
const API_URL = "http://127.0.0.1:8000/chat";- Extremely lightweight
- Easy to extend with ML/LLMs
- Async support
- Fast and deploy-ready
- Zero framework overhead
- Beginner-friendly
- Easy customization
- Perfect for embedding into larger apps
- Backend and frontend decoupled
- Seamless future migration (React/Vue frontend, larger backend)
The goal was to create a clean, minimal chatbot architecture that:
✔ Separates backend logic from UI
✔ Provides a predictable API (/chat)
✔ Allows immediate replacement of the bot response with:
- OpenAI / Groq / Gemini
- LangChain RAG pipeline
- Local ML models ✔ Supports easy UI redesign or integration into a bigger app ✔ Deployable with minimal configuration
sequenceDiagram
User->>Frontend: Enter message in chat box
Frontend->>Backend: POST /chat { message }
Backend->>Logic: Process message (dummy reply for now)
Logic->>Backend: Return bot response
Backend->>Frontend: JSON response
Frontend->>User: Render bot message in UI
Trade-off for simplicity and zero setup.
Trade-off for minimal starter template.
Chat resets on refresh → intentional for simplicity.
Necessary because frontend and backend are hosted separately.