{"id":30865702,"url":"https://github.com/rajpatel148/conversi","last_synced_at":"2026-04-08T11:32:44.719Z","repository":{"id":313040386,"uuid":"1048343220","full_name":"Rajpatel148/CONVERSI","owner":"Rajpatel148","description":"A online chatting webapp","archived":false,"fork":false,"pushed_at":"2025-09-27T06:18:15.000Z","size":1165,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-03T16:04:56.089Z","etag":null,"topics":["expressjs","lucide-react","mui","nodejs","reactjs","socket-io","socket-io-client"],"latest_commit_sha":null,"homepage":"https://conversi-nine.vercel.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rajpatel148.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-01T09:49:08.000Z","updated_at":"2025-09-27T06:18:19.000Z","dependencies_parsed_at":"2025-10-14T15:36:52.579Z","dependency_job_id":"adbc0dcb-0e92-4e12-9faa-37a6b9da79f1","html_url":"https://github.com/Rajpatel148/CONVERSI","commit_stats":null,"previous_names":["rajpatel148/conversi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Rajpatel148/CONVERSI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rajpatel148%2FCONVERSI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rajpatel148%2FCONVERSI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rajpatel148%2FCONVERSI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rajpatel148%2FCONVERSI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rajpatel148","download_url":"https://codeload.github.com/Rajpatel148/CONVERSI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rajpatel148%2FCONVERSI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31554091,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T10:21:54.569Z","status":"ssl_error","status_checked_at":"2026-04-08T10:21:38.171Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["expressjs","lucide-react","mui","nodejs","reactjs","socket-io","socket-io-client"],"created_at":"2025-09-07T21:49:11.535Z","updated_at":"2026-04-08T11:32:44.703Z","avatar_url":"https://github.com/Rajpatel148.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CONVERSI\n\nA full‑stack real‑time chat application with 1:1 and group messaging, typing indicators, media sharing, presence, and built‑in voice/video calling powered by Agora. Built with Node.js/Express, MongoDB, Socket.IO, and React + Vite.\n\n\u003e Live chat UX with call invites, ringing, and 10‑minute call sessions. Secure authentication uses JWT (httpOnly cookies and optional Authorization header).\n\n## Features\n\n- Auth: Sign up, login, logout, JWT cookies, update profile, change avatar/password, delete account\n- Chats: 1:1 and groups, unread counters per user, latest message preview, media messages, delete for me/everyone\n- Real‑time: Typing indicator, message delivery, presence (online/offline), per‑user rooms\n- Calling: Voice and video calls via Agora, invite/accept/decline/cancel, ring tone, time limit, device permission handling\n- Responsive UI: React + Vite with modern components and toasts\n\n## Tech Stack\n\n- Backend: Node.js (ESM), Express 5, MongoDB (Mongoose), Socket.IO, JWT, bcrypt, dotenv, CORS, cookie‑parser\n- Frontend: React 19, Vite, Socket.IO Client, Axios, MUI, Lucide Icons, react‑hot‑toast\n- Realtime/RTC: Agora Web SDK NG\n- Deployment: Vercel (frontend). Backend can be hosted on your server/VM/Render/Railway/etc.\n\n## Monorepo structure\n\n```\nbackend/\n  src/\n    app.js              # Express app + CORS/cookies/static\n    index.js            # HTTP + Socket.IO server bootstrap\n    db/index.js         # Mongo connection\n    constants.js        # DB name\n    middlewares/\n      auth.middleware.js\n    models/             # User, Chat, Message schemas\n    controllers/        # user, chat, message, call\n    routes/             # /api/v1/*\n    socket/             # socket init + event handler\n  package.json\n\nfrontend/\n  src/\n    api/axios.js        # Axios client\n    context/Authcotext.jsx\n    components/...      # Dashboard, Chat, Call boxes\n    lib/agora.js\n  vite.config.js\n  vercel.json           # SPA rewrites\n  package.json\n```\n\n## Environment variables\n\nCreate two .env files, one for backend and one for frontend.\n\n### backend/.env\n\n- PORT=4000\n- FRONTEND_URL=http://localhost:5173\n- MONGODB_URL=mongodb://127.0.0.1:27017\n- ACCESS_TOKEN_SECRET=your_access_secret\n- ACCESS_TOKEN_EXPIRY=7d\n- REFRESH_TOKEN_SECRET=your_refresh_secret\n- REFRESH_TOKEN_EXPIRY=30d\n- AGORA_APP_ID=your_agora_app_id\n- AGORA_APP_CERT=your_agora_app_certificate\n- AGORA_TOKEN_EXPIRE=3600               # seconds\n- CALL_TIME_LIMIT_MS=600000             # 10 minutes\n\nNotes\n- Cookies are set with SameSite=None; Secure=true in production. Use HTTPS for frontend to receive cookies from a different origin.\n- CORS origin must match your frontend origin exactly.\n\n### frontend/.env\n\n- VITE_BASE_URL=http://localhost:4000           # Socket.IO server URL\n- VITE_BACKEND_API_URL=http://localhost:4000/api/v1\n- VITE_AGORA_APP_ID=your_agora_app_id           # Optional; backend responds with appId\n- VITE_CLOUD_NAME=your_cloudinary_cloud_name\n- VITE_CLOUDINARY_PRESET_NAME=unsigned_preset\n\n## Install and run (Windows PowerShell)\n\nFrom the repo root, install and start both apps in separate terminals.\n\nBackend\n\n```powershell\ncd backend; npm install; npm start\n```\n\nFrontend\n\n```powershell\ncd frontend; npm install; npm run dev\n```\n\n- Backend defaults to http://localhost:4000\n- Vite dev server defaults to http://localhost:5173\n\n## API overview (REST)\n\nBase URL: /api/v1\n\nAuth (user.routes)\n- GET /user/validate → 200 if cookie present\n- POST /user/signup { username, fullname, email, password, avatar? }\n- POST /user/login { username, email, password }\n- POST /user/logout (JWT required)\n- POST /user/update-account { fullname, username? } (JWT)\n- POST /user/change-password { oldPassword, newPassword } (JWT)\n- POST /user/change-avatar { avatar } (JWT)\n- DELETE /user/me (JWT) — deletes account, cleans up chats/messages\n\nChats (chat.routes, JWT)\n- POST /chat/create { members: [userIds], name? } — group if \u003e2\n- GET  /chat/list — chats where requester is a member (excludes self from members in response)\n- GET  /chat/non-friends — users not in any 1:1 chat with requester\n- GET  /chat/:id — chat details\n\nMessages (message.routes, JWT)\n- POST /message/send { chatId, senderId, text?|imageUrl? }\n- GET  /message/c/:chatId — list messages; marks seen; resets unread count\n- POST /message/delete { messageId, userIds } — delete for me or everyone\n\nCalls (call.routes)\n- GET  /call/token?channel=abc\u0026uid=123 — Agora RTC token\n- POST /call/start { callId, channel, callerId, calleeId } — server starts auto end‑timer\n- POST /call/end { callId } — ends the call and notifies peers\n\n## Socket events (client ↔ server)\n\nConnection\n- setup: userId → joins personal room and marks online\n\nPresence\n- user-online: userId (broadcast)\n- user-offline: userId (broadcast on logout)\n\nChat\n- join-chat { roomId, userId }\n- leave-chat roomId\n- send-message chatId → server emits receive-message to room and new-message-notification to members\n- typing { chatId, ... }\n- stop-typing { chatId, ... }\n- message-deleted { messageId, chatId }\n\nCalling (signaling)\n- call-invite { to, from, callId, channel, kind: \"audio\"|\"video\" }\n- call-accept { to, from, callId, channel }\n- call-decline { to, from, callId }\n- call-cancelled { to, from, callId }\n- end-call { callId, reason } (server → clients)\n\n## Data models (MongoDB)\n\nUser\n- username, fullname, email, password (hashed), avatar, isOnline, lastSeen, refreshToken\n- Methods: generateAccessToken, generateRefreshToken\n\nChat\n- members [ObjectId\u003cUser\u003e], isGroup, name?, groupAdmin?, latestMsg, unreadCounts [{ userId, count }]\n\nMessage\n- senderId, chatId, text?|imageUrl?, reaction, seenBy [{ user, seenAt }], deletedFrom [userId], replyTo?\n\n## Deployment notes\n\nFrontend (Vercel)\n- `vercel.json` rewrites all routes to `index.html` for SPA routing.\n- Set env variables in Vercel project for VITE_* keys.\n\nBackend\n- Provide all backend .env values on your host. Expose PORT and ensure CORS FRONTEND_URL matches deployed frontend origin.\n- If using HTTPS on frontend and a different domain, cookies require Secure and SameSite=None (already configured in code).\n\n## Troubleshooting\n\n- CORS/auth cookie not sent: Ensure FRONTEND_URL matches exactly and you are using HTTPS for cross‑site cookies. Also set VITE_BACKEND_API_URL to your /api/v1 base.\n- Mongo connect fails: Check MONGODB_URL and that your Mongo service is running and reachable.\n- 401 Unauthorized: Make sure you include the access token as an httpOnly cookie (server sets on login/signup) or through Authorization header (frontend helper setAuthToken does this after login).\n- Agora errors or no media: Verify AGORA_APP_ID/APP_CERT. On Windows, close apps that lock the camera (Zoom/Teams/OBS). Check browser permissions and use https or localhost.\n- Socket not connecting: Confirm VITE_BASE_URL points to your backend origin/port and that backend `initServer` CORS origin matches FRONTEND_URL.\n\n## License\n\nThis project is provided under the ISC license. (Update if you prefer a different license.)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajpatel148%2Fconversi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frajpatel148%2Fconversi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajpatel148%2Fconversi/lists"}