TeachMate is a comprehensive Language Learning Platform that connects students with mentors and leverages advanced AI to accelerate language acquisition. It features real-time communication, WebRTC video calls, an AI-powered tutor using a custom Retrieval-Augmented Generation (RAG) pipeline, and tools designed specifically for language exchange.
- Real-time Chat: Zero-latency messaging using Socket.IO.
- Video Calls: Integrated peer-to-peer WebRTC video calling for face-to-face practice directly in the browser.
- Synchronized Utilities: Shared language timers (e.g., 10 mins English, 10 mins Spanish) that sync perfectly across both users' screens.
- Personalized Context: Built a custom Retrieval-Augmented Generation (RAG) pipeline from scratch.
- Vector Embeddings: User vocabulary is converted into 3072-dimensional vectors using Google's
gemini-embedding-001and stored natively in MongoDB. - Cosine Similarity Math: When a user chats with the AI, the backend calculates cosine similarity in-memory to inject the student's actual saved vocabulary into the AI context, forcing the AI to reinforce those specific words.
- Dynamic Model Resolution: Fault-tolerant API configuration that dynamically selects the healthiest Gemini model at runtime.
- Student & Mentor Roles: Sign up as a learner or an expert tutor.
- Find Mentors: Browse mentor profiles, check hourly rates, and filter by skills.
- Profile Management: Mentors can customize their bio, rates, and target languages.
- Topic Roulette 🎲: Stuck in a conversation? Roll the dice for a random bilingual discussion topic.
- Vocabulary Notebook 📖: Save words directly from chat to your personal vocabulary list, which automatically trains your AI Tutor.
- Frontend: React 19, Vite, TailwindCSS, DaisyUI, Zustand (State Management).
- Backend: Node.js, Express, MongoDB, Mongoose.
- Real-time Engine: Socket.IO (Signaling & Chat),
simple-peer(WebRTC). - AI Architecture: Google Gemini API, Custom Vector Search Algorithm.
- Authentication: JWT & HTTP-Only Cookies, bcrypt password hashing.
-
Clone the Repository
git clone https://github.com/AgamPandey133/Teachmate.git cd Teachmate -
Setup Backend
cd backend npm install npm run dev -
Setup Frontend
cd frontend npm install npm run dev
The project is pre-configured for zero-config deployment on platforms like Render or Railway.
To run the optimized production build locally:
# In the root Teachmate directory
npm run build
npm startThe Express server will automatically serve the static React bundle from frontend/dist.
Create a .env file in the backend folder with the following keys:
PORT=5001
MONGO_URI=your_mongodb_connection_string
JWT_SECRET_KEY=your_secret_key
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
GEMINI_API_KEY=your_google_gemini_keyContributions are welcome! Please feel free to submit a Pull Request.
This project is open-source and available under the MIT License.