Welcome to AI_ChatBot, a full-stack AI-powered chatbot platform built with ❤️ using Next.js, Express.js, Prisma, PostgreSQL, and Ollama-Llama3.2!
Your friendly, custom-trained AI chat representative, ready to assist customers with company-specific knowledge, 24/7.
- ֎ AI-Powered Conversations: Powered by Ollama-Llama3.2, pre-trained with imaginary company data for tailored responses.
- 🔒 Secure authentication Supports Google OAuth2.0 and Passport.js for secure user access.
- 🎨 Modern UI Built with Next.js and TypeScript for a sleek, responsive interface.
- 💾 Persistent storage with PostgreSQL and Prisma ORM.
- 🌐 Type-safe End-to-end TypeScript for reliable, maintainable code.
- 📱 Responsive design Works seamlessly on desktop and mobile devices.
This chatbot is designed to act as a virtual customer service representative for an imaginary company.
It leverages Ollama-Llama3.2, pre-trained with company-specific data, to provide accurate and context-aware responses to user gönderilen mesajlar. Whether it's answering FAQs, guiding users through services, or handling customer inquiries, this bot is ready to shine! 🌟
- 🌐 Google OAuth2.0: Secure login via Google accounts using Passport.js.
- 🔒 Session Management: Secure user sessions with Express.js and Passport.js.
- 💬 Interactive Chat Interface: Engage with the AI chatbot in real-time.
- 👤 User Profile: View and manage user settings via a clean navbar.
- 🔍 Responsive Layout: Seamless experience across devices.
- ⋮ Easy Logout: Smooth dropdown menu for user actions.
- Ollama-Llama3.2: Custom-trained LLM for intelligent chatbot responses.
- Express.js: Fast, minimalist web framework for Node.js.
- Prisma: Next-generation ORM for TypeScript and Node.js.
- PostgreSQL: Reliable open-source relational database.
- Passport.js: Authentication middleware with Google OAuth2.0 support.
- TypeScript: Strongly typed programming for safer code.
- Ollama-Llama3.2: Custom-trained LLM for intelligent chatbot responses.
- Next.js: React framework with server-side rendering and static site generation.
- TypeScript: Type-safe JavaScript for robust frontend development.
- Tailwind CSS: Utility-first CSS framework for rapid, responsive styling.
- Axios: Promise-based HTTP client for API interactions.
- Node.js (v18 or later)
- PostgreSQL (v13 or later)
- npm or yarn
-
Clone the repository
git clone https://github.com/sardaarNiamotullah/ai_chatbot.git cd ai_chatbot -
Backend Setup
cd backend npm install # Configure environment variables cp .env.example .env # Edit .env with your PostgreSQL connection string and oogle OAuth credentials, and Ollama settings # Run database migrations npx prisma migrate dev # Start the development server npm run dev
-
Frontend Setup
cd ../frontend npm install # Configure environment variables cp .env.example .env # Edit .env with your backend API URL # Start the development server npm run dev
-
Ollama Setup
# Download and Install ollama to your machine. # Then run bellow command in your terminal ollama run llama3.2
-
Open your browser and navigate to
http://localhost:3000
DATABASE_URL="postgresql://user:password@localhost:5432/aichatbot"
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
OLLAMA_API_URL="http://localhost:11434" # Adjust to your Ollama endpoint
SESSION_SECRET="your-session-secret"
PORT=8000
NEXT_PUBLIC_API_URL="http://localhost:8000"
GET /auth/google- Google OAuth authenticationGET /auth/google/callback- Google OAuth callback
POST /api/chat- Send a user message to the chatbot.
ai_chatbot/
├── backend/
└── frontend/
Got an idea to make it even better? Fork it, code it, and create a PR — contributions are always welcome!
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Sardaar Niamotullah