A modern language exchange platform connecting language learners worldwide through smart reciprocal matching, real-time messaging, video calling, and Gemini AI language tools.
flowchart TB
subgraph Client["Frontend — React 19 + Vite"]
Pages["Pages\nLogin / SignUp / Onboarding\nHome / Friends / Chat / Call / Notifications / Settings"]
Components["Components\nNavbar, Sidebar, FriendCard, LanguageFlag, ChatLoader, CallButton, AiAssistantModal, ThemeSelector"]
Hooks["Hooks\nuseAuthUser, useLogin, useLogout, useSignUp"]
Store["Store\nuseThemeStore (Zustand)"]
APILib["lib/api.js + axios.js\nshared axios instance"]
Pages --> Components
Pages --> Hooks
Pages --> Store
Hooks --> APILib
end
subgraph Server["Backend — Node.js + Express"]
Security["Security layer\nHelmet, CORS allow-list, rate limiters"]
Routes["Routes\nauth.route / user.route / chat.route"]
Middleware["auth.middleware.js\nJWT verification & route protection"]
Controllers["Controllers\nauth.controller / user.controller / chat.controller"]
Models["Models\nUser, FriendRequest (Compound Indexed)"]
StreamLib["lib/stream.js\nStream tokens, users & channels"]
Validation["lib/validation.js\nInput validation helpers"]
DBLib["lib/db.js\nMongoDB connection"]
Security --> Routes
Routes --> Middleware
Middleware --> Controllers
Controllers --> Validation
Controllers --> Models
Controllers --> StreamLib
end
subgraph External["External Cloud Services"]
Mongo[("MongoDB Atlas Database")]
StreamAPI["Stream Chat & Video SDK (WebSockets / WebRTC)"]
GeminiAPI["Google Gemini API\n3.8 Flash + lite-model fallback"]
CloudinaryAPI["Cloudinary CDN (Avatar Transforms & Storage)"]
end
APILib -- "REST calls with httpOnly JWT cookie" --> Security
Models --> DBLib
DBLib --> Mongo
StreamLib --> StreamAPI
Controllers -- "Translation, Grammar, Icebreakers" --> GeminiAPI
Controllers -- "Face-centered crop & upload" --> CloudinaryAPI
Components -- "Stream Video & Chat Client SDK" --> StreamAPI
Streamify is a full-stack web application designed to help language learners connect with native speakers and fellow learners. The platform features user authentication, friend matching based on language preferences, real-time messaging, and video calling capabilities. Users can create profiles with their native and target languages, discover compatible language partners, and engage in meaningful conversations to improve their language skills.
- User Authentication: Secure signup/login with JWT tokens stored in httpOnly cookies, password hashing with bcrypt, case-insensitive emails, and per-IP rate limiting
- User Onboarding: Complete profile setup with language preferences, bio, location, and device photo uploads
- Cloud Media Storage: Cloudinary integration for profile avatars featuring automated face-centering crop and auto-format optimization. Uploads up to 5 MB with Cloudinary configured; without it, images are stored inline and capped at 1 MB
- Smart Reciprocal Matching: Discover language partners ranked by mutual compatibility (100% Perfect Exchange, 75% Native Speaker, 50% Study Partner, 40% Practice Partner, 15% Community Member), with real-time keyword search and language filters
- Gemini AI Language Tools: Integrated in-chat AI assistant powered by Google's Gemini 3.8 Flash for instant translation with phonetics, grammar error checking with explanations, and contextual conversation icebreakers. Falls back automatically to lighter Gemini models when the primary model is overloaded or slow
- Friend System: Send, accept, decline, or cancel friend requests, unfriend partners, and dismiss notices
- Real-time Chat: Instant messaging powered by Stream Chat; channels are created on the server and only between friends
- Video Calling: High-quality video calls using Stream Video SDK with 1-click friend call access and in-chat call notification prompts
- Responsive Design: Mobile-friendly interface with mobile bottom navigation, DaisyUI, and Tailwind CSS
- Automated Testing: Vitest and Node test runner covering matching algorithms, input validation, chat/call authorization, and AI request validation
- Theme Support: Multiple UI themes for personalized experience
A seamless and secure entry flow ensuring personalized language partner discovery right from the start.
Discover partners tailored to mutual linguistic learning needs.
Robust friend management with real-time alerts.
Low-latency messaging integrated with generative language learning intelligence.
Face-to-face language practice with route-level authorization.
Full customization across light, dark, and novelty themes.
- React 19 - Modern UI library
- Vite - Fast build tool and dev server
- Vitest - Unit and integration testing
- React Router - Client-side routing
- Tailwind CSS - Utility-first CSS framework
- DaisyUI - Component library for Tailwind
- Stream Chat React - Real-time messaging components
- Stream Video React SDK - Video calling functionality
- Zustand - State management
- React Query - Server state management
- Axios - HTTP client
- Node.js - JavaScript runtime
- Express.js - Web application framework
- MongoDB - NoSQL database
- Mongoose - MongoDB object modeling
- Cloudinary - Media asset cloud storage & transformations
- Google Gemini API - Conversational AI language assistant (
gemini-3.8-flash, with lite-model fallback) - Stream Chat - Chat backend service
- JWT - Authentication tokens
- bcryptjs - Password hashing
- CORS - Cross-origin resource sharing (allow-listed origins only)
- Helmet & express-rate-limit - Security headers and request rate limiting
- Node.js 20 or higher (required by React Router 7 and Vite 6)
- MongoDB database (e.g. a free MongoDB Atlas cluster)
- Stream.io account (for chat and video features)
- Google Gemini API key (for the AI language tools)
- Cloudinary account (optional, for avatar uploads larger than 1 MB)
git clone https://github.com/kushGupta-15/Streamify.git
cd Streamify# Install backend dependencies
cd Backend
npm install
# Install frontend dependencies
cd ../Frontend
npm installCopy Backend/.env.example to Backend/.env and Frontend/.env.example to Frontend/.env, then fill in your values.
PORT=5001
MONGO_URI=your_mongodb_connection_string
STREAM_API_KEY=your_stream_api_key
STREAM_API_SECRET=your_stream_api_secret
JWT_SECRET_KEY=a_long_random_secret
NODE_ENV=development
GEMINI_API_KEY=your_gemini_api_key
# Optional
GEMINI_MODEL=gemini-3.8-flash # primary Gemini model (lite models are used as fallback)
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name # avatar uploads via Cloudinary
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
CLIENT_URL=https://your-frontend.example.com # only if the frontend is hosted on a different domain
KEEP_ALIVE_URL=https://your-app.onrender.com # pinged every 10 minutes to stop a free Render instance from sleepingThe older names
STEAM_API_KEY/STEAM_API_SECRETare still accepted for backward compatibility.
VITE_STREAM_API_KEY=your_stream_api_keyEnsure your MongoDB database is running and accessible via the connection string in your backend .env file.
- Start the backend server:
cd Backend
npm run devThe backend will run on http://localhost:5001
- Start the frontend development server:
cd Frontend
npm run devThe frontend will run on http://localhost:5173
Run both backend and frontend test suites from the root repository:
npm testOr run individually:
- Backend:
npm test --prefix Backend(Node.js test runner) - Frontend:
npm test --prefix Frontend(Vitest)
- Build the application:
npm run build- Start the production server:
npm start- Sign Up: Create a new account with email and password
- Onboarding: Complete your profile with:
- Full name and bio
- Native language
- Language you want to learn
- Location
- Discover: Browse recommended language partners
- Connect: Send friend requests to potential language partners
- Chat: Start conversations with your friends
- Video Call: Initiate video calls directly from chat
The repository includes a render.yaml blueprint that deploys the backend and the built frontend as one web service: npm run build builds the React app, and Express serves it from Frontend/dist alongside the API.
- In Render, create a new Blueprint from this repository.
- In the service's Environment tab, set every variable marked
sync: falseinrender.yaml(MONGO_URI,JWT_SECRET_KEY,GEMINI_API_KEY, the Stream and Cloudinary keys). - Also add
VITE_STREAM_API_KEY(same value as your Stream API key). It is read when the frontend is built, andFrontend/.envis not committed, so without it chat and video will not work in production. - Optionally set
KEEP_ALIVE_URLto your app's URL so the free instance doesn't go to sleep. - In MongoDB Atlas, allow connections from Render (Network Access).
RENDER_EXTERNAL_URL is set automatically by Render and is added to the CORS allow-list.
- Authentication: bcrypt-hashed passwords (never returned by the API), JWT in an
httpOnly,sameSite=strict,secure(in production) cookie. - Rate limiting (per client IP, behind Render's proxy): 30 login/signup attempts, 40 AI requests and 300 API requests per 15 minutes.
- Input validation: string-only credentials (blocks NoSQL operator injection), escaped search input (blocks regex DoS), ObjectId checks on route parameters, length limits on profile fields and AI input, and profile pictures restricted to https URLs or PNG/JPEG/WebP/GIF images.
- Privacy: partner discovery only returns public profile fields; emails and friend lists are never exposed.
- Authorization: friend requests can only be accepted/declined by their recipient; chats and 1:1 calls are only allowed between friends, and chat channels are created on the server.
- HTTP hardening: Helmet security headers,
X-Powered-Byhidden, CORS limited to an allow-list, and internal error details are never sent to clients. - Secrets: the Gemini key is sent in a request header, never in URLs; all keys live in environment variables.
Recommended Stream setting: in the Stream dashboard, open Chat → Roles & Permissions → messaging and remove Create Channel from the
userrole. Channels are created by the server, so this stops clients from opening chats with non-friends by calling Stream directly.
POST /api/auth/signup- User registrationPOST /api/auth/login- User loginPOST /api/auth/logout- User logoutPOST /api/auth/onboarding- Complete user onboardingPUT /api/auth/profile- Update user profileGET /api/auth/me- Get currently logged-in user (session check)
All routes below require authentication.
GET /api/users?search=&language=&matchType=- Get recommended partners ranked by reciprocal compatibilityGET /api/users/friends- Get user's friends listDELETE /api/users/friends/:id- Unfriend a connected userPOST /api/users/friend-request/:id- Send a friend request to user:idPUT /api/users/friend-request/:id/accept- Accept a friend requestPUT /api/users/friend-request/:id/reject- Decline a friend requestDELETE /api/users/friend-request/:id- Cancel a pending friend requestGET /api/users/friend-requests- Get incoming (pending) and accepted friend requestsPUT /api/users/friend-requests/:id/dismiss- Dismiss an accepted connection notificationGET /api/users/outgoing-friend-requests- Get friend requests sent by current user (pending)
GET /api/chat/token- Get Stream chat tokenGET /api/chat/verify/:targetUserId- Verify friendship access before joining private chatGET /api/chat/verify-call/:callId- Verify participant authorization before joining video callPOST /api/chat/ai-assistant- Gemini AI language assistance (translate,grammar-check,icebreakers)
Streamify/
├── Backend/
│ ├── src/
│ │ ├── controllers/ # Route handlers (auth, users, chat & AI)
│ │ ├── middleware/ # JWT auth middleware
│ │ ├── models/ # Mongoose models (User, FriendRequest)
│ │ ├── routes/ # API routes
│ │ ├── lib/ # DB, Stream, Cloudinary and validation helpers
│ │ └── server.js # Express server, security middleware, static frontend
│ ├── test/ # Node test runner tests
│ ├── package.json
│ └── .env # not committed
├── Frontend/
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Page components
│ │ ├── hooks/ # Custom React hooks
│ │ ├── lib/ # API client and utilities
│ │ ├── store/ # Zustand stores
│ │ ├── constants/ # Languages, flags and themes
│ │ └── test/ # Vitest tests
│ ├── package.json
│ └── .env # not committed
├── docs/screenshots/ # README screenshots
├── render.yaml # Render deployment blueprint
├── package.json # Root scripts (build, start, test)
└── readme.md











