{"id":23370303,"url":"https://github.com/aajafry/communex_api","last_synced_at":"2026-04-08T11:31:21.634Z","repository":{"id":266985287,"uuid":"899970600","full_name":"aajafry/communex_api","owner":"aajafry","description":"communex is a real-time chat application API build with Node.js, Express.js, mongodb and socket-io","archived":false,"fork":false,"pushed_at":"2025-02-21T15:31:16.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-03T14:24:17.563Z","etag":null,"topics":["authentication","chat-application","cookie","expressjs","jwt-authentication","mongodb","mongoose","nodejs","socket-io"],"latest_commit_sha":null,"homepage":"","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/aajafry.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}},"created_at":"2024-12-07T14:13:53.000Z","updated_at":"2025-02-21T15:31:20.000Z","dependencies_parsed_at":"2024-12-07T14:18:53.967Z","dependency_job_id":"9666c1f6-8d64-441a-8d47-b413bea10249","html_url":"https://github.com/aajafry/communex_api","commit_stats":null,"previous_names":["aajafry/communex_api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aajafry/communex_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aajafry%2Fcommunex_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aajafry%2Fcommunex_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aajafry%2Fcommunex_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aajafry%2Fcommunex_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aajafry","download_url":"https://codeload.github.com/aajafry/communex_api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aajafry%2Fcommunex_api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31553993,"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":["authentication","chat-application","cookie","expressjs","jwt-authentication","mongodb","mongoose","nodejs","socket-io"],"created_at":"2024-12-21T15:36:06.866Z","updated_at":"2026-04-08T11:31:21.322Z","avatar_url":"https://github.com/aajafry.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CommuneX - Backend 💬\n\nThis is the **backend** for **CommuneX**, a real-time chat application built using Node.js, Express, MongoDB, and Socket.IO.\n\n## 🚀 Features\n\n- **User Authentication**: Secure login, signup, and logout using JWT and bcrypt.\n- **Socket.IO Integration**: Real-time message broadcasting.\n- **RESTful API**: CRUD operations for users, groups, and messages.\n- **Rate Limiting**: Protects against brute-force attacks.\n- **Cookie-Based Sessions**: Secure HTTP-only cookies for authentication.\n\n## 🛠️ Tech Stack\n\n- **Node.js**: Server runtime.\n- **Express.js**: Web framework.\n- **MongoDB (Mongoose)**: Database for storing chat data.\n- **Socket.IO**: Real-time communication.\n- **Bcrypt**: Password hashing.\n- **JWT**: Token-based authentication.\n- **Cookie-Parser**: Middleware for parsing cookies.\n- **Express-Rate-Limit**: Prevent abuse.\n- **Helmet**: Security headers.\n- **Cloudinary**: Image management.\n  and more.\n\n## 📦 Installation\n\n1. Clone the repository:\n\n```bash\n    git clone https://github.com/aajafry/communex_api.git\n```\n\n2.Install dependencies:\n\n```bash\n    npm install\n```\n\n3. Set up environment variables: Create a `.env` file in the root directory:\n\n```env\n    PORT=3000\n    NODE_ENV=(set `production` || `development`)\n    CORS_ORIGIN=http://localhost:5173\n    DB_ENDPOINT=mongodb://localhost:27017/communex\n    JWT_SECRET=(your secret key)CLOUDINARY_CLOUD_NAME=(set your cloudinary cloud name)\n    CLOUDINARY_API_KEY=(set your cloudinary cloud API key)\n    CLOUDINARY_API_SECRET=(set your cloudinary API secret)\n```\n\n4. Run the server:\n\n```bash\n    npm run dev\n```\n\n5. The server will run at:\n\n```arduino\n    http://localhost:3000\n```\n\n## 📜 API Documentation\n\nThe backend provides the following RESTful APIs:\n\n#### Authentication\n\n| Route          | Method | Description       |\n| -------------- | ------ | ----------------- |\n| `/auth/signup` | POST   | User registration |\n| `/auth/login`  | POST   | User login        |\n| `/auth/logout` | POST   | User logout       |\n\n#### User Management\n\n| Route          | Method | Description         |\n| -------------- | ------ | ------------------- |\n| `/user/me`     | GET    | Get user details    |\n| `/user/users`  | GET    | Get all users       |\n| `/user/update` | PUT    | Update user profile |\n| `/user/delete` | DELETE | Delete user profile |\n\n#### Group Management\n\n| Route                     | Method | Description               |\n| ------------------------- | ------ | ------------------------- |\n| `/group/create`           | POST   | Create a group            |\n| `/group/getUserGroups`    | GET    | Get all groups for user   |\n| `/group/getGroupMessages` | POST   | get all messages of group |\n\n#### Messages Management\n\n| Route               | Method | Description             |\n| ------------------- | ------ | ----------------------- |\n| `/message/messages` | POST   | get all message of user |\n\n#### cloudinary Management\n\n| Route                      | Method | Description                    |\n| -------------------------- | ------ | ------------------------------ |\n| `/cloudinary/delete-image` | POST   | delete image from `cloudinary` |\n\n## 🔗 Frontend Integration\n\nThe `CommuneX Frontend` repository can be found [here](https://github.com/aajafry/communex.git). To run the project end-to-end:\n\n1. Clone and set up the frontend repository.\n2. Ensure the backend server is running.\n3. Update the backend URL in the frontend .env file.\n4. Start both servers (frontend and backend) to test the integration.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faajafry%2Fcommunex_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faajafry%2Fcommunex_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faajafry%2Fcommunex_api/lists"}