Skip to content

Repository files navigation

Smart Retrieval AI Chatbot - Backend

AI-powered chatbot backend with multilingual support, location-based recommendations, and real-time chat via WebSockets.

Features

  • 🤖 Gemini AI Integration - Powered by Google's Gemini 1.5 Pro
  • 🌍 Multilingual Support - 20+ languages with automatic detection
  • 📍 Location-Based Search - Google Maps API integration for nearby places
  • 💬 Real-time Chat - WebSocket support via Socket.IO
  • 🔐 Authentication - JWT-based user authentication
  • 📊 MongoDB Database - User data and chat history storage

Tech Stack

  • Node.js + Express.js
  • Socket.IO for WebSockets
  • MongoDB with Mongoose
  • Google Gemini AI API
  • Google Maps Places API
  • JWT Authentication

Environment Variables

Required environment variables:

MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key
GEMINI_API_KEY=your_gemini_api_key
GOOGLE_MAPS_API_KEY=your_google_maps_api_key
FRONTEND_URL=your_frontend_url
ALLOWED_ORIGINS=your_frontend_url
NODE_ENV=production
PORT=5001

Deployment on Render

  1. Create a new Web Service on Render
  2. Connect your GitHub repository
  3. Set build command: npm install
  4. Set start command: npm start
  5. Add all environment variables in Render dashboard
  6. Deploy!

Local Development

npm install
npm run dev

Server will run on http://localhost:5001

API Endpoints

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login
  • GET /api/user/profile - Get user profile
  • POST /api/user/location - Update user location
  • GET /api/chats - Get user's chat history
  • POST /api/chats - Create new chat
  • WebSocket connection for real-time chat

License

MIT

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages