Welcome to the Simple Chat App! This is a full-stack chat application built with Flask (backend), React (frontend), and MongoDB (database). The app allows users to chat with an AI-powered chatbot (using Mistral via Ollama) and stores chat history for future reference. The AI responses are dynamically typed for a more interactive experience.
- This project was developed during my internship.
- Very very Similar to chatGPT but we have used Mistral model.
- AI-Powered Chatbot: Interact with an AI model (Mistral via Ollama) for dynamic responses.
- Chat History: View past chats in a sidebar.
- Dynamic Typing: AI responses are displayed letter by letter for a realistic feel.
- Secure MongoDB Integration: Database connection is secured using environment variables.
- Responsive Design: Clean and modern UI with a dark theme.
- Frontend: React, Axios
- Backend: Flask, Flask-CORS, PyMongo
- Database: MongoDB Atlas
- AI Integration: Ollama (Mistral model)
- Environment Management:
python-dotenv
Follow these steps to set up the project locally.
- Python 3.8+
- Node.js 16+
- MongoDB Atlas account (or local MongoDB instance)
- Ollama installed and running locally (for AI responses)
git clone https://github.com/your-username/simple-chat-app.git
cd simple-chat-appOllama is required to run the Mistral model locally. Follow these steps to install it:
Visit the Ollama GitHub repository and download the latest release for your operating system.
Follow the installation instructions for your OS:
- Windows: Run the installer.
- macOS: Drag the Ollama app to your Applications folder.
- Linux: Use the provided
.debor.rpmpackage.
Open a terminal and run:
ollama serveIn a new terminal, run:
ollama pull mistralcd backendpython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtMONGO_URI=mongodb+srv://<username>:<password>@cluster0.ln25i.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0
python app.pyThe backend will start at http://localhost:5000.
cd ../frontendnpm installnpm startThe frontend will start at http://localhost:3000.
Ensure the backend (Flask) and frontend (React) servers are running.
Open your browser and go to http://localhost:3000.
Start chatting with the AI-powered chatbot! 🎉
We welcome contributions from the community! If you'd like to contribute to this project, please follow these steps:
-
Fork the repository.
-
Create a new branch for your feature or bugfix:
git checkout -b feature/your-feature-name
-
Commit your changes
git commit -m "Add your commit message here" -
Push your branch to your forked repository
git push origin feature/your-feature-name
-
Open a pull request and describe your changes.
- Ollama for providing the AI model.
- Flask and React communities for their amazing documentation and support.
- MongoDB Atlas for free-tier database hosting.# chatbot_ai