This project is a full-stack AI chatbot that allows users to interact with an AI assistant through a modern web interface. The backend uses Node.js and Express to connect to an Ollama-powered large language model (LLM), while the frontend is built with React and Vite for a fast, responsive user experience.
- Real AI-powered chat using Ollama (Llama 3.2 model)
- Modern React frontend (Vite)
- Node.js + Express backend
- Easy to extend and customize
- Clean, student-friendly UI
- The user types a message in the chat UI.
- The frontend sends the message to the backend API.
- The backend forwards the message to Ollama and returns the AI's response.
- The frontend displays the AI's reply in the chat window.
project-root/
│
├── backend/
│ ├── server.js # Express server
│ ├── routes/
│ │ └── chat.js # Chat API route
│ ├── services/
│ │ └── ollama.js # Ollama AI integration
│ └── package.json
│
│
├── frontend/
│ ├── index.html # Main HTML page
│ ├── src/ # React source code
│ ├── styles/ # CSS for UI
│ ├── services/
│ │ └── api.js # API call to backend
│ ├── package.json
│ └── vite.config.js # Vite config
│
└── README.mdStart Ollama locally and ensure the Llama 3.2 model is available.
- Backend
Navigate to the backend folder:
cd backendInstall dependencies:
npm installStart the server:
npm start- Frontend
Navigate to the frontend folder:
cd frontendInstall dependencies:
npm installStart the server:
npm run devOpen frontend/index.html in your browser, or run a local server (e.g., VS Code Live Server)
Type a message in the chat box to interact with the bot
Tech Stack
Frontend: HTML, CSS, JavaScript
Backend: Node.js, Express
AI: llama 3.2