{"id":15741300,"url":"https://github.com/alfatcse/chat-app-server","last_synced_at":"2026-01-02T13:49:37.802Z","repository":{"id":156296046,"uuid":"582780404","full_name":"alfatcse/Chat-App-Server","owner":"alfatcse","description":"Chat App Server ","archived":false,"fork":false,"pushed_at":"2024-09-08T20:18:05.000Z","size":440,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-11T03:01:15.839Z","etag":null,"topics":["aws","cicd-pipeline","docker","docker-compose","ec2-instance","express-js","mongodb","nodejs","nodemon","socket-io"],"latest_commit_sha":null,"homepage":"https://chat-app-server-414t.onrender.com","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/alfatcse.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}},"created_at":"2022-12-27T21:09:57.000Z","updated_at":"2024-09-08T20:18:08.000Z","dependencies_parsed_at":"2024-10-04T03:02:21.532Z","dependency_job_id":"6daa7ee3-df5f-4478-a111-0f4f88d4646e","html_url":"https://github.com/alfatcse/Chat-App-Server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfatcse%2FChat-App-Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfatcse%2FChat-App-Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfatcse%2FChat-App-Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfatcse%2FChat-App-Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alfatcse","download_url":"https://codeload.github.com/alfatcse/Chat-App-Server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221359282,"owners_count":16804763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["aws","cicd-pipeline","docker","docker-compose","ec2-instance","express-js","mongodb","nodejs","nodemon","socket-io"],"created_at":"2024-10-04T03:00:27.357Z","updated_at":"2026-01-02T13:49:37.760Z","avatar_url":"https://github.com/alfatcse.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Introduction\nThis Project is an innovative chat application that leverages modern technologies such as Socket.io, React, React Bootstrap, HTML, CSS, and more to deliver a dynamic and interactive messaging experience. With its robust features and seamless integration, ChatApp allows users to connect, communicate, and express themselves in real-time with other users from around the world.\n \n### Project Features\n* User can register into the application.\n* User can login into the application.\n* User can select an emoji as profile picture.\n* Real time conversation can be carried out among the users.\n* In between the conversation emoji can be used.  \n### Usage\n* Run npm start:dev to start the application.\n* Connect to the API using Postman on port 5009.\n## Live Link:     [http://Chat-App-Server:4000](http://3.64.144.2:4000)  \n### API Endpoints\n| HTTP Verbs | Endpoints | Action |\n| --- | --- | --- |\n| POST |api/v1/user/register | To Create new User |\n| POST |api/v1/user/login | To Log in new user|\n| POST |api/v1/setAvatar/:id | To set Avatar as profile picture|\n| GET  |api/v1/allusers/:id | To get all the registered users|\n| POST  |api/v1/addmsg | To send message any of the registered users|\n| GET  |api/v1/getallmessages | To retrive all conversations of a specific user|\n### Technologies Used\n* [NodeJS](https://nodejs.org/) This is a cross-platform runtime environment built on Chrome's V8 JavaScript engine used in running JavaScript codes on the server. It allows for installation and managing of dependencies and communication with databases.\n* [ExpressJS](https://www.expresjs.org/) This is a NodeJS web application framework.\n* [MongoDB](https://www.mongodb.com/) This is a free open source NOSQL document database with scalability and flexibility. Data are stored in flexible JSON-like documents.\n* [Socket.IO](https://socket.io/) Socket.IO is an event-driven library for real-time web applications. It enables real-time, bi-directional communication between web clients and servers. It consists of two components: a client, and a server. Both components have a nearly identical API.\n* [Mongoose ODM](https://mongoosejs.com/) This makes it easy to write MongoDB validation by providing a straight-forward, schema-based solution to model to application data.\n\u003chr\u003e\n### Sample Data: (User)\n\n```json\n{\n     \"username\": \"Müller\",\n     \"email\": \"müller@gmail.com\",\n     \"password\": \"12345678\" \n     \"avatarImage\": \"\",\n     \"isAvatarImageSet\": false\n}\n```\n### Create a new User \n Route:  api/v1/user/register (POST)\n \n Request body:\n ```json\n {\n     \"username\": \"Müller\",\n     \"email\": \"müller@gmail.com\",\n     \"password\": \"12345678\" \n     \"avatarImage\": \"\",\n     \"isAvatarImageSet\": false\n}\n```\n Response: The newly created user object.\n Response Sample Pattern:\n```json\n {\n      \"status\":\"success\" , \n      \"message\": \"Data Inserted\",\n      \"data\": {\n               \"username\": \"Müller\",\n               \"email\": \"müller@gmail.com\",\n               \"password\": \"\",//in hash format \n              \"avatarImage\": \"\",\n             \"isAvatarImageSet\": false\n              }, \n}\n```        \n### Login User\n\n Route:  api/v1/user/login (POST)\n \n Request body:\n ```json\n  {\n     \"username\": \"Müller\",\n     \"password\": \"12345678\" \n  }\n```\n Response: The user's array of objects.\n Response Sample Pattern:\n```json\n {\n      \"status\":\"success\" , \n      \"message\": \"Data Retrived\",\n      \"data\": {\n               \"username\": \"Müller\",\n               \"email\": \"müller@gmail.com\",\n               \"password\": \"\", //in hash format \n               \"avatarImage\":\"PHuNTQx=PHN2ZyB4bmYwMDAwOyIvPjwvc3ZnPg===\",\n               \"isAvatarImageSet\": false\n              }, \n}\n```   \n\n### Set avatar of a Single User\n\nRoute:  /api/v1/setAvatar/:id (POST)\n\nRequest Param: :id\n\n Request body:\n ```json\n  {\n     \"_id\": \"\" //id of the single user,\n     \"avatarImage\": \"PHuNTQx=PHN2ZyB4bmYwMDAwOyIvPjwvc3ZnPg===\" \n  }\n```\n\nResponse: The specified user object.\n\nResponse Sample Pattern:\n\n```json\n  {\n      \"success\": \"success\", \n      \"message\": \"Avatar Image set successfully\",\n  }\n  ```  \n  ### Get all Users\n\n Route:  /api/v1/allusers/:id (GET)\n \n Request Param: :id\n \n Response:  The array of all user object.\n \n Response Sample Pattern:\n \n```json\n  {\n      \"success\": \"success\", \n      \"message\": \"All Uers retrived successfully\",\n      \"data\": [{},{}...], \n  }\n```\n\n### Send message to any of the registered user\n\nRoute:  api/v1/addmsg (POST)\n\nRequest body:\n\n```json\n {\n    \"message\":\"\",  //Message to send\n    \"sender\":\"\",   //Sender Id\n    \"reciver\":\"\",  //Reciver Id\n    \"createdAt\":\"\" //Time Stamp\n}\n\n```\n \n Response:Sent message .\n\n Response Sample Pattern:\n\n```json\n {\n      \"success\": \"success\", \n      \"message\": \"Message sent successfully\",\n      \"data\":  \"\" //Sent message\n  }\n```\n### Get all conversations of a specific user           \n\nRoute:  api/v1/getallmessages (GET)\n\nRequest body:\n\n```json\n {\n    \"sender\":\"\",   //Sender Id\n    \"reciver\":\"\",  //Reciver Id\n}\n\n```\n \n Response:Retrive all messages .\n\n Response Sample Pattern:\n\n```json\n {\n      \"success\": \"success\", \n      \"message\": \"Message sent successfully\",\n      \"data\":  [{},{}....] //Sent message\n  }\n```\n\n### Error Handling:\nError Response Object include the following properties:\n- success  →  false\n- message → Error Type → Validation Error, Cast Error, Duplicate Entry\n- errorMessages \n- stack\n\n### Sample Error Response\n\n```json\n   {\n    \"success\": false,\n    \"message\": \"E11000 duplicate key error collection: univerity-management.students index: email_1 dup key: { email: \\\"user2@gmail.com\\\" }\",\n    \"errorMessages\": [\n        {\n            \"path\": \"\",\n            \"message\": \"E11000 duplicate key error collection: univerity-management.students index: email_1 dup key: { email: \\\"user2@gmail.com\\\" }\"\n        }\n    ],\n    \"stack\": \"MongoServerError: E11000 duplicate key error collection: univerity-management.students index: email_1 dup key: { email: \\\"user2@gmail.com\\\" }\\n    at H:\\\\next-level-development\\\\university-management-auth-service\\\\node_modules\\\\mongodb\\\\src\\\\operations\\\\insert.ts:85:25\\n    at H:\\\\next-level-development\\\\university-management-auth-service\\\\node_modules\\\\mongodb\\\\src\\\\cmap\\\\connection_pool.ts:574:11\\n    at H:\\\\next-level-development\\\\university-writeOrBuffer (node:internal/streams/writable:391:12)\"\n}\n```\n\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falfatcse%2Fchat-app-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falfatcse%2Fchat-app-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falfatcse%2Fchat-app-server/lists"}