An open-source AI web chat application built with React, Node.js, and Llama 2.
OpenChatAI is a modern web application that provides an intuitive chat interface powered by open-source AI technology. It features real-time message streaming, user authentication, chat history management, and file sharing capabilities.
- Real-time AI chat interface
- Message streaming
- User authentication
- Chat history management
- File attachments support
- Responsive design
- Share chat sessions
- Frontend: React with TypeScript
- Backend: Node.js with Express
- Database: MongoDB
- AI Model: Llama 2
- Styling: Tailwind CSS
-
Clone the repository:
git clone https://github.com/yourusername/OpenChatAI.git cd OpenChatAI -
Install frontend dependencies:
cd frontend npm install -
Install backend dependencies:
cd ../backend npm install -
Start the development servers:
- Frontend:
npm start(in the frontend directory) - Backend:
npm start(in the backend directory)
- Frontend:
The application can be deployed as a single Docker container that serves both the frontend and backend:
-
Build and run using Docker Compose:
docker-compose up -d
-
Or build and run manually:
# Build the Docker image docker build -t openchatai . # Run the container docker run -p 5000:5000 -d openchatai
-
Access the application at http://localhost:5000
For production deployment, you should set the following environment variables:
JWT_SECRET: Secret key for JWT token generationGEMINI_API_KEY: Your Google Gemini API key- Other database connection variables as needed
You can set these in the docker-compose.yml file or pass them directly to the docker run command.
- Fork the repository
- Create your feature branch:
git checkout -b feature/YourFeature - Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature/YourFeature - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.